/* =========================================================
   HCGF — Design System "The Architectural Ledger"
   Primary: #004181 | Manrope + Inter
   No borders — only background color shifts & tonal layering
   ========================================================= */

/* === TOKENS === */
:root {
  --primary: #004181;
  --primary-dark: #002f5e;
  --primary-light: #1a5a9a;
  --primary-surface: #e8f0f9;
  --primary-fixed: #d0e4f7;

  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-low: #f4f5f7;
  --surface-high: #e7e8e9;
  --surface-overlay: #eceff3;

  --on-bg: #1a1c1e;
  --on-surface: #1a1c1e;
  --on-surface-variant: #43474e;
  --on-surface-muted: #73777f;
  --outline: rgba(67, 71, 78, 0.12);
  --outline-variant: rgba(67, 71, 78, 0.08);

  --success: #1b7a3e;
  --success-surface: #e6f7ee;
  --warning: #a05c00;
  --warning-surface: #fff3e0;
  --danger: #b3261e;
  --danger-surface: #fde8e7;
  --info: #1555a4;
  --info-surface: #e8f0ff;
  --neutral: #73777f;
  --neutral-surface: #f0f1f3;

  --shadow-low: 0 4px 24px 0 rgba(25, 28, 29, 0.06);
  --shadow-mid: 0 8px 32px 0 rgba(25, 28, 29, 0.10);
  --shadow-high: 0 16px 48px 0 rgba(25, 28, 29, 0.14);

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

  --sidebar-width: 250px;
  --topbar-height: 60px;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Empêcher la barre de debug Symfony de bloquer les clics sur le contenu */
.sf-toolbar { pointer-events: none !important; }
.sf-toolbar * { pointer-events: auto !important; }

/* En mode dev, la barre Symfony (36px) recouvre le bas de la sidebar */
body.app-layout .sidebar { bottom: 36px; }
body.app-layout .main-content { padding-bottom: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6, .kpi-value, .brand-name, .verify-brand, .mono {
  font-family: 'Manrope', 'Inter', sans-serif;
}

h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 600; }

.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--on-surface-muted); }
.font-medium { font-weight: 600; }
.font-large { font-size: 1.2rem; }
.mono { font-family: 'Manrope', 'JetBrains Mono', monospace; letter-spacing: -0.3px; }
.required { color: var(--danger); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === APP LAYOUT === */
.app-layout {
  display: block;
  min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition);
}

.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-footer .user-info { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.brand-mark {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.brand-name { font-size: 1rem; font-weight: 800; color: #fff; line-height: 1.2; }
.brand-tagline { font-size: 0.68rem; color: rgba(255,255,255,0.55); display: block; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-section { margin-bottom: 4px; }
.nav-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 12px 8px 4px;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
.nav-item i { font-size: 16px; flex-shrink: 0; }
.nav-item.sub-item { padding-left: 28px; font-size: 0.82rem; }
.nav-badge {
  margin-left: auto;
  font-size: 0.58rem; font-weight: 700;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 1px 6px; border-radius: 100px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: 0.82rem; font-weight: 600; color: #fff; display: block; }
.user-role { font-size: 0.68rem; color: rgba(255,255,255,0.5); display: block; }
.logout-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 17px;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  text-decoration: none;
}

/* === MAIN CONTENT === */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}
.main-content.expanded { margin-left: 60px; }

/* === TOPBAR === */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-height);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-low);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 0.8rem; color: var(--on-surface-muted); }

.sidebar-toggle {
  width: 36px; height: 36px;
  background: var(--bg);
  border: none; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; color: var(--on-surface-variant);
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--surface-high); }

/* === BREADCRUMB === */
.breadcrumb { display: flex; align-items: center; gap: 6px; }
.breadcrumb-item { font-size: 0.82rem; color: var(--on-surface-muted); }
.breadcrumb-item.active { color: var(--on-surface); font-weight: 600; }
.breadcrumb-item:not(.active):hover { color: var(--primary); }
.breadcrumb-sep { color: var(--on-surface-muted); font-size: 0.7rem; }

/* === FLASH MESSAGES === */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
}
.flash-success { background: var(--success-surface); color: var(--success); }
.flash-error { background: var(--danger-surface); color: var(--danger); }
.flash-warning { background: var(--warning-surface); color: var(--warning); }
.flash-info { background: var(--info-surface); color: var(--info); }
.flash-close { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.5; }
.flash-close:hover { opacity: 1; }

/* === CONTENT AREA === */
.content-area { flex: 1; padding: 24px; max-width: 1400px; width: 100%; }

/* === PAGE HEADER === */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.page-title { font-size: 1.5rem; font-weight: 800; color: var(--on-surface); }
.page-subtitle { font-size: 0.82rem; color: var(--on-surface-muted); margin-top: 2px; }

/* === CARDS === */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-low);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
}
.card-title { font-size: 0.92rem; font-weight: 700; color: var(--on-surface); }
.card-action { font-size: 0.78rem; color: var(--primary); font-weight: 600; }
.card-action:hover { text-decoration: none; color: var(--primary-dark); }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-wide { grid-column: span 2; }
.card-muted { background: var(--bg); }
.card-alert { background: var(--danger-surface); }
.card.mt-3 { margin-top: 16px; }
.card.mt-4 { margin-top: 24px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-low); text-decoration: none; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #145e30; text-decoration: none; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8c1c16; text-decoration: none; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #7a4600; text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-outline:hover { background: var(--primary-surface); text-decoration: none; }
.btn-danger-outline { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn-danger-outline:hover { background: var(--danger-surface); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--on-surface-variant); }
.btn-ghost:hover { background: var(--surface-high); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent; border: none; cursor: pointer;
  color: var(--on-surface-variant); font-size: 15px;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--bg); color: var(--primary); text-decoration: none; }
.btn-icon--green:hover { color: var(--success); }
.btn-icon--orange:hover { color: var(--warning); }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-success { background: var(--success-surface); color: var(--success); }
.badge-danger { background: var(--danger-surface); color: var(--danger); }
.badge-warning { background: var(--warning-surface); color: var(--warning); }
.badge-info { background: var(--info-surface); color: var(--info); }
.badge-neutral { background: var(--neutral-surface); color: var(--neutral); }
.badge-lg { padding: 6px 16px; font-size: 0.85rem; }
.badge-sm { padding: 2px 7px; font-size: 0.66rem; }

.badge-role--admin { background: #fde8e7; color: #b3261e; }
.badge-role--manager { background: #e8f0ff; color: #1555a4; }
.badge-role--validator { background: #e6f7ee; color: #1b7a3e; }
.badge-role--operator { background: var(--neutral-surface); color: var(--neutral); }

/* === KPI GRID === */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-low);
  display: flex; align-items: center; gap: 16px;
}
.kpi-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.kpi-icon--blue { background: var(--primary-surface); color: var(--primary); }
.kpi-icon--green { background: var(--success-surface); color: var(--success); }
.kpi-icon--orange { background: var(--warning-surface); color: var(--warning); }
.kpi-icon--purple { background: #f3e8ff; color: #7c3aed; }
.kpi-icon--red { background: var(--danger-surface); color: var(--danger); }
.kpi-body { flex: 1; min-width: 0; }
.kpi-value { font-size: 1.8rem; font-weight: 800; display: block; line-height: 1.1; color: var(--on-surface); }
.kpi-label { font-size: 0.75rem; color: var(--on-surface-muted); display: block; margin-top: 2px; }
.kpi-trend { flex-shrink: 0; }

/* === DASHBOARD GRID === */
.dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.dashboard-sidebar { display: flex; flex-direction: column; gap: 16px; }

/* === DATA TABLES === */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead tr { background: var(--bg); }
.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--on-surface-muted);
  white-space: nowrap;
}
.data-table td { padding: 12px 16px; font-size: 0.85rem; vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-low); }
.data-table tbody tr.row-alert { background: var(--danger-surface); }

/* === STATUS PILLS === */
.status-pills { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.78rem; font-weight: 600;
  background: var(--surface); color: var(--on-surface-variant);
  box-shadow: var(--shadow-low);
  text-decoration: none;
  transition: background var(--transition);
}
.status-pill:hover { background: var(--surface-high); text-decoration: none; }
.status-pill.active { background: var(--primary); color: #fff; }
.pill-count { opacity: 0.6; font-size: 0.7rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--success); }
.dot-orange { background: var(--warning); }
.dot-yellow { background: #d97706; }
.dot-red { background: var(--danger); }

/* === SEARCH / FILTER === */
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-row-wrap { flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 0 12px;
  flex: 1; min-width: 200px;
}
.search-box i { color: var(--on-surface-muted); flex-shrink: 0; }
.search-box .form-input { background: transparent; border: none; box-shadow: none; padding: 9px 0; }
.search-box .form-input:focus { box-shadow: none; }

/* === FORMS === */
.form-group { margin-bottom: 4px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--on-surface-variant); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  color: var(--on-surface);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-bottom-color: var(--primary);
  background: var(--primary-fixed);
  box-shadow: none;
}
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2373777f' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
.form-select-sm { width: auto; padding: 6px 32px 6px 10px; font-size: 0.78rem; }
.w-auto { width: auto !important; }

.input-group { display: flex; align-items: center; position: relative; }
.input-group .form-input { padding-left: 38px; }
.input-icon { position: absolute; left: 12px; color: var(--on-surface-muted); font-size: 15px; z-index: 1; }
.input-action { position: absolute; right: 10px; background: none; border: none; cursor: pointer; color: var(--on-surface-muted); padding: 4px; }
.input-action:hover { color: var(--primary); }

.input-amount { display: flex; }
.input-amount .form-input { flex: 1; border-radius: var(--radius-sm) 0 0 0; }
.input-currency { width: 130px; border-radius: 0 var(--radius-sm) 0 0; border-left: 1px solid var(--outline); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.form-group-span-2 { grid-column: span 2; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.form-narrow { max-width: 800px; }

/* === FORM CARD (attestation create) === */
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-low);
  overflow: hidden;
  margin-bottom: 16px;
}
.form-card-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  background: var(--bg);
}
.form-card-header h3 { font-size: 0.92rem; font-weight: 700; }
.form-card-header p { font-size: 0.78rem; color: var(--on-surface-muted); margin-top: 2px; }
.form-card-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--primary-surface); color: var(--primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.form-card-body { padding: 20px; }

.form-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.form-sections { min-width: 0; }
.form-preview { position: sticky; top: calc(var(--topbar-height) + 20px); align-self: start; }

.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.duration-display {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary-surface); color: var(--primary);
  padding: 8px 14px; border-radius: var(--radius-md);
  font-size: 0.82rem; font-weight: 600;
}

/* === PREVIEW CARD === */
.preview-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-mid);
  overflow: hidden;
  font-size: 0.82rem;
}
.preview-header {
  background: var(--primary);
  padding: 20px 16px 16px;
  text-align: center;
  position: relative;
}
.preview-watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 24pt; font-weight: 800;
  color: rgba(255,255,255,0.08);
  pointer-events: none; white-space: nowrap;
}
.preview-logo { display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; margin-bottom: 10px; }
.preview-logo i { font-size: 20px; }
.preview-logo span { font-size: 1rem; font-weight: 800; }
.preview-header h4 { font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px; color: rgba(255,255,255,0.9); margin-bottom: 2px; }
.preview-subtitle { font-size: 0.62rem; color: rgba(255,255,255,0.55); }
.preview-body { padding: 14px 16px; }
.preview-field { display: flex; flex-direction: column; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--outline-variant); }
.preview-field:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.preview-field-label { font-size: 0.65rem; color: var(--on-surface-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.preview-field-value { font-size: 0.82rem; font-weight: 600; color: var(--on-surface); margin-top: 2px; }
.preview-qr { padding: 12px 16px; border-top: 1px solid var(--outline-variant); display: flex; justify-content: center; }
.qr-placeholder {
  width: 90px; height: 90px;
  background: var(--bg); border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--on-surface-muted); font-size: 0.62rem; text-align: center;
}
.qr-placeholder i { font-size: 28px; }
.preview-footer { padding: 10px 16px; text-align: center; background: var(--bg); }

/* === DETAIL LAYOUT === */
.detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.detail-main { display: flex; flex-direction: column; gap: 16px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--topbar-height) + 20px); align-self: start; }
.detail-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-low); overflow: hidden; }
.detail-card-header { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--bg); }
.detail-card-header i { color: var(--primary); font-size: 16px; }
.detail-card-header h3 { font-size: 0.88rem; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px; }
.detail-field { display: flex; flex-direction: column; gap: 3px; }
.detail-field-full { grid-column: span 2; }
.detail-label { font-size: 0.72rem; color: var(--on-surface-muted); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600; }
.detail-value { font-size: 0.88rem; color: var(--on-surface); }

/* === TIMELINE === */
.timeline { padding: 20px; display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::after {
  content: ''; position: absolute; left: 8px; top: 20px; bottom: 0;
  width: 2px; background: var(--outline);
}
.timeline-dot {
  width: 18px; height: 18px; flex-shrink: 0;
  border-radius: 50%; margin-top: 1px; z-index: 1;
}
.timeline-dot.dot-blue { background: var(--primary); }
.timeline-dot.dot-green { background: var(--success); }
.timeline-dot.dot-red { background: var(--danger); }
.timeline-content { display: flex; flex-direction: column; gap: 2px; }
.timeline-label { font-size: 0.72rem; font-weight: 700; color: var(--on-surface-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* === QR IMAGE === */
.qr-image { width: 150px; height: 150px; border-radius: var(--radius-md); }
.qr-pending { text-align: center; padding: 20px; color: var(--on-surface-muted); }
.qr-pending i { font-size: 40px; display: block; margin-bottom: 8px; }
.qr-pending p { font-size: 0.8rem; }

/* === META LIST === */
.meta-list { display: flex; flex-direction: column; gap: 10px; }
.meta-item { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; }
.meta-label { color: var(--on-surface-muted); }
.meta-value { font-weight: 600; }

/* === ACTIVITY === */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; transition: background var(--transition); }
.activity-item:hover { background: var(--surface-low); }
.activity-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.activity-success { background: var(--success-surface); color: var(--success); }
.activity-failure { background: var(--danger-surface); color: var(--danger); }
.activity-body { flex: 1; min-width: 0; }
.activity-desc { font-size: 0.82rem; font-weight: 500; display: block; }
.activity-meta { font-size: 0.72rem; color: var(--on-surface-muted); }

/* === STATUS BARS === */
.status-bars { display: flex; flex-direction: column; gap: 12px; }
.status-bar-item { display: flex; flex-direction: column; gap: 5px; }
.status-bar-label { display: flex; justify-content: space-between; font-size: 0.78rem; }
.progress-bar { height: 6px; background: var(--bg); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; transition: width 0.5s ease; }
.progress-green { background: var(--success); }
.progress-orange { background: var(--warning); }
.progress-yellow { background: #d97706; }
.progress-red { background: var(--danger); }

/* === ROLE GRID === */
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.role-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-low);
  padding: 20px; display: flex; align-items: center; gap: 14px;
}
.role-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.role-icon--red { background: var(--danger-surface); color: var(--danger); }
.role-icon--blue { background: var(--info-surface); color: var(--info); }
.role-icon--green { background: var(--success-surface); color: var(--success); }
.role-count { font-size: 1.6rem; font-weight: 800; display: block; }
.role-label { font-size: 0.75rem; color: var(--on-surface-muted); }

/* === USER CELL === */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
  width: 32px; height: 32px;
  background: var(--primary-surface); color: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}

/* === SETTINGS LAYOUT === */
.settings-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.settings-main { display: flex; flex-direction: column; gap: 0; }
.settings-sidebar { display: flex; flex-direction: column; gap: 16px; }
.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--outline-variant);
}
.setting-item:last-child { border-bottom: none; }
.setting-label { font-size: 0.85rem; font-weight: 600; display: block; }
.setting-desc { font-size: 0.72rem; color: var(--on-surface-muted); }
.toggle {
  width: 40px; height: 22px;
  border-radius: 100px; cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.toggle-on { background: var(--success); }
.toggle-off { background: var(--surface-high); }
.toggle::after {
  content: ''; position: absolute;
  top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  transition: left var(--transition);
}
.toggle-on::after { left: 21px; }
.toggle-off::after { left: 3px; }
.health-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; font-size: 0.82rem;
}
.text-green { color: var(--success); }

/* === API KEYS === */
.api-key-group { display: flex; flex-direction: column; gap: 16px; }
.api-key-item { display: flex; flex-direction: column; gap: 8px; }
.api-key-label { font-size: 0.82rem; font-weight: 600; }
.api-key-value { display: flex; align-items: center; gap: 8px; background: var(--bg); padding: 10px 14px; border-radius: var(--radius-md); }
.api-key-value code { flex: 1; font-size: 0.78rem; font-family: monospace; }

/* === PAGINATION === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px; }
.page-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent; color: var(--on-surface-variant);
  font-size: 0.82rem; font-weight: 600;
  transition: background var(--transition);
  text-decoration: none;
}
.page-btn:hover { background: var(--surface-high); text-decoration: none; }
.page-btn.active { background: var(--primary); color: #fff; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--on-surface-muted);
}
.empty-state i { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.88rem; }
.mt-2 { margin-top: 8px; }

/* === ACTION GROUP === */
.action-group { display: flex; align-items: center; gap: 4px; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-high);
  width: 100%; max-width: 500px;
  overflow: hidden;
}
.modal-header {
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 12px 24px 20px;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* === FLEX / GAP UTILS === */
.flex-row { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-page { background: var(--bg); min-height: 100vh; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.login-panel-left {
  background: var(--primary);
  padding: 60px 48px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  color: #fff;
}
/* Logo on left (blue) panel — white card, full width of the brand zone */
.login-logo-wrap {
  background: #fff;
  border-radius: 14px;
  padding: 14px 24px;
  margin-bottom: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.login-logo-wrap img {
  max-width: 220px;
  height: auto;
  display: block;
}
/* Logo above the form on the right panel */
.login-form-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-form-logo img {
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.login-subtitle { font-size: 0.95rem; color: rgba(255,255,255,0.65); line-height: 1.6; }
.login-features { display: flex; flex-direction: column; gap: 20px; }
.feature-item { display: flex; align-items: flex-start; gap: 14px; }
.feature-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(255,255,255,0.12); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.feature-item strong { display: block; font-size: 0.88rem; font-weight: 700; }
.feature-item span { font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.login-footer-text p { font-size: 0.75rem; color: rgba(255,255,255,0.35); line-height: 1.6; }

.login-panel-right {
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 48px;
}
.login-form-container { width: 100%; max-width: 380px; }
.login-form-header h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.login-form-header p { font-size: 0.82rem; color: var(--on-surface-muted); margin-bottom: 28px; }

.login-form .form-group { margin-bottom: 16px; }
.login-form .form-input { background: var(--bg); }

.form-options {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.forgot-link { font-size: 0.78rem; color: var(--primary); }

.login-verify-link {
  text-align: center; margin-top: 20px;
  font-size: 0.78rem; color: var(--on-surface-muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 0.85rem; display: flex; gap: 8px; align-items: flex-start; }
.alert-error { background: var(--danger-surface); color: var(--danger); }

/* =========================================================
   PUBLIC VERIFY PAGE
   ========================================================= */
.verify-page { background: var(--bg); min-height: 100vh; }
.verify-layout { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.verify-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--outline);
}
.verify-logo { display: flex; align-items: center; gap: 12px; }
.verify-logo i { font-size: 28px; color: var(--primary); }
.verify-brand { font-size: 1.2rem; font-weight: 800; color: var(--primary); display: block; }
.verify-brand-full { font-size: 0.7rem; color: var(--on-surface-muted); display: block; }
.verify-badge { font-size: 0.75rem; color: var(--on-surface-muted); display: flex; align-items: center; gap: 6px; }

.verify-main { padding: 32px 0; }
.verify-search-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-mid);
  padding: 32px;
  text-align: center; margin-bottom: 28px;
}
.verify-search-header i { font-size: 36px; color: var(--primary); margin-bottom: 14px; display: block; }
.verify-search-header h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.verify-search-header p { font-size: 0.85rem; color: var(--on-surface-muted); margin-bottom: 24px; }

.verify-input-group {
  display: flex; align-items: center;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 16px;
  gap: 10px;
}
.verify-input-group i { color: var(--on-surface-muted); flex-shrink: 0; }
.verify-input {
  flex: 1; background: transparent; border: none;
  font-size: 0.92rem; font-family: 'Manrope', monospace;
  padding: 8px 0; color: var(--on-surface);
}
.verify-input:focus { outline: none; }

.verify-result {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-mid);
  padding: 32px; display: flex; gap: 24px;
}
.verify-result--valid { border-top: 4px solid var(--success); }
.verify-result--cancelled { border-top: 4px solid var(--danger); }
.verify-result--suspended { border-top: 4px solid var(--warning); }
.verify-result--error { border-top: 4px solid var(--neutral); }

.verify-result-icon { font-size: 40px; flex-shrink: 0; margin-top: 4px; }
.verify-result--valid .verify-result-icon { color: var(--success); }
.verify-result--cancelled .verify-result-icon { color: var(--danger); }
.verify-result--suspended .verify-result-icon { color: var(--warning); }
.verify-result--error .verify-result-icon { color: var(--neutral); }

.verify-result-body { flex: 1; min-width: 0; }
.verify-status-banner { margin-bottom: 12px; }
.verify-number { font-size: 1.4rem; font-weight: 800; margin-bottom: 20px; font-family: monospace; }

.verify-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.verify-data-item { display: flex; flex-direction: column; gap: 3px; }
.verify-data-item--full { grid-column: span 2; }
.verify-data-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.7px; color: var(--on-surface-muted); font-weight: 600; }
.verify-data-value { font-size: 0.92rem; font-weight: 600; }

.verify-footer-note {
  background: var(--bg); padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 0.78rem; color: var(--on-surface-muted);
  display: flex; align-items: flex-start; gap: 8px;
}
.verify-tips { margin: 12px 0 0 16px; font-size: 0.82rem; color: var(--on-surface-muted); }
.verify-tips li { margin-bottom: 4px; }

.verify-page-footer {
  text-align: center; padding: 24px 0 32px;
  border-top: 1px solid var(--outline);
  font-size: 0.78rem; color: var(--on-surface-muted);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  :root { --sidebar-width: 60px; }
  .brand-text, .nav-label, .nav-item span, .sidebar-footer .user-info { display: none; }
  .main-content { margin-left: 60px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .form-preview { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
}

@media (max-width: 768px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-panel-left { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .role-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-group-span-2 { grid-column: span 1; }
  .settings-layout { grid-template-columns: 1fr; }
  .verify-result { flex-direction: column; }
  .verify-data-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar-date { display: none; }
}
