/* FastLabel - Premium European Design System */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;600;700&family=Lexend+Deca:wght@300;400;500;600;700&display=swap');

:root {
  --navy:      #0F1738;
  --navy-90:   #1a2550;
  --navy-80:   #1e2d5e;
  --gold:      #CCAA6F;
  --gold-light:#DFC08A;
  --gold-pale: #F5EDDB;
  --cream:     #FAF7F2;
  --white:     #FFFFFF;
  --gray-50:   #F8F9FB;
  --gray-100:  #EEF0F5;
  --gray-200:  #D8DCE8;
  --gray-400:  #8E96AD;
  --gray-600:  #5A6175;
  --gray-800:  #2E3347;
  --danger:    #C0392B;
  --danger-bg: #FDECEA;
  --success:   #1A7A4A;
  --success-bg:#E8F7EF;
  --warning:   #C47A00;
  --warning-bg:#FFF8E6;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Lexend Deca', system-ui, sans-serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 3px rgba(15,23,56,.06);
  --shadow-sm: 0 2px 8px rgba(15,23,56,.08);
  --shadow:    0 4px 20px rgba(15,23,56,.10);
  --shadow-lg: 0 8px 40px rgba(15,23,56,.14);
  --shadow-xl: 0 20px 60px rgba(15,23,56,.18);

  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --sidebar-w: 240px;
}

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

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── LAYOUT ── */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, #fff8ec 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  display: block;
}

.logo-sub {
  font-size: 9px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(204,170,111,.55);
  margin-top: 4px;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 18px 24px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 24px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,.05);
  border-left-color: rgba(204,170,111,.4);
}

.nav-item.active {
  color: var(--gold);
  background: rgba(204,170,111,.1);
  border-left-color: var(--gold);
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--navy-80) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,.38); text-transform: uppercase; letter-spacing: .08em; }

.btn-logout {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.35);
  transition: color var(--transition);
  padding: 4px;
  display: flex; align-items: center;
}
.btn-logout:hover { color: #e74c3c; }

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 90;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  flex: 1;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .01em;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px;
  color: var(--navy);
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: 60px;
  padding: 32px;
  min-height: calc(100vh - 60px);
  max-width: 1400px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1;
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(15,23,56,.22);
}
.btn-primary:hover {
  background: var(--navy-80);
  box-shadow: 0 4px 16px rgba(15,23,56,.3);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #b8922f 100%);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(204,170,111,.4);
}
.btn-gold:hover {
  box-shadow: 0 4px 18px rgba(204,170,111,.55);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--gray-200);
}
.btn-outline:hover {
  border-color: var(--navy);
  background: var(--gray-50);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { background: #a93226; }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  padding: 7px 12px;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--navy); }

.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }

.btn-print {
  background: linear-gradient(135deg, var(--gold) 0%, #a87c20 100%);
  color: var(--white);
  padding: 11px 22px;
  font-size: 14px;
  box-shadow: 0 3px 14px rgba(168,124,32,.45);
}
.btn-print:hover {
  box-shadow: 0 6px 22px rgba(168,124,32,.6);
  transform: translateY(-2px);
}
.btn-print svg { width: 17px; height: 17px; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #3d4460;
  margin-bottom: 7px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--white);
  border: 1.5px solid var(--gray-300, #c4c9d8);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: #1a1f36;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(204,170,111,.15);
}

.form-control::placeholder { color: #9aa0b8; }

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

.input-group {
  display: flex;
  align-items: center;
}
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); }
.input-addon {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 12px;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-left: none;
  font-size: 12.5px;
  color: var(--gray-600);
  white-space: nowrap;
}
.input-addon:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-right-width: 1.5px; }

.stepper-group {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}
.stepper-group .form-control {
  border: none;
  text-align: center;
  border-radius: 0;
  box-shadow: none;
  width: 70px;
  flex: 1;
}
.stepper-group .form-control:focus { box-shadow: none; }
.stepper-btn {
  width: 38px; height: 40px;
  background: var(--gray-50);
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--navy);
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
  font-weight: 300;
}
.stepper-btn:hover { background: var(--gray-100); }
.stepper-btn:first-child { border-right: 1.5px solid var(--gray-200); }
.stepper-btn:last-child  { border-left: 1.5px solid var(--gray-200); }

.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

/* Inline grid for form rows */
.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .01em;
}

.card-body { padding: 20px 24px 24px; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .01em;
  line-height: 1.1;
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ── GRID LAYOUTS ── */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── LAYOUT / TEMPLATE CARDS ── */
.tpl-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.tpl-card:hover {
  border-color: var(--gold-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tpl-preview {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 12px;
}

.preview-iframe-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-iframe-wrap iframe {
  border: none;
  transform-origin: center center;
  pointer-events: none;
  flex-shrink: 0;
}

.tpl-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.tpl-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tpl-meta { font-size: 11.5px; color: var(--gray-400); margin-bottom: 12px; flex: 1; }

.tpl-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tpl-actions .btn-print { padding: 8px 16px; font-size: 13px; }

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-navy { background: rgba(15,23,56,.08); color: var(--navy); }
.badge-gold { background: rgba(204,170,111,.18); color: #8B6914; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gray-400);
  border-bottom: 1.5px solid var(--gray-100);
  background: var(--gray-50);
}
tbody td {
  padding: 13px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(192,57,43,.15); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(26,122,74,.15); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(196,122,0,.15); }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,56,.55);
  backdrop-filter: blur(3px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform var(--transition);
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal.modal-lg { max-width: 800px; }
.modal.modal-xl { max-width: 1100px; }

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400);
  transition: color var(--transition);
  padding: 4px;
  font-size: 22px;
  line-height: 1;
  display: flex; align-items: center;
}
.modal-close:hover { color: var(--navy); }

.modal-body { padding: 20px 28px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--gray-100);
}

/* ── SEARCH ── */
.search-wrap {
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 16px; height: 16px;
  pointer-events: none;
}
.search-wrap input {
  padding-left: 38px;
}

/* ── PRINT PREVIEW ── */
.print-preview-frame {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 2px dashed var(--gray-200);
}

.print-preview-frame iframe {
  border: none;
  box-shadow: var(--shadow-lg);
}

/* ── PRINT HISTORY LIST ── */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  border: 1.5px solid transparent;
}
.history-item:hover { background: var(--gray-50); border-color: var(--gray-200); }
.history-item.selected { background: rgba(204,170,111,.08); border-color: var(--gold); }

.history-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.history-info { flex: 1; min-width: 0; }
.history-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.history-dates { font-size: 11px; color: var(--gray-400); }

/* ── UPLOAD ZONE ── */
.upload-zone {
  display: block;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
  user-select: none;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-pale);
}
.upload-zone .upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { font-size: 13.5px; color: var(--gray-600); }
.upload-zone strong { color: var(--navy); }
.upload-zone input[type=file] { display: none; }

/* ── SETTINGS GRID ── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state h3 {
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.empty-state p { font-size: 13.5px; }

/* ── TABS ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 24px;
  gap: 4px;
}
.tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-400);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--navy); background: var(--gray-50); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--gray-100);
  margin: 24px 0;
}

/* ── NOTIFICATIONS ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  min-width: 280px;
  max-width: 360px;
  transform: translateX(120%);
  transition: transform 300ms cubic-bezier(.34,1.56,.64,1);
  pointer-events: all;
  border-left: 4px solid var(--gray-200);
}
.toast.show { transform: translateX(0); }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 16px; padding: 2px; line-height: 1; }

/* ── SEPARATOR LABEL ── */
.sep-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray-400);
  font-weight: 600;
  margin: 20px 0;
}
.sep-label::before, .sep-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-100);
}

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(204,170,111,.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(204,170,111,.08) 0%, transparent 60%);
}

.login-card {
  position: relative;
  background: var(--navy);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,.08);
}

/* Override form inputs inside login card to dark theme */
.login-card .form-label {
  color: rgba(255,255,255,.6);
}
.login-card .form-control {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.15);
  color: var(--white);
}
.login-card .form-control:focus {
  background: rgba(255,255,255,.1);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(204,170,111,.2);
}
.login-card .form-control::placeholder { color: rgba(255,255,255,.3); }
.login-card label[for="remember"] { color: rgba(255,255,255,.55) !important; }
.login-card .alert-danger {
  background: rgba(192,57,43,.2);
  border-color: rgba(192,57,43,.4);
  color: #f5a99a;
}
.login-card p { color: rgba(255,255,255,.3) !important; }

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-text { font-size: 40px; display: inline-block; }
.login-logo .logo-sub {
  color: rgba(204,170,111,.55);
  -webkit-text-fill-color: rgba(204,170,111,.55);
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
}
.stat-card.gold::before { background: var(--gold); }
.stat-card.navy::before { background: var(--navy); }
.stat-card.success::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }

.stat-value {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--gray-400); margin-top: 4px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }

  .topbar { left: 0; padding: 0 16px; }
  .hamburger { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
  }

  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }

  .modal { border-radius: var(--radius-lg); }
  .login-card { padding: 28px 24px; }
  .page-title { font-size: 26px; }

  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
    display: none;
  }
  .sidebar-overlay.open { display: block; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .tpl-actions { flex-direction: column; align-items: stretch; }
  .tpl-actions .btn { justify-content: center; }
}

/* ── PRINT STYLES ── */
@media print {
  .sidebar, .topbar, .page-header, #toast-container { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  body { background: white; }
}

/* ── MISC UTILITIES ── */
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.text-muted { color: var(--gray-400); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 12.5px; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
