/**
 * Design System & Styles
 * Hà Phong Visuals - Quản lý Báo giá
 * 
 * Premium admin panel with dark sidebar + light content
 * Professional customer quotation view
 */

/* ==========================================
   CSS Custom Properties (Design Tokens)
   ========================================== */
:root {
  /* Màu chủ đạo */
  --color-primary: #C41E1E;
  --color-primary-dark: #A11818;
  --color-primary-darker: #8B1515;
  --color-primary-light: #E85555;
  --color-primary-bg: rgba(196, 30, 30, 0.08);
  --color-primary-bg-hover: rgba(196, 30, 30, 0.12);

  /* Sidebar */
  --sidebar-bg: #1a1a2e;
  --sidebar-bg-light: #222240;
  --sidebar-text: rgba(255, 255, 255, 0.7);
  --sidebar-text-active: #ffffff;
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 0px;

  /* Nền */
  --bg-body: #f5f5f7;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;

  /* Border */
  --border-color: #e5e7eb;
  --border-color-light: #f3f4f6;
  --border-color-focus: var(--color-primary);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-index */
  --z-sidebar: 100;
  --z-mobile-header: 90;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-loading: 500;

  /* Status colors */
  --status-draft: #6b7280;
  --status-draft-bg: #f3f4f6;
  --status-sent: #3b82f6;
  --status-sent-bg: #eff6ff;
  --status-reviewing: #f59e0b;
  --status-reviewing-bg: #fffbeb;
  --status-approved: #10b981;
  --status-approved-bg: #ecfdf5;
  --status-rejected: #ef4444;
  --status-rejected-bg: #fef2f2;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

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

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

.layout-centered {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b3d 50%, #1a1a2e 100%);
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: transform var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(196, 30, 30, 0.05) 0%, transparent 40%);
  pointer-events: none;
}

.sidebar-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header .logo {
  flex-shrink: 0;
}

.sidebar-header .logo svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(196, 30, 30, 0.3));
}

.sidebar-brand h2 {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  color: var(--sidebar-text-active);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.sidebar-brand .subtitle {
  font-size: var(--font-size-xs);
  color: var(--sidebar-text);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: var(--font-size-base);
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(196, 30, 30, 0.2) 0%, rgba(196, 30, 30, 0.08) 100%);
  color: var(--sidebar-text-active);
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.nav-item:hover svg,
.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.storage-mode {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
}

.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mode-dot.mode-cloud {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.mode-dot.mode-local {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.mode-text {
  font-size: var(--font-size-xs);
  color: var(--sidebar-text);
}

.nav-logout:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-sidebar) - 1);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.show {
  opacity: 1;
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-body);
}

/* ==========================================
   Mobile Header
   ========================================== */
.mobile-header {
  display: none;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: var(--z-mobile-header);
}

.mobile-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1px;
}

.btn-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.sidebar .btn-sidebar-toggle {
  display: none;
  color: var(--sidebar-text);
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
}

.sidebar .btn-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text-active);
}

/* ==========================================
   Page Structure
   ========================================== */
.page {
  padding: var(--space-xl) var(--space-2xl);
  max-width: 1400px;
  animation: fadeIn 0.3s ease;
}

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

.page-enter {
  animation: fadeIn 0.3s ease;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header h1 {
  font-size: var(--font-size-2xl);
  color: var(--text-primary);
}

.page-header .page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 400;
  font-family: var(--font-body);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

/* ==========================================
   Cards
   ========================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color-light);
}

.card-header h2, .card-header h3 {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.card-body {
  /* Flexible body */
}

/* ==========================================
   Stats Grid (Dashboard)
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-card);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1.5px;
  background: linear-gradient(135deg, var(--color-primary), rgba(196, 30, 30, 0.2), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.stat-card-badge {
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.stat-card-badge.up {
  background: var(--status-approved-bg);
  color: var(--status-approved);
}

.stat-card-badge.down {
  background: var(--status-rejected-bg);
  color: var(--status-rejected);
}

.stat-card-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-body);
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ==========================================
   Data Table
   ========================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  font-size: var(--font-size-sm);
}

.data-table thead {
  background: var(--bg-body);
}

.data-table th {
  padding: 12px var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-primary);
  vertical-align: middle;
}

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

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

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

.table-actions {
  display: flex;
  gap: var(--space-xs);
}

.table-actions .btn {
  padding: 6px 8px;
}

/* ==========================================
   Forms
   ========================================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
  background: var(--bg-input-focus);
}

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

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

.form-select {
  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 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 4px;
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--status-rejected);
  margin-top: 4px;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--status-rejected);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border-color-light);
  margin: var(--space-xl) 0;
}

/* Inline form controls (checkbox, toggle) */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  line-height: 1.4;
}

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

.btn svg {
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: var(--color-primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(196, 30, 30, 0.3);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-body);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color-light);
  border-color: var(--text-tertiary);
}

/* Danger */
.btn-danger {
  background: var(--status-rejected);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

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

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

/* Icon-only button */
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

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

/* Large button */
.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-size-md);
}

/* Full width */
.btn-block {
  width: 100%;
}

/* ==========================================
   Badges
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.badge-draft {
  background: var(--status-draft-bg);
  color: var(--status-draft);
}

.badge-sent {
  background: var(--status-sent-bg);
  color: var(--status-sent);
}

.badge-reviewing {
  background: var(--status-reviewing-bg);
  color: var(--status-reviewing);
}

.badge-approved {
  background: var(--status-approved-bg);
  color: var(--status-approved);
}

.badge-rejected {
  background: var(--status-rejected-bg);
  color: var(--status-rejected);
}

/* ==========================================
   Search Bar
   ========================================== */
.search-bar {
  position: relative;
  max-width: 320px;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.search-bar svg,
.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  padding: var(--space-lg);
}

.modal-overlay.modal-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition-base);
}

.modal-overlay.modal-show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-lg {
  max-width: 640px;
}

.modal-xl {
  max-width: 800px;
}

.modal-header {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border-color-light);
}

.modal-header h3 {
  font-size: var(--font-size-lg);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ==========================================
   Toast Notifications
   ========================================== */
#toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all var(--transition-base);
  border-left: 4px solid var(--text-tertiary);
}

.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-success {
  border-left-color: var(--status-approved);
}

.toast-error {
  border-left-color: var(--status-rejected);
}

.toast-warning {
  border-left-color: var(--status-reviewing);
}

.toast-info {
  border-left-color: var(--status-sent);
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
}

.toast-success .toast-icon { color: var(--status-approved); }
.toast-error .toast-icon { color: var(--status-rejected); }
.toast-warning .toast-icon { color: var(--status-reviewing); }
.toast-info .toast-icon { color: var(--status-sent); }

.toast-message {
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.toast-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--bg-body);
  color: var(--text-primary);
}

/* ==========================================
   Loading Overlay
   ========================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
}

.spinner-container {
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

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

.spinner-text {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

/* ==========================================
   Auth Pages
   ========================================== */
.auth-page {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.auth-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.auth-card .auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-card .auth-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  box-shadow: 0 8px 24px rgba(196, 30, 30, 0.4);
}

.auth-card .auth-logo svg {
  width: 36px;
  height: 36px;
}

.auth-card h1 {
  font-size: var(--font-size-2xl);
  color: #ffffff;
  margin-bottom: var(--space-sm);
}

.auth-card p {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-size-sm);
}

.auth-card .form-group label {
  color: rgba(255, 255, 255, 0.8);
}

.auth-card .form-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.auth-card .form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(196, 30, 30, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.auth-card .form-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.auth-card .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: var(--font-size-md);
  margin-top: var(--space-md);
}

.auth-card h2 {
  font-size: var(--font-size-xl);
  color: #ffffff;
  margin-bottom: var(--space-xs);
  text-align: center;
  font-family: var(--font-heading);
}

.auth-card .auth-subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-sm);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-error {
  color: #ef4444;
  font-size: var(--font-size-sm);
  text-align: center;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================
   Customer Page (Quotation View)
   ========================================== */
.customer-page {
  background: #f0f0f0;
  min-height: 100vh;
  padding: 40px 16px;
}

.quotation-container {
  max-width: 960px;
  margin: 0 auto;
}

.quotation-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

/* Quotation Template - matches PDF design */
.quotation-template {
  background: #ffffff;
  box-shadow: 0 4px 32px rgba(0,0,0,0.12);
  border-radius: 4px;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 56px;
  font-family: 'Inter', sans-serif;
  color: #222;
  line-height: 1.6;
}

.qt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 3px solid var(--color-primary);
}

.qt-company-info {
  flex: 1;
}

.qt-company-name {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.qt-company-details {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.8;
}

.qt-company-details span {
  display: block;
}

.qt-logo {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.qt-title-section {
  text-align: center;
  padding: var(--space-xl) var(--space-2xl);
  background: linear-gradient(to bottom, rgba(196, 30, 30, 0.03), transparent);
}

.qt-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-sm);
}

.qt-quotation-id {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.qt-meta {
  padding: 0 var(--space-2xl) var(--space-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.qt-meta-group h4 {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.qt-meta-group p {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.6;
}

.qt-body {
  padding: 0 var(--space-2xl) var(--space-xl);
}

.qt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
}

.qt-table thead {
  background: var(--color-primary);
  color: #ffffff;
}

.qt-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.qt-table th:first-child {
  border-radius: 4px 0 0 0;
}

.qt-table th:last-child {
  border-radius: 0 4px 0 0;
}

.qt-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color-light);
}

.qt-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.qt-table .text-right {
  text-align: right;
}

.qt-table .text-center {
  text-align: center;
}

.qt-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: var(--space-lg);
}

.qt-total-row {
  display: flex;
  justify-content: space-between;
  min-width: 320px;
  padding: 8px 0;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--border-color-light);
}

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

.qt-total-row.qt-grand-total {
  font-weight: 700;
  font-size: var(--font-size-md);
  color: var(--color-primary);
  border-top: 2px solid var(--color-primary);
  border-bottom: none;
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
}

.qt-total-label {
  color: var(--text-secondary);
}

.qt-total-value {
  font-weight: 600;
  min-width: 140px;
  text-align: right;
}

.qt-total-words {
  font-style: italic;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: right;
  margin-bottom: var(--space-xl);
}

.qt-notes-section {
  padding: 0 var(--space-2xl) var(--space-xl);
}

.qt-notes-section h4 {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qt-notes-section p,
.qt-notes-section li {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}

.qt-notes-section ul {
  list-style: none;
  padding: 0;
}

.qt-notes-section ul li::before {
  content: '•';
  color: var(--color-primary);
  font-weight: bold;
  margin-right: var(--space-sm);
}

.qt-signature {
  padding: var(--space-xl) var(--space-2xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  border-top: 1px solid var(--border-color-light);
}

.qt-signature-block {
  text-align: center;
}

.qt-signature-block h4 {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
}

.qt-signature-block p {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-style: italic;
}

.qt-signature-space {
  height: 80px;
}

.qt-signature-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.qt-signature-title {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.qt-footer {
  padding: var(--space-md) var(--space-2xl);
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-xs);
  text-align: center;
}

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-md);
  color: var(--border-color);
}

.empty-state h3 {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 600;
}

.empty-state p {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
}

/* ==========================================
   Utility Classes
   ========================================== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-red { color: var(--color-primary); }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.grid { display: grid; }

.hidden { display: none !important; }
.visible { display: block; }

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

.whitespace-pre-wrap {
  white-space: pre-wrap;
}

/* ==========================================
   Scrollbar Styling
   ========================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   Responsive: Tablet (≤ 1024px)
   ========================================== */
@media (max-width: 1024px) {
  .page {
    padding: var(--space-lg);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .qt-meta {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   Responsive: Mobile (≤ 768px)
   ========================================== */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .sidebar .btn-sidebar-toggle {
    display: flex;
  }

  .mobile-header {
    display: flex;
  }

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

  .page {
    padding: var(--space-md);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: var(--font-size-xs);
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }

  #toast-container {
    right: var(--space-md);
    left: var(--space-md);
  }

  .toast {
    min-width: auto;
  }

  .auth-card {
    padding: var(--space-xl);
  }

  .qt-header {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .qt-signature {
    grid-template-columns: 1fr;
  }

  .qt-total-row {
    min-width: auto;
  }

  .qt-body,
  .qt-notes-section,
  .qt-title-section,
  .qt-meta {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .qt-header,
  .qt-signature,
  .qt-footer {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .modal-content {
    margin: var(--space-md);
  }
}

/* ==========================================
   Responsive: Small Mobile (≤ 480px)
   ========================================== */
@media (max-width: 480px) {
  .page {
    padding: var(--space-sm);
  }

  .card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .btn {
    padding: 8px 14px;
    font-size: var(--font-size-xs);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-card-value {
    font-size: var(--font-size-2xl);
  }
}

/* ==========================================
   Print & PDF Styles
   ========================================== */
@media print {
  body {
    background: #ffffff;
    font-size: 11pt;
  }

  .sidebar,
  .mobile-header,
  .sidebar-overlay,
  #toast-container,
  .loading-overlay,
  .modal-overlay,
  .quotation-actions-bar,
  .btn,
  .page-header .page-actions {
    display: none !important;
  }

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

  .page {
    padding: 0;
    max-width: 100%;
  }

  .card {
    box-shadow: none;
    border: 1px solid #eee;
  }

  .quotation-template {
    box-shadow: none;
    border-radius: 0;
  }

  .customer-page {
    padding: 0;
    background: #ffffff;
  }

  .qt-header {
    padding: 20px 24px;
  }

  .qt-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }

  /* Tránh page break giữa các section */
  .qt-table,
  .qt-totals,
  .qt-signature {
    break-inside: avoid;
  }
}

/* ==========================================
   PDF Export specific (for html2pdf.js)
   ========================================== */
.pdf-export-mode .sidebar,
.pdf-export-mode .mobile-header,
.pdf-export-mode #toast-container,
.pdf-export-mode .loading-overlay,
.pdf-export-mode .quotation-actions-bar {
  display: none !important;
}

.pdf-export-mode .main-content {
  margin-left: 0;
}

.pdf-export-mode .customer-page {
  padding: 0;
  background: #ffffff;
}

.pdf-export-mode .quotation-template {
  box-shadow: none;
}

/* ==========================================
   Selection
   ========================================== */
::selection {
  background: var(--color-primary-bg);
  color: var(--color-primary-dark);
}

/* ==========================================
   Focus Visible
   ========================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================
   Template Pages Admin
   ========================================== */
.tp-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(196, 30, 30, 0.06);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.tp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.2s;
}

.tp-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(196, 30, 30, 0.08);
}

.tp-card-disabled {
  opacity: 0.5;
}

.tp-card-quotation {
  border-left: 3px solid var(--color-primary);
}

.tp-card-grip {
  cursor: grab;
  padding: 4px;
  flex-shrink: 0;
}

.tp-card-preview {
  width: 80px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f5f5;
}

.tp-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tp-card-preview-dynamic {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(135deg, #fff5f5, #fff);
}

.tp-card-preview-dynamic span {
  font-size: 9px;
  color: #C41E1E;
  font-weight: 600;
}

.tp-card-info {
  flex: 1;
  min-width: 0;
}

.tp-card-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tp-card-type {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.tp-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tp-card-order-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tp-card-order-btns .btn-icon {
  padding: 4px;
  border-radius: 4px;
}

.tp-card-order-btns .btn-icon:disabled {
  opacity: 0.2;
  cursor: default;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}

.tp-btn-delete:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* Toggle switch */
.tp-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.tp-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tp-toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 22px;
  transition: 0.2s;
}

.tp-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.tp-toggle-input:checked + .tp-toggle-slider {
  background: var(--color-primary);
}

.tp-toggle-input:checked + .tp-toggle-slider::before {
  transform: translateX(18px);
}

.tp-card-dragging {
  opacity: 0.4;
  border: 2px dashed #C41E1E !important;
  box-shadow: none !important;
}
.tp-card-drag-over {
  border-top: 3px solid #C41E1E !important;
}


/* =========================================================
   LANDING PAGE (SEO)
   ========================================================= */
.landing-hero {
  position: relative;
  height: 80vh;
  min-height: 500px;
  background-image: url('https://haphong.com/wp-content/uploads/2023/10/chup-anh-khach-san-da-nang-ha-phong-visuals-7.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.landing-hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 26, 46, 0.75);
}

.landing-container {
  position: relative;
  z-index: 10;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.landing-title {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.landing-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 4px;
}

.landing-desc {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 40px auto;
  line-height: 1.6;
  opacity: 0.9;
}

.landing-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 15px 35px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.landing-btn:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3);
}

.landing-services {
  padding: 80px 0;
  background: var(--bg-main);
  text-align: center;
}

.landing-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--text-light);
  margin-bottom: 50px;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.landing-card {
  background: var(--bg-card);
  padding: 40px 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.3s;
}

.landing-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.landing-card h3 {
  color: var(--text-light);
  font-size: 1.3rem;
  margin-bottom: 15px;
  font-family: 'Playfair Display', serif;
}

.landing-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

.landing-footer {
  background: var(--bg-sidebar);
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.landing-footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 5px 0;
}

.admin-login-link {
  color: rgba(255,255,255,0.2);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.3s;
}

.admin-login-link:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .landing-title { font-size: 2.5rem; }
  .landing-subtitle { font-size: 1rem; }
}

/* =========================================================
   NEW PREMIUM LANDING PAGE (Based on download.haphong.com)
   ========================================================= */

#page-landing {
  --bg-main: #0a0a0f;
  --bg-card: #16161f;
  --text-main: #e8e8ed;
  --text-muted: #9a9aad;
  --accent: #e30613;
  --bg-sidebar: #111118;
  
  background-color: var(--bg-main) !important;
  color: var(--text-main) !important;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  width: 100%;
  flex: 1;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.header-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #fff;
}

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 100px;
  font-weight: 600;
}

.nav-cta:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* HERO SECTION */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(231, 76, 60, 0.1);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 30px;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 700;
}

.hero-title-accent {
  display: block;
  font-size: 1.5rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  margin-top: 16px;
}

.hero-desc {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  max-width: 90%;
}

.hero-desc strong {
  color: #fff;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 20px;
}

.hero-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 100px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
}

.hero-actions .btn-primary {
  background: var(--accent);
  color: #fff;
}

.hero-actions .btn-primary:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3);
}

.hero-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* HERO VISUAL (Right side) */
.hero-visual {
  position: relative;
}

.hero-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.hero-card-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-card-icon {
  width: 80px;
  height: 80px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.hero-card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-card-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.hero-card-value {
  color: var(--text-muted);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
}

.stat-number {
  font-size: 2.5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #fff;
}

.stat-number::after {
  content: '+';
  color: var(--accent);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 40px 24px;
    gap: 40px;
  }
  .hero-title { font-size: 3rem; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .header-nav { display: none; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { grid-template-columns: 1fr; gap: 15px; }
  .hero-card { padding: 20px; }
  .step-card { padding: 20px; }
  .logo-name { font-size: 1rem; }
}


/* ==========================================
   TIMELINE (Quy Trình)
   ========================================== */
.timeline {
  margin-top: 40px;
}
.timeline-item {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  position: relative;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  top: 40px;
  bottom: -40px;
  left: 20px;
  width: 2px;
  background: rgba(255,255,255,0.05);
}
.timeline-item:last-child::before {
  display: none;
}
.timeline-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  z-index: 2;
  flex-shrink: 0;
}
.timeline-content {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 24px;
  border-radius: 12px;
  flex: 1;
}

/* ==========================================
   FAQ
   ========================================== */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 24px;
}
.faq-question {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: #fff;
}
.faq-answer p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .timeline-item { gap: 16px; flex-direction: column; }
  .timeline-item::before { left: 20px; top: 40px; bottom: 0; }
  .timeline-marker { margin-bottom: 8px; }
}
