/**
 * MediaManager
 * Main stylesheet complementing Tailwind CSS
 * ALL values in rem, ZERO px
 */

/* ============================================================
   CSS Custom Properties (Light / Dark via .dark class on <html>)
   ============================================================ */
:root {
  /* Light theme defaults */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-bg-card: #ffffff;
  --color-bg-sidebar: #f8fafc;
  --color-bg-modal-overlay: rgba(0, 0, 0, 0.4);

  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;

  --color-brand: #6366f1;
  --color-brand-hover: #4f46e5;
  --color-brand-light: #e0e7ff;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  --color-input-bg: #ffffff;
  --color-input-border: #d1d5db;
  --color-input-focus: #6366f1;

  --shadow-sm: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.05);
  --shadow-md: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 0.625rem 0.9375rem -0.1875rem rgba(0, 0, 0, 0.1);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 62.5rem;

  --sidebar-width: 16rem;
  --header-height: 4rem;
  --touch-min: 2.75rem;
}

.dark {
  --color-bg-primary: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-tertiary: #334155;
  --color-bg-card: #1e293b;
  --color-bg-sidebar: #0f172a;
  --color-bg-modal-overlay: rgba(0, 0, 0, 0.6);

  --color-text-primary: #f1f5f9;
  --color-text-secondary: #b0c4de;
  --color-text-muted: #8da4bf;
  --color-text-inverse: #0f172a;

  --color-border: #334155;
  --color-border-hover: #475569;

  --color-brand-light: #312e81;

  --color-input-bg: #1e293b;
  --color-input-border: #475569;

  --shadow-sm: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.3);
  --shadow-md: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 0.625rem 0.9375rem -0.1875rem rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 100%; /* 16px base */
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ============================================================
   Layout
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--color-bg-sidebar);
  border-right: 0.0625rem solid var(--color-border);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  z-index: 40;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding-top: var(--header-height);
  min-height: 100vh;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-card);
  border-bottom: 0.0625rem solid var(--color-border);
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  transition: background-color 0.2s ease;
}

/* Mobile sidebar */
@media (max-width: 48rem) {
  .app-sidebar {
    transform: translateX(-100%);
  }

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

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

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-bg-modal-overlay);
    z-index: 35;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

/* ============================================================
   Navigation
   ============================================================ */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: var(--touch-min);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, color 0.15s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

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

.nav-item.active {
  background: var(--color-brand-light);
  color: var(--color-brand);
}

.nav-item i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

/* ============================================================
   Cards
   ============================================================ */
.stat-card {
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-card .stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* ============================================================
   Upload Drop Zone
   ============================================================ */
.upload-dropzone {
  border: 0.125rem dashed var(--color-border);
  border-radius: var(--radius-xl);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  background: var(--color-bg-secondary);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--color-brand);
  background: var(--color-brand-light);
}

.upload-dropzone .dropzone-icon {
  font-size: 3rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}

.upload-dropzone:hover .dropzone-icon,
.upload-dropzone.dragover .dropzone-icon {
  color: var(--color-brand);
}

.upload-dropzone .dropzone-text {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.upload-dropzone .dropzone-subtext {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* ============================================================
   Media Library Grid
   ============================================================ */
.media-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 30rem) {
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 48rem) {
  .media-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 64rem) {
  .media-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 80rem) {
  .media-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 96rem) {
  .media-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.media-card {
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  position: relative;
}

.media-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-0.0625rem);
}

.media-card .card-thumb {
  aspect-ratio: 1;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card .card-thumb .placeholder-icon {
  font-size: 2rem;
  color: var(--color-text-muted);
}

.media-card .card-info {
  padding: 0.75rem;
}

.media-card .card-filename {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card .card-meta {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.media-card .select-overlay {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.media-card:hover .select-overlay,
.media-card.selected .select-overlay {
  opacity: 1;
}

.media-card.selected {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 0.125rem var(--color-brand);
}

/* List view */
.media-list .media-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease;
  min-height: var(--touch-min);
}

.media-list .media-list-item:hover {
  background: var(--color-bg-tertiary);
}

.media-list .media-list-item .list-thumb {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-list .media-list-item .list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   Modal Styles
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-modal-overlay);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

/* `.modal-content` is the class the HTML actually uses for the dialog box; it
   was previously unstyled, so the modal box was transparent and the page behind
   it bled through. Both names share the box styling. */
.modal,
.modal-content {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  max-height: 85vh;
  width: 100%;
  max-width: 32rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 0.0625rem solid var(--color-border);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 0.0625rem solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 0.0625rem solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ============================================================
   Progress Bar
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  background: var(--color-brand);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  min-width: 0;
}

.progress-bar .progress-fill.success {
  background: var(--color-success);
}

.progress-bar .progress-fill.error {
  background: var(--color-danger);
}

/* Storage gauge */
.storage-gauge {
  width: 100%;
  height: 0.625rem;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.storage-gauge .gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--color-success), var(--color-brand));
}

.storage-gauge .gauge-fill.warning {
  background: linear-gradient(90deg, var(--color-warning), var(--color-danger));
}

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 1rem);
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--color-text-inverse);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastSlideIn 0.3s ease;
  min-height: var(--touch-min);
}

.toast.toast-success {
  background: var(--color-success);
}

.toast.toast-error {
  background: var(--color-danger);
}

.toast.toast-warning {
  background: var(--color-warning);
}

.toast.toast-info {
  background: var(--color-info);
}

.toast .toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  font-size: 1rem;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast .toast-close:hover {
  opacity: 1;
}

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

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

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

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch-min);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 0.0625rem solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-hover);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.btn-icon {
  padding: 0;
  width: var(--touch-min);
  height: var(--touch-min);
  min-height: var(--touch-min);
}

/* ============================================================
   Focus Indicators for Keyboard Navigation
   ============================================================ */
:focus-visible {
  outline: 0.125rem solid var(--color-brand);
  outline-offset: 0.125rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 0.125rem solid var(--color-brand);
  outline-offset: 0.125rem;
}

/* ============================================================
   Form Controls
   ============================================================ */
.form-input {
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  background: var(--color-input-bg);
  border: 0.0625rem solid var(--color-input-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-input-focus);
  box-shadow: 0 0 0 0.1875rem rgba(99, 102, 241, 0.15);
}

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

.form-select {
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.5rem 2.25rem 0.5rem 0.875rem;
  font-size: 0.875rem;
  background: var(--color-input-bg);
  border: 0.0625rem solid var(--color-input-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--color-input-focus);
  box-shadow: 0 0 0 0.1875rem rgba(99, 102, 241, 0.15);
}

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

/* ============================================================
   File Queue (Upload)
   ============================================================ */
.file-queue {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-queue-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: var(--touch-min);
}

.file-queue-item .file-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

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

.file-queue-item .file-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-queue-item .file-status {
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

/* ============================================================
   Filter Sidebar (Library)
   ============================================================ */
.filter-sidebar {
  width: 16rem;
  flex-shrink: 0;
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  height: fit-content;
}

@media (max-width: 48rem) {
  .filter-sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 18rem;
    max-width: 85vw;
    border-radius: 0;
    z-index: 45;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

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

.filter-section {
  margin-bottom: 1.25rem;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.625rem;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch-min);
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.filter-checkbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--color-brand);
  cursor: pointer;
}

/* Tag chips */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
  min-height: 2rem;
}

.tag-chip:hover {
  background: var(--color-brand-light);
  color: var(--color-brand);
}

.tag-chip.active {
  background: var(--color-brand);
  color: white;
}

/* ============================================================
   Bulk Action Toolbar
   ============================================================ */
.bulk-toolbar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 0.625rem 1.5rem;
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 60;
  min-height: var(--touch-min);
}

.bulk-toolbar.visible {
  display: flex;
}

.bulk-toolbar .selected-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-brand);
  white-space: nowrap;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.5rem 0;
}

.pagination .page-btn {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 0.0625rem solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination .page-btn:hover:not(:disabled) {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-hover);
}

.pagination .page-btn.active {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: white;
}

.pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   User / Tenant Dropdown Menus
   ============================================================ */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 12rem;
  z-index: 70;
  display: none;
  overflow: hidden;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  min-height: var(--touch-min);
  transition: background-color 0.15s ease;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

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

.dropdown-divider {
  height: 0.0625rem;
  background: var(--color-border);
  margin: 0.25rem 0;
}

/* ============================================================
   Skip-to-Content Link
   ============================================================ */
.skip-link {
  position: absolute;
  top: -999rem;
  left: 0.5rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--color-brand);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.5rem;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visually-hidden {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 0.375rem;
  height: 0.375rem;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-hover);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-bg-secondary) 50%, var(--color-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================================
   Login Page
   ============================================================ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--color-bg-primary);
}

.login-card {
  background: var(--color-bg-card);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 24rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand);
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo i {
  margin-right: 0.5rem;
}

/* ============================================================
   Admin Panel Tabs
   ============================================================ */
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  min-height: var(--touch-min);
}

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

.admin-tab.active {
  background: var(--color-bg-card);
  color: var(--color-brand);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.admin-tab i {
  font-size: 0.75rem;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}
