:root {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #1f2937;
  --bg-card-hover: #283548;
  --border-color: #374151;
  --border-subtle: #1f2937;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.15);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.12);
  
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-subtle: #64748b;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* Typography & Links */
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Top Navbar */
.navbar {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.brand-icon.large {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px auto;
  border-radius: var(--radius-lg);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  display: block;
}

/* Drive Status Pill in Nav */
.drive-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drive-status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.drive-status-pill.connected {
  background-color: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.drive-status-pill.connected .status-dot {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.drive-status-pill.disconnected {
  background-color: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.drive-status-pill.disconnected .status-dot {
  background-color: #ef4444;
}

[data-theme="light"] .drive-status-pill.connected {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
[data-theme="light"] .drive-status-pill.disconnected {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.nav-username {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.nav-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 700;
}

/* Layout: Main Container & Sidebar */
.main-container {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.nav-link:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.nav-link.active {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
}

.nav-link.active svg {
  stroke: white;
}

/* Storage Card in Sidebar */
.storage-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.storage-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.storage-sub {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-bottom: 10px;
}

.user-stats-compact {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px;
  background-color: var(--bg-main);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.alert-banner.warning {
  background-color: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.alert-banner.warning svg {
  stroke: #f59e0b;
  flex-shrink: 0;
}
.alert-banner.warning .banner-content strong {
  color: #fbbf24;
}
.alert-banner.warning .banner-content p {
  color: #fde68a;
}

[data-theme="light"] .alert-banner.warning {
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}
[data-theme="light"] .alert-banner.warning svg {
  stroke: #d97706;
}
[data-theme="light"] .alert-banner.warning .banner-content strong {
  color: #78350f;
}
[data-theme="light"] .alert-banner.warning .banner-content p {
  color: #92400e;
}

.alert-banner.info {
  background-color: var(--primary-light);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}
.alert-banner.info svg {
  stroke: #3b82f6;
  flex-shrink: 0;
}
.alert-banner.info .banner-content strong {
  color: #bfdbfe;
}
.alert-banner.info .banner-content p {
  color: #93c5fd;
}

[data-theme="light"] .alert-banner.info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
[data-theme="light"] .alert-banner.info svg {
  stroke: #2563eb;
}
[data-theme="light"] .alert-banner.info .banner-content strong {
  color: #1e3a8a;
}
[data-theme="light"] .alert-banner.info .banner-content p {
  color: #1e40af;
}

.banner-content {
  flex: 1;
}
.banner-content strong {
  display: block;
  font-size: 0.92rem;
}
.banner-content p {
  font-size: 0.82rem;
  margin: 0;
}

/* Explorer Header & Breadcrumbs */
.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.explorer-nav-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-user-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-md);
}

.admin-user-selector label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-user-selector label svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
}

.select-drive {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.crumb {
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.crumb:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.crumb.active {
  color: var(--text-main);
  cursor: default;
  font-weight: 700;
}

.crumb-separator {
  color: var(--text-subtle);
  font-size: 0.8rem;
}

/* Action Buttons & Search */
.explorer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 40px;
}

.search-box svg {
  stroke: var(--text-subtle);
  width: 18px;
  height: 18px;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  width: 140px;
}

.search-box input::placeholder {
  color: var(--text-subtle);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-danger-outline:hover {
  background-color: var(--danger-bg);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-icon:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.btn-google {
  background-color: white;
  color: #374151;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #d1d5db;
}
.btn-google:hover {
  background-color: #f3f4f6;
}

/* File Explorer Area & Drag Drop */
.file-explorer-area {
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.drag-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(59, 130, 246, 0.2);
  border: 3px dashed var(--primary);
  border-radius: var(--radius-lg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.drag-overlay.active {
  display: flex;
}

.drag-icon {
  width: 64px;
  height: 64px;
  color: var(--primary);
  margin-bottom: 12px;
}

/* Table styles */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.file-table, .data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.file-table th, .data-table th {
  padding: 14px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.file-table td, .data-table td {
  padding: 14px 20px;
  font-size: 0.9rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

.file-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.file-row:hover {
  background-color: var(--bg-card);
}

.item-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.item-icon.folder {
  color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.15);
}

.item-icon.file {
  color: #3b82f6;
  background-color: var(--primary-light);
}

.item-icon.image {
  color: #ec4899;
  background-color: rgba(236, 72, 153, 0.15);
}

.item-icon.video {
  color: #8b5cf6;
  background-color: rgba(139, 92, 246, 0.15);
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

.action-btn.delete:hover {
  background-color: var(--danger-bg);
  color: var(--danger);
}

/* Empty & Loading States */
.empty-state, .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  color: var(--text-subtle);
  margin-bottom: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Cards & Grid */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 24px;
}

.card-subtext {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* Google Drive Settings Views */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.one-click-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 20px;
}

.one-click-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.one-click-box h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.one-click-box p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 460px;
  margin-bottom: 24px;
}

.connected-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-card);
  padding: 18px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.connected-avatar {
  color: var(--success);
}

.connected-details {
  display: flex;
  flex-direction: column;
}

.connected-label {
  font-size: 0.78rem;
  color: var(--text-subtle);
  text-transform: uppercase;
}

.connected-email {
  font-size: 1.1rem;
  color: var(--text-main);
}

.quota-container {
  margin-bottom: 24px;
}

.quota-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-bar-bg {
  height: 8px;
  background-color: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.connected-actions {
  display: flex;
  gap: 12px;
}

/* Forms & Inputs */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus {
  border-color: var(--primary);
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.input-with-action .input {
  flex: 1;
}

.help-box {
  margin-top: 32px;
  padding: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.help-box h4 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--text-main);
}

.help-box ol {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.help-box code {
  background-color: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  font-family: monospace;
}

.text-hint {
  font-size: 0.8rem;
  color: var(--warning);
  margin-top: 8px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success {
  background-color: var(--success-bg);
  color: #34d399;
}

.badge-primary {
  background-color: var(--primary-light);
  color: #60a5fa;
}

/* About Tab */
.about-container {
  padding: 48px 36px;
  max-width: 800px;
  margin: 0 auto;
}

.brand-hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin: 0 auto 16px auto;
}

.brand-hero h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.version-badge {
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--bg-card);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.about-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 40px;
}

.feature-checklist {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.feature-item svg {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Auth Overlay & Modals */
.auth-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Upload Progress Toast / Card */
.upload-progress-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-filename {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 110;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease;
  min-width: 260px;
}

.toast.success {
  background-color: #064e3b;
  border: 1px solid #059669;
  color: #a7f3d0;
}

.toast.error {
  background-color: #7f1d1d;
  border: 1px solid #dc2626;
  color: #fecaca;
}

.toast.info {
  background-color: #1e3a8a;
  border: 1px solid #2563eb;
  color: #bfdbfe;
}

[data-theme="light"] .toast.success {
  background-color: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
}

[data-theme="light"] .toast.error {
  background-color: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

[data-theme="light"] .toast.info {
  background-color: #eff6ff;
  border: 1px solid #3b82f6;
  color: #1e40af;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile Toggle & Sidebar Drawer */
.mobile-toggle-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .mobile-toggle-btn {
    display: inline-flex;
    margin-right: 8px;
  }

  .navbar {
    padding: 0 16px;
  }

  .brand-title {
    font-size: 1.05rem;
  }
  .brand-tagline {
    display: none;
  }

  .drive-status-pill {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  /* Off-canvas sidebar */
  .sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: -280px;
    width: 260px;
    z-index: 48;
    box-shadow: var(--shadow-lg);
    transition: left 0.25s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .content-area {
    padding: 20px 16px;
  }

  .explorer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .explorer-nav-group {
    width: 100%;
    justify-content: space-between;
  }

  .explorer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    flex: 1;
  }
  .search-box input {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .nav-role {
    display: none;
  }

  #drive-status-badge {
    display: none;
  }

  .user-info {
    display: none;
  }

  .explorer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn span {
    display: inline;
  }

  /* Hide creation date on tiny screens to preserve horizontal space */
  .file-table th:nth-child(3),
  .file-table td:nth-child(3) {
    display: none;
  }

  .file-table th, .file-table td,
  .data-table th, .data-table td {
    padding: 10px 12px;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .modal {
    margin: 12px;
    max-width: calc(100vw - 24px);
  }

  .toast-container {
    left: 16px;
    right: 16px;
    top: 16px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}
