/* =============================================================================
   TrafficTrack – Minimal CSS (Only what's used today)
   Sections:
   1) Variables & Base
   2) Public Layout (nav, main, footer)
   3) Buttons (global)
   4) Forms (global)
   5) Modal (global)
   6) Landing Page (/, public)
   7) Auth Page (/signin)
   8) Dashboard Shell (sidebar/header/content)
   9) KPI Cards (dashboard)
   10) Tables & Data UI (dashboard)
============================================================================= */

/* ===== 1) VARIABLES & BASE ================================================== */
:root{
  --bg:#ffffff;
  --panel:#14141a;
  --text:#e7e7ee;
  --muted:#a3a3b2;
  --brand:#66c2ff;
  --brand-strong:#2aa6ff;
  --line:#23232a;

  --tfx-accent:#1e4d8b;
  --tfx-accent-600:#184373;
  --tfx-accent-50:#f5f8ff;
  --tfx-accent-75:#eef4ff;
  --tfx-border:#e5effa;
  --tfx-border-soft:#eef2f7;
  --tfx-text:#333;

  --input-bg:#ffffff;
  --input-text:#1f2937;
  --input-border:#d0d7e2;
  --input-placeholder:#9aa4b2;
  --input-focus:#1e4d8b;

  --radius:16px;
  --radius-sm:10px;
  --pad:16px;
  --gap:12px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

body.tt-body{
  background:var(--bg);
  color:var(--text);
  font:15px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Helvetica Neue",Arial,sans-serif;
}

.visually-hidden{
  position:absolute !important;
  height:1px; width:1px;
  overflow:hidden;
  clip:rect(1px,1px,1px,1px);
  white-space:nowrap;
}

/* Currency prefix helper */
.tfx-money{
  text-align:left;
  font-variant-numeric: tabular-nums;
}
.tfx-money::before{
  content:"Le ";
  margin-right:2px;
  color:#6b7280;
  font-weight:600;
}

/* ===== 2) PUBLIC LAYOUT (nav, main, footer shell) ========================== */
.tt-nav{
  position:sticky; top:0; z-index:50;
  background:rgba(20,20,26,.9); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.tt-nav-inner{
  max-width:1100px; margin:0 auto;
  display:flex; align-items:center; gap:20px;
  padding:12px var(--pad);
}
.tt-brand{font-weight:700}
.tt-links a{margin-right:14px; opacity:.9}
.tt-links a:hover{opacity:1}
.tt-spacer{margin-left:auto}

.tt-main{max-width:1100px; margin:32px auto; padding:0 var(--pad)}
.tt-footer{
  border-top:1px solid var(--line);
  color:var(--muted); text-align:center;
  padding:24px var(--pad);
}

/* ===== 3) BUTTONS (global) ================================================= */
.tt-btn{
  display:inline-block;
  padding:10px 16px;
  border-radius:var(--radius);
  border:1px solid var(--line);
  background:#fff;
  color:#111827;
}
.tt-btn:hover{border-color:var(--brand); color:var(--brand)}
.tt-btn-primary{background:var(--brand); color:#081018; border:none}
.tt-btn-primary:hover{background:var(--brand-strong); color:#02060a}
.tt-btn-ghost{background:transparent}

/* Pill + outline variants */
.tt-btn.tt-pill{ border-radius:999px; padding:5px 15px; }

/* Neutral outline (Edit) */
.tt-btn.tt-outline{ color:#111827; border-color:#111827; background:#fff; }
.tt-btn.tt-outline:hover{ background:#f9fafb; }

/* Blue outline (Print) */
.tt-btn.tt-primary-outline{ color:var(--tfx-accent); border-color:var(--tfx-accent); background:#fff; }
.tt-btn.tt-primary-outline:hover{ background:var(--tfx-accent-50); }

/* Red outline (Delete) */
.tt-btn.tt-danger-outline{ color:#b91c1c; border-color:#f5c2c7; background:#fff; }
.tt-btn.tt-danger-outline:hover{ background:#fff5f5; }

/* ===== 4) FORMS ============================================================ */
form{ color:var(--input-text); }
label{display:grid; gap:6px; font-weight:600; color:var(--input-text);}
input,select,textarea{
  padding:10px; border-radius:var(--radius-sm);
  border:1px solid var(--input-border);
  background:var(--input-bg); color:var(--input-text);
}
input::placeholder, textarea::placeholder{ color:var(--input-placeholder); }
input:focus,select:focus,textarea:focus{
  outline:0; border-color:var(--input-focus);
  box-shadow:0 0 0 3px rgba(30,77,139,0.15);
}
input[type="number"]{appearance:textfield}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{appearance:none; margin:0}
.tt-main h1,.tt-main h2,.tt-main h3{ color:#1f2937; }

/* ===== 5) MODAL ============================================================ */
.modal{position:fixed; inset:0; background:rgba(0,0,0,.5); display:none; align-items:center; justify-content:center}
.modal.open{display:flex}
.modal-card{
  background:#fff; color:#1f2937; padding:var(--pad);
  border-radius:var(--radius-sm); width:min(680px,92vw);
  border:1px solid var(--tfx-border); box-shadow:0 10px 32px rgba(0,0,0,.15);
}
.grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--gap)}
.actions{display:flex; gap:8px; margin-top:12px}
.form-errors{background:#fff7e6; color:#92400e; padding:8px; border-radius:var(--radius-sm); margin-top:8px; border:1px solid #fde3b6}

/* ===== 6) LANDING PAGE (/, public) ======================================== */
/* Scope everything to .landing so it doesn’t affect the dashboard */
.landing { --top-nav-h: 40px; --main-nav-h: 64px; color:#333; line-height:1.6; }
.landing .tt-main { max-width:none; margin:0; padding:0; }

/* Top utility bar */
.landing .top-nav{ background:#666; color:#fff; padding:8px 0; font-size:14px; }
.landing .top-nav-container{
  max-width:1200px; margin:0 auto;
  display:flex; justify-content:space-between; align-items:center;
  padding:0 20px;
}
.landing .top-nav-left{ display:flex; gap:20px; }
.landing .top-nav-left a{ color:#fff; text-decoration:none; }
.landing .top-nav-left a:hover{ text-decoration:underline; }
.landing .top-nav-right{ display:flex; gap:15px; align-items:center; }
.landing .contact-btn{
  background:#f4c430; color:#333; padding:6px 15px; border-radius:4px; text-decoration:none; font-weight:bold; transition:background .3s ease;
}
.landing .contact-btn:hover{ background:#e6b82a; }

/* Main nav */
.landing .main-nav{
  background:#fff; padding:15px 0;
  box-shadow:0 2px 5px rgba(0,0,0,0.1);
  position:sticky; top:0; z-index:1000;
  margin-bottom: clamp(50px, 2vw, 28px);
}
.landing .main-nav-container{
  max-width:1200px; margin:0 auto;
  display:flex; justify-content:space-between; align-items:center;
  padding:0 20px;
}
.landing .logo{
  background:#1e4d8b; color:#fff; padding:8px 20px;
  border-radius:25px; font-size:20px; font-weight:bold; text-decoration:none;
}
.landing .main-nav-links{ display:flex; gap:40px; list-style:none; margin:0; padding:0; }
.landing .main-nav-links a{ color:#666; text-decoration:none; font-size:16px; font-weight:500; transition:color .3s ease; }
.landing .main-nav-links a:hover{ color:#1e4d8b; }



/* === Landing Hero (final) === */
/* === Landing Hero (final, consolidated) === */
.landing{
  --hero-title-color:#003366;
  --hero-sub-color:#333;
  --overlay-left: rgba(255,255,255,.96);
  --overlay-mid:  rgba(255,255,255,.78);
  --overlay-end:  rgba(255,255,255,0);
  --hero-left-gutter: 64px; /* left padding on desktop */
}

.landing .hero{
  position: relative;
  /* stable height across iPhone Safari; uses dynamic viewport units */
  min-height: clamp(520px, 64dvh, 760px);
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--hero-left-gutter);
  padding-right: 20px;
  display: flex; align-items: center;
  overflow: hidden;
  background: #fff;
}

/* soft overlay – text should sit ABOVE this */
.landing .hero::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, var(--overlay-left) 0%, var(--overlay-mid) 45%, var(--overlay-end) 70%);
  z-index:1; pointer-events:none;
}

/* image layer */
.landing .hero .hero-art{
  position:absolute; inset:0;
  z-index:0; overflow:hidden; pointer-events:none;
}

/* make <picture>/<img> fill and cover */
.landing .hero .hero-art picture,
.landing .hero .hero-art img{
  display:block;
  width:100%; height:100%;
  object-fit:cover;
  object-position:right 50%;
}

/* text layer above overlay + image */
.landing .hero .hero-content{
  position:relative;
  z-index:2;               /* above ::before(1) and image(0) */
  max-width:800px;
}

/* headings */
.landing .hero h1{
  color:var(--hero-title-color);
  font-weight:300; line-height:1.1;
  font-size:clamp(1.5rem, 4.5vw, 3.5rem);
  margin:0 0 .4rem 0;
}
.landing .hero p{
  color:var(--hero-sub-color);
  font-size:clamp(1rem, 2.1vw, 1.5rem);
  line-height:1.6; max-width:680px; margin:0;
}

/* mobile tweaks */
@media (max-width: 768px){
  .landing { --hero-left-gutter: 20px; }
  .landing .hero::before{
    background: linear-gradient(90deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.70) 55%, rgba(255,255,255,.05) 100%);
  }
}


/* Service promise */
.landing .service-promise{ background:#fff; padding:60px 20px; text-align:center; }
.landing .service-promise h2{ font-size:2.2rem; color:#1e4d8b; font-weight:400; max-width:800px; margin:0 auto 50px; line-height:1.4; }

/* Services grid */
.landing .services-section{ background:#f8f9fa; padding:60px 20px; }
.landing .services-container{
  max-width:1200px; margin:0 auto;
  display:grid; grid-template-columns: repeat(3, 1fr); gap:40px;
}
.landing .service-item{ text-align:center; }
.landing .service-link{ display:block; text-decoration:none; color:inherit; }
.landing .service-image{
  width:100%; height:250px; border-radius:8px; margin-bottom:16px;
  position:relative; overflow:hidden;
  background-size:cover; background-position:center; background-repeat:no-repeat;
  transition: transform .3s ease, box-shadow .3s ease;
}
.landing .service-link:hover .service-image{ transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.landing .service-title{
  font-size:1.8rem; color:#1e4d8b; margin:0 0 8px; font-weight:500; transition: color .2s ease, text-decoration-color .2s ease;
}
.landing .service-link:hover .service-title{ color:#153a68; text-decoration: underline; text-underline-offset: 4px; }
.landing .service-item p{ color:#666; font-size:16px; line-height:1.6; margin:0; }

/* Service images (progressive formats with fallbacks) */
.landing .service-image.book-bus{
  /* simple fallback first */
  background-image: url('/images/services/interior.png');

  /* modern formats (browser picks best) */
  background-image: image-set(
    url('/images/services/interior.avif') type('image/avif'),
    url('/images/services/interior.webp') type('image/webp'),
    url('/images/services/interior.png')  type('image/png')
  );
  background-size: cover;
  background-position: center;
}

.landing .service-image.fix-car{
  background-image: url('/images/services/garage.png');
  background-image: image-set(
    url('/images/services/garage.avif') type('image/avif'),
    url('/images/services/garage.webp') type('image/webp'),
    url('/images/services/garage.png')  type('image/png')
  );
  background-size: cover;
  background-position: center;
}

.landing .service-image.advert-bus{
  background-image: url('/images/services/advert.png');
  background-image: image-set(
    url('/images/services/advert.avif') type('image/avif'),
    url('/images/services/advert.webp') type('image/webp'),
    url('/images/services/advert.png')  type('image/png')
  );
  background-size: cover;
  background-position: center;
}




/* Legacy simple footer (kept for backward compatibility) */
.landing .footer{ background:#333; color:#ccc; padding:40px 20px 20px; text-align:center; }
.landing .footer-content{ max-width:1200px; margin:0 auto; }

/* New site footer */
.landing .site-footer{ background:#3d3e3f; color:#cbd5e1; margin-top:60px; }
.landing .site-footer a{ color:inherit; text-decoration:none; opacity:.9; }
.landing .site-footer a:hover{ opacity:1; text-decoration:underline; }
.landing .site-footer .footer-inner{
  max-width:1200px; margin:0 auto; padding:40px 20px;
  display:grid; grid-template-columns:1.2fr repeat(3, 1fr); gap:24px;
}
.landing .site-footer .footer-brand .logo{ display:inline-flex; align-items:center; line-height:1; }
.landing .site-footer .footer-brand .logo img{ height:68px; width:auto; display:block; }
.landing .site-footer .footer-brand p{ margin:12px 0 0; color:#94a3b8; font-size:14px; }
.landing .site-footer h4{
  margin:0 0 10px; font-size:14px; letter-spacing:.08em; text-transform:uppercase; color:#e2e8f0;
}
.landing .site-footer ul{ list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.landing .site-footer .socials a{ display:inline-block; }
.landing .site-footer .footer-bottom{
  border-top:1px solid rgba(255,255,255,.08);
  padding:12px 20px; text-align:center; font-size:13px; color:#94a3b8;
}

/* Landing responsive */
@media (max-width:1024px){
  .landing .services-container{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width:768px){
  .landing .hero::before{
    background: linear-gradient(90deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.70) 55%, rgba(255,255,255,.05) 100%);
  }
  .landing .hero .hero-content{ padding:0; }
  .landing .top-nav-container, .landing .main-nav-container{ flex-direction:column; gap:10px; }
  .landing .main-nav-links{ gap:20px; }
  .landing .hero h1{ font-size:2.2rem; }
  .landing .services-container{ grid-template-columns:1fr; gap:30px; }
  .landing .cta-buttons{ flex-direction:column; align-items:center; }
}

/* Hero spacing override (force precedence) */

.landing .hero .hero-content,
.landing .hero h1,
.landing .hero p{
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* ===== Landing Testimonials (marquee) ===== */
.landing .testimonials{
  background:#fff;
  border-top:1px solid rgba(0,0,0,.06);
  border-bottom:1px solid rgba(0,0,0,.06);
}

.landing .testi-inner{
  max-width:1200px;
  margin:0 auto;
  padding:18px 0;          /* tighter vertical rhythm */
  position:relative;
  overflow:hidden;         /* hides track overflow for the loop */
}

/* soft edge fades */
.landing .testi-inner::before,
.landing .testi-inner::after{
  content:"";
  position:absolute; top:0; bottom:0; width:80px; z-index:2;
  pointer-events:none;
}
.landing .testi-inner::before{
  left:0;
  background:linear-gradient(90deg, #fff 0%, rgba(255,255,255,0) 100%);
}
.landing .testi-inner::after{
  right:0;
  background:linear-gradient(270deg, #fff 0%, rgba(255,255,255,0) 100%);
}

/* the scrolling track */
.landing .testi-track{
  display:flex;
  gap:14px;
  will-change: transform;
  animation: testi-scroll 34s linear infinite;
}
@keyframes testi-scroll{
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); } /* because we duplicated the items */
}

/* individual item */
.landing .testi-item{
  flex:0 0 auto;
  min-width: clamp(280px, 42vw, 520px);
  display:flex; align-items:center; gap:12px;
  background:#fff;
  border:1px solid var(--tfx-border);
  border-radius:12px;
  padding:10px 12px;
  box-shadow:0 6px 18px rgba(0,0,0,.05);
}

/* logo/avatar box */
.landing .t-badge{
  width:48px; height:48px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  flex-shrink:0;
}
.landing .t-badge img{
  max-width:90%; max-height:90%;
  object-fit:contain; display:block;
}

/* quote & name */
.landing .testi-item blockquote{
  margin:0;
  color:#111827;
  font-size:15px;
  line-height:1.5;
  font-style:italic;
}
.landing .testi-item figcaption{
  color:#6b7280;
  font-size:13px;
  white-space:nowrap;
}

/* pause on hover (nice UX) */
.landing .testi-inner:hover .testi-track{ animation-play-state: paused; }

/* accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .landing .testi-track{ animation: none; }
}


/* ===== 7) AUTH PAGE ======================================================== */
.auth{ max-width:420px; margin:56px auto; padding:0 var(--pad); }
.auth .card{
  background:#fff; color:#1f2937; border:1px solid var(--tfx-border);
  border-radius:var(--radius); padding:calc(var(--pad) + 4px);
  box-shadow:0 6px 20px rgba(0,0,0,.06);
}
.auth-form{ display:grid; gap:12px; margin-top:12px; }
.auth-form button{ margin-top:8px; }
.muted{ color:var(--muted); margin-top:8px; }

/* ===== 8) DASHBOARD SHELL ================================================== */
.dash .dashboard-container{display:flex;min-height:100vh}
.dash .sidebar{width:260px;background:#1e4d8b;color:#fff;position:fixed;height:100vh;overflow-y:auto;transition:all .3s;z-index:1000}
.dash .sidebar-header{padding:20px;border-bottom:1px solid rgba(255,255,255,.1);text-align:center}
.dash .sidebar-logo{color:#fff;font-size:24px;font-weight:700;text-decoration:none;display:block}
.dash .sidebar-subtitle{font-size:12px;color:rgba(255,255,255,.7);margin-top:5px}
.dash .sidebar-nav{padding:20px 0}
.dash .nav-section{margin-bottom:30px}
.dash .nav-section-title{padding:0 20px 10px;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:rgba(255,255,255,.6);font-weight:600}
.dash .nav-item{
  display:flex;align-items:center;gap:10px;padding:12px 20px;color:rgba(255,255,255,.8);
  text-decoration:none;transition:all .3s;border-left:3px solid transparent; position:relative;
}
.dash .nav-item:hover,.dash .nav-item.active{background:rgba(255,255,255,.1);color:#fff;border-left-color:#f4c430}
.dash .nav-item i{width:20px;margin-right:10px;text-align:center}
.dash .nav-badge{
  margin-left:auto;background:#f4c430;color:#333;font-weight:700;font-size:12px;line-height:1;
  padding:4px 8px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;min-width:22px;
}
.dash .main-content{margin-left:260px;flex:1;min-height:100vh}
.dash .dashboard-header{
  background:#fff;padding:15px 30px;box-shadow:0 2px 4px rgba(0,0,0,.1);
  display:flex;justify-content:space-between;align-items:center
}
.dash .header-title{font-size:24px;color:#1e4d8b;font-weight:500}
.dash .dashboard-content{ padding: 30px 56px; }

.dash .user-menu{display:flex;align-items:center;gap:10px;padding:8px 15px;background:#f8f9fa;border-radius:25px;cursor:pointer;transition:background .3s}
.dash .user-menu:hover{background:#e9ecef}
.dash .user-avatar{width:32px;height:32px;background:#1e4d8b;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:14px}

/* Mobile sidebar toggle */
@media (max-width: 900px) {
  .dash .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    left: 0; top: 0; bottom: 0;
  }
  .dash .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: 1px solid rgba(0,0,0,.1);
    border-radius: 8px; background: #fff; cursor: pointer;
  }
}
@media (min-width: 901px) { .mobile-menu-toggle { display: none; } }

/* User dropdown */
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-menu { position: relative; }
.user-menu-button{
  display: inline-flex; align-items: center; gap: 8px;
  background:#fff; border:1px solid rgba(0,0,0,.08);
  padding:6px 10px; border-radius:10px; cursor:pointer;
}
.user-name{ max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.user-menu-dropdown{
  position:absolute; right:0; top:calc(100% + 8px); min-width:180px;
  background:#fff; border:1px solid #e5e7eb; border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.08); padding:6px; display:none; z-index:1000;
}
.user-menu.open .user-menu-dropdown{ display:block; }
.user-menu-item{
  display:block; width:100%; text-align:left; padding:8px 10px;
  border-radius:8px; color:#111827; text-decoration:none;
}
.user-menu-item:hover{ background:#f3f4f6; }
.user-menu-item.logout-btn,
.user-menu-item .logout-btn{
  display:block; width:100%; background:transparent; border:0; padding:0;
  text-align:left; color:#111827; cursor:pointer;
}

/* Section label utility */
.section-label{
  margin:10px 0 14px; padding:6px 0; font-size:12px; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase; color:#6b7280;
  border-bottom:1px solid rgba(0,0,0,.08);
}

/* ===== 9) KPI CARDS (dashboard) =========================================== */
.kpi-card{
  background:#fff; border:1px solid var(--tfx-border); border-radius:12px;
  box-shadow:0 4px 16px rgba(30,77,139,0.08); overflow:hidden; margin:0 0 24px; color:var(--tfx-text);
}
.kpi-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--tfx-border);
  background:var(--tfx-accent-50);
}
.kpi-title{ font-weight:600; color:var(--tfx-accent); }
.kpi-filter select{
  border:1px solid var(--tfx-border); border-radius:8px; padding:6px 8px;
  background:#fff; color:var(--tfx-text); font-size:14px;
}
.kpi-subtitle{ padding:10px 16px 0 16px; color:#6b7280; font-size:12px; }
.kpi-rows{ padding:4px 16px 14px 16px; }
.kpi-row{
  display:flex; align-items:baseline; justify-content:space-between;
  padding:8px 0; border-bottom:1px solid var(--tfx-border-soft);
}
.kpi-row:last-child{ border-bottom:0; }
.kpi-label{ color:#6b7280; }
.kpi-value{ font-weight:600; }
.kpi-row-strong .kpi-label{ color:#111827; }
.kpi-row-strong .kpi-value{ font-size:18px; }
.kpi-delta{ margin-left:8px; font-weight:700; font-size:12px; }
.kpi-delta.up{ color:#15803d; }
.kpi-delta.down{ color:#b91c1c; }

/* Compact variant */
.kpi-card.kpi-small{ font-size:85%; max-width:360px; }
.kpi-card.kpi-small .kpi-header{ padding:10px 12px; }
.kpi-card.kpi-small .kpi-title{ font-size:14px; }
.kpi-card.kpi-small .kpi-filter select{ padding:4px 6px; font-size:12px; }
.kpi-card.kpi-small .kpi-subtitle{ padding:8px 12px 0 12px; font-size:11px; }
.kpi-card.kpi-small .kpi-rows{ padding:4px 12px 12px; }
.kpi-card.kpi-small .kpi-row{ padding:6px 0; }
.kpi-card.kpi-small .kpi-value{ font-size:16px; }
.kpi-card.kpi-small .kpi-row-strong .kpi-value{ font-size:18px; }

/* KPI helper grids */
.kpi-grid{
  display:grid; grid-template-columns:1fr; gap:16px; margin:8px 0 24px;
}
@media (min-width:720px){ .kpi-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:1100px){ .kpi-grid{ grid-template-columns:repeat(3,minmax(0,1fr)); } }

.kpi-grid-2{ display:grid; grid-template-columns:repeat(auto-fit,minmax(420px,1fr)); gap:16px; }
.kpi-half{ padding:14px 16px; }
.kpi-subtle{ color:#6b7280; font-size:12px; }
.kpi-table-wrap{ margin-top:8px; }
.kpi-table{ width:100%; border-collapse:collapse; font-size:14px; color:#111827; }
.kpi-table th, .kpi-table td{ padding:10px 12px; border-bottom:1px solid var(--tfx-border); }
.kpi-table thead th{
  background:var(--tfx-accent-50); color:var(--tfx-accent);
  text-align:left; font-size:12.5px; letter-spacing:.3px; text-transform:uppercase;
}
.kpi-table td.num, .kpi-table th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.kpi-table .empty{ text-align:center; color:#6b7280; }

.sev-badge{
  display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700;
  border-radius:999px; padding:4px 10px; border:1px solid transparent; white-space:nowrap;
}
.sev-ok{ background:#e6f4ea; color:#1f7a3f; border-color:#cfe9d6; }
.sev-minor{ background:#fff7e6; color:#92400e; border-color:#fde3b6; }
.sev-major{ background:#ffe6e6; color:#b45309; border-color:#fcd4d4; }
.sev-extreme{ background:#fdecea; color:#b91c1c; border-color:#f7c6c5; }

/* ===== 10) TABLES & DATA UI (dashboard) =================================== */
.dash .tfx-table-wrap{
  background:#fff;border:1px solid var(--tfx-border);border-radius:12px;
  box-shadow:0 4px 16px rgba(30,77,139,0.08);overflow:hidden;margin:12px 0 24px;
}
.dash .tfx-table-header{
  padding:16px 20px;background:var(--tfx-accent);color:#fff;font-weight:600;letter-spacing:.3px;
  border-bottom:1px solid var(--tfx-accent-600);display:flex;align-items:center;justify-content:space-between;
}
.dash .tfx-table-header>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dash .tfx-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px;line-height:1.6;color:var(--tfx-text);}
.dash .tfx-table th{background:var(--tfx-accent-50);color:var(--tfx-accent);font-weight:600;text-align:left;padding:14px 18px;font-size:12.5px;text-transform:uppercase;letter-spacing:.4px;border-bottom:1px solid var(--tfx-border);white-space:nowrap;overflow:hidden;}
.dash .tfx-table td{padding:14px 18px;border-bottom:1px solid var(--tfx-border-soft);background:transparent;transition:background-color .15s ease;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;}
.dash .tfx-table tbody tr{background:#fff;}
.dash .tfx-table tbody tr:hover{background:var(--tfx-accent-75);}

.dash .tfx-table thead th:nth-child(1),
.dash .tfx-table tbody td:nth-child(1){width:60px;}
.dash .tfx-table thead th:nth-child(2),
.dash .tfx-table tbody td:nth-child(2){width:80px;}
.dash .tfx-table thead th:nth-child(3),
.dash .tfx-table tbody td:nth-child(3){width:160px;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dash .tfx-table thead th:nth-child(4),
.dash .tfx-table tbody td:nth-child(4){width:190px;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dash .tfx-table thead th:nth-child(5),
.dash .tfx-table tbody td:nth-child(5){width:120px;white-space:nowrap;}
.dash .tfx-table thead th:nth-child(6),
.dash .tfx-table tbody td:nth-child(6){width:auto;}
.dash .tfx-table thead th:nth-child(7),
.dash .tfx-table tbody td:nth-child(7){width:150px;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dash .tfx-table thead th:nth-child(8),
.dash .tfx-table tbody td:nth-child(8){width:230px;max-width:230px;white-space:nowrap;overflow:hidden;}
.dash .tfx-table thead th:nth-child(9),
.dash .tfx-table tbody td:nth-child(9){width:190px;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dash .tfx-table thead th:nth-child(10),
.dash .tfx-table tbody td:nth-child(10){width:56px;white-space:nowrap;}

.dash .tfx-notes{white-space:normal;word-break:break-word;}
.dash .tfx-note-wrap{position:relative;padding-bottom:6px;}
.dash .tfx-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-break:break-word;}
.dash .tfx-fade{position:absolute;right:0;bottom:6px;width:40%;height:1.2em;background:linear-gradient(90deg, rgba(255,255,255,0), #fff 60%);pointer-events:none;display:none;}
.dash .tfx-note-wrap.is-truncated .tfx-fade{display:block;}
.dash .tfx-note-wrap.is-open .tfx-fade{display:none;}
.dash .tfx-note-wrap.is-open .tfx-clamp-2{-webkit-line-clamp:initial;display:block;}
.dash .tfx-table td *{background:transparent!important;}
.dash .tfx-nowrap{white-space:nowrap;}
.dash .tfx-status{display:inline-block;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;border:1px solid transparent;white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis;}
.dash .tfx-status--approved,.dash .tfx-status--active{background:#e6f4ea;color:#1f7a3f;border-color:#cfe9d6;}
.dash .tfx-status--pending,.dash .tfx-status--new{background:#fff7e6;color:#92400e;border-color:#fde3b6;}
.dash .tfx-status--inactive,.dash .tfx-status--rejected{background:#fdecea;color:#b91c1c;border-color:#f7c6c5;}
.dash .tfx-status--info{background:#e8f1ff;color:var(--tfx-accent);border-color:#cfe0ff;}
.dash td.tfx-actions{white-space:nowrap;overflow:hidden;}
.dash td.tfx-actions .tfx-inline-form{display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap;min-width:0;}
.dash td.tfx-actions .tfx-inline-form select{flex:0 0 120px;width:120px;max-width:120px;min-width:0;}
.dash td.tfx-actions .tfx-inline-form button{flex:0 0 auto;padding:6px 10px;}
.dash .tfx-table a{color:var(--tfx-accent);text-decoration:none;}
.dash .tfx-table a:hover{text-decoration:underline;}

.dash .tfx-num{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-weight:500; text-align:right;
}
.dash .tfx-right{text-align:right;}
.dash .tfx-center{text-align:center;}
.dash .tfx-num-left{ text-align:left; }

.dash .tfx-icon-btn{
  display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;
  border:1px solid var(--tfx-border);border-radius:8px;background:#fff;cursor:pointer;
  transition:background .15s ease, border-color .15s ease, color .15s ease;color:#6b7280;
}
.dash .tfx-icon-btn:hover{background:#fff7f7;border-color:#f5c2c7;color:#b91c1c;}
.dash .tfx-icon-btn svg{width:16px;height:16px;display:block;}
.dash .tfx-icon-btn.tfx-danger{border-color:#f5c2c7;}

.dash .tfx-pager{display:flex;gap:6px;align-items:center;justify-content:flex-end;padding:12px 0;}
.dash .tfx-pager a,.dash .tfx-pager span{
  padding:6px 10px;border-radius:6px;text-decoration:none;border:1px solid var(--tfx-border);
  background:#fff;color:var(--tfx-accent);
}
.dash .tfx-pager .is-current{background:var(--tfx-accent);border-color:var(--tfx-accent);color:#fff;font-weight:700;}
.dash .tfx-pager a:hover{background:var(--tfx-accent-50);}

@media (max-width:600px){
  .dash .tfx-table th, .dash .tfx-table td{ padding:12px 14px; }
  .dash .tfx-table{ font-size:13px; }
}
@media (max-width:640px){
  .grid{grid-template-columns:1fr}
}

/* Make the audit table flexible and allow wrapping */
.dash .audit-table{
  table-layout: auto;          /* override the dashboard's fixed layout */
}
.dash .audit-table th,
.dash .audit-table td{
  white-space: normal;         /* allow wrapping */
  overflow: visible;           /* remove ellipsis clipping */
  text-overflow: clip;
}
.dash .audit-table .tfx-nowrap{
  white-space: nowrap;         /* keep "When" and "IP" tidy */
}

/* Insights grid */
.insights-title { color:#1e4d8b; margin:0 0 14px; letter-spacing:.02em; }

.insights-grid {
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
@media (max-width: 1024px) {
  .insights-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 680px) {
  .insights-grid { grid-template-columns: repeat(4, 1fr); }
}

.insight-card {
  grid-column: span 4; /* 3-up on desktop */
  background:#fff;
  border:1px solid #e5effa;
  border-radius:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transition: box-shadow .2s ease, transform .2s ease;
}
@media (max-width: 1024px) { .insight-card { grid-column: span 4; } } /* 2-up on tablet */
@media (max-width: 680px)  { .insight-card { grid-column: span 4; } } /* 1-up on mobile */

.insight-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.06); transform: translateY(-2px); }

.insight-media { display:block; aspect-ratio: 16 / 9; background:#f3f6fb; }
.insight-media > img { width:100%; height:100%; object-fit:cover; display:block; }

.insight-meta { display:flex; gap:10px; align-items:center; padding:12px 14px 0; }
.insight-chip {
  text-transform: uppercase;
  font-size:.72rem;
  letter-spacing:.08em;
  color:#0b6b4a;
  background:#e9fbf3;
  border-radius:999px;
  padding:3px 8px;
}
.insight-date { color:#6b7280; font-size:.8rem; }

.insight-title { font-size:1.1rem; margin:6px 14px; line-height:1.3; }
.insight-title a { color:#1e4d8b; text-decoration:none; }
.insight-title a:hover { text-decoration:underline; }

.insight-excerpt { color:#374151; margin:4px 14px 10px; }

.insight-cta { margin: 0 14px 14px; }

/* Controls */
.insights-controls { display:flex; flex-direction:column; align-items:center; gap:16px; margin-top:20px; }
#infiniteSentinel { width: 1px; height: 1px; }


/* 0) Guardrail: stop any horizontal overflow on landing pages */
.landing { overflow-x: hidden; }

/* 1) Allow main nav links to wrap on phones instead of forcing a wide row */
@media (max-width: 768px){
  .landing .main-nav-links{
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* 2) Footer: make the 4-column grid responsive + prevent child overflow */
.landing .site-footer .footer-inner > * { min-width: 0; }
.landing .site-footer ul,
.landing .site-footer .footer-brand p { overflow-wrap: anywhere; }

/* tablet: 2 columns */
@media (max-width: 900px){
  .landing .site-footer .footer-inner{
    grid-template-columns: 1fr 1fr;
  }
}

/* phones: 1 column */
@media (max-width: 560px){
  .landing .site-footer .footer-inner{
    grid-template-columns: 1fr;
  }
}
