/* ============================================= */
/*  Media Upload LNV - Premium Dark Theme CSS    */
/*  Google Drive-inspired with Glassmorphism      */
/* ============================================= */

/* ── CSS Custom Properties ─────────────────── */
:root {
  /* Primary palette */
  --primary: #6C63FF;
  --primary-light: #8B83FF;
  --primary-dark: #5A52E0;
  --primary-glow: rgba(108, 99, 255, 0.3);

  /* Accent */
  --accent: #00D4AA;
  --accent-light: #33DDBB;
  --accent-dark: #00B892;

  /* Backgrounds */
  --bg-primary: #0F0F1A;
  --bg-secondary: #161625;
  --bg-card: rgba(22, 22, 37, 0.8);
  --bg-card-solid: #1A1A2E;
  --bg-card-hover: rgba(30, 30, 50, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(255, 255, 255, 0.06);

  /* Text */
  --text-primary: #EAEAF0;
  --text-secondary: #8E8EA0;
  --text-muted: #5A5A72;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);

  /* Status colors */
  --success: #00D4AA;
  --error: #FF6B6B;
  --warning: #FFB347;
  --info: #6C63FF;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #00D4AA 100%);
  --gradient-card: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(0, 212, 170, 0.05) 100%);
  --gradient-bg: radial-gradient(ellipse at top left, rgba(108, 99, 255, 0.15) 0%, transparent 50%),
                 radial-gradient(ellipse at bottom right, rgba(0, 212, 170, 0.1) 0%, transparent 50%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.2);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & Base ──────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.nav-item.active svg {
  stroke: var(--primary-light);
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  color: var(--error) !important;
}
.logout-btn:hover {
  background: rgba(255, 107, 107, 0.1) !important;
}

/* ── Sidebar Overlay (Mobile) ──────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
}
.sidebar-overlay.active {
  display: block;
}

/* ── Main Content ──────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  z-index: 50;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  flex: 1;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}
.hamburger:hover {
  background: var(--bg-glass);
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
}

.content-area {
  padding: 2rem;
  max-width: 1400px;
}

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 12px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--primary-glow);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.icon-btn:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* ── Dashboard Grid ────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.storage-card {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: stretch;
  background: var(--gradient-card);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.stat-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: var(--primary-glow);
  color: var(--primary-light);
  font-weight: 600;
}

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

.stat-icon-total { background: rgba(108, 99, 255, 0.15); color: var(--primary); }
.stat-icon-image { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.stat-icon-video { background: rgba(255, 107, 107, 0.15); color: var(--error); }
.stat-icon-audio { background: rgba(255, 179, 71, 0.15); color: var(--warning); }
.stat-icon-document { background: rgba(108, 99, 255, 0.15); color: var(--primary-light); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ── Storage Bar ───────────────────────────── */
.storage-bar-wrapper {
  width: 100%;
}

.storage-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.75rem 0 0.5rem;
}

.storage-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.storage-bar-fill[style*="width: 0%"] {
  display: none;
}

.storage-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  animation: storageShimmer 2s ease infinite;
}

@keyframes storageShimmer {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.storage-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Section Headers ───────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── File Grid ─────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.file-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.file-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-glow);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.15);
}

.file-card-preview {
  width: 100%;
  height: 160px;
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.file-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.file-card:hover .file-card-preview img {
  transform: scale(1.05);
}

.file-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--border-radius);
}

.file-type-image { color: var(--accent); background: rgba(0, 212, 170, 0.1); }
.file-type-video { color: var(--error); background: rgba(255, 107, 107, 0.1); }
.file-type-audio { color: var(--warning); background: rgba(255, 179, 71, 0.1); }
.file-type-document { color: var(--primary-light); background: rgba(108, 99, 255, 0.1); }

.public-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-card-info {
  padding: 0.75rem 1rem;
}

.file-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  display: block;
}

.file-card-actions {
  padding: 0 0.75rem 0.75rem;
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

/* ── File List View ────────────────────────── */
.file-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.file-grid.list-view .file-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.file-grid.list-view .file-card-preview {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
}

.file-grid.list-view .file-card-preview img {
  border-radius: var(--border-radius-sm);
}

.file-grid.list-view .file-type-icon {
  width: 36px;
  height: 36px;
}

.file-grid.list-view .file-card-info {
  padding: 0;
}

.file-grid.list-view .file-card-actions {
  padding: 0;
}

/* ── File Toolbar ──────────────────────────── */
.file-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 0.25rem;
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.filter-tab.active {
  background: var(--primary);
  color: white;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.view-toggles {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 0.25rem;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-btn:hover {
  color: var(--text-primary);
}

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

/* ── Empty State ───────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 1.5rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

/* ── Upload Zone ───────────────────────────── */
.upload-container {
  max-width: 800px;
  margin: 0 auto;
}

.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--border-radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--bg-glass);
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(108, 99, 255, 0.05);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
  opacity: 1;
}

.upload-zone-content {
  position: relative;
  z-index: 1;
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.upload-zone:hover .upload-icon {
  color: var(--primary);
  transform: translateY(-4px);
}

.upload-zone h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.upload-zone p {
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.upload-hint {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  margin-top: 0.5rem !important;
}

.upload-zone .btn {
  margin-top: 1.25rem;
}

.storage-info-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Upload Queue ──────────────────────────── */
.upload-queue {
  margin-top: 1.5rem;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.queue-header h3 {
  font-size: 1rem;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
}

.queue-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.queue-item-progress {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.queue-item-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.queue-item-status {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.queue-item-status.uploading { color: var(--primary-light); }
.queue-item-status.success { color: var(--success); }
.queue-item-status.error { color: var(--error); }

/* ── Context Menu ──────────────────────────── */
.context-menu {
  display: none;
  position: fixed;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  padding: 0.5rem;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  backdrop-filter: blur(20px);
}

.context-menu.active {
  display: block;
  animation: contextFadeIn 0.15s ease;
}

@keyframes contextFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
  text-align: left;
}

.context-item:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.context-danger:hover {
  background: rgba(255, 107, 107, 0.1);
  color: var(--error);
}

.context-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* ── Modals ────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-sm {
  max-width: 420px;
  padding: 2rem;
}

.modal-sm h3 {
  margin-bottom: 1rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-glass);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 1rem;
}

.modal-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
}

.modal-body video,
.modal-body audio {
  max-width: 100%;
  border-radius: var(--border-radius-sm);
}

.modal-info {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.modal-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.modal-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── Forms ──────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-input,
.input-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus,
.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Fix dropdown options being invisible on some OSes */
select.form-input option,
select.auth-input option,
select option {
  background-color: var(--bg-card-solid);
  color: var(--text-primary);
}

.form-input::placeholder,
.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper svg {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  padding-left: 2.75rem;
}

/* ── Alerts ────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--error);
}

.alert-success {
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.3);
  color: var(--success);
}

/* ── Toast Notifications ───────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 400;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
  font-size: 0.85rem;
  animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.toast-out {
  animation: toastSlideOut 0.3s ease forwards;
}

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

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

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-info { border-left: 3px solid var(--info); }

/* ── Auth Pages ────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-container {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.auth-bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  animation: shapePulse 8s ease infinite;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  bottom: -50px;
  left: -50px;
  animation: shapePulse 10s ease infinite reverse;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: var(--warning);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: shapePulse 6s ease infinite 2s;
}

@keyframes shapePulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 0.5; }
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  margin-bottom: 1.25rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

.auth-form {
  margin-bottom: 1.5rem;
}

.auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-footer a {
  font-weight: 600;
}

/* ── Settings ──────────────────────────────── */
.settings-container {
  max-width: 700px;
}

.settings-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.settings-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.settings-row label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.settings-row span {
  font-size: 0.85rem;
  font-weight: 500;
}

.settings-form .form-group {
  margin-bottom: 1rem;
}

.storage-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ── Share Page ─────────────────────────────── */
.share-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.share-container {
  width: 100%;
  max-width: 700px;
}

.share-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.share-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.share-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.share-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  background: var(--bg-glass);
}

.share-preview img {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.share-preview video {
  max-width: 100%;
}

.share-audio-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.share-info {
  padding: 1.5rem;
  text-align: center;
}

.share-info h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.share-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.share-error {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.share-error svg {
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.share-error h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .topbar {
    padding: 0 1rem;
  }

  .content-area {
    padding: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .storage-card {
    grid-column: 1 / -1;
  }

  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .file-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .topbar-actions .btn span {
    display: none;
  }

  .auth-card {
    padding: 1.75rem;
  }

  .upload-zone {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .file-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

/* ── Animations ────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card,
.file-card,
.settings-card {
  animation: fadeInUp 0.4s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }

.file-card:nth-child(1) { animation-delay: 0.05s; }
.file-card:nth-child(2) { animation-delay: 0.08s; }
.file-card:nth-child(3) { animation-delay: 0.11s; }
.file-card:nth-child(4) { animation-delay: 0.14s; }
.file-card:nth-child(5) { animation-delay: 0.17s; }
.file-card:nth-child(6) { animation-delay: 0.2s; }
.file-card:nth-child(7) { animation-delay: 0.23s; }
.file-card:nth-child(8) { animation-delay: 0.26s; }

/* ── Share Settings Modal ─────────────────── */
.modal-share {
  max-width: 560px;
  padding: 0;
  overflow: hidden;
}

.share-modal-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.share-modal-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.share-file-name {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 0.25rem;
}

/* Share toggle row */
.share-section {
  padding: 1rem 1.75rem;
}

.share-section label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.share-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.share-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.share-toggle-info strong {
  font-size: 0.9rem;
}

.share-toggle-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 26px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: white;
}

/* Share tabs */
.share-tabs {
  display: flex;
  gap: 0;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.share-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.share-tab:hover {
  color: var(--text-primary);
}

.share-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

/* Share tab content */
.share-tab-content {
  max-height: 400px;
  overflow-y: auto;
}

/* Link row (input + buttons) */
.share-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-link-row .form-input {
  flex: 1;
  min-width: 0;
}

.share-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Embed textarea */
.share-embed-textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem;
}

/* Stats row */
.share-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
}

.share-stat {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.share-stat strong {
  color: var(--primary-light);
  font-size: 1.1rem;
}

/* Share status badges */
.share-status {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  transition: var(--transition-fast);
}

.share-status.status-active {
  color: var(--accent);
  font-weight: 500;
}

/* ── Password Gate (share page) ───────────── */
.share-password-gate {
  padding: 2rem;
  text-align: center;
}

.password-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  margin-bottom: 1rem;
}

.share-password-gate h2 {
  margin-bottom: 0.5rem;
}

.share-password-gate p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.password-form .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-form .input-wrapper svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.password-form .input-wrapper input {
  width: 100%;
  padding-left: 2.5rem;
}

.password-form .btn {
  margin-top: 1rem;
}

.alert-error {
  padding: 0.75rem 1rem;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--border-radius-sm);
  color: var(--error);
  font-size: 0.85rem;
}

/* ── Share Modal Responsive ───────────────── */
@media (max-width: 600px) {
  .modal-share {
    max-width: 100%;
    margin: 0.5rem;
  }

  .share-modal-header,
  .share-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .share-tabs {
    padding: 0 1rem;
  }

  .share-tab {
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
  }

  .share-link-row {
    flex-wrap: wrap;
  }

  .share-link-row .form-input {
    width: 100%;
  }
}

/* ── Admin: Nav section label ─────────────── */
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 1rem;
}

.nav-section-label {
  display: block;
  padding: 0 1.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ── Admin: Toolbar ───────────────────────── */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 0 0.75rem;
  min-width: 200px;
  max-width: 320px;
  flex: 1;
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: none;
  padding: 0.6rem 0;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 100%;
  outline: none;
}

.filter-select {
  max-width: 140px;
  padding: 0.55rem 0.75rem !important;
  font-size: 0.82rem !important;
}

/* ── Admin: Users Table ───────────────────── */
.users-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.users-table thead {
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
}

.users-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.users-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

.users-table tbody tr:hover {
  background: rgba(108, 99, 255, 0.04);
}

.user-row.row-suspended {
  opacity: 0.6;
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem !important;
  font-size: 0.9rem;
}

.table-mono {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.table-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* User cell in table */
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-cell-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.user-cell-info strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-cell-info strong small {
  color: var(--text-muted);
  font-weight: 400;
}

.user-cell-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Storage bar in table */
.storage-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.storage-cell span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.storage-bar-sm {
  width: 100%;
  max-width: 100px;
  height: 4px;
  background: var(--bg-glass);
  border-radius: 2px;
  overflow: hidden;
}

.storage-fill-sm {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Role Badges ──────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.role-superadmin {
  background: rgba(255, 99, 132, 0.15);
  color: #ff6384;
  border: 1px solid rgba(255, 99, 132, 0.3);
}

.role-admin {
  background: rgba(108, 99, 255, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(108, 99, 255, 0.3);
}

.role-user {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 170, 0.25);
}

/* ── Status Badges ────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-active-badge {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 170, 0.25);
}

.status-suspended {
  background: rgba(255, 107, 107, 0.12);
  color: var(--error);
  border: 1px solid rgba(255, 107, 107, 0.25);
}

/* ── Action Icon Buttons ──────────────────── */
.action-btns {
  display: flex;
  gap: 0.35rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.1);
}

.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-icon-warning:hover {
  border-color: var(--warning);
  color: var(--warning);
  background: rgba(255, 193, 7, 0.1);
}

.btn-icon-danger:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(255, 107, 107, 0.1);
}

.btn-icon-success:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 170, 0.1);
}

/* ── Btn Block ────────────────────────────── */
.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* ── Admin Responsive ─────────────────────── */
@media (max-width: 768px) {
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar-left {
    flex-direction: column;
  }

  .search-box {
    max-width: 100%;
  }

  .filter-select {
    max-width: 100%;
  }

  .users-table th:nth-child(5),
  .users-table td:nth-child(5),
  .users-table th:nth-child(6),
  .users-table td:nth-child(6) {
    display: none;
  }
}

/* ── Admin Tabs ───────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
  margin-bottom: -1px;
}

.admin-tab:hover {
  color: var(--text-primary);
}

.admin-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Responsive Modal ─────────────────────── */
.modal-responsive {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-scroll-body {
  overflow-y: auto;
  max-height: calc(90vh - 100px);
  padding-right: 0.5rem;
}

.modal-scroll-body::-webkit-scrollbar {
  width: 4px;
}

.modal-scroll-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── Form Grid ────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Toolbar Right Section ────────────────── */
.admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Bulk Actions Bar ─────────────────────── */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--border-radius-sm);
}

.bulk-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-light);
  white-space: nowrap;
}

/* ── Outline Buttons ──────────────────────── */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.08);
}

.btn-outline-danger:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(255, 107, 107, 0.08);
}

/* ── File Type Icon ───────────────────────── */
.file-type-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Text Utilities ───────────────────────── */
.text-muted {
  color: var(--text-muted);
}

/* ── Toggle Label Text (for unlimited) ────── */
.toggle-label-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Table Pagination ─────────────────────── */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
}
