/* ==========================================================================
   Stellar Seeds Corp. - Operation System
   Base layout. Drive-inspired UX, original dark theme.
   ========================================================================== */

/* ---------- Design tokens (dark — default) ---------- */
:root {
  --bg:            #0d1018;
  --surface:       #141927;
  --surface-2:     #1b2134;
  --surface-3:     #242c45;
  --surface-hover: #1f2740;
  --border:        rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text:          #e8edf6;
  --text-muted:    #8b93a8;
  --text-faint:    #5c6478;

  --accent:        #6c7bff;
  --accent-strong: #5566f0;
  --accent-soft:   rgba(108, 123, 255, 0.14);
  --green:         #2fd57e;
  --green-soft:    rgba(47, 213, 126, 0.14);
  --amber:         #f5b64c;
  --amber-soft:    rgba(245, 182, 76, 0.14);
  --danger:        #f0506e;
  --danger-soft:   rgba(240, 80, 110, 0.14);

  --radius:        10px;
  --radius-lg:     14px;
  --sidebar-w:     264px;
  --sidebar-w-min: 76px;
  --topbar-h:     60px;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 18px 50px rgba(0, 0, 0, 0.55);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  color-scheme: dark;
}

/* ---------- Light mode tokens ---------- */
:root[data-theme="light"] {
  --bg:            #f0f2f7;
  --surface:       #ffffff;
  --surface-2:     #f7f9fc;
  --surface-3:     #eef1f7;
  --surface-hover: #e8ecf5;
  --border:        rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  --text:          #1a1e2e;
  --text-muted:    #586080;
  --text-faint:    #9199b0;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.10);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.10);
  --shadow-3: 0 14px 40px rgba(0, 0, 0, 0.14);

  color-scheme: light;
}

/* ---------- Smooth theme transition ---------- */
html {
  transition: background-color 0.3s ease;
}
body, .sidebar, .topbar, .card, .modal-backdrop, .modal-box,
.dropdown, .dropdown--new, .context-menu, .storage-bar__track {
  transition: background-color 0.3s ease, border-color 0.25s ease, color 0.2s ease, box-shadow 0.25s ease;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3350; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #36406a; }
::-webkit-scrollbar-track { background: transparent; }

/* Light mode scrollbar */
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c5cade; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #a8b0cc; }

/* ---------- App shell ---------- */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.18s ease;
  overflow: hidden;
}

.app.sidebar-collapsed .sidebar { width: var(--sidebar-w-min); }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  min-height: var(--topbar-h);
}

.sidebar__brand img,
.sidebar__brand svg {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: none;
}

.sidebar__brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.app.sidebar-collapsed .sidebar__brand-name,
.app.sidebar-collapsed .sidebar__nav-label,
.app.sidebar-collapsed .sidebar__storage,
.app.sidebar-collapsed .btn-new span,
.app.sidebar-collapsed .sidebar__user-name { display: none; }

/* New button & Dropdown (Google Drive Style) */
.sidebar__new {
  padding: 4px 18px 16px;
  position: relative;
  z-index: 50;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-new:hover {
  background: var(--surface-3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.btn-new:active {
  transform: translateY(0);
}

.btn-new__icon {
  font-size: 18px;
  color: var(--accent);
}

.app.sidebar-collapsed .sidebar__new {
  padding: 4px 14px 16px;
}

.app.sidebar-collapsed .btn-new {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
}

/* Dedicated Google Drive Style + New Dropdown Menu */
.dropdown--new {
  position: absolute;
  top: calc(100% + 4px);
  left: 18px;
  min-width: 230px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 8px;
  display: none;
  z-index: 1000;
  transform-origin: top left;
  animation: gdriveMenuIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown--new.open {
  display: block;
}

.app.sidebar-collapsed .dropdown--new {
  left: 100%;
  top: 0;
  margin-left: 8px;
}

@keyframes gdriveMenuIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.dropdown--new .dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
}

.dropdown--new .dropdown-item:hover {
  background: var(--surface-hover);
}

.dropdown--new .dropdown-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.dropdown--new .dropdown-item .icon-folder { color: #f5b64c; }
.dropdown--new .dropdown-item .icon-upload { color: #6c7bff; }
.dropdown--new .dropdown-item .icon-upload-folder { color: #2fd57e; }
.dropdown--new .dropdown-item .icon-project { color: #a855f7; }

/* Navigation */
.sidebar__nav { flex: 1; overflow-y: auto; padding: 0 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
}

.nav-item i { width: 22px; text-align: center; font-size: 16px; flex: none; }

.nav-item:hover { background: var(--surface-hover); color: var(--text); }

.nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-section {
  padding: 16px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Storage meter */
.sidebar__storage {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}

.storage-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-bottom: 8px;
}

.storage-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.storage-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.storage-bar__fill--warn { background: #f5b64c; }
.storage-bar__fill--full { background: #ef4444; }

/* Near-full / full storage warning banner (sidebar) */
.storage-warning {
  display: none;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.storage-warning.visible { display: block; }
.storage-warning--warn {
  background: rgba(245, 182, 76, 0.12);
  border-color: rgba(245, 182, 76, 0.35);
  color: var(--text-main);
}
.storage-warning--full {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--text-main);
}
.storage-warning .sw-strong { font-weight: 700; color: #d97706; }
.storage-warning--full .sw-strong { color: #dc2626; }

/* Sidebar user (collapsed view) */
.sidebar__user {
  display: none;
  padding: 12px;
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: center;
}

.app.sidebar-collapsed .sidebar__user { display: flex; }

/* ==========================================================================
   Main column
   ========================================================================== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.icon-btn:hover { background: var(--surface-hover); color: var(--text); }

/* Theme button accent glow in light mode */
:root[data-theme="light"] #btn-theme { color: var(--accent); }
:root[data-theme="light"] #btn-theme:hover { background: var(--accent-soft); }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
}

.breadcrumbs .crumb { cursor: pointer; color: var(--text); transition: color 0.12s; }
.breadcrumbs .crumb:hover { color: var(--accent); }
.breadcrumbs .crumb.current { color: var(--text-muted); font-weight: 500; pointer-events: none; }
.breadcrumbs i.sep { font-size: 13px; color: var(--text-faint); }

.search {
  flex: 1;
  max-width: 560px;
  margin-left: 8px;
  position: relative;
}

.search input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.search input::placeholder { color: var(--text-faint); }
.search input:focus { border-color: var(--accent); background: var(--surface-3); }
.search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 14px;
}

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* View toggle */
.view-toggle { display: flex; background: var(--surface-2); border-radius: 20px; padding: 3px; }
.view-toggle button {
  width: 34px;
  height: 30px;
  border: none;
  border-radius: 17px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.view-toggle button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }

/* User menu */
.user-menu { position: relative; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--border-strong);
  user-select: none;
  transition: border-color 0.12s ease;
}

.avatar:hover { border-color: var(--accent); }

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 6px;
  display: none;
  z-index: 100;
  animation: menuIn 0.12s ease;
}

.dropdown.open { display: block; }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown__head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.dropdown__head .name { font-weight: 600; font-size: 14px; }
.dropdown__head .email { font-size: 12px; color: var(--text-muted); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 0.12s ease;
}

.dropdown-item i { width: 18px; text-align: center; color: var(--text-muted); font-size: 14px; }

.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger i { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-soft); }

/* ==========================================================================
   Content
   ========================================================================== */
.content { flex: 1; overflow-y: auto; padding: 0 26px 40px; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}

.toolbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.toolbar .results-count { font-size: 13px; color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn:hover { background: var(--surface-3); border-color: var(--accent); }
.btn i { font-size: 13px; color: var(--text-muted); }

.btn--primary {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-strong); }
.btn--primary i { color: #fff; }

/* ---------- Grid view ---------- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  padding-top: 6px;
}

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}

.file-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.file-card.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.file-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}

.file-card__name {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.file-card__name-txt {
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.file-card__meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.file-card__more {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.file-card__star {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease, background 0.14s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  z-index: 2;
}

.file-card__star.starred {
  opacity: 1;
  color: #eab308;
}

.file-card:hover .file-card__more,
.file-card.selected .file-card__more { opacity: 1; }
.file-card__more:hover { background: var(--surface-3); color: var(--text); }

.file-card:hover .file-card__star { opacity: 1; }
.file-card__star:hover { background: var(--surface-3); color: #eab308; }

/* ---------- List view ---------- */
.file-list {
  width: 100%;
  border-collapse: collapse;
  padding-top: 6px;
}

.file-list__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s ease;
}

.file-row:hover { background: var(--surface-hover); }
.file-row.selected { background: var(--accent-soft); }

.file-row__name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.file-row__name i { font-size: 20px; width: 26px; text-align: center; }
.file-row__name .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row__owner { width: 160px; color: var(--text-muted); font-size: 13px; }
.file-row__size { width: 100px; color: var(--text-muted); font-size: 13px; }
.file-row__modified { width: 140px; color: var(--text-muted); font-size: 13px; }

.file-row__star {
  width: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-row__star button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.file-row__star button.starred {
  opacity: 1;
  color: #eab308;
}

.file-row:hover .file-row__star button { opacity: 1; }
.file-row__star button:hover { background: var(--surface-3); color: #eab308; }

/* ---------- Empty / placeholder ---------- */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
}

.empty-state i { font-size: 60px; color: var(--text-faint); margin-bottom: 16px; display: block; }
.empty-state h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 380px; margin: 0 auto; }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-backdrop.open { display: flex; }

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 24px;
  animation: menuIn 0.16s ease;
}

.modal__title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }

.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-muted);
}

.field input[type="text"],
.field input[type="search"] {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.12s ease;
}

.field input:focus { border-color: var(--accent); }

/* ---------- Toasts ---------- */
.toast-wrap {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 24px;
  font-size: 13.5px;
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.2s ease;
}

.toast i { color: var(--green); }
.toast.error i { color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Context menu ---------- */
.context-menu {
  position: fixed;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 6px;
  z-index: 250;
  display: none;
  animation: menuIn 0.1s ease;
}

.context-menu.open { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .search { max-width: none; }
  .file-row__owner, .file-row__size { display: none; }
  .file-row__modified { width: 110px; }
}

@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    z-index: 150;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-3);
  }
  .app.sidebar-collapsed .sidebar { transform: translateX(0); width: var(--sidebar-w); }
  .app.sidebar-collapsed .sidebar__brand-name,
  .app.sidebar-collapsed .sidebar__nav-label,
  .app.sidebar-collapsed .sidebar__storage,
  .app.sidebar-collapsed .btn-new span,
  .app.sidebar-collapsed .sidebar__user-name { display: initial; }
  .app.sidebar-collapsed .sidebar__user { display: none; }
  .content { padding: 0 14px 30px; }
  .breadcrumbs { font-size: 14px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ==========================================================================
   Progress Panel
   ========================================================================== */
.progress-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 340px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  z-index: 210;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  transform: translateY(120%);
  opacity: 0;
}

.progress-panel.open {
  transform: translateY(0);
  opacity: 1;
}

.progress-panel.minimized .progress-panel__list {
  display: none;
}

.progress-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.progress-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.progress-panel__actions {
  display: flex;
  gap: 8px;
}

.progress-panel__actions button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.progress-panel__actions button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.progress-panel__list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
  background: var(--surface-2);
}

.progress-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--accent);
  flex: none;
}

.progress-item__details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.progress-item__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-item__bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-item__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s linear;
}

.progress-item.done .progress-item__bar {
  width: 100%;
}
.progress-item.done .progress-item__icon {
  color: var(--green);
}
.progress-item.error .progress-item__icon {
  color: var(--danger);
}
.progress-item.error .progress-item__bar {
  background: var(--danger);
}

/* ==========================================================================
   Share Modal & Public Share Styles
   ========================================================================== */
.shared-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(108, 123, 255, 0.14);
  color: #6c7bff;
  white-space: nowrap;
}
.shared-badge i { font-size: 11px; }
@media (max-width: 900px) {
  .shared-badge { padding: 1px 5px; font-size: 10px; }
}
.modal--wide {
  max-width: 560px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal__header .modal__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
}

.modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.modal__close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.share-section {
  margin-bottom: 18px;
}

.share-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.share-input-wrap {
  position: relative;
}

.share-input-wrap input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}

.share-input-wrap input:focus {
  border-color: var(--accent);
  outline: none;
}

.user-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  display: none;
}

.user-autocomplete-list.open {
  display: block;
}

.user-auto-item {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.user-auto-item:last-child {
  border-bottom: none;
}

.user-auto-item:hover {
  background: var(--surface-hover);
}

.user-auto-item .name {
  font-weight: 600;
  font-size: 13px;
}

.user-auto-item .email {
  font-size: 12px;
  color: var(--text-muted);
}

.share-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
}

.share-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.share-user-item__info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.share-user-details .name {
  font-size: 13px;
  font-weight: 500;
}

.share-user-details .email {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-revoke {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-revoke:hover {
  background: rgba(239, 68, 68, 0.1);
}

.share-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.share-link-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.share-link-details {
  flex: 1;
}

.share-link-title {
  font-size: 14px;
  font-weight: 600;
}

.share-link-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.share-select {
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
}

.share-link-actions {
  display: flex;
  gap: 8px;
}

.share-link-actions input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
}

/* Public Share Card Page */
.public-share-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.share-card-container {
  width: 100%;
  max-width: 480px;
}

.share-card {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  text-align: center;
}

.share-card__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.share-card__brand img {
  height: 24px;
}

.share-card__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.share-card__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
  word-break: break-word;
}

.share-card__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.expire-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
}

.expire-badge.never {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
}

.share-card__error .error-icon {
  font-size: 54px;
  color: var(--danger);
  margin-bottom: 16px;
}

.share-card__actions .btn--lg {
  padding: 12px 28px;
  font-size: 15px;
  border-radius: 10px;
}

/* ---------- Storage Section & Request Storage ---------- */
.storage-text-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.storage-text {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-request-storage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-main);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-request-storage:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.08);
}

/* ==========================================================================
   Auth Pages (Login & Register) — Light Mode Always
   Premium clean design: white card, pastel gradient, indigo accents.
   ========================================================================== */

/* Force light color-scheme for auth pages regardless of user preference */
html[data-theme="light"] .auth-body,
.auth-body {
  background-color: #eef1f9;
  color: #1a1e2e;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

.auth-bg-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: #eef1f9;
}

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: orbFloat 16s infinite ease-in-out alternate;
}

/* Orbs removed — flat background only */
.auth-bg-orb { display: none; }

@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, 40px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

/* Card */
.login-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 20px 40px -12px rgba(99, 102, 241, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  width: 100%;
  max-width: 440px;
  padding: 2.75rem 2.25rem 2.25rem;
  box-sizing: border-box;
  animation: authFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.register-card {
  max-width: 540px;
  padding: 2.75rem 2.5rem 2.25rem;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand Section */
.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo-wrap {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.25rem;
  border-radius: 22px;
  background: #eef0ff;
  border: 1.5px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.brand-logo-wrap:hover {
  transform: scale(1.05) rotate(2deg);
}

.brand-logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(99, 102, 241, 0.2));
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.025em;
  color: #3730a3;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.45;
}

/* Alert Styling */
.alert-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  color: #dc2626;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.45;
}

.alert-error .alert-icon {
  font-size: 1.1rem;
  color: #ef4444;
  margin-top: 1px;
  flex-shrink: 0;
}

.error-list {
  margin: 0;
  padding-left: 1.2rem;
}

.error-list li { margin-bottom: 4px; }
.error-list li:last-child { margin-bottom: 0; }

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.75rem 0 1.5rem;
}

.login-divider .line {
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.10);
}

.divider-text {
  font-size: 0.79rem;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  white-space: nowrap;
}

/* Microsoft SSO Button */
.btn-ms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 52px;
  background: #ffffff;
  color: #1a1a2e;
  border-radius: 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.10);
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255,255,255,0.8) inset;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.btn-ms:hover {
  background: #f5f6ff;
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.btn-ms:active { transform: translateY(0); }

.btn-ms .ms-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Trust / Security Badge */
.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 1.75rem;
  text-align: center;
}

.security-badge i { color: #10b981; }

/* Form Controls & Layout */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-group label i {
  color: #6366f1;
  font-size: 0.85rem;
}

.form-control {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(0, 0, 0, 0.10);
  color: #1a1e2e;
  padding: 0 14px;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) inset;
}

.form-control::placeholder { color: #9ca3af; }

.form-control:focus {
  outline: none;
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.input-lock-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-control--readonly {
  background: rgba(243, 244, 246, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.07) !important;
  color: #9ca3af !important;
  cursor: not-allowed;
}

.input-lock-icon {
  position: absolute;
  right: 14px;
  color: #9ca3af;
  font-size: 0.85rem;
  pointer-events: none;
}

.role-badge {
  position: absolute;
  right: 10px;
  background: rgba(34, 197, 94, 0.10);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 1.75rem;
  box-sizing: border-box;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.45);
  filter: brightness(1.06);
}

.btn-submit:active { transform: translateY(0); }

/* Registration Success Modal */
#reg-success-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(30, 30, 60, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

#reg-success-modal.is-open { display: flex; }

.reg-modal-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(255,255,255,0.8) inset;
  max-width: 440px;
  width: 100%;
  padding: 2.75rem 2.25rem 2.25rem;
  text-align: center;
  animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.reg-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.10);
  border: 2px solid rgba(34, 197, 94, 0.3);
  margin: 0 auto 1.5rem;
  color: #16a34a;
  font-size: 2rem;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.12);
}

.reg-modal-card h2 {
  font-family: 'Outfit', sans-serif;
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1e2e;
}

.reg-modal-card p {
  margin: 0 0 2rem;
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.6;
}

.reg-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.reg-modal-btn--web {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.2);
}

.reg-modal-btn--web:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.reg-modal-btn--app {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.reg-modal-btn--app:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

/* Login Footer */
.login-footer {
  margin-top: 2rem;
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
}
