/* Mirrors dashboard/frontend/tailwind.config.ts and the shared admin components. */
:root {
  --bg-primary: #f4f7fc;
  --bg-secondary: #fff;
  --bg-tertiary: #f8fafc;
  --bg-hover: #eef2f7;
  --border: #e2e8f0;
  --border-light: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.14);
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --gradient: #1e3a5f;
  --gradient-subtle: #eaf2ff;
}
body {
  background-image: none;
}
.app {
  grid-template-columns: 256px minmax(0, 1fr);
}
.sidebar {
  background: #1e3a5f;
  color: white;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  border: 0;
  z-index: 50;
}
.logo {
  padding: 0 8px 20px;
  border-color: #ffffff1a;
  margin-bottom: 20px;
}
.logo-icon {
  background: #3b82f6;
  border-radius: 12px;
  box-shadow: 0 4px 12px #12263e55;
}
.logo-text h1 {
  font-size: 14px !important;
  font-weight: 800;
  letter-spacing: 0;
}
.logo-text small {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: #cbd5e1;
}
.nav-title {
  color: #94a3b8;
  font-size: 10px;
  letter-spacing: 0.1em;
}
.nav-item {
  width: 100%;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  font:
    500 14px Inter,
    system-ui,
    sans-serif;
  text-decoration: none;
  text-align: left;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
}
.nav-item:hover {
  background: #ffffff0d;
  color: #fff;
}
.nav-item.active {
  border: 0;
  border-left: 4px solid #3b82f6;
  background: #ffffff1a;
  color: #fff;
}
.sidebar-footer {
  position: static;
  margin-top: auto;
  padding-top: 20px;
  border-color: #ffffff1a;
}
.storage-info {
  background: #ffffff0d;
  color: white;
  border-radius: 12px;
}
.storage-info .label {
  color: #cbd5e1;
}
.storage-bar {
  display: none;
}
.nav-section {
  margin-bottom: 12px;
}
.sidebar-close {
  display: none;
}
.main {
  padding: 0 32px 32px;
  overflow: visible;
  min-width: 0;
}
.admin-topbar {
  height: 72px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -32px 28px;
  padding: 0 32px;
}
.breadcrumb {
  display: flex;
  gap: 10px;
  color: #64748b;
  font-size: 13px;
  align-items: center;
}
.breadcrumb strong {
  color: #0f172a;
}
.admin-profile {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.admin-profile small {
  display: block;
  color: #64748b;
}
.avatar {
  display: grid;
  place-items: center;
  background: #eaf2ff;
  color: #1e3a5f;
  border-radius: 50%;
  font-weight: 800;
  width: 36px;
  height: 36px;
}
.mobile-menu {
  display: none;
}
.topbar {
  margin-bottom: 24px;
  gap: 20px;
}
.page-title h2 {
  font-size: 24px;
  font-weight: 800;
}
.page-title p {
  font-size: 14px;
}
.topbar-actions {
  gap: 8px;
}
.btn {
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  min-height: 40px;
}
.btn-gradient,
.btn-primary {
  background: #1e3a5f;
  border-color: #1e3a5f;
  box-shadow: none;
  color: white;
}
.btn-gradient:hover,
.btn-primary:hover {
  background: #18304f;
  border-color: #18304f;
  box-shadow: none;
  transform: none;
}
.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-ghost {
  background: white;
}
.btn-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
.btn-danger:hover {
  color: white;
}
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
}
.ui-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  border-radius: 16px;
  box-shadow: 0 2px 8px #0f172a12;
  padding: 20px;
}
.stat-card::before {
  display: none;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding-right: 40px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.stat-change {
  color: #64748b;
  font-size: 11px;
}
.stat-icon {
  background: #eaf2ff;
  color: #3b82f6;
  border-radius: 12px;
  right: 16px;
}
.stat-card:nth-child(2) .stat-icon {
  color: #16a34a;
  background: #f0fdf4;
}
.stat-card:nth-child(3) .stat-icon {
  color: #d97706;
  background: #fffbeb;
}
.stat-card:nth-child(4) .stat-icon {
  color: #1e3a5f;
  background: #f1f5f9;
}
.upload-zone {
  background: white;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 2px 8px #0f172a08;
  padding: 28px;
  margin-bottom: 24px;
  cursor: default;
}
.upload-zone:hover {
  background: #fff;
  border-color: #94a3b8;
  transform: none;
  box-shadow: 0 2px 8px #0f172a12;
}
.upload-zone.dragover {
  background: #eaf2ff;
  border-color: #3b82f6;
}
.upload-icon {
  background: #eaf2ff;
  color: #3b82f6;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 16px;
}
.upload-icon .ui-icon {
  width: 26px;
  height: 26px;
}
.upload-zone h3 {
  font-size: 17px;
  font-weight: 700;
}
.upload-zone p {
  font-size: 13px;
  margin: 6px 0 18px;
}
.upload-zone .btn {
  margin-top: 0;
}
.upload-progress {
  text-align: left;
  margin-top: 20px;
}
.progress-item {
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  align-items: flex-start;
}
.progress-info {
  min-width: 0;
}
.progress-name {
  overflow-wrap: anywhere;
  font-weight: 600;
}
.progress-bar {
  height: 8px;
  background: #e2e8f0;
  margin: 8px 0;
}
.progress-bar-fill {
  background: #3b82f6;
  transition: width 0.4s;
}
.progress-status {
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}
.encode-percent {
  color: #1e3a5f;
  font-weight: 800;
  font-size: 15px;
}
.encode-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 5px;
}
.encoding-progress {
  min-width: 185px;
  padding-top: 8px;
}
.encoding-progress:empty {
  display: none;
}
.finalizing .progress-bar-fill {
  background: #f59e0b;
}
.indeterminate .progress-bar-fill {
  animation: estimate-pulse 1.5s infinite;
  width: 30% !important;
}
@keyframes estimate-pulse {
  50% {
    opacity: 0.35;
  }
}
.spinner {
  border-color: #e2e8f0;
  border-top-color: #3b82f6;
  flex-shrink: 0;
}
.library {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 8px #0f172a12;
  overflow: hidden;
}
.section-header {
  padding: 20px;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
  gap: 14px;
  flex-wrap: wrap;
}
.section-header h3 {
  font-size: 16px;
}
.library-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search-box {
  width: 260px;
}
.search-box input {
  background: white;
  border-radius: 12px;
}
.status-filter {
  width: 160px;
}
.video-grid {
  display: block;
  overflow-x: auto;
}
.video-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
.video-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.video-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: middle;
}
.video-table tbody tr:hover {
  background: #f8fafc;
}
.video-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
}
.table-thumb {
  width: 64px;
  height: 44px;
  background: #eaf2ff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #3b82f6;
  flex-shrink: 0;
}
.table-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.table-title {
  font-weight: 600;
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-storage {
  font: 11px monospace;
  color: #64748b;
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.table-actions {
  display: flex;
  gap: 6px;
}
.badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.badge.ready {
  background: #f0fdf4;
  color: #16a34a;
}
.badge.pending {
  background: #f1f5f9;
  color: #64748b;
}
.badge.encoding {
  background: #fffbeb;
  color: #d97706;
}
.badge.failed {
  background: #fef2f2;
  color: #ef4444;
}
.library-footer {
  padding: 14px 20px;
  color: #64748b;
  font-size: 12px;
}
.modal {
  background: #0f172a66;
  backdrop-filter: blur(3px);
}
.modal-content {
  border-radius: 20px;
  background: white;
  box-shadow: 0 20px 60px #0f172a33;
}
.modal-header {
  border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 {
  font-weight: 700;
}
.modal-body input,
.modal-body select {
  background: white;
  border-radius: 12px;
}
.tabs {
  background: #f1f5f9;
}
.tab.active {
  background: white;
  color: #1e3a5f;
  box-shadow: 0 1px 4px #0f172a12;
}
.info-item {
  border-radius: 12px;
  background: #f8fafc;
}
.toast {
  background: white;
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px #0f172a1f;
}
.sidebar-overlay {
  display: none;
}
.key-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
}
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main {
    padding: 0 24px 24px;
  }
  .admin-topbar {
    margin: 0 -24px 24px;
    padding: 0 24px;
  }
}
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 256px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: #0f172a66;
    z-index: 45;
  }
  .sidebar-close,
  .mobile-menu {
    display: inline-flex;
  }
  .sidebar-close {
    margin-left: auto;
    background: transparent;
    color: white;
    border: 0;
    cursor: pointer;
  }
  .main {
    padding: 0 16px 20px;
  }
  .admin-topbar {
    margin: 0 -16px 20px;
    padding: 0 16px;
  }
  .admin-profile > div:last-child {
    display: none;
  }
  .breadcrumb {
    font-size: 12px;
  }
  .topbar {
    align-items: flex-start;
    gap: 16px;
  }
  .topbar-actions {
    flex-wrap: wrap;
  }
  .stats-grid {
    gap: 12px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-value {
    font-size: 24px;
  }
  .upload-zone {
    padding: 20px;
  }
  .library-tools {
    width: 100%;
  }
  .search-box {
    width: 100%;
    flex: 1;
    min-width: 160px;
  }
  .section-header {
    padding: 16px;
  }
  .status-filter {
    width: 145px;
  }
  .toast {
    min-width: 0;
    max-width: calc(100vw - 32px);
  }
  .modal-content {
    max-width: calc(100vw - 24px) !important;
  }
  .stat-label {
    max-width: 100%;
    padding-right: 30px;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
    top: 12px;
    right: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
