/* ============================================================
   Warehouse Operations Management System — Design System
   仓库库内运营管理系统 — 设计系统
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(15, 23, 42, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-hover: rgba(255, 255, 255, 0.2);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-amber-glow: rgba(245, 158, 11, 0.3);
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-purple: #8b5cf6;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-amber: 0 0 20px rgba(245, 158, 11, 0.15);
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
  --topbar-height: 64px;
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

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

/* Subtle grid pattern overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

::selection {
  background: var(--accent-amber);
  color: var(--bg-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInLeft {
  from { transform: translateX(-16px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

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

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-amber-glow); }
  50%      { box-shadow: 0 0 24px 6px var(--accent-amber-glow); }
}

@keyframes pulseRing {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@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; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

@keyframes rowHighlight {
  0%   { background: rgba(245, 158, 11, 0.15); }
  100% { background: transparent; }
}

/* ============================================================
   Layout — App Grid
   ============================================================ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  animation: slideInLeft 0.5s ease;
}

.sidebar-header {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-header .logo {
  font-size: 32px;
  line-height: 1;
}

.sidebar-header h2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.sidebar-header h2 small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* QR Section */
.qr-section {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid var(--border-glass);
}

.qr-container {
  width: 160px;
  height: 160px;
  background: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
  animation: pulse 3s ease-in-out infinite;
  border: 2px solid var(--accent-amber);
}

.qr-container::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--radius-md) + 4px);
  border: 2px solid transparent;
  background: linear-gradient(135deg, var(--accent-amber), transparent 60%) border-box;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.qr-container img,
.qr-container canvas {
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
}

.qr-label {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-amber);
}

.qr-hint {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

/* Sidebar Stats */
.sidebar-stats {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.stat-item:hover {
  background: var(--bg-glass-hover);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-amber);
  font-variant-numeric: tabular-nums;
}

/* Logout */
.logout-btn {
  margin: 12px 20px 20px;
}

/* ============================================================
   Main Area
   ============================================================ */
.main-area {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.topbar h1 small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-glass);
  position: relative;
  background: rgba(15, 23, 42, 0.3);
}

.tab {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-normal);
  font-family: var(--font-sans);
  white-space: nowrap;
}

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

.tab.active {
  color: var(--accent-amber);
}

/* Sliding underline indicator */
.tab-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--accent-amber);
  border-radius: 2px 2px 0 0;
  transition: left var(--transition-slow), width var(--transition-slow);
  box-shadow: 0 0 8px var(--accent-amber-glow);
}

/* ============================================================
   Tab Content
   ============================================================ */
.tab-content {
  display: none;
  padding: 24px 32px 40px;
  animation: fadeIn 0.35s ease;
}

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

/* ============================================================
   Cards — Glassmorphism
   ============================================================ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  animation: fadeInUp 0.4s ease both;
}

.card:hover {
  border-color: var(--border-glass-hover);
  box-shadow: var(--shadow-md);
}

.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px 24px;
}

/* ============================================================
   Forms
   ============================================================ */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-action {
  flex: 0 0 auto;
  min-width: auto;
}

.input,
.select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.input:focus,
.select:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

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

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Date input styling */
input[type="date"] {
  color-scheme: dark;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

/* Ripple-like hover shimmer */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.1) 55%,
    transparent 60%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
  animation: shimmer 0.8s ease forwards;
}

/* Primary — Amber */
.btn-primary {
  background: var(--accent-amber);
  color: #000;
  border-color: var(--accent-amber);
}

.btn-primary:hover {
  background: var(--accent-amber-hover);
  border-color: var(--accent-amber-hover);
  box-shadow: var(--shadow-glow-amber);
}

/* Success — Green */
.btn-success {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

.btn-success:hover {
  background: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
}

/* Danger — Red */
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* Info — Blue */
.btn-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-glass);
}

.btn-ghost:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

/* Small button */
.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Data Tables
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-glass-hover);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:nth-child(even):hover {
  background: var(--bg-glass-hover);
}

/* Staggered row entrance */
.data-table tbody tr {
  animation: fadeIn 0.3s ease both;
}

.data-table tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.data-table tbody tr:nth-child(2)  { animation-delay: 0.04s; }
.data-table tbody tr:nth-child(3)  { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(4)  { animation-delay: 0.08s; }
.data-table tbody tr:nth-child(5)  { animation-delay: 0.10s; }
.data-table tbody tr:nth-child(6)  { animation-delay: 0.12s; }
.data-table tbody tr:nth-child(7)  { animation-delay: 0.14s; }
.data-table tbody tr:nth-child(8)  { animation-delay: 0.16s; }
.data-table tbody tr:nth-child(9)  { animation-delay: 0.18s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.20s; }

.data-table tbody td {
  padding: 12px 14px;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* Highlight animation for newly updated rows */
.data-table tbody tr.row-highlight {
  animation: rowHighlight 1.5s ease forwards;
}

/* Editable cell indicator */
.data-table td[data-editable="true"] {
  cursor: pointer;
  position: relative;
}

.data-table td[data-editable="true"]:hover {
  background: rgba(245, 158, 11, 0.08);
}

.data-table td[data-editable="true"]:hover::after {
  content: '✏️';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.6;
}

/* Editable cell in editing mode */
.data-table td .cell-edit-input {
  width: 100%;
  padding: 4px 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--accent-amber);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Clickable task number */
.data-table td.task-number-cell {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-blue);
  transition: color var(--transition-fast);
}

.data-table td.task-number-cell:hover {
  color: var(--accent-red);
  text-decoration: line-through;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-count {
  background: var(--accent-amber);
  color: #000;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.badge-active,
.badge-pending {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-completed {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-break,
.badge-partial {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state span {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass-hover);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transform: translateX(100%);
  transition: none;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  pointer-events: auto;
  animation: toastSlideIn 0.35s ease forwards;
}

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

.toast-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.toast-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.toast-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.toast-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #000;
}

/* ============================================================
   Login Overlay
   ============================================================ */
#login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

/* Ambient background glow for login */
#login-overlay::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#login-overlay::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  bottom: 10%;
  right: 15%;
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass-hover);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 380px;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.5s ease;
  position: relative;
  z-index: 1;
}

.login-card h1 {
  font-size: 56px;
  margin-bottom: 8px;
  line-height: 1;
}

.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-primary);
  line-height: 1.4;
}

.login-card h2 small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-card .input {
  margin-bottom: 16px;
  text-align: center;
  font-size: 16px;
  padding: 14px 18px;
  letter-spacing: 4px;
}

.login-card .btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.error-text {
  margin-top: 12px;
  color: var(--accent-red);
  font-size: 12px;
  min-height: 18px;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-amber  { color: var(--accent-amber); }
.text-green  { color: var(--accent-green); }
.text-blue   { color: var(--accent-blue); }
.text-red    { color: var(--accent-red); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.font-mono { font-family: var(--font-mono); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

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

.hidden { display: none !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-glass);
  border-top-color: var(--accent-amber);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================================
   Responsive — Tablet & Below
   ============================================================ */
@media (max-width: 1200px) {
  .form-row {
    flex-direction: column;
  }
  .form-group {
    min-width: 100%;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    z-index: 200;
  }

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

  .app-layout {
    grid-template-columns: 1fr;
  }

  .main-area {
    grid-column: 1;
  }

  .topbar {
    padding: 0 16px;
  }

  .tabs {
    padding: 0 16px;
    overflow-x: auto;
  }

  .tab-content {
    padding: 16px;
  }

  /* Add toggle button for sidebar */
  .sidebar-toggle {
    display: flex;
  }
}

@media (min-width: 1025px) {
  .sidebar-toggle {
    display: none;
  }
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--bg-glass-hover);
}

/* Sidebar overlay for mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}

.sidebar-backdrop.show {
  display: block;
}

/* ============================================================
   Progress Bar (for task completion)
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-glass);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-green));
  border-radius: 3px;
  transition: width var(--transition-slow);
}

/* ============================================================
   Confirm Dialog Enhancement
   ============================================================ */
.confirm-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.confirm-text strong {
  color: var(--accent-amber);
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  .sidebar,
  .topbar,
  .tabs,
  .toast,
  .modal-overlay,
  #login-overlay,
  .btn {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .app-layout {
    display: block;
  }

  .card {
    break-inside: avoid;
    border: 1px solid #ddd;
    background: #fff;
  }

  .data-table tbody td {
    color: #333;
  }
}
