:root {
  --primary: #1a56db; --primary-dark: #1444a8; --primary-light: #e8effc;
  --success: #059669; --success-light: #ecfdf5;
  --warning: #d97706; --warning-light: #fffbeb;
  --danger: #dc2626; --danger-light: #fef2f2;
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-300: #d1d5db;
  --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563; --gray-700: #374151;
  --gray-800: #1f2937; --gray-900: #111827; --white: #ffffff;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 8px; --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--gray-800); background: var(--gray-50); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-main); }
input, select, textarea { font-family: var(--font-main); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 22px; border-radius: var(--radius); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border: none; transition: all 150ms ease; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="date"], input[type="number"], select, textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 14px; color: var(--gray-800); background: var(--white); transition: border-color 150ms, box-shadow 150ms; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
input:disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 4px; }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { background: var(--danger-light); color: var(--danger); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; border: 1px solid #fecaca; }
.form-success { background: var(--success-light); color: var(--success); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; border: 1px solid #a7f3d0; }
.form-subtitle { color: var(--gray-500); margin-bottom: 24px; }
.form-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-label input[type="checkbox"] { width: auto; }
.card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px; }
.card h3 { font-size: 16px; font-weight: 600; color: var(--gray-800); margin-bottom: 16px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-qualiopi { background: #dbeafe; color: #1d4ed8; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.font-mono { font-family: var(--font-mono); font-size: 13px; }
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { background: var(--gray-50); }
.data-table th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--gray-600); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: var(--gray-50); }
.data-table tbody tr:hover { background: var(--gray-100); }
.table-filters { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-input { max-width: 280px; }
.filter-select { max-width: 180px; }
.table-actions { display: flex; gap: 6px; }
.table-actions .btn { padding: 4px 10px; font-size: 11px; }
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination button { padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--white); font-size: 13px; cursor: pointer; transition: all 150ms; }
.pagination button:hover { background: var(--gray-50); }
.pagination button.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.page-home { background: var(--white); min-height: 100vh; display: flex; flex-direction: column; }
.header-home { padding: 16px 32px; position: absolute; top: 0; left: 0; right: 0; z-index: 10; }
.header-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; }
.header-link { font-size: 13px; color: var(--gray-500); font-weight: 500; padding: 8px 16px; border: 1px solid var(--gray-200); border-radius: var(--radius); transition: all 150ms; }
.header-link:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.home-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 80px 24px 60px; }
.home-center { text-align: center; width: 100%; max-width: 640px; }
.home-logo { margin-bottom: 40px; }
.home-logo svg { margin-bottom: 16px; }
.home-title { font-size: 28px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.home-subtitle { font-size: 15px; color: var(--gray-500); font-weight: 400; }
.search-container { margin-bottom: 32px; }
.search-bar { display: flex; align-items: center; background: var(--white); border: 2px solid var(--gray-200); border-radius: 28px; padding: 4px 4px 4px 20px; box-shadow: var(--shadow-md); transition: border-color 150ms, box-shadow 150ms; }
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,86,219,0.1), var(--shadow-md); }
.search-icon { flex-shrink: 0; margin-right: 12px; }
.search-input { flex: 1; border: none; outline: none; font-size: 16px; padding: 12px 0; background: transparent; color: var(--gray-800); font-family: var(--font-main); }
.search-input::placeholder { color: var(--gray-400); }
.search-btn { padding: 12px 28px; background: var(--primary); color: var(--white); border: none; border-radius: 24px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 150ms; white-space: nowrap; }
.search-btn:hover { background: var(--primary-dark); }
.search-actions { text-align: center; margin-top: 16px; }
.qr-scan-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: none; color: var(--gray-500); font-size: 13px; cursor: pointer; padding: 8px 16px; border-radius: var(--radius); transition: all 150ms; }
.qr-scan-btn:hover { color: var(--primary); background: var(--primary-light); }
.home-stats { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--gray-400); margin-top: 40px; }
.stat-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gray-300); }
.footer-home { padding: 20px 32px; border-top: 1px solid var(--gray-100); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; font-size: 12px; color: var(--gray-400); flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--gray-400); }
.footer-links a:hover { color: var(--gray-600); }
.footer-credit { font-size: 11px; }
.result-container { max-width: 540px; margin: 0 auto; width: 100%; text-align: left; }
.result-loading { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 24px; color: var(--gray-500); font-size: 14px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-card { border-radius: var(--radius-lg); padding: 24px; margin-top: 8px; }
.result-valid { background: var(--success-light); border: 1px solid #a7f3d0; }
.result-expired { background: var(--warning-light); border: 1px solid #fde68a; }
.result-not-found { background: var(--danger-light); border: 1px solid #fecaca; }
.result-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.result-icon { font-size: 32px; }
.result-header h3 { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
.result-id { font-family: var(--font-mono); font-size: 13px; color: var(--gray-500); }
.result-details { border-top: 1px solid rgba(0,0,0,0.08); padding-top: 16px; }
.result-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.04); }
.result-label { font-size: 13px; color: var(--gray-500); }
.result-value { font-size: 13px; font-weight: 500; color: var(--gray-800); text-align: right; }
.result-note { font-size: 13px; color: var(--gray-600); margin-top: 16px; padding: 12px; background: rgba(0,0,0,0.04); border-radius: var(--radius); }
.result-footer { margin-top: 16px; text-align: center; }
.verified-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--gray-400); padding: 6px 14px; border: 1px solid var(--gray-200); border-radius: 20px; background: var(--white); }

.page-login { min-height: 100vh; background: var(--gray-50); }
.login-container { display: flex; min-height: 100vh; }
.login-left { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--white); }
.login-form-wrapper { width: 100%; max-width: 420px; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; text-decoration: none; }
.login-logo span { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.login-form-wrapper h2 { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.login-right { flex: 1; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--white); }
.login-right-content { max-width: 440px; }
.login-right h2 { font-size: 28px; font-weight: 700; margin-bottom: 32px; line-height: 1.3; }
.login-features { list-style: none; }
.login-features li { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; font-size: 15px; opacity: 0.9; }
.login-features svg { flex-shrink: 0; margin-top: 2px; }
.login-right-note { font-size: 13px; opacity: 0.7; margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.2); }
.page-dashboard { background: var(--gray-50); min-height: 100vh; }
.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--white); border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; transition: transform 300ms ease; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; gap: 12px; }
.sidebar-centre-name { font-size: 14px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--gray-600); font-size: 14px; font-weight: 500; transition: all 150ms; text-decoration: none; border-left: 3px solid transparent; }
.sidebar-link:hover { background: var(--gray-50); color: var(--gray-800); text-decoration: none; }
.sidebar-link.active { color: var(--primary); background: var(--primary-light); border-left-color: var(--primary); }
.sidebar-link svg { flex-shrink: 0; }
.sidebar-footer { padding: 12px 0; border-top: 1px solid var(--gray-100); }
.sidebar-logout { color: var(--danger); }
.sidebar-logout:hover { background: var(--danger-light); }
.hamburger { display: none; position: fixed; top: 16px; left: 16px; z-index: 200; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 10px; cursor: pointer; flex-direction: column; gap: 4px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--gray-700); transition: all 150ms; }
.dashboard-main { flex: 1; margin-left: 260px; padding: 32px; }
.dashboard-section { display: none; }
.dashboard-section.active { display: block; }
.dashboard-section h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); margin-bottom: 24px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--primary); }
.kpi-card.kpi-success { border-left-color: var(--success); }
.kpi-card.kpi-warning { border-left-color: var(--warning); }
.kpi-card.kpi-danger { border-left-color: var(--danger); }
.kpi-value { font-size: 32px; font-weight: 700; color: var(--gray-900); }
.kpi-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.hab-success-card { margin-top: 20px; background: var(--success-light); border: 1px solid #a7f3d0; border-radius: var(--radius-lg); padding: 24px; }
.hab-success-card h3 { color: var(--success); }
.hab-success-card .hab-id { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--gray-900); margin: 8px 0; }
.csv-dropzone { border: 2px dashed var(--gray-300); border-radius: var(--radius-lg); padding: 48px 24px; text-align: center; transition: all 150ms; cursor: pointer; }
.csv-dropzone:hover, .csv-dropzone.dragover { border-color: var(--primary); background: var(--primary-light); }
.csv-dropzone svg { margin-bottom: 12px; }
.csv-dropzone p { color: var(--gray-500); font-size: 14px; margin-bottom: 4px; }
.csv-browse { color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; }
.csv-hint { font-size: 12px; color: var(--gray-400); }
.type-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.type-bar-label { min-width: 160px; font-size: 13px; color: var(--gray-600); text-align: right; }
.type-bar-fill { height: 24px; background: var(--primary); border-radius: 4px; min-width: 2px; transition: width 300ms; }
.type-bar-count { font-size: 12px; color: var(--gray-500); font-weight: 600; }
.top-centre-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.top-centre-item:last-child { border-bottom: none; }
.top-centre-rank { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 700; border-radius: 50%; margin-right: 12px; }

@media (max-width: 1024px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .dashboard-main { padding: 24px 16px; } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .hamburger { display: flex; }
  .dashboard-main { margin-left: 0; padding: 70px 16px 24px; }
  .login-container { flex-direction: column; }
  .login-right { display: none; }
  .login-left { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .table-filters { flex-direction: column; }
  .filter-input, .filter-select { max-width: 100%; }
  .home-stats { flex-direction: column; gap: 4px; }
  .stat-dot { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .home-title { font-size: 22px; }
  .search-bar { flex-direction: column; border-radius: var(--radius-lg); padding: 8px; }
  .search-icon { display: none; }
  .search-input { text-align: center; padding: 10px; }
  .search-btn { width: 100%; border-radius: var(--radius); }
  .result-row { flex-direction: column; gap: 2px; }
  .result-value { text-align: left; }
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 90; }
.sidebar-overlay.active { display: block; }
