/* ═══════════════════════════════════════════════════════════════════
   TEA-HR  |  Design System
   Aesthetic: Letshego-inspired — dark navy navbar, gold accents,
   white cards, DM Sans body, DM Serif Display headings
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  --navy:        #1A2235;
  --navy-deep:   #111827;
  --navy-hover:  #243047;
  --gold:        #C9A84C;
  --gold-light:  #E2C97E;
  --gold-dim:    rgba(201,168,76,.15);
  --white:       #FFFFFF;
  --bg:          #F4F6FA;
  --surface:     #FFFFFF;
  --border:      #E2E8F0;
  --border-dark: #CBD5E1;
  --text:        #1A2235;
  --text-muted:  #64748B;
  --text-light:  #94A3B8;

  --green:       #16A34A;
  --green-bg:    #DCFCE7;
  --red:         #DC2626;
  --red-bg:      #FEE2E2;
  --amber:       #D97706;
  --amber-bg:    #FEF3C7;
  --blue:        #2563EB;
  --blue-bg:     #DBEAFE;
  --grey:        #64748B;
  --grey-bg:     #F1F5F9;

  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);

  --nav-h:       64px;
  --sidebar-w:   240px;
  --font:        'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display:'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font-family: var(--font);
  font-size: 0.9rem;
}
img { max-width: 100%; display: block; }

/* ── TOPNAV ─────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--navy-deep);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.3px;
  flex-shrink: 0;
}
.navbar-brand .brand-icon {
  width: 34px;
  height: 34px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--navy-deep);
  font-family: var(--font-display);
}
.navbar-brand .brand-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.18);
}
.navbar-brand .brand-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255,255,255,.45);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 1px;
}

.navbar-spacer { flex: 1; }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.8);
  font-size: 0.85rem;
}
.navbar-user .user-name { font-weight: 500; }
.navbar-user .user-role {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.btn-logout {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 90;
  border-right: 1px solid rgba(255,255,255,.05);
}

.sidebar-section {
  padding: 20px 0 8px;
}
.sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 0 20px 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: 0.875rem;
  font-weight: 400;
  transition: all .15s;
  cursor: pointer;
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
}
.sidebar-item.active {
  background: rgba(201,168,76,.12);
  color: var(--gold-light);
  border-left-color: var(--gold);
  font-weight: 500;
}
.sidebar-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-item .badge-count {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 0.72rem;
  color: rgba(255,255,255,.25);
}

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

.page-header {
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── CARDS ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  margin-bottom: 16px;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.card-body { padding: 0 24px 24px; }

/* ── KPI CARDS ───────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.kpi-meta {
  font-size: 0.78rem;
  color: var(--text-light);
}
.kpi-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  opacity: .06;
}

/* ── TABLES ──────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  background: #F8FAFC;
  text-align: left;
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F8FAFC; }
tbody tr { transition: background .12s; }

/* ── BADGES ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-pending  { background: var(--amber-bg);  color: var(--amber); }
.badge-approved { background: var(--green-bg);  color: var(--green); }
.badge-rejected { background: var(--red-bg);    color: var(--red);   }
.badge-cancelled{ background: var(--grey-bg);   color: var(--grey);  }
.badge-active   { background: var(--green-bg);  color: var(--green); }
.badge-inactive { background: var(--grey-bg);   color: var(--grey);  }
.badge-on_leave { background: var(--amber-bg);  color: var(--amber); }
.badge-terminated{ background: var(--red-bg);   color: var(--red);   }
.badge-gold     { background: var(--gold-dim);  color: var(--gold);  }

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy-deep);
}
.btn-primary:hover { background: var(--gold-light); }
.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover { background: var(--navy-hover); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-dark);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }
.btn-success {
  background: var(--green);
  color: #fff;
}
.btn-success:hover { background: #15803D; }
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #B91C1C; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* ── FORMS ───────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}
.form-full { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
}
.field-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: -2px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
textarea { resize: vertical; min-height: 80px; }
.select-wrap { position: relative; }

/* ── AVATAR ──────────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  background: var(--navy);
  color: var(--gold);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-md  { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar-lg  { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl  { width: 72px; height: 72px; font-size: 1.4rem; font-family: var(--font-display); }

/* ── ALERTS ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert-error   { background: var(--red-bg);   color: var(--red);   border-color: #FECACA; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #BBF7D0; }
.alert-info    { background: var(--blue-bg);  color: var(--blue);  border-color: #BFDBFE; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: #FDE68A; }

/* ── DIVIDERS ────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── TOOLBAR ─────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar-left  { display: flex; align-items: center; gap: 10px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

/* ── SEARCH ──────────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
}
.search-wrap input {
  padding-left: 36px;
  width: 260px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── DETAIL ROWS ─────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:nth-child(odd)  { padding-right: 24px; border-right: 1px solid var(--border); }
.detail-row:nth-child(even) { padding-left: 24px; }
.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.detail-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 400;
}

/* ── LEAVE BALANCE BARS ──────────────────────────────────────────── */
.balance-item {
  margin-bottom: 14px;
}
.balance-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 5px;
}
.balance-name { font-weight: 500; }
.balance-days { color: var(--text-muted); }
.balance-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.balance-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width .4s ease;
}
.balance-fill.low  { background: var(--red); }
.balance-fill.mid  { background: var(--amber); }

/* ── TABS ────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── FILTER CHIPS ────────────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-dark);
  color: var(--text-muted);
  background: var(--white);
  transition: all .15s;
}
.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip.active { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); font-weight: 600; }

/* ── EMPTY STATE ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: .35; }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-sub { font-size: 0.875rem; }

/* ── LOGIN PAGE ──────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 440px;
  background: var(--bg);
}
.login-left {
  background: var(--navy-deep);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.18) 0%, transparent 70%);
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.10) 0%, transparent 70%);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
  position: relative;
  z-index: 1;
}
.login-logo-icon {
  width: 44px; height: 44px;
  background: var(--gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy-deep);
}
.login-logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}
.login-heading {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.login-heading span { color: var(--gold); }
.login-sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,.5);
  max-width: 380px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}
.login-right {
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  box-shadow: -4px 0 24px rgba(0,0,0,.06);
}
.login-form-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.login-form-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}
.login-fields { display: flex; flex-direction: column; gap: 18px; }
.login-submit {
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background .18s;
}
.login-submit:hover { background: var(--navy-hover); }

/* ── UTILITIES ───────────────────────────────────────────────────── */
.flex        { display: flex; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }
.text-sm    { font-size: 0.8rem; }
.text-muted { color: var(--text-muted); }
.text-gold  { color: var(--gold); }
.font-medium{ font-weight: 500; }
.font-semi  { font-weight: 600; }
.truncate   { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── ANIMATIONS ──────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kpi-card { animation: fadeUp .3s ease both; }
.kpi-card:nth-child(1) { animation-delay: .04s; }
.kpi-card:nth-child(2) { animation-delay: .08s; }
.kpi-card:nth-child(3) { animation-delay: .12s; }
.kpi-card:nth-child(4) { animation-delay: .16s; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 12px 0 0;
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: rgba(0,0,0,.45);
  z-index: 80;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: min(280px, 85vw); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-overlay { display: block; }
  .navbar-brand .brand-sub, .navbar-user .user-name, .navbar-user .user-role { display: none; }
  .content { margin-left: 0; padding: 20px 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-row:nth-child(odd) { border-right: none; padding-right: 0; }
  .detail-row:nth-child(even) { padding-left: 0; }
}

@media (max-width: 480px) {
  .navbar { padding: 0 12px; }
  .navbar-brand .brand-sep, .navbar-brand > div:last-child { display: none; }
  .navbar-user { gap: 8px; }
  .btn-logout { padding: 5px 10px; }
}

/* ── SCROLLBAR HIDE ──────────────────────────────────────────────── */
html, body, .sidebar, .content, * {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ── BACK BUTTON ─────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
  cursor: pointer;
  transition: color .15s;
  background: none;
  border: none;
  padding: 0;
}
.back-btn:hover { color: var(--text); }
.back-btn::before { content: '←'; font-size: 0.9rem; }

/* ── STOCK STATUS INDICATORS ─────────────────────────────────────── */
.stock-ok      { color: var(--green); font-weight: 700; }
.stock-low     { color: var(--amber); font-weight: 700; }
.stock-out     { color: var(--red);   font-weight: 700; }

.stock-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stock-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.stock-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.stock-bar-fill.ok  { background: var(--green); }
.stock-bar-fill.low { background: var(--amber); }
.stock-bar-fill.out { background: var(--red);   }

/* ── STAT BLOCKS (inventory view) ────────────────────────────────── */
.stat-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
}
.stat-block-value {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-block-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── BADGE EXTRA COLOURS ─────────────────────────────────────────── */
.badge-success  { background: var(--green-bg); color: var(--green); }
.badge-warning  { background: var(--amber-bg); color: var(--amber); }
.badge-danger   { background: var(--red-bg);   color: var(--red);   }
.badge-info     { background: var(--blue-bg);  color: var(--blue);  }
.badge-secondary{ background: var(--grey-bg);  color: var(--grey);  }
.badge-primary  { background: var(--gold-dim); color: var(--gold);  }

/* ── FIELD GRID ──────────────────────────────────────────────────── */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-full { grid-column: 1 / -1; }
.field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── MONO ────────────────────────────────────────────────────────── */
.mono {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── TAB BAR ─────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── MISC ────────────────────────────────────────────────────────── */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.bg-subtle { background: var(--bg); }
.btn-icon-danger {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background .15s;
}
.btn-icon-danger:hover { background: var(--red-bg); }
.btn-warning { background: var(--amber); color: var(--navy-deep); }
.btn-warning:hover { background: #B45309; }