@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --navy-950: #060d18;
  --navy-900: #0a1628;
  --navy-800: #0f2240;
  --navy-700: #162d52;
  --navy-600: #1e3a68;
  --navy-500: #2a4d80;

  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;

  --amber-400: #fbbf24;
  --amber-500: #d4a017;
  --amber-600: #b8860b;
  --amber-700: #92400e;

  --concrete-50: #faf9f7;
  --concrete-100: #f0ede8;
  --concrete-200: #e4dfd7;

  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #2563eb;
  --info-light: #dbeafe;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(10, 22, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(10, 22, 40, 0.12);
  --shadow-xl: 0 24px 48px rgba(10, 22, 40, 0.16);
  --shadow-glow: 0 0 20px rgba(212, 160, 23, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --grid-line: rgba(10, 22, 40, 0.04);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--navy-900);
  background: var(--concrete-50);
  line-height: 1.6;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════
   BLUEPRINT GRID BACKGROUND
   ═══════════════════════════════════════════ */

.blueprint-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */

.portal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════════ */

.sidebar {
  background: var(--navy-900);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--navy-700);
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

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

.sidebar-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: #fff;
}

.sidebar-logo span {
  color: var(--amber-500);
}

.sidebar-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-400);
  font-family: var(--font-mono);
  margin-top: 4px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-500);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--slate-300);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  background: var(--navy-800);
  color: #fff;
}

.nav-link.active {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--navy-600);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--amber-500);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--amber-500);
  color: var(--navy-900);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--navy-700);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy-900);
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
}

.sidebar-user-email {
  font-size: 0.7rem;
  color: var(--slate-400);
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════ */

.main-content {
  padding: 32px 40px;
  width: 100%;
}

@media (max-width: 768px) {
  .main-content {
    padding: 20px 16px;
  }
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  color: var(--navy-900);
  line-height: 1.2;
}

.page-subtitle {
  color: var(--slate-500);
  font-size: 0.9rem;
  margin-top: 4px;
}

.page-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--slate-400);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.page-breadcrumb a {
  color: var(--slate-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.page-breadcrumb a:hover {
  color: var(--amber-500);
}

/* ═══════════════════════════════════════════
   MOBILE TOPBAR
   ═══════════════════════════════════════════ */

.mobile-topbar {
  display: none;
  background: var(--navy-900);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

@media (max-width: 1024px) {
  .mobile-topbar {
    display: flex;
  }
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(4px);
  z-index: 45;
}

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

/* ═══════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════ */

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

.stat-card {
  background: #fff;
  border: 1px solid var(--concrete-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

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

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent, var(--navy-800));
}

.stat-card--amber::after { --stat-accent: var(--amber-500); }
.stat-card--success::after { --stat-accent: var(--success); }
.stat-card--info::after { --stat-accent: var(--info); }
.stat-card--warning::after { --stat-accent: var(--warning); }
.stat-card--danger::after { --stat-accent: var(--danger); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--navy-900);
  line-height: 1;
}

.stat-change {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change--up { color: var(--success); }
.stat-change--down { color: var(--danger); }

/* ═══════════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════════ */

.table-container {
  background: #fff;
  border: 1px solid var(--concrete-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--concrete-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.table-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy-900);
}

.table-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--concrete-50);
  border-bottom: 2px solid var(--concrete-200);
}

th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--navy-800);
  border-bottom: 1px solid var(--concrete-100);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--concrete-50);
}

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

.table-link {
  color: var(--navy-800);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.table-link:hover {
  color: var(--amber-600);
}

.table-cell-mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--slate-400);
}

.table-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge--pending { background: var(--warning-light); color: var(--warning); }
.badge--pending::before { background: var(--warning); }

.badge--reviewing { background: var(--info-light); color: var(--info); }
.badge--reviewing::before { background: var(--info); }

.badge--assigned { background: #ede9fe; color: #7c3aed; }
.badge--assigned::before { background: #7c3aed; }

.badge--pending_approval { background: #fef3c7; color: #b45309; }
.badge--pending_approval::before { background: #b45309; }

.badge--in_execution { background: #dbeafe; color: #1d4ed8; }
.badge--in_execution::before { background: #1d4ed8; animation: pulse-dot 2s ease-in-out infinite; }

.badge--pending_acceptance { background: #fce7f3; color: #be185d; }
.badge--pending_acceptance::before { background: #be185d; }

.badge--completed { background: var(--success-light); color: var(--success); }
.badge--completed::before { background: var(--success); }

.badge--cancelled { background: var(--danger-light); color: var(--danger); }
.badge--cancelled::before { background: var(--danger); }

.badge--draft { background: var(--concrete-200); color: var(--slate-600); }
.badge--draft::before { background: var(--slate-400); }

.badge--submitted { background: var(--info-light); color: var(--info); }
.badge--submitted::before { background: var(--info); }

.badge--approved { background: var(--success-light); color: var(--success); }
.badge--approved::before { background: var(--success); }

.badge--rejected { background: var(--danger-light); color: var(--danger); }
.badge--rejected::before { background: var(--danger); }

.badge--sent { background: #e0f2fe; color: #0369a1; }
.badge--sent::before { background: #0369a1; animation: pulse-dot 2s ease-in-out infinite; }

.badge--low { background: var(--concrete-200); color: var(--slate-600); }
.badge--medium { background: var(--info-light); color: var(--info); }
.badge--high { background: var(--warning-light); color: var(--warning); }
.badge--urgent { background: var(--danger-light); color: var(--danger); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn--primary {
  background: var(--navy-900);
  color: #fff;
}

.btn--primary:hover {
  background: var(--navy-800);
  box-shadow: var(--shadow-md);
}

.btn--amber {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--navy-900);
}

.btn--amber:hover {
  box-shadow: var(--shadow-glow), var(--shadow-md);
  transform: translateY(-1px);
}

.btn--success {
  background: var(--success);
  color: #fff;
}

.btn--success:hover {
  background: #047857;
  box-shadow: var(--shadow-md);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: #b91c1c;
}

.btn--outline {
  background: #fff;
  color: var(--navy-800);
  border: 1px solid var(--concrete-200);
}

.btn--outline:hover {
  border-color: var(--slate-300);
  background: var(--concrete-50);
}

.btn--ghost {
  background: transparent;
  color: var(--slate-600);
}

.btn--ghost:hover {
  background: var(--concrete-100);
  color: var(--navy-800);
}

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

.btn--lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn--icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy-800);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--slate-400);
  margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--concrete-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--navy-900);
  background: #fff;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--slate-400);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--concrete-200);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.form-checkbox-label:has(input:checked) {
  border-color: var(--amber-500);
  background: rgba(212, 160, 23, 0.06);
  color: var(--amber-700);
}

.form-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--amber-500);
}

.form-error {
  color: var(--danger);
  font-size: 0.78rem;
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */

.card {
  background: #fff;
  border: 1px solid var(--concrete-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

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

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

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--navy-900);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--concrete-100);
  background: var(--concrete-50);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ═══════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════ */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--concrete-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
  animation: fadeInUp 0.3s ease-out both;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--slate-300);
  z-index: 1;
}

.timeline-item:first-child .timeline-dot {
  border-color: var(--amber-500);
  background: var(--amber-500);
  box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.15);
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--slate-400);
}

.timeline-content {
  margin-top: 4px;
}

.timeline-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy-800);
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--slate-500);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   DETAIL PAGE
   ═══════════════════════════════════════════ */

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

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

.detail-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--concrete-100);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
  width: 160px;
  flex-shrink: 0;
  padding-top: 2px;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--navy-800);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   AUTHORIZATION PAGE
   ═══════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-900);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  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: 32px 32px;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease-out;
}

.auth-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  color: var(--navy-900);
  margin-bottom: 8px;
}

.auth-logo span {
  color: var(--amber-500);
}

.auth-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.8rem;
  color: var(--navy-900);
  letter-spacing: -0.03em;
  margin: 24px 0 8px;
}

.auth-amount-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
}

/* ═══════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .login-page {
    grid-template-columns: 1fr;
  }
}

.login-brand {
  background: var(--navy-900);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .login-brand {
    display: none;
  }
}

.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.login-brand-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  color: #fff;
  letter-spacing: -0.04em;
}

.login-brand-logo span {
  color: var(--amber-500);
}

.login-brand-tagline {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-top: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-form-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}

.login-form {
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}

.login-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--slate-500);
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

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

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

.animate-in {
  animation: fadeInUp 0.4s ease-out both;
}

.animate-in-1 { animation-delay: 0.05s; }
.animate-in-2 { animation-delay: 0.1s; }
.animate-in-3 { animation-delay: 0.15s; }
.animate-in-4 { animation-delay: 0.2s; }
.animate-in-5 { animation-delay: 0.25s; }

/* ═══════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════ */

.progress-bar {
  height: 6px;
  background: var(--concrete-200);
  border-radius: 3px;
  overflow: hidden;
}

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

/* ═══════════════════════════════════════════
   FILE UPLOAD
   ═══════════════════════════════════════════ */

.file-upload {
  border: 2px dashed var(--concrete-200);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.file-upload:hover {
  border-color: var(--amber-500);
  background: rgba(212, 160, 23, 0.03);
}

.file-upload-icon {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.file-upload-text {
  font-size: 0.85rem;
  color: var(--slate-500);
  line-height: 1.6;
}

.file-upload-text strong {
  color: var(--amber-600);
}

/* ═══════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════ */

.text-mono { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--slate-500); }
.text-amber { color: var(--amber-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.w-full { width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE TABLE WRAPPER
   ═══════════════════════════════════════════ */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--concrete-200) transparent;
}

.table-scroll::-webkit-scrollbar {
  height: 4px;
}

.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--concrete-200);
  border-radius: 2px;
}

.table-scroll table {
  min-width: 640px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
  html {
    font-size: 14.5px;
  }

  .main-content {
    padding: 24px 20px;
    padding-top: 8px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .stat-value {
    font-size: 1.7rem;
  }

  .card-body {
    padding: 20px;
  }

  .card-header {
    padding: 16px 20px;
  }

  .card-footer {
    padding: 14px 20px;
    flex-wrap: wrap;
  }

  .auth-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤640px)
   ═══════════════════════════════════════════ */

@media (max-width: 640px) {
  html {
    font-size: 14px;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  .main-content {
    padding: 16px 12px;
    padding-top: 4px;
  }

  .page-header {
    margin-bottom: 20px;
    flex-direction: column;
    gap: 12px;
  }

  .page-header .btn {
    width: 100%;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .page-subtitle {
    font-size: 0.82rem;
  }

  /* Stats — 2 columnas en móvil, no 1 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .stat-label {
    font-size: 0.6rem;
    margin-bottom: 4px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  /* Tables */
  .table-toolbar {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .table-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .table-filters .btn {
    flex-shrink: 0;
  }

  th {
    padding: 10px 12px;
    font-size: 0.62rem;
  }

  td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  /* Detail page — stack label/value */
  .detail-row {
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
  }

  .detail-label {
    width: auto;
    font-size: 0.65rem;
  }

  .detail-value {
    font-size: 0.85rem;
  }

  /* Cards */
  .card-body {
    padding: 16px;
  }

  .card-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-footer {
    padding: 12px 16px;
    flex-direction: column;
  }

  .card-footer .btn {
    width: 100%;
  }

  /* Buttons — larger touch targets on mobile */
  .btn {
    padding: 12px 20px;
    min-height: 44px;
  }

  .btn--sm {
    padding: 10px 14px;
    min-height: 40px;
  }

  /* Forms */
  .form-input,
  .form-select,
  .form-textarea {
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .form-checkbox-group {
    gap: 6px;
  }

  .form-checkbox-label {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  /* File upload */
  .file-upload {
    padding: 20px 16px;
  }

  /* Timeline */
  .timeline {
    padding-left: 24px;
  }

  .timeline-dot {
    left: -20px;
    width: 12px;
    height: 12px;
  }

  .timeline-item {
    padding-bottom: 18px;
  }

  /* Badges — slightly tighter */
  .badge {
    padding: 3px 8px;
    font-size: 0.62rem;
  }

  .badge::before {
    width: 5px;
    height: 5px;
  }

  /* Login — mobile adjustments */
  .login-form-container {
    padding: 32px 20px;
  }

  .login-title {
    font-size: 1.3rem;
  }

  /* Auth page */
  .auth-card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .auth-amount {
    font-size: 2rem;
  }

  .auth-logo {
    font-size: 1.4rem;
  }

  /* Progress bar */
  .progress-bar {
    height: 8px;
    border-radius: 4px;
  }

  .progress-bar-fill {
    border-radius: 4px;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤380px)
   ═══════════════════════════════════════════ */

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

  .stat-card {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .page-title {
    font-size: 1.15rem;
  }

  .auth-amount {
    font-size: 1.6rem;
  }

  .sidebar-logo {
    font-size: 1.3rem;
  }

  .mobile-topbar {
    padding: 10px 12px;
  }
}

/* ═══════════════════════════════════════════
   SAFE AREAS (notch devices)
   ═══════════════════════════════════════════ */

@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .mobile-topbar {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }

  .main-content {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .login-form-container {
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }

  .card-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════
   TOUCH ENHANCEMENTS
   ═══════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
  .nav-link {
    padding: 12px;
    min-height: 44px;
  }

  .btn:active {
    transform: scale(0.96);
    transition-duration: 50ms;
  }

  .stat-card:hover {
    transform: none;
    box-shadow: none;
  }

  .card:hover {
    box-shadow: none;
  }

  tbody tr:hover {
    background: transparent;
  }

  .table-link:active {
    color: var(--amber-600);
  }
}

/* ═══════════════════════════════════════════
   LANDSCAPE MOBILE
   ═══════════════════════════════════════════ */

@media (max-height: 500px) and (orientation: landscape) {
  .login-page {
    min-height: auto;
  }

  .login-brand {
    display: none;
  }

  .login-form-container {
    padding: 24px;
  }

  .auth-page {
    min-height: auto;
    padding: 16px;
  }

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

/* ═══════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════ */

@media print {
  .sidebar,
  .mobile-topbar,
  .mobile-overlay,
  .btn,
  .nav-link,
  .table-filters {
    display: none !important;
  }

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

  .main-content {
    padding: 0;
    max-width: none;
  }

  .card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }

  .badge {
    border: 1px solid currentColor;
  }

  .badge::before {
    display: none;
  }

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