@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  --blue: #1a73e8;
  --soft: #e8f0fe;
  --line: #dadce0;
  --muted: #5f6368;
  --bg: #f8fafd;
  --ink: #202124;
}

* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Montserrat, Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; }
input, select, button { font: inherit; }
input, select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; outline: 0; background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 300px; min-height: 100vh; background: #fff; border-right: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 24px; flex: 0 0 300px; position: sticky; top: 0; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 21px; white-space: nowrap; }
.mark { width: 34px; height: 34px; border-radius: 8px; background: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSdvNyV-IBhBU6Ak_o99Em_4GdRrf3cbc1msA&s") center / contain no-repeat; flex: 0 0 auto; }
.user-chip { text-align: center; border: 1px solid var(--line); border-radius: 999px; padding: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 8px; min-height: calc(100vh - 220px); flex: 1; }
.nav a, .nav button { min-height: 44px; border: 0; background: transparent; border-radius: 999px; display: flex; align-items: center; gap: 12px; padding: 0 16px; color: var(--ink); font: inherit; }
.nav .active, .nav a:hover, .nav button:hover { background: var(--soft); }
.nav-icon { width: 20px; height: 20px; display: inline-block; position: relative; flex: 0 0 auto; }
.nav-icon.drive { border: 2px solid var(--blue); border-radius: 4px; }
.nav-icon.drive:before { content: ""; position: absolute; left: 3px; right: 3px; top: 8px; border-top: 2px solid var(--blue); }
.nav-icon.recent { border: 2px solid var(--blue); border-radius: 50%; }
.nav-icon.recent:before { content: ""; position: absolute; width: 6px; height: 2px; background: var(--blue); left: 8px; top: 8px; transform-origin: left center; transform: rotate(28deg); }
.nav-icon.starred:before { content: "☆"; color: var(--blue); font-size: 24px; line-height: 18px; }
.nav-icon.spam { border: 2px solid var(--blue); clip-path: polygon(25% 0,75% 0,100% 25%,100% 75%,75% 100%,25% 100%,0 75%,0 25%); }
.nav-icon.spam:before { content: "!"; position: absolute; color: var(--blue); font-weight: 700; left: 7px; top: 0; }
.nav-icon.trash { border: 2px solid var(--blue); border-radius: 2px; height: 18px; margin-top: 2px; }
.nav-icon.trash:before { content: ""; position: absolute; left: 3px; right: 3px; top: -5px; border-top: 2px solid var(--blue); }
.nav-icon.storage { border: 2px solid var(--blue); border-radius: 999px 999px 6px 6px; height: 14px; margin-top: 4px; }
.nav-icon.starred:before { content: "\2606"; }
.storage-box { padding: 4px 16px 10px 16px; color: var(--muted); font-size: 12px; display: grid; gap: 7px; }
.storage-track { height: 6px; background: #e0e3e7; border-radius: 999px; overflow: hidden; }
.storage-track span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.storage-line { line-height: 1.35; }
.storage-line strong { color: var(--ink); font-weight: 600; }
.storage-line.muted { color: var(--muted); }
.sync-sidebar-button {
  min-height: 44px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0 14px;
  margin: 2px 0 4px;
}
.sync-sidebar-button:hover { background: #0b57d0; color: #fff; }
.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 12px;
}
.apps-button {
  background: #fff;
  color: var(--blue);
}
.apps-button:hover {
  background: var(--soft);
  color: var(--blue);
}
.signout { margin-top: 0; }
.main { flex: 1; padding: 28px; min-width: 0; }
.top { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.top span { margin-left: auto; white-space: nowrap; color: #3c4043; }
.search { width: min(900px, 100%); border: 0; outline: 0; border-radius: 999px; background: #edf2fa; min-height: 54px; padding: 0 24px; font: inherit; }
.panel { background: #fff; border-radius: 22px; padding: 34px; min-height: calc(100vh - 112px); overflow: hidden; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.crumb { font-size: 32px; margin-bottom: 6px; display: flex; gap: 16px; align-items: center; font-weight: 500; }
.subtle { margin: 0; color: var(--muted); font-size: 14px; }
.section-title { font-size: 22px; font-weight: 650; margin: 28px 0 14px; }
.employee-actions { margin: 18px 0 30px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.sync-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafd; }
.sync-card strong { display: block; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.sync-card span { color: var(--muted); font-size: 13px; }
.sync-download { white-space: nowrap; }
.upload-row { display: grid; grid-template-columns: minmax(240px,380px) 180px minmax(260px,1fr); gap: 16px; align-items: center; margin-bottom: 0; }
.upload-progress { color: var(--muted); font-size: 13px; display: grid; gap: 8px; }
.folder-form { display: flex; justify-content: flex-end; }
.new-folder { min-height: 46px; }
.admin-form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px 18px; align-items: end; padding: 18px; background: #f8fafd; border: 1px solid #eef2f7; border-radius: 18px; margin-bottom: 22px; }
.field.compact { margin: 0; }
.field.compact span { color: var(--muted); font-size: 12px; font-weight: 600; }
.field.compact input { min-height: 44px; }
.field.wide { grid-column: span 2; }
.admin-create { min-height: 46px; border-radius: 999px; }
.choose, .btn { min-height: 52px; border-radius: 18px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 20px; font-weight: 600; cursor: pointer; }
.btn { background: var(--blue); color: #fff; border-color: var(--blue); }
.progress { height: 8px; border-radius: 999px; background: #e8eaed; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); }
.view-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.toggle { border: 1px solid #8b8d90; border-radius: 999px; overflow: hidden; display: flex; }
.toggle button { border: 0; background: #fff; padding: 10px 24px; font: inherit; font-weight: 600; }
.toggle .active { background: #c2e7ff; }
.grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; align-items: start; }
.grid.list-mode { display: grid; grid-template-columns: 1fr; gap: 8px; }
.card { background: #f0f4f9; border-radius: 14px; padding: 10px; min-height: 202px; position: relative; }
.grid.list-mode .card { min-height: 58px; display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 10px; align-items: center; }
.card-head { display: grid; grid-template-columns: 22px minmax(0,1fr) 30px; gap: 7px; align-items: start; }
.file-icon { width: 20px; height: 18px; border-radius: 4px; color: #fff; background: var(--blue); display: grid; place-items: center; font-size: 7px; font-weight: 600; position: relative; }
.file-icon.img, .file-icon.pdf, .file-icon.zip { background: var(--blue); color: #fff; }
.file-icon.folder { background: var(--blue); border-radius: 3px; }
.file-icon.folder:before { content: ""; position: absolute; left: 2px; top: -4px; width: 8px; height: 5px; border-radius: 3px 3px 0 0; background: var(--blue); }
.file-name { color: var(--ink); font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { border: 0; background: transparent; color: #202124; font-size: 26px; line-height: 24px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.dots:hover { background: #dfe6f1; }
.file-menu { position: absolute; right: 12px; top: 42px; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(60,64,67,.22); padding: 8px; display: none; z-index: 20; }
.file-menu.open { display: grid; }
.file-menu a, .file-menu button { min-height: 38px; border: 0; background: #fff; color: var(--ink); text-align: left; padding: 0 12px; border-radius: 8px; font: inherit; cursor: pointer; display: flex; align-items: center; }
.file-menu a:hover, .file-menu button:hover { background: #f1f3f4; }
.preview { height: 118px; border-radius: 8px; background: #fff; margin-top: 8px; display: grid; place-items: center; color: var(--blue); font-weight: 700; }
.preview.img { color: #fff; background: linear-gradient(135deg,#4285f4,#34a853); }
.preview.folder { height: 64px; color: #4a4f52; background: #fff; }
.grid.list-mode .preview { display: none; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 10px; }
.grid.list-mode .meta { margin-top: 0; align-items: center; }
.date { text-align: right; color: var(--muted); font-size: 11px; }
.empty-card { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); min-height: 140px; display: grid; place-items: center; background: #fff; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 430px); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 34px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field input, .field select { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font: inherit; }
.email-lock { display: grid; grid-template-columns: minmax(0,1fr) auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.email-lock input { border: 0; border-radius: 0; min-height: 44px; }
.email-lock strong { display: flex; align-items: center; padding: 0 12px; background: #edf2fa; color: var(--muted); font-weight: 600; border-left: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 13px; color: #3c4043; font-weight: 650; background: #fff; }
.admin-table { table-layout: fixed; }
.admin-table th:nth-child(1), .admin-table th:nth-child(2) { width: 20%; }
.admin-table th:nth-child(3), .admin-table th:nth-child(4) { width: 130px; }
.admin-table th:nth-child(5) { width: 24%; }
.admin-table th:nth-child(6) { width: 90px; }
.admin-table th:nth-child(7) { width: 90px; }
.table-input { min-height: 38px; border-radius: 10px; padding: 0 10px; font-size: 13px; }
.folder-input { font-family: Arial, sans-serif; font-size: 12px; }
.switch-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.switch-line input { width: 18px; min-height: 18px; box-shadow: none; }
.mini-btn { min-height: 36px; border: 1px solid var(--blue); background: #fff; color: var(--blue); border-radius: 999px; padding: 0 16px; font-weight: 650; cursor: pointer; }
.mini-btn:hover { background: var(--soft); }
.empty { color: var(--muted); text-align: center; padding: 26px !important; }
.flash { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 14px; }
@media (max-width: 1250px) { .admin-form { grid-template-columns: repeat(2, minmax(180px, 1fr)); } .field.wide { grid-column: span 1; } }
@media (max-width: 1400px) { .grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .upload-row, .employee-actions { grid-template-columns: 1fr; } .folder-form { justify-content: flex-start; } .top { flex-wrap: wrap; } .top span { margin-left: 0; } .table { min-width: 860px; } .panel { overflow-x: auto; } }
@media (max-width: 760px) { .shell { flex-direction: column; } .sidebar { width: 100%; flex-basis: auto; } .grid { grid-template-columns: 1fr; } .grid.list-mode .card { grid-template-columns: 1fr; } .admin-form { grid-template-columns: 1fr; } .crumb { font-size: 26px; } }

/* Drive polish overrides */
.sidebar { height: 100vh; overflow: hidden; }
.user-chip, .user-chip strong { color: var(--ink); }
.user-chip strong { font-weight: 600; }
.signout { margin-top: auto; align-self: stretch; }
.signout button { width: 100%; justify-content: flex-start; }
.crumb { font-size: 28px; color: var(--ink); margin-bottom: 18px; }
.crumb a, .crumb strong, .crumb span { color: var(--ink); font-weight: 500; }
.employee-actions { grid-template-columns: 1fr; margin: 22px 0 24px; }
.upload-row { grid-template-columns: minmax(220px,340px) 160px minmax(320px,1fr); width: 100%; }
.upload-progress { width: 100%; }
.view-row { gap: 18px; }
.view-left { display: flex; align-items: center; gap: 16px; color: var(--ink); font-weight: 500; }
.new-folder { min-height: 42px; padding: 0 18px; }
.grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
.file-name { font-weight: 500; }
.file-icon { transform: scale(.88); transform-origin: left top; }

@media (max-width: 1500px) {
  .grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 980px) {
  .shell { flex-direction: column; }
  .sidebar { position: relative; width: 100%; height: auto; min-height: auto; flex-basis: auto; padding: 18px; overflow: visible; }
  .brand { font-size: 20px; }
  .user-chip { border-radius: 18px; text-align: left; padding: 12px 16px; }
  .nav { min-height: auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .nav a, .nav button { min-height: 48px; padding: 0 12px; font-size: 15px; }
  .storage-box { grid-column: 1 / -1; padding: 8px 12px; }
  .sync-sidebar-button { grid-column: 1 / -1; }
  .signout { margin-top: 0; }
  .main { padding: 16px; }
  .top { margin-bottom: 16px; }
  .top span { display: none; }
  .search { min-height: 50px; width: 100%; }
  .panel { border-radius: 18px; padding: 18px; min-height: auto; overflow-x: visible; }
  .crumb { font-size: 24px; gap: 10px; flex-wrap: wrap; }
  .upload-row { grid-template-columns: 1fr; gap: 12px; }
  .sync-card { align-items: stretch; flex-direction: column; }
  .sync-download { width: 100%; justify-content: center; }
  .choose, .btn { width: 100%; min-height: 50px; }
  .view-row { align-items: stretch; flex-direction: column; }
  .view-left { justify-content: space-between; }
  .toggle { width: 100%; }
  .toggle button { flex: 1; min-height: 44px; }
  .grid, .grid.list-mode { grid-template-columns: 1fr; }
  .card { min-height: 188px; }
  .file-name { font-size: 14px; }
}

/* Latest Drive alignment polish */
.nav-icon { width: 22px; height: 22px; color: var(--blue); }
.nav-icon.drive,
.nav-icon.recent,
.nav-icon.spam,
.nav-icon.trash,
.nav-icon.storage { border-color: currentColor; }
.nav-icon.drive:before,
.nav-icon.trash:before { border-color: currentColor; }
.nav-icon.recent:before { background: currentColor; }
.nav-icon.spam:before,
.nav-icon.starred:before { color: currentColor; }
.nav-symbol { color: var(--blue); font-size: 23px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.toggle button, .mini-btn, .new-folder { font-weight: 500; }
.signout { margin-top: auto; padding-top: 12px; align-self: stretch; }
.signout button {
  width: 100%;
  justify-content: center;
  border: 1px solid var(--blue);
  color: var(--blue);
  background: #fff;
  font-weight: 600;
}
.signout button:hover { background: var(--soft); }
.view-row { gap: 18px; }
.view-actions { display: flex; align-items: center; gap: 12px; }
.folder-card {
  min-height: 68px;
  display: flex;
  align-items: center;
}
.folder-card .card-head {
  width: 100%;
  align-items: center;
}
.folder-card .preview,
.folder-card .meta { display: none; }
.folder-card .file-name,
.card-head .file-name { line-height: 1.25; }

/* Breadcrumb, sync button, and folder icon final polish */
.crumb {
  font-size: 23px;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1.25;
  margin-bottom: 22px;
}
.crumb a,
.crumb span,
.crumb strong {
  color: var(--ink);
  font-weight: 500;
}
.crumb strong { font-weight: 600; }
.sync-sidebar-button {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}
.sync-sidebar-button:hover {
  background: #0b57d0 !important;
  color: #fff !important;
}
.file-icon.folder {
  width: 25px;
  height: 24px;
  background: transparent;
  color: var(--blue);
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.file-icon.folder:before { display: none; }
.file-folder-symbol {
  font-size: 25px;
  line-height: 1;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.folder-card .card-head {
  grid-template-columns: 28px minmax(0,1fr) 30px;
  gap: 8px;
}

@media (max-width: 980px) {
  .crumb { font-size: 20px; gap: 8px; }
}

@media (max-width: 980px) {
  .view-actions { justify-content: space-between; width: 100%; }
}

/* Separate folder row and centered list rows */
.file-sections {
  display: grid;
  gap: 18px;
}
.folder-grid {
  margin-bottom: 8px;
}
.file-grid {
  margin-top: 0;
}
.grid.list-mode .card {
  min-height: 72px;
  border-radius: 14px;
  grid-template-columns: minmax(0,1fr) 310px;
  align-items: center;
}
.grid.list-mode .card-head {
  align-items: center;
  grid-template-columns: 28px minmax(0,1fr) 34px;
  gap: 10px;
}
.grid.list-mode .file-icon {
  align-self: center;
  justify-self: center;
  transform: none;
}
.grid.list-mode .file-name {
  align-self: center;
  display: block;
  font-size: 14px;
  line-height: 1.2;
}
.grid.list-mode .dots {
  align-self: center;
  justify-self: center;
}
.grid.list-mode .meta {
  align-self: center;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  justify-content: end;
  text-align: right;
}
.folder-card {
  justify-content: center;
}
.folder-card .card-head {
  align-items: center;
}
.folder-card .file-name {
  font-size: 14px;
}
.folder-card .dots {
  align-self: center;
}

@media (max-width: 980px) {
  .grid.list-mode .card {
    grid-template-columns: 1fr;
    min-height: 62px;
  }
  .grid.list-mode .meta {
    display: none;
  }
}

/* Drag/drop upload, image preview, restore view, and storage final polish */
.panel[data-upload-drop] {
  position: relative;
}
.drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  border: 2px solid #1a73e8;
  border-radius: inherit;
  background: rgba(227, 242, 253, .88);
  pointer-events: none;
}
.panel.drag-active .drop-overlay {
  display: grid;
}
.drop-card {
  min-width: min(360px, 86vw);
  border-radius: 999px;
  background: #0b57d0;
  color: #fff;
  padding: 18px 30px;
  display: grid;
  justify-items: center;
  gap: 6px;
  box-shadow: 0 20px 50px rgba(26, 115, 232, .28);
}
.drop-card .material-symbols-outlined {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  color: #0b57d0;
  font-size: 36px;
}
.drop-card strong {
  font-weight: 500;
}
.drop-card em {
  font-style: normal;
  font-weight: 600;
}
.grid.list-mode .card {
  min-height: 72px !important;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px) !important;
  align-items: center !important;
  padding: 0 18px;
}
.grid.list-mode .card-head {
  height: 100%;
  grid-template-columns: 30px minmax(0, 1fr) 44px !important;
  align-items: center !important;
  gap: 12px;
}
.grid.list-mode .file-icon {
  align-self: center !important;
  justify-self: center !important;
}
.grid.list-mode .file-name {
  align-self: center !important;
  display: flex;
  align-items: center;
  min-height: 44px;
}
.grid.list-mode .dots {
  width: 42px;
  height: 42px;
  align-self: center !important;
  justify-self: center !important;
}
.grid.list-mode .meta {
  height: 100%;
  margin: 0;
  display: grid !important;
  grid-template-columns: 120px 170px;
  align-items: center;
  gap: 24px;
}
.grid.list-mode .meta span:last-child {
  justify-self: end;
}
.storage-donut {
  background: #e8eaed;
}
.storage-type-card {
  min-height: 92px !important;
  align-items: center !important;
}
.storage-type-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #fff;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 24px !important;
  line-height: 1;
  align-self: center !important;
}
.storage-type-card strong,
.storage-type-card span,
.storage-type-size,
.storage-type-percent {
  line-height: 1.25;
}
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(32, 33, 36, .72);
}
.image-modal.open {
  display: grid;
}
.image-modal figure {
  position: relative;
  margin: 0;
  max-width: min(1100px, 94vw);
  max-height: 88vh;
  display: grid;
  gap: 10px;
}
.image-modal img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.image-modal figcaption {
  color: #fff;
  text-align: center;
  font-size: 14px;
}
.image-modal button {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #202124;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 760px) {
  .grid.list-mode .card {
    grid-template-columns: 1fr !important;
    padding: 8px 12px;
  }
  .grid.list-mode .meta {
    display: none !important;
  }
}

/* Move-to-folder menu and drag target polish */
.card[draggable="true"] {
  cursor: grab;
}
.card.dragging-file {
  opacity: .62;
}
.folder-card.folder-drop-hover {
  outline: 2px solid var(--blue);
  background: #e8f0fe !important;
  transform: translateY(-1px);
}
.menu-nested {
  position: relative;
}
.menu-nested > button {
  width: 100%;
}
.menu-sub-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.menu-sub-toggle span {
  font-size: 20px;
  line-height: 1;
}
.submenu {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  width: 210px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(60, 64, 67, .2);
  display: none;
  z-index: 180;
}
.menu-nested:hover .submenu,
.menu-nested:focus-within .submenu,
.menu-nested.open .submenu {
  display: grid;
}
.submenu button {
  min-height: 36px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}
@media (max-width: 760px) {
  .submenu {
    position: static;
    width: 100%;
    max-height: 180px;
    box-shadow: none;
    margin-top: 4px;
  }
}

/* Center file card header controls */
.card-head {
  align-items: center !important;
}
.card-head .file-icon,
.card-head .file-name,
.card-head .dots {
  align-self: center !important;
}
.card-head .file-icon {
  justify-self: center;
  transform: none;
}
.card-head .file-name {
  display: flex;
  align-items: center;
  min-height: 32px;
}

/* Real image previews */
.preview.has-thumb {
  background: #fff;
  color: transparent;
  overflow: hidden;
  padding: 0;
}
.preview.has-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Slim Google Drive-like folder pills */
.folder-card {
  min-height: 54px !important;
  height: 54px;
  padding: 8px 12px;
  border-radius: 13px;
}
.folder-card .card-head {
  height: 100%;
}
.folder-card .file-icon.folder {
  width: 24px;
  height: 22px;
}
.folder-card .file-folder-symbol {
  font-size: 24px;
}
.folder-card .dots {
  height: 30px;
}

/* Bottom action group */
.sidebar-bottom {
  margin-top: auto !important;
  display: grid;
  gap: 8px;
  padding-top: 12px;
}
.sidebar-bottom .sync-sidebar-button {
  width: 100%;
  margin: 0;
}
.sidebar-bottom .apps-button {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}
.sidebar-bottom .apps-button:hover {
  background: #0b57d0 !important;
  color: #fff !important;
}
.sidebar-bottom .signout {
  margin-top: 0 !important;
  padding-top: 0;
}

@media (max-width: 980px) {
  .sidebar-bottom {
    grid-column: 1 / -1;
  }
}

/* Big portal update */
.sidebar > .brand {
  justify-content: center;
  width: 100%;
}
.storage-used {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.storage-used > span {
  min-width: 0;
}
.storage-used > strong {
  color: var(--blue);
  font-weight: 600;
}
.login {
  background: #f4f7fb;
}
.login-card {
  width: min(100%, 538px);
  border-radius: 8px;
  padding: 44px;
  box-shadow: none;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.login-brand .mark {
  width: 44px;
  height: 44px;
}
.login-brand strong {
  display: block;
  font-size: 28px;
  font-weight: 500;
}
.login-brand span:not(.mark) {
  display: block;
  color: var(--muted);
  font-size: 17px;
  margin-top: 4px;
}
.login-card h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 500;
}
.login-copy {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.45;
}
.login-card .field {
  font-size: 18px;
  gap: 12px;
  margin-bottom: 22px;
}
.login-card .field input {
  min-height: 52px;
  border-radius: 9px;
  font-size: 21px;
  background: #eaf1ff;
}
.login-card .btn {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  font-size: 20px;
}
.login-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 0;
  font-weight: 600;
}
.apps-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.apps-head .mini-btn {
  min-width: 180px;
  min-height: 46px;
  justify-content: center;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.admin-stats article {
  background: #f0f4f9;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.admin-stats span,
.muted-small {
  color: var(--muted);
  font-size: 12px;
}
.admin-stats strong {
  font-size: 22px;
  font-weight: 600;
}
.storage-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 18px;
  background: #f0f4f9;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 22px;
}
.storage-hero strong {
  font-size: 30px;
  font-weight: 600;
}
.storage-hero span,
.storage-hero p {
  color: var(--muted);
}
.storage-hero p {
  margin: 0;
}
.storage-hero .storage-track {
  grid-column: 1 / -1;
}
.storage-hero-percent {
  color: var(--blue);
  font-size: 28px;
  font-weight: 600;
}
.storage-breakdown {
  display: grid;
  gap: 12px;
}
.storage-type-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px 18px;
  align-items: center;
  background: #f8fafd;
  border: 1px solid #edf1f6;
  border-radius: 14px;
  padding: 14px 16px;
}
.storage-type-card strong,
.storage-type-card span {
  display: block;
}
.storage-type-card > .storage-track {
  grid-column: 1 / -1;
}
.tutorial-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(32, 33, 36, .36);
  display: grid;
  place-items: center;
  padding: 20px;
}
.tutorial-modal[hidden] {
  display: none;
}
.tutorial-card {
  width: min(100%, 620px);
  max-height: min(760px, 90vh);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(32, 33, 36, .28);
}
.tutorial-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.tutorial-head strong {
  display: block;
  font-size: 22px;
}
.tutorial-head span:not(.mark) {
  color: var(--muted);
}
.tutorial-card ol {
  margin: 0 0 22px;
  padding-left: 22px;
  display: grid;
  gap: 10px;
  color: #3c4043;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .admin-stats,
  .apps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .login-card {
    padding: 28px;
  }
  .login-brand strong {
    font-size: 24px;
  }
  .login-copy {
    font-size: 18px;
  }
  .admin-stats,
  .apps-grid,
  .storage-type-card {
    grid-template-columns: 1fr;
  }
  .storage-hero {
    grid-template-columns: 1fr;
  }
}

/* Apps page */
.apps-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}
.apps-head h1 {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 500;
}
.apps-head p {
  margin: 0;
  color: var(--muted);
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.app-card {
  min-height: 176px;
  background: #f0f4f9;
  border-radius: 16px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  border: 1px solid #edf1f6;
}
.app-symbol {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-size: 26px;
}
.app-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}
.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.app-action {
  min-height: 42px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-weight: 500;
}
.app-action:hover {
  background: #0b57d0;
  color: #fff;
}
.app-card.word .app-symbol { background: #185abd; }
.app-card.excel .app-symbol { background: #107c41; }
.app-card.powerpoint .app-symbol { background: #c43e1c; }
.app-card.sync .app-symbol { background: #1a73e8; }

@media (max-width: 1200px) {
  .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .apps-head { flex-direction: column; }
  .apps-grid { grid-template-columns: 1fr; }
}

/* Clean URLs update polish */
.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.apps-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.office-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 7px;
  background: #fff;
}
.office-logo i:nth-child(1) { background: #f25022; }
.office-logo i:nth-child(2) { background: #7fba00; }
.office-logo i:nth-child(3) { background: #00a4ef; }
.office-logo i:nth-child(4) { background: #ffb900; }
.office-logo i {
  border-radius: 3px;
}
.storage-infographic {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.storage-infographic article {
  min-height: 138px;
  border-radius: 18px;
  background: #f0f4f9;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
}
.storage-info-main {
  background: var(--blue) !important;
  color: #fff;
}
.storage-info-main .material-symbols-outlined {
  font-size: 30px;
}
.storage-infographic strong {
  font-size: 28px;
  font-weight: 600;
}
.storage-infographic p,
.storage-infographic span {
  margin: 0;
  color: var(--muted);
}
.storage-info-main p,
.storage-info-main span {
  color: rgba(255,255,255,.86);
}
.storage-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.storage-type-card {
  grid-template-columns: 42px minmax(0,1fr);
  gap: 10px 12px;
  min-height: 126px;
  align-content: start;
}
.storage-type-icon {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
}
.storage-type-size {
  grid-column: 2;
  font-weight: 600;
}
.storage-type-percent {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .storage-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .apps-grid,
  .storage-infographic,
  .storage-type-grid {
    grid-template-columns: 1fr;
  }
}

/* Donut storage, compact login, mobile app polish */
.login-card {
  width: min(100%, 468px);
  padding: 34px 36px;
}
.login-brand {
  margin-bottom: 20px;
}
.login-brand .mark {
  width: 34px;
  height: 34px;
}
.login-brand strong {
  font-size: 25px;
}
.login-brand span:not(.mark) {
  font-size: 15px;
}
.login-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}
.login-copy {
  font-size: 18px;
  margin-bottom: 22px;
}
.login-card .field {
  font-size: 16px;
  gap: 8px;
  margin-bottom: 16px;
}
.login-card .field input {
  min-height: 46px;
  font-size: 16px;
}
.login-card .btn {
  min-height: 48px;
  font-size: 17px;
}
.login-links {
  margin-top: 18px;
  font-size: 15px;
}
.storage-donut-wrap {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin: 18px 0 30px;
}
.storage-donut {
  width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(60,64,67,.08);
}
.storage-donut:before {
  content: "";
  position: absolute;
  inset: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 24px rgba(60,64,67,.12);
}
.storage-donut div {
  position: relative;
  z-index: 1;
  text-align: center;
  display: grid;
  gap: 3px;
}
.storage-donut strong {
  font-size: 26px;
  font-weight: 650;
}
.storage-donut span,
.storage-donut em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}
.storage-donut-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.storage-donut-summary article {
  min-height: 118px;
  border-radius: 18px;
  background: #f0f4f9;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 6px;
}
.storage-donut-summary strong {
  font-size: 24px;
  font-weight: 650;
}
.storage-donut-summary span {
  color: var(--muted);
}
.tutorial-card {
  width: min(100%, 500px);
  padding: 24px;
}
.tutorial-progress {
  height: 7px;
  background: #e8eaed;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}
.tutorial-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width .2s ease;
}
.tutorial-step {
  display: none;
  min-height: 220px;
  text-align: center;
  align-content: center;
  gap: 12px;
}
.tutorial-step.active {
  display: grid;
}
.tutorial-step .material-symbols-outlined {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  font-size: 34px;
}
.tutorial-step h2 {
  margin: 0;
  font-size: 24px;
}
.tutorial-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.tutorial-actions {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}
.tutorial-actions .mini-btn:disabled {
  opacity: .45;
  cursor: default;
}

@media (max-width: 980px) {
  body {
    background: #fff;
  }
  .shell {
    min-height: 100svh;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 14px;
  }
  .sidebar > .brand {
    justify-content: flex-start;
  }
  .user-chip {
    text-align: center;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav a,
  .nav button,
  .sync-sidebar-button {
    border-radius: 16px;
  }
  .main {
    padding: 12px;
  }
  .top {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    padding: 6px 0 10px;
  }
  .panel {
    padding: 18px 14px;
    border-radius: 0;
  }
  .apps-head {
    gap: 12px;
    margin-bottom: 18px;
  }
  .apps-head h1,
  .crumb {
    font-size: 24px;
  }
  .upload-row {
    grid-template-columns: 1fr;
  }
  .view-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .folder-form,
  .new-folder,
  .toggle {
    width: 100%;
  }
  .grid,
  .folder-grid,
  .file-grid {
    grid-template-columns: 1fr !important;
  }
  .card {
    min-height: 190px;
  }
  .folder-card {
    min-height: 54px !important;
  }
  .apps-grid,
  .admin-stats,
  .storage-donut-wrap,
  .storage-donut-summary,
  .storage-type-grid {
    grid-template-columns: 1fr;
  }
  .storage-donut {
    width: min(280px, 82vw);
    justify-self: center;
  }
  .table {
    min-width: 760px;
  }
}

@media (max-width: 560px) {
  .login {
    min-height: 100svh;
    padding: 14px;
    align-items: stretch;
  }
  .login-card {
    width: 100%;
    min-height: auto;
    padding: 24px;
    border-radius: 18px;
    align-self: center;
  }
  .login-brand strong {
    font-size: 22px;
  }
  .login-copy {
    font-size: 16px;
  }
  .login-links {
    flex-direction: column;
    gap: 10px;
  }
  .nav {
    grid-template-columns: 1fr;
  }
  .storage-donut {
    width: min(250px, 78vw);
  }
  .tutorial-actions {
    grid-template-columns: 1fr;
  }
}

/* Admin portal and storage polish */
.nav-hover {
  position: relative;
  z-index: 90;
}
.nav-hover > a {
  margin-bottom: 0;
}
.nav-flyout {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(60, 64, 67, .18);
  display: none;
  z-index: 80;
}
.nav-hover:hover .nav-flyout,
.nav-hover:focus-within .nav-flyout {
  display: grid;
}
.nav-flyout a {
  min-height: 38px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 13px;
}
.nav-flyout a:hover {
  background: #eef4ff;
  color: var(--blue);
}
.admin-overview-grid,
.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 26px;
}
.admin-overview-grid article,
.admin-health-grid article {
  border: 1px solid #edf1f6;
  border-radius: 18px;
  background: #f8fafd;
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.admin-overview-grid h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.admin-overview-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.admin-health-grid span {
  color: var(--muted);
  font-size: 13px;
}
.admin-health-grid strong {
  font-size: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.storage-donut-wrap {
  grid-template-columns: 1fr !important;
  justify-items: center;
  align-items: center;
  gap: 16px;
  margin: 18px 0 28px;
}
.storage-donut {
  width: min(320px, 72vw);
  aspect-ratio: 1;
}
.storage-type-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.storage-type-card {
  min-height: 96px;
  grid-template-columns: 44px minmax(0, 1fr) !important;
  align-items: center;
  align-content: center;
  gap: 8px 12px;
  padding: 14px 16px;
}
.storage-type-icon {
  align-self: center;
  justify-self: center;
}
.storage-type-card > div:first-of-type {
  min-width: 0;
}
.storage-type-card > div:first-of-type strong,
.storage-type-card > div:first-of-type span {
  text-align: left;
}
.storage-type-size,
.storage-type-percent {
  grid-column: 2;
  text-align: left;
}
.employee-storage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.employee-storage-card {
  border: 1px solid #edf1f6;
  border-radius: 18px;
  background: #f8fafd;
  padding: 16px;
  display: grid;
  gap: 10px;
}
.employee-storage-card strong {
  font-weight: 600;
}
.employee-storage-card span {
  color: var(--muted);
  font-size: 13px;
}
.employee-storage-size {
  font-weight: 600;
}
.employee-storage-size span {
  font-weight: 400;
}
.employee-storage-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.employee-storage-meta strong {
  color: var(--blue);
}

@media (max-width: 980px) {
  .nav-hover {
    position: static;
  }
  .nav-flyout {
    position: static;
    width: 100%;
    box-shadow: none;
    margin-top: 8px;
    grid-column: 1 / -1;
  }
  .admin-overview-grid,
  .admin-health-grid,
  .employee-storage-grid,
  .storage-type-grid {
    grid-template-columns: 1fr !important;
  }
}
