/* Premium Modern Design System (Phiên bản LITE - Dưới 500 Dòng) */
:root {
  /* Color Palette */
  --bg-primary: #0a0e27;
  --bg-secondary: #141b2d;
  --bg-tertiary: #1f2937;
  --card-bg: linear-gradient(145deg, #1a1f35 0%, #141b2d 100%);
  --card-hover: linear-gradient(145deg, #1f2640 0%, #1a1f35 100%);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-disabled: #64748b;
  
  /* Brand Colors */
  --accent-primary: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #818cf8;
  --accent-glow: rgba(79, 70, 229, 0.4);
  
  /* Status Colors */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --success-border: rgba(34, 197, 94, 0.3);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  
  /* Border & Dividers */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.05);
  --divider: rgba(255, 255, 255, 0.1);
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
} /* <-- ĐÃ SỬA LỖI THIẾU NGOẶC */

/* =========================================
   Global Reset & Base Styles
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* =========================================
   Layout: Header, Container, Footer
   ========================================= */
.topbar {
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar .wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.topbar strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  padding-left: 36px;
  position: relative;
}

.topbar strong::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-light) 100%);
  border-radius: 8px;
}

.topbar nav {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  flex-wrap: wrap;
}

.topbar nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  font-weight: 500;
  font-size: 14px;
}

.topbar nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.container {
  max-width: 1280px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-xl);
}

.footer {
  border-top: 1px solid var(--border-light);
  margin-top: 80px;
  padding: 48px 0 32px;
}

.footer .wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.footer-brand .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
  max-width: 360px;
}

.footer-section h4 {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-section ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition-fast);
}

.footer-section ul li a:hover {
  color: var(--accent-light);
  transform: translateX(4px);
}

.footer-bottom {
  max-width: 1280px;
  margin: var(--space-xl) auto 0;
  padding: var(--space-lg) var(--space-xl) 0;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.footer-bottom p {
  color: var(--text-disabled);
  font-size: 12px;
  margin: 0;
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}

.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
  font-size: 16px;
}

.footer-social a:hover {
  background: var(--accent-primary);
  color: white;
}

/* =========================================
   Components
   ========================================= */

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  background: var(--card-hover);
}

.card h2,
.card h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  font-weight: 700;
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-color);
}

.card h2 { font-size: 24px; }
.card h3 {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Grid Layouts */
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table thead {
  background: rgba(79, 70, 229, 0.1);
}

.table th {
  padding: 16px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
}

.table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 14px;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Forms */
label {
  display: block;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  margin-top: var(--space-sm);
  transition: var(--transition-fast);
  font-family: inherit;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-disabled);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

/* Buttons */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  box-shadow: none;
  border: 1px solid var(--border-color);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn.small {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
}

.btn.danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid;
}
.alert.error {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #fecaca;
}
.alert.success {
  background: var(--success-bg);
  border-color: var(--success);
  color: #86efac;
}

/* Auth Page */
.auth {
  max-width: 480px;
  margin: 100px auto;
}
.auth .card {
  padding: var(--space-2xl);
  text-align: center;
}

/* Stats & Big Numbers */
.big {
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: var(--space-md);
}

/* Code Blocks */
code {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  color: var(--accent-light);
}

/* Status Badges */
.badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.badge.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.badge.info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-bg);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }

/* Loading State (dùng cho JS) */
.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 1024px) {
  .grid2, .grid3 {
    grid-template-columns: 1fr;
  }
  .footer .wrap {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .topbar .wrap {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md);
  }
  .topbar nav {
    width: 100%;
    overflow-x: auto;
  }
  .topbar nav a {
    white-space: nowrap;
  }
  .container {
    margin: var(--space-lg) auto;
    padding: 0 var(--space-md);
  }
  .card { padding: var(--space-lg); }
  .big { font-size: 36px; }

  .footer .wrap {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .auth { margin: 60px auto; }
}

@media (max-width: 480px) {
  .card { padding: var(--space-md); }
  .table {
    display: block;
    overflow-x: auto;
  }
  .table thead { display: none; }
  .table tbody tr {
    display: block;
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
  }
  .table tbody td {
    display: block;
    text-align: right;
    border-bottom: 1px dashed var(--border-light);
  }
  .table tbody td::before {
    content: attr(data-label); /* Yêu cầu HTML phải có data-label */
    float: left;
    font-weight: 700;
    color: var(--text-muted);
  }
  button, .btn {
    width: 100%;
  }
  .btn.small { width: auto; }
}