:root {
  --bg: #131313;
  --surface: #1c1b1b;
  --surface-container: #201f1f;
  --surface-high: #2a2a2a;
  --surface-highest: #353534;
  --surface-bright: #3a3939;
  --primary: #b0c6ff;
  --primary-container: #568dff;
  --on-primary: #002d6f;
  --on-primary-container: #002661;
  --tertiary: #ffb599;
  --tertiary-container: #f36420;
  --error: #ffb4ab;
  --on-surface: #e5e2e1;
  --on-surface-variant: #c2c6d8;
  --on-secondary-container: #b4b5b5;
  --secondary: #c6c6c7;
  --outline: #8c90a1;
  --outline-variant: #424655;
  --white-5: rgba(255,255,255,0.05);
  --white-10: rgba(255,255,255,0.1);
  --white-20: rgba(255,255,255,0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Geist', -apple-system, sans-serif;
  background: #000;
  color: var(--on-surface);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.glass-card {
  background: rgba(53,53,52,0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--white-10);
}

/* ===== LOGIN (macOS style) ===== */
.login-os-screen {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-bg-img {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.login-os-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
  width: 100%;
  padding: 0 24px;
}
.login-os-glow {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-os-glow::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
  animation: pulseGlow 4s infinite alternate ease-in-out;
}
@keyframes pulseGlow {
  0% { opacity: 0.4; }
  100% { opacity: 0.6; }
}
.login-os-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 24px;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeUp 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
}
.login-os-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.login-os-input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 16px;
  font-family: inherit;
  color: white;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.15);
  outline: none;
  transition: all 0.3s;
  animation: fadeUp 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
  opacity: 0;
}
.login-os-input:nth-child(1) { animation-delay: 100ms; }
.login-os-input:focus {
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2), 0 0 15px rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.12);
}
.login-os-input::placeholder { color: rgba(255,255,255,0.5); }
.login-os-pass-wrap {
  position: relative;
  animation: fadeUp 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
  animation-delay: 200ms;
  opacity: 0;
}
.login-os-pass-wrap .login-os-input { padding-right: 48px; animation: none; opacity: 1; }
.login-os-submit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(100,140,255,0.6);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  backdrop-filter: blur(8px);
}
.login-os-submit:hover { background: rgba(100,140,255,0.8); }
.login-os-submit:disabled { opacity: 0.4; cursor: default; }
.login-os-submit:disabled { opacity: 0.4; cursor: default; }
.login-os-hint {
  font-size: 12px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-align: center;
  text-transform: uppercase;
  animation: fadeUp 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
  animation-delay: 300ms;
  opacity: 0;
}
.login-os-footer {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  z-index: 20;
  animation: fadeUp 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
  animation-delay: 400ms;
  opacity: 0;
}
.login-error { color: #ffb4ab; font-size: 13px; margin-top: 8px; min-height: 18px; text-align: center; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Drag-to-move indicators */
.folder-card.drag-over {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: rgba(176,198,255,0.15) !important;
}
.file-row.dragging, .file-card.dragging, .folder-card.dragging {
  opacity: 0.4;
}

/* ===== APP LAYOUT ===== */
#app-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  position: relative;
  background: rgba(19,19,19,0.7);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}
.app-wallpaper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
.app-wallpaper-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.1);
  z-index: 0;
  pointer-events: none;
}
html.light .app-wallpaper-overlay {
  background: rgba(255,255,255,0.25);
}

/* ===== TOP NAV BAR ===== */
.topbar {
  background: transparent;
  border-bottom: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  flex-shrink: 0;
  z-index: 41;
  position: relative;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.01em;
}
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 4px;
}
.topbar-search {
  flex: 1;
  max-width: 640px;
  margin: 0 24px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-variant);
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  background: rgba(42,42,42,0.5);
  border: none;
  border-bottom: 1px solid var(--white-10);
  color: var(--on-surface);
  padding: 8px 12px 8px 40px;
  border-radius: 4px 4px 0 0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.topbar-search input::placeholder { color: var(--on-surface-variant); }
.topbar-search input:focus { border-bottom-color: var(--primary); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--primary); background: var(--white-5); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-high);
  border: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--on-surface-variant);
  margin-left: 4px;
}

/* ===== APP BODY ===== */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 256px;
  min-width: 256px;
  background: rgba(32,31,31,0.5);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  border-right: 1px solid var(--white-10);
  display: flex;
  flex-direction: column;
  padding: 16px 8px;
  flex-shrink: 0;
  z-index: 30;
  overflow-y: auto;
}
.btn-new {
  background: var(--primary);
  color: var(--on-primary);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 9999px;
  padding: 8px 24px;
  margin: 0 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s;
}
.btn-new:hover { opacity: 0.9; }
.dropdown-menu {
  background: var(--surface-high);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  padding: 4px;
  margin: 0 8px 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.dropdown-item:hover { background: var(--white-5); }
.dropdown-item .material-symbols-outlined { font-size: 20px; color: var(--on-surface-variant); }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--on-secondary-container);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--white-10); color: var(--on-surface); }
.nav-item.active {
  color: var(--primary);
  font-weight: 700;
  background: var(--white-5);
}
.nav-item .material-symbols-outlined {
  padding: 4px;
  margin-left: -4px;
  border-radius: 50%;
  transition: background 0.15s;
}
.nav-item:hover .material-symbols-outlined { background: var(--white-10); }

.sidebar-storage {
  margin-top: auto;
  border-top: 1px solid var(--white-10);
  padding: 12px 8px 0;
}
.storage-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  color: var(--on-secondary-container);
  font-size: 16px;
  margin-bottom: 8px;
}
.storage-bar {
  height: 4px;
  background: var(--surface-high);
  border-radius: 9999px;
  overflow: hidden;
}
.storage-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  box-shadow: 0 0 8px rgba(176,198,255,0.5);
  transition: width 0.3s;
}
.storage-text {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--on-surface-variant);
  padding: 4px 8px;
  margin-top: 4px;
}

/* ===== MAIN CANVAS ===== */
.main-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(19,19,19,0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.05);
}

/* Breadcrumb */
.breadcrumb {
  padding: 14px 32px;
  font-size: 16px;
  border-bottom: 1px solid var(--white-5);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.breadcrumb .bc-item {
  cursor: pointer;
  color: var(--on-surface-variant);
  font-weight: 500;
  transition: color 0.15s;
}
.breadcrumb .bc-item:hover { color: var(--on-surface); }
.breadcrumb .bc-item:last-child { color: var(--on-surface); cursor: default; }
.breadcrumb .bc-sep { color: var(--outline); font-size: 14px; margin: 0 6px; }

/* View panels */
.view-panel { display: none; flex: 1; overflow-y: auto; }
.view-panel.active { display: flex; flex-direction: column; }

/* ===== FILES VIEW ===== */
.section-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 16px;
}

/* Quick Access */
.quick-access {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 8px;
}
.quick-access::-webkit-scrollbar { display: none; }
.quick-access { -ms-overflow-style: none; scrollbar-width: none; }

.quick-card {
  min-width: 240px;
  flex-shrink: 0;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.quick-card:hover { background: rgba(42,42,42,0.6); }
.quick-card-preview {
  width: 100%;
  height: 128px;
  background: var(--surface-highest);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 8px;
}
.quick-card-preview .material-symbols-outlined { font-size: 24px; }
.quick-card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.quick-card-info span:first-child {
  font-size: 14px;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-card-info .material-symbols-outlined {
  font-size: 18px;
  color: var(--on-surface-variant);
  cursor: pointer;
}

/* Folders grid */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.folder-card {
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.folder-card:hover {
  background: var(--white-5);
  border-color: var(--white-10);
}
.folder-card-icon {
  background: var(--surface-high);
  padding: 8px;
  border-radius: 8px;
  transition: all 0.15s;
}
.folder-card:hover .folder-card-icon {
  background: rgba(176,198,255,0.1);
}
.folder-card:hover .folder-card-icon .material-symbols-outlined {
  color: var(--primary);
}
.folder-card-icon .material-symbols-outlined {
  color: var(--on-surface-variant);
}
.folder-card-info h3 {
  font-size: 16px;
  font-weight: 400;
  color: var(--on-surface);
}
.folder-card-info p {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--on-surface-variant);
}

/* File list */
.file-list-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--white-5);
  margin-bottom: 4px;
}
.file-list-header .col-name { flex: 1; }
.file-list-header .col-owner { width: 128px; }
.file-list-header .col-modified { width: 128px; }
.file-list-header .col-size { width: 96px; text-align: right; }

.file-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.file-row:hover { background: var(--white-5); }
.file-row.selected {
  background: rgba(176,198,255,0.1);
  border: 1px solid rgba(176,198,255,0.2);
}
.file-row.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.file-row .col-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.file-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.file-row .col-name span.file-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.file-row .col-owner {
  width: 128px;
  font-size: 14px;
  color: var(--on-surface);
}
.file-row .col-modified {
  width: 128px;
  font-size: 14px;
  color: var(--on-surface-variant);
}
.file-row .col-size {
  width: 96px;
  text-align: right;
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--on-surface-variant);
}
.file-row .file-actions {
  display: none;
  gap: 2px;
  margin-left: 8px;
}
.file-row:hover .file-actions { display: flex; }
.file-row .file-actions button {
  background: var(--surface-high);
  border: 1px solid var(--white-10);
  border-radius: 6px;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.file-row .file-actions button:hover {
  background: var(--surface-bright);
  color: var(--on-surface);
}
.file-row .file-actions button .material-symbols-outlined { font-size: 16px; }

/* File grid (alternate view) */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.file-card {
  border-radius: 12px;
  padding: 20px 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  border: 1px solid var(--white-10);
  background: rgba(53,53,52,0.3);
}
.file-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  background: rgba(53,53,52,0.6);
}
.file-card .file-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.file-card .file-icon .material-symbols-outlined { font-size: 36px; }
.file-card .file-name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
  margin: 0 auto;
}
.file-card .file-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--on-surface-variant);
  margin-top: 4px;
}
.file-card .file-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 2px;
}
.file-card:hover .file-card-actions { display: flex; }
.file-card .file-card-actions button {
  background: var(--bg);
  border: 1px solid var(--white-10);
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  color: var(--on-surface-variant);
  display: flex;
}
.file-card .file-card-actions button:hover { background: var(--surface-high); }
.file-card .file-card-actions button .material-symbols-outlined { font-size: 16px; }

/* ===== PHOTOS VIEW ===== */
.photos-categories {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 32px;
  flex-shrink: 0;
}
.photos-categories::-webkit-scrollbar { display: none; }
.photos-categories { -ms-overflow-style: none; scrollbar-width: none; }

.cat-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 9999px;
  background: rgba(19,19,19,0.8);
  backdrop-filter: blur(24px);
  border: 1px solid var(--white-10);
  color: var(--on-surface-variant);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-chip:hover { color: var(--on-surface); background: var(--white-10); }
.cat-chip.active {
  background: rgba(176,198,255,0.1);
  color: var(--primary);
  border-color: rgba(176,198,255,0.2);
}

.photos-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--white-5);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(19,19,19,0.9);
  backdrop-filter: blur(12px);
}
.photos-section-header h2 {
  font-size: 20px;
  font-weight: 500;
  color: var(--on-surface);
}
.photos-section-header span {
  font-size: 14px;
  color: var(--on-surface-variant);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
}
.photo-card {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
  background: var(--surface-highest);
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.photo-card:hover img { transform: scale(1.05); }
.photo-card .photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.photo-card:hover .photo-overlay { opacity: 1; }
.photo-card .photo-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.photo-card:hover .photo-icon { opacity: 0.8; }
.photo-card img { cursor: pointer; position: relative; z-index: 1; }
.photo-card.landscape { grid-column: span 2; aspect-ratio: 16/9; }

/* ===== PHOTO SELECT CIRCLE ===== */
.photo-select-circle {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-card:hover .photo-select-circle { opacity: 1; }
.photo-select-circle.selected {
  opacity: 1;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 8px rgba(176,198,255,0.6);
}
.photo-select-circle .material-symbols-outlined {
  font-size: 16px;
  color: white;
  font-weight: bold;
}
.photo-card.is-selected {
  ring: 2px solid var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.photo-card.is-selected img { opacity: 0.8; }

/* ===== PHOTO SELECTION TOOLBAR ===== */
.photo-select-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--surface-high);
  border-bottom: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}
.select-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--on-surface);
}
.select-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== PHOTO VIEWER ===== */
.photo-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  display: flex;
  flex-direction: column;
}
.viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0,0,0,0.6);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
.viewer-btn { color: #fff !important; }
.viewer-btn:hover { background: rgba(255,255,255,0.1) !important; }
.viewer-actions { display: flex; align-items: center; gap: 4px; }
.viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 5;
}
.viewer-nav:hover { background: rgba(255,255,255,0.2); }
.viewer-prev { left: 16px; }
.viewer-next { right: 16px; }
.viewer-nav .material-symbols-outlined { font-size: 28px; }

/* ===== DETAILS PANEL ===== */
.details-panel {
  width: 320px;
  background: rgba(28,27,27,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--white-10);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.details-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--white-10);
}
.details-header h3 {
  font-size: 20px;
  font-weight: 500;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
}
.details-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.details-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface-highest);
  border-radius: 8px;
  border: 1px solid var(--white-10);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.details-preview .material-symbols-outlined { font-size: 48px; color: var(--on-surface-variant); }
.details-filename {
  font-size: 16px;
  font-weight: 500;
  color: var(--on-surface);
  word-break: break-all;
}
.details-filetype {
  font-size: 14px;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 4px;
}
.details-filetype .material-symbols-outlined { font-size: 16px; }
.details-props {
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.details-prop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--white-5);
}
.details-prop:last-child { border-bottom: none; }
.details-prop .prop-label { font-size: 14px; color: var(--on-surface-variant); }
.details-prop .prop-value { font-size: 14px; color: var(--on-surface); }
.details-prop .prop-value.mono {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
}
.details-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.details-actions button {
  flex: 1;
  background: var(--white-5);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  padding: 8px;
  color: var(--on-surface);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s;
}
.details-actions button:hover { background: var(--white-10); }
.details-actions button .material-symbols-outlined { font-size: 18px; }

/* ===== THREE-DOT MENU BUTTON ===== */
.more-btn {
  background: none;
  border: none;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin-left: auto;
  flex-shrink: 0;
}
.more-btn:hover { background: var(--white-10); color: var(--on-surface); }
.more-btn .material-symbols-outlined { font-size: 20px; }

/* ===== CONTEXT MENU ===== */
.context-menu {
  position: fixed;
  z-index: 200;
  background: var(--surface-high);
  border: 1px solid var(--white-10);
  border-radius: 12px;
  padding: 6px;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--on-surface);
  transition: background 0.1s;
}
.ctx-item:hover { background: var(--white-5); }
.ctx-item .material-symbols-outlined { font-size: 20px; color: var(--on-surface-variant); }
.ctx-item.ctx-danger { color: var(--error); }
.ctx-item.ctx-danger .material-symbols-outlined { color: var(--error); }
.ctx-divider {
  height: 1px;
  background: var(--white-10);
  margin: 4px 8px;
}

/* ===== STATES ===== */
.loading, .empty-state, .error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--on-surface-variant);
  font-size: 14px;
}
.empty-state .material-symbols-outlined {
  font-size: 48px;
  color: var(--outline-variant);
  margin-bottom: 12px;
  display: block;
}
.error-state { color: var(--error); }
#upload-status {
  font-size: 12px;
  color: var(--primary);
  min-height: 18px;
}

/* ===== UPLOAD TOAST ===== */
.upload-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  background: var(--surface-high);
  border: 1px solid var(--white-10);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 150;
  overflow: hidden;
}
.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--white-5);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
}
.toast-header-actions { display: flex; gap: 2px; }
.toast-btn { padding: 4px !important; }
.toast-btn .material-symbols-outlined { font-size: 20px; }
.toast-body {
  max-height: 200px;
  overflow-y: auto;
}
.toast-body.collapsed { display: none; }
.toast-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--on-surface);
  border-bottom: 1px solid var(--white-5);
}
.toast-item:last-child { border-bottom: none; }
.toast-item-row { display: flex; align-items: center; gap: 10px; }
.toast-item-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--white-5);
  overflow: hidden;
}
.toast-item-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.15s linear;
}
.toast-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--on-surface-variant);
}
.toast-item-meta.error-text { color: var(--error); }

.move-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface, #1c1b1b);
  border: 1px solid var(--white-5);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  z-index: 2000;
  font-size: 13px;
  color: var(--on-surface);
}
.move-banner .move-banner-text { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-banner button {
  background: var(--primary);
  color: var(--on-primary, #002d6f);
  border: none;
  border-radius: 16px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.move-banner button.move-banner-cancel {
  background: transparent;
  color: var(--on-surface-variant);
}
.toast-item-icon .material-symbols-outlined { font-size: 20px; }
.toast-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-item-status { flex-shrink: 0; display: flex; align-items: center; }
.toast-item-status .material-symbols-outlined { font-size: 20px; }
.toast-item-status.uploading { color: var(--primary); }
.toast-item-status.done { color: #34d399; }
.toast-item-status.error { color: var(--error); }
.toast-item-cancel {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
}
.toast-progress {
  height: 3px;
  background: var(--white-10);
}
.toast-progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
  border-radius: 2px;
}

/* Cancel dialog */
.cancel-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cancel-dialog {
  padding: 24px;
  border-radius: 16px;
  width: 400px;
  max-width: 90vw;
}
.cancel-dialog h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 8px;
}
.cancel-dialog p {
  font-size: 14px;
  color: var(--on-surface-variant);
  margin-bottom: 20px;
}
.cancel-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.cancel-dialog-btn {
  padding: 8px 20px;
  border-radius: 9999px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--primary);
  transition: background 0.15s;
}
.cancel-dialog-btn:hover { background: var(--white-5); }
.cancel-dialog-btn.primary {
  background: var(--primary);
  color: var(--on-primary);
}
.cancel-dialog-btn.primary:hover { opacity: 0.9; }

/* Light overrides */
html.light .upload-toast { background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,0.12); }
html.light .cancel-dialog { background: #fff; }

/* ===== FILE PREVIEW OVERLAY ===== */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  display: flex;
  flex-direction: column;
}
.preview-topbar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0,0,0,0.5);
  z-index: 10;
  gap: 12px;
}
.preview-filename {
  flex: 1;
  color: white;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-actions { display: flex; gap: 4px; }
.preview-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
}

/* ===== FILE MULTI-SELECT ===== */
.file-select-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface-high);
  border-bottom: 1px solid var(--white-10);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-select-bar .select-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
}
.file-select-bar .select-actions { margin-left: auto; display: flex; gap: 4px; }

.file-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--on-surface-variant);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-right: 4px;
}
.file-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.file-checkbox .material-symbols-outlined { font-size: 16px; color: var(--on-primary); }
.file-row.multi-selected { background: rgba(176,198,255,0.1); }
.file-checkbox.indeterminate {
  background: var(--primary);
  border-color: var(--primary);
}
.header-checkbox { margin-right: 12px; }

/* ===== DRAG OVERLAY ===== */
.drag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drag-content {
  text-align: center;
  color: var(--primary);
  font-size: 18px;
}
.drag-content p { margin-top: 12px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; position: fixed; top: 64px; left: 0; bottom: 0; z-index: 50; }
  .sidebar.open { display: flex; }
  .mobile-menu-btn { display: flex; }
  .topbar-search { display: none; }
  .topbar { padding: 0 16px; }
  .breadcrumb { padding: 10px 16px; }
  .view-panel { padding: 16px !important; }
  .photos-categories { padding: 12px 16px; }
  .file-row .col-owner { display: none; }
  .file-row .col-modified { display: none; }
  .file-list-header .col-owner { display: none; }
  .file-list-header .col-modified { display: none; }
  .details-panel { display: none !important; }
  .folders-grid { grid-template-columns: 1fr; }
  .photos-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .photos-categories { padding: 8px 12px; gap: 8px; }
  .cat-chip { padding: 6px 16px; font-size: 13px; }
  .photos-section-header { padding: 8px 4px; }
  .photos-section-header h2 { font-size: 16px; }
  #photos-grid > div { padding: 0 4px 16px !important; }

  /* Mobile file list */
  .file-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .file-row { padding: 8px 12px; }
  .file-row .col-size { width: 70px; font-size: 11px; }
  .section-title { font-size: 16px; }
  .folder-card { padding: 12px; }

  /* Mobile topbar */
  .brand-text { font-size: 20px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .icon-btn { padding: 4px; }
  #upload-status { display: none; }

  /* Mobile upload toast */
  .upload-toast { width: calc(100vw - 16px); right: 8px; bottom: 8px; }

  /* Mobile viewer */
  .viewer-nav { width: 36px; height: 36px; }
  .viewer-prev { left: 8px; }
  .viewer-next { right: 8px; }
}

@media (max-width: 480px) {
  .photos-grid { grid-template-columns: repeat(3, 1fr); gap: 1px; }
  .photo-card { border-radius: 0; }
  .file-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  .details-panel { display: none !important; }
}

/* ===== LIGHT MODE ===== */
html.light {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-container: #f0f1f3;
  --surface-high: #e8e9eb;
  --surface-highest: #dfe0e2;
  --surface-bright: #ffffff;
  --primary: #0058cb;
  --primary-container: #d9e2ff;
  --on-primary: #ffffff;
  --on-primary-container: #001945;
  --tertiary: #7f2b00;
  --tertiary-container: #ffdbce;
  --error: #ba1a1a;
  --on-surface: #1c1b1b;
  --on-surface-variant: #44474f;
  --on-secondary-container: #1a1c1c;
  --secondary: #5e5e5f;
  --outline: #74777f;
  --outline-variant: #c4c6d0;
  --white-5: rgba(0,0,0,0.04);
  --white-10: rgba(0,0,0,0.08);
  --white-20: rgba(0,0,0,0.12);
}
html.light body { background: #f0f1f3; color: var(--on-surface); }
html.light .glass-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(24px);
  border: 1px solid var(--white-10);
}
html.light #app-screen { background: rgba(255,255,255,0.6); backdrop-filter: blur(40px); }
html.light .topbar { background: transparent; }
html.light .sidebar { background: rgba(245,245,255,0.4); backdrop-filter: blur(50px) saturate(150%); }
html.light .main-canvas { background: rgba(250,250,255,0.3); backdrop-filter: blur(20px) saturate(150%); box-shadow: inset 0 1px 0 0 rgba(0,0,0,0.03); }
html.light .details-panel { background: rgba(245,245,255,0.5); backdrop-filter: blur(50px) saturate(150%); }
html.light .topbar-search input { background: var(--surface-high); }
html.light .storage-fill { box-shadow: 0 0 8px rgba(0,88,203,0.3); }
html.light .cat-chip { background: rgba(255,255,255,0.8); }
html.light .cat-chip.active { background: rgba(0,88,203,0.1); }
html.light .photos-section-header { background: rgba(248,249,250,0.9); }
html.light .file-card { background: rgba(255,255,255,0.6); }
html.light .drag-overlay { background: rgba(255,255,255,0.8); }
html.light .context-menu { background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
