/* ==========================================================
   TOVAPAY — Brand CSS
   Brand: deep forest green #1F7A6C · gold #CFAF6E · off-white #F7F7F5
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --primary:        #1F7A6C;
  --primary-dark:   #14584e;
  --primary-light:  #e8f5f3;
  --gold:           #CFAF6E;
  --gold-dark:      #b8953d;
  --beige:          #E6D8C3;
  --off-white:      #F7F7F5;
  --charcoal:       #2C2C2C;
  --gray-100:       #f1f1f1;
  --gray-200:       #e5e7eb;
  --gray-300:       #d1d5db;
  --gray-500:       #6b7280;
  --gray-700:       #374151;
  --success:        #3cb371;
  --danger:         #d9534f;
  --warning:        #e6a817;
  --info:           #0891b2;

  --radius:         10px;
  --shadow-soft:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.12);
  --transition:     0.25s ease;
  --font:           'Inter', 'Segoe UI', system-ui, sans-serif;
  --header-h:       75px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--charcoal);
  background: var(--off-white);
  min-height: 100vh;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

/* Fixed header spacer — auth pages suppress the header so no padding needed */
body:not(.auth-page) {
  padding-top: var(--header-h);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-dark); }

h1, h2, h3, h4 { color: var(--primary); font-weight: 700; }

/* ── Site Header (fixed, white) ─────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 1000;
  background: rgba(247,247,245,.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: var(--shadow-soft);
}

/* ── Logo ───────────────────────────────────────────────────── */
.site-logo {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img { max-width: 120px; height: auto; max-height: 44px; }

.logo-fallback {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-bottom: 10px;
  flex-shrink: 0;
}

/* ── Site Nav ───────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
}

.site-nav a {
  font-size: .845rem;
  color: var(--charcoal);
  font-weight: 600;
  text-decoration: none;
  padding: .5rem .9rem;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}

.site-nav a:hover {
  background: rgba(31,122,108,.08);
  color: var(--primary);
  text-decoration: none;
}

/* Active link — add class "active" to current page link */
.site-nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Login / Logout CTA button in nav */
.site-nav a.nav-btn {
  background: var(--primary);
  color: var(--gold);
  padding: .5rem 1.1rem;
  border-radius: 8px;
  margin-left: .25rem;
}

.site-nav a.nav-btn:hover {
  background: var(--primary-dark);
  color: var(--gold);
}

/* ── Hamburger toggle ───────────────────────────────────────── */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--charcoal);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Main content wrapper ───────────────────────────────────── */
.main-content {
  min-height: calc(100vh - var(--header-h));
}

/* Flash container inside admin/portal pages */
.flash-wrap {
  padding: .75rem 1.5rem 0;
  max-width: 1300px;
  margin: 0 auto;
}

/* Admin page layout constraints */
body.admin-page .main-content,
body.portal-page .main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
}

body.admin-page .flash-wrap,
body.portal-page .flash-wrap {
  padding: 0 0 1rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
}

.card-header {
  padding: .9rem 1.35rem;
  font-weight: 600;
  font-size: .875rem;
  color: var(--primary);
  border-bottom: 1px solid var(--gray-200);
  background: var(--off-white);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-header::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

.card-body { padding: 1.35rem; }

/* ── Grid utilities ─────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ── Stats ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.25rem;
  border: 1px solid rgba(0,0,0,0.04);
  border-top: 3px solid var(--beige);
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.success { border-top-color: var(--success); }
.stat-card.danger  { border-top-color: var(--danger); }
.stat-card.warning { border-top-color: var(--warning); }
.stat-card.info    { border-top-color: var(--primary); }

.stat-icon  { font-size: 1.3rem; color: var(--primary); margin-bottom: .35rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--charcoal); line-height: 1.2; }
.stat-label { font-size: .75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .6px; margin-top: .2rem; }

/* ── Tables ─────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: #fff;
}

.table th {
  text-align: left;
  padding: .7rem 1rem;
  background: var(--charcoal);
  color: #fff;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .4px;
}

.table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--charcoal);
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--primary-light); }
.table-sm th, .table-sm td { padding: .5rem .75rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  min-height: 2.5rem;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: var(--gold) !important;
  box-shadow: var(--shadow-soft);
  border: none;
}
.btn-primary:hover { background: var(--primary-dark); color: var(--gold) !important; }

.btn-gold {
  background: var(--gold);
  color: var(--primary-dark);
  box-shadow: var(--shadow-soft);
}
.btn-gold:hover { background: var(--gold-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b02a27; }

.btn-sm { padding: .35rem .7rem; font-size: .78rem; min-height: auto; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Bootstrap btn-primary override */
.btn.btn-primary,
button.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--gold) !important;
}
.btn.btn-primary:hover,
button.btn-primary:hover {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: .825rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: .375rem;
}

.form-control {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .875rem;
  color: var(--charcoal);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  height: 2.75rem;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,122,108,.15);
}

textarea.form-control { resize: vertical; min-height: 80px; height: auto; }
select.form-control { cursor: pointer; }

/* ── Flash / Alert ──────────────────────────────────────────── */
.alert {
  padding: .8rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: .5rem;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.alert-success { background: #d9f5df; color: #1a6b33; border-left: 4px solid var(--success); }
.alert-danger  { background: #fde8e8; color: #8b1a1a; border-left: 4px solid var(--danger); }
.alert-error   { background: #fde8e8; color: #8b1a1a; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3d0; color: #7a4a00; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); border-left: 4px solid var(--primary); }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-bar .form-control { flex: 1; min-width: 200px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .22em .7em;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: capitalize;
  background: var(--gray-200);
  color: var(--gray-700);
}

.badge-active, .badge-completed, .badge-paid, .badge-sent
  { background: #d9f5df; color: #1a6b33; }
.badge-suspended, .badge-failed, .badge-cancelled, .badge-terminated
  { background: #fde8e8; color: #8b1a1a; }
.badge-overdue, .badge-urgent, .badge-high
  { background: #fef3d0; color: #7a4a00; }
.badge-pending, .badge-partial, .badge-open
  { background: var(--primary-light); color: var(--primary-dark); }
.badge-in_progress { background: #ede9fe; color: #5b21b6; }
.badge-mpesa  { background: #d9f5df; color: #1a6b33; }
.badge-cash   { background: #f0fdf4; color: #15803d; }
.badge-bank   { background: var(--primary-light); color: var(--primary-dark); }
.badge-superadmin { background: #fef3d0; color: #7a4a00; }
.badge-admin  { background: var(--primary-light); color: var(--primary-dark); }
.badge-medium { background: #e0f2fe; color: #0c4a6e; }
.badge-low    { background: var(--gray-100); color: var(--gray-500); }

/* ── Page header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 1.25rem;
}

/* ── Detail list ────────────────────────────────────────────── */
.detail-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .6rem .85rem;
  font-size: .875rem;
}
.detail-list dt { color: var(--primary); font-weight: 600; white-space: nowrap; }
.detail-list dd { color: var(--charcoal); }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--off-white), var(--beige));
  padding: 0;
}

.auth-page .main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* ── Simple auth card (OTP, change-password, small forms) ── */
.auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--gray-200);
}

.auth-logo { text-align: center; margin-bottom: 1rem; }
.auth-logo-img { height: 52px; width: auto; }

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.auth-logo-text .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  margin-bottom: 10px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
}

.auth-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--gray-500);
  line-height: 1.8;
}

/* ── Split auth card (login pages — logo panel + form) ─────── */
.auth-split {
  width: 100%;
  max-width: 860px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.10);
  overflow: hidden;
  display: flex;
  border: 1px solid var(--gray-200);
}

/* Left brand panel — off-white, NOT green */
.auth-brand {
  width: 42%;
  flex-shrink: 0;
  background: var(--off-white);
  border-right: 1px solid var(--gray-200);
  padding: 3rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand-logo { margin-bottom: 1.5rem; }
.auth-brand-logo img { height: 48px; width: auto; }

.auth-brand-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--charcoal);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: .3em .85em;
  border-radius: 20px;
  margin-bottom: 1.1rem;
}

.auth-brand h2 {
  color: var(--charcoal);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: .6rem;
  text-align: left;
}

.auth-brand h2 span { color: var(--primary); }

.auth-brand p {
  color: var(--gray-500);
  font-size: .875rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .75rem;
  font-size: .875rem;
  color: var(--charcoal);
  font-weight: 500;
}

.auth-feature i {
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* Right form panel */
.auth-form {
  flex: 1;
  padding: 3rem 2.5rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form h3 {
  color: var(--charcoal);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: .35rem;
  text-align: left;
}

.auth-form .auth-sub {
  color: var(--gray-500);
  font-size: .875rem;
  margin-bottom: 1.75rem;
}

/* Input groups with icons */
.auth-input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
}

.auth-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,122,108,.12);
}

.auth-input-group .input-icon {
  display: flex;
  align-items: center;
  padding: 0 .85rem;
  color: var(--primary);
  font-size: 1rem;
  background: var(--off-white);
  border-right: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.auth-input-group input {
  flex: 1;
  border: none;
  outline: none;
  padding: .75rem .9rem;
  font-family: var(--font);
  font-size: .875rem;
  color: var(--charcoal);
  background: transparent;
  height: 2.9rem;
}

.auth-input-group .pw-toggle {
  display: flex;
  align-items: center;
  padding: 0 .85rem;
  background: none;
  border: none;
  border-left: 1px solid var(--gray-200);
  cursor: pointer;
  color: var(--gray-500);
  font-size: .95rem;
  transition: color .2s;
}

.auth-input-group .pw-toggle:hover { color: var(--primary); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--gray-300);
  font-size: .78rem;
  margin: 1.25rem 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
  font-size: .825rem;
}

.auth-links a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }

.auth-footer-note {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
  text-align: center;
  font-size: .8rem;
  color: var(--gray-500);
}
.auth-footer-note a { color: var(--primary); font-weight: 600; }

/* Hide brand panel on small screens */
@media (max-width: 767px) {
  .auth-split { flex-direction: column; max-width: 440px; }
  .auth-brand { display: none; }
  .auth-form { padding: 2.25rem 1.75rem; }
}

.otp-input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: .6rem;
  font-weight: 700;
}

/* ── Notification items ─────────────────────────────────────── */
.notification-item { padding: 1rem 0; border-bottom: 1px solid var(--gray-100); }
.notification-item:last-child { border-bottom: none; }
.notification-meta { display: flex; gap: .75rem; align-items: center; margin-bottom: .35rem; }
.notification-subject { font-weight: 600; color: var(--charcoal); margin-bottom: .25rem; }
.notification-body { color: var(--gray-500); font-size: .875rem; }

/* ── Error pages ────────────────────────────────────────────── */
.error-page { text-align: center; padding: 5rem 1rem; }
.error-code { font-size: 5.5rem; font-weight: 800; color: var(--beige); line-height: 1; }
.error-msg  { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: .5rem 0 1rem; }

/* ── Public pages ───────────────────────────────────────────── */

/* Section wrappers */
.pub-section     { padding: 5rem 0; }
.pub-section-alt { background: var(--off-white); }
.pub-section-full { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; }

/* Hero */
.pub-hero {
  background: linear-gradient(135deg, var(--off-white), var(--beige));
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 5rem 0 4rem;
}

/* Gold badge label */
.pub-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--charcoal);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: .3em .9em;
  border-radius: 20px;
  margin-bottom: 1rem;
}

/* Public buttons */
.btn-tova         { background: var(--primary); color: var(--gold); border: none; font-weight: 600; }
.btn-tova:hover   { background: var(--primary-dark); color: var(--gold); text-decoration: none; }

.btn-outline-tova         { background: transparent; color: var(--primary); border: 2px solid var(--primary); font-weight: 600; }
.btn-outline-tova:hover   { background: var(--primary); color: #fff; text-decoration: none; }

/* Feature cards */
.feature-card { border: 1px solid var(--gray-200) !important; border-radius: 20px; transition: var(--transition); }
.feature-card:hover { transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0,0,0,.08); }

/* Circular icon box */
.icon-box { width: 70px; height: 70px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; margin: auto; }
.icon-box i { font-size: 1.75rem; color: var(--primary); }

/* Mission / Vision / Values cards */
.mv-card { border: 1px solid var(--gray-200); border-radius: 18px; box-shadow: var(--shadow-soft);
  transition: var(--transition); background: #fff; }
.mv-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.mv-card .pub-icon { font-size: 2.5rem; color: var(--primary); }

/* Trust stat cards */
.trust-card { background: #fff; border-radius: 20px; padding: 2.25rem 1.5rem; text-align: center;
  height: 100%; border: 1px solid var(--gray-200); transition: var(--transition); box-shadow: var(--shadow-soft); }
.trust-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.trust-card h2 { color: var(--primary); }

/* Lordicon / trust icon wrapper */
.icon-wrapper { width: 90px; height: 90px; margin: 0 auto 1.25rem; display: flex;
  align-items: center; justify-content: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), rgba(207,175,110,.12)); }

/* CTA banner — charcoal background, NOT green */
.cta-section { background: var(--charcoal); border-radius: 20px; }

/* Floating badge overlay on images */
.img-float-badge { position: absolute; bottom: 1.25rem; left: 1.25rem; background: #fff;
  padding: .7rem 1rem; border-radius: 14px; box-shadow: var(--shadow-md); }
.img-float-badge h6 { color: var(--primary); margin-bottom: .15rem; font-weight: 700; font-size: .875rem; }

/* Contact / about form card */
.pub-contact-card { background: #fff; border: 1px solid var(--gray-200);
  border-radius: 20px; box-shadow: var(--shadow-md); }

/* Public footer */
.pub-footer { background: #fff; border-top: 1px solid var(--gray-200); padding: 2rem 0; text-align: center; }

/* ── Utilities ──────────────────────────────────────────────── */
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.ml-2 { margin-left: .5rem; }
.text-muted  { color: var(--gray-500) !important; }
.text-center { text-align: center; }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--primary); }

code {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: .1em .4em;
  border-radius: 5px;
  font-size: .85em;
  font-family: 'Consolas', 'Monaco', monospace;
}

hr { border: none; border-top: 1px solid var(--gray-200); margin: 1.25rem 0; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--off-white); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ── Mobile nav ─────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .site-header { padding: 0 1rem; }

  .menu-toggle { display: flex; }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: #fff;
    border-bottom: 2px solid var(--beige);
    box-shadow: var(--shadow-md);
    z-index: 999;
    padding: .5rem 0;
  }

  .site-nav.open { display: flex; }

  .site-nav a {
    padding: .85rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: .9rem;
    width: 100%;
  }

  .site-nav a:last-child { border-bottom: none; }

  .site-nav a.nav-btn {
    margin: .5rem 1rem;
    border-radius: 8px;
    text-align: center;
    width: calc(100% - 2rem);
  }
}

/* ── Responsive admin/portal ────────────────────────────────── */
@media (max-width: 1024px) {
  body.admin-page .main-content,
  body.portal-page .main-content { padding: 1.25rem 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body.admin-page .main-content,
  body.portal-page .main-content { padding: 1rem .75rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .auth-card { padding: 2rem 1.25rem; }
  .btn-group { flex-wrap: wrap; }
  .table { font-size: .8rem; }
  .table th, .table td { padding: .6rem .6rem; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { margin: 0 .5rem; }
}

/* ── Ticket thread ─────────────────────────────────────────── */
.ticket-note {
  border-left: 3px solid var(--gold);
  background: #fffbf0;
}

.ticket-reply-support {
  border-left: 3px solid var(--primary);
  background: #f4faf9;
}

.ticket-reply-customer {
  border-left: 3px solid var(--gray-300);
}

.badge-open       { background: #e8f4fd; color: #1a6fa8; }
.badge-assigned   { background: #fff3cd; color: #856404; }
.badge-in_progress { background: #cce5ff; color: #004085; }
.badge-resolved   { background: #d4edda; color: #155724; }
.badge-closed     { background: #e2e3e5; color: #383d41; }
.badge-critical   { background: #f8d7da; color: #721c24; }
.badge-high       { background: #ffeeba; color: #856404; }
.badge-medium     { background: #d1ecf1; color: #0c5460; }
.badge-low        { background: #e2e3e5; color: #383d41; }

/* ── Ticket attachments ────────────────────────────────────── */
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25em .7em;
  background: var(--off-white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: .78rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: background .15s;
}
.attachment-chip:hover { background: var(--beige); color: var(--primary); }

.attach-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3em .85em;
  border: 1.5px dashed var(--gray-300);
  border-radius: 8px;
  font-size: .82rem;
  color: var(--gray-500);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.attach-label:hover { border-color: var(--primary); color: var(--primary); }

/* ── Accounting module ─────────────────────────────────────── */
.acct-section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: .6rem;
}

.card-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.stat-sub {
  font-size: .75rem;
  color: var(--gray-500);
  margin-top: .2rem;
}

.text-success { color: #28a745 !important; }
.text-danger  { color: var(--danger) !important; }

@media print {
  .site-header, .page-header .btn, .card:last-child .btn { display: none !important; }
}
