:root{
  /* Brand */
  --brand-900:#071a2b;
  --brand-800:#0b2a45;

  /* Accent */
  --evas-teal:#08b0d4;
  --evas-teal-600:#059bbd;

  /* Surfaces */
  --bg-app: linear-gradient(180deg,#f7fafc 0%, #eef3f8 100%);
  --card:#ffffff;

  /* Text */
  --text-900:#0f172a;
  --text-600:#475569;

  /* Borders / radius / shadows */
  --border: rgba(15, 23, 42, .10);
  --radius: 18px;
  --shadow: 0 18px 45px rgba(2, 10, 20, .10);

  /* App shell */
  --app-header-h: 64px;
  --app-sidebar-w: 300px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text-900);
  background: var(--bg-app);
}

a{ color:inherit; text-decoration:none; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.small{ font-size:13px; color: var(--text-600); }

/* =========================================================
   Buttons
========================================================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color: var(--text-900);
  font-weight:700;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }

.btn.evas{
  background: var(--evas-teal);
  border-color: rgba(8,176,212,.28);
  color:#fff;
  box-shadow: 0 12px 26px rgba(8,176,212,.18);
}
.btn.evas:hover{ background: var(--evas-teal-600); color:#fff; }

.btn.evas-danger{
  background: #dc3545;
  border-color: rgba(220,53,69,.28);
  color:#fff;
  box-shadow: 0 12px 26px rgba(220,53,69,.18);
}
.btn.evas-danger:hover{ background: #c82333; color:#fff; }

/* =========================================================
   App layout helpers (NO-JS mobile drawer)
   Place: <input id="nav-toggle" class="nav-toggle" type="checkbox">
========================================================= */
.nav-toggle{
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-label{ display:flex; align-items:center; gap:10px; }

/* Settings group */
.nav-group{
  border: 1px solid transparent;
  border-radius: 16px;
  overflow: hidden;
}
.nav-parent{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px;
  border-radius: 16px;
  font-weight: 850;
  color: var(--text-600);
}
.nav-parent:hover{
  background: rgba(15,23,42,.05);
  color: var(--text-900);
}
.nav-group[open] .nav-parent .nav-caret{ transform: rotate(0deg); }
.nav-caret{
  font-weight: 900;
  color: var(--text-600);
  transform: rotate(-90deg);
  transition: transform .15s ease;
}
.nav-parent::-webkit-details-marker{ display:none; }

/* Children */
.nav-children{
  margin-top: 6px;
  padding: 0 10px 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav-child{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border-radius: 14px;
  font-weight: 800;
  color: var(--text-600);
  border: 1px solid rgba(15,23,42,.06);
  background: rgba(15,23,42,.02);
}
.nav-child:hover{
  background: rgba(15,23,42,.05);
  color: var(--text-900);
}
.nav-subgroup{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin: 0;
  padding: 0;
}
.nav-subparent{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 12px;
  border-radius: 14px;
  font-weight: 800;
  color: var(--text-600);
  border: 1px solid rgba(15,23,42,.06);
  background: rgba(15,23,42,.02);
  margin: 0;
}
.nav-subparent:hover{
  background: rgba(15,23,42,.05);
  color: var(--text-900);
}
.nav-subparent::-webkit-details-marker{ display:none; }
.nav-subparent .nav-caret{
  font-weight: 900;
  color: var(--text-600);
  transform: rotate(-90deg);
  transition: transform .15s ease;
}
.nav-subgroup[open] .nav-subparent .nav-caret{ transform: rotate(0deg); }
.nav-subchildren{
  margin-top: 0;
  padding-left: 18px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.nav-subgroup[open] .nav-subchildren{
  margin-top: 4px;
}
.nav-subchild{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 750;
  color: var(--text-600);
  border: 1px solid rgba(15,23,42,.06);
  background: rgba(15,23,42,.02);
}
.nav-subchild:hover{
  background: rgba(15,23,42,.05);
  color: var(--text-900);
}
.nav-dot{
  width:8px; height:8px; border-radius:50%;
  background: rgba(8,176,212,.55);
  box-shadow: 0 0 0 3px rgba(8,176,212,.14);
}

/* dark overlay on mobile when sidebar open */
.app-overlay{
  position: fixed;
  inset: 0;
  background: rgba(2,10,20,.45);
  opacity: 0;
  pointer-events: none;
  z-index: 95;
  transition: opacity .18s ease;
}

/* =========================================================
   Header
========================================================= */
.app-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--app-header-h);
  z-index: 110;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* =========================================================
   Modal (confirmations)
========================================================= */
.evas-modal-backdrop{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(2,10,20,.45);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity .14s ease;
}
.evas-modal-backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}
.evas-modal{
  width: min(520px, calc(100vw - 36px));
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 26px 70px rgba(2,10,20,.22);
  padding: 16px;
  transform: translateY(6px) scale(.99);
  transition: transform .14s ease;
}
.evas-modal-backdrop.is-open .evas-modal{
  transform: translateY(0) scale(1);
}
.evas-modal-h{
  display:flex;
  gap: 12px;
  align-items:flex-start;
}
.evas-modal-icon{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 950;
  background: rgba(8,176,212,.14);
  color: var(--evas-teal-600);
  flex: 0 0 auto;
}
.evas-modal-title{
  font-weight: 950;
  letter-spacing: .01em;
}
.evas-modal-message{
  margin-top: 4px;
  color: var(--text-600);
  font-size: 14px;
  line-height: 1.35;
}
.evas-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  margin-top: 14px;
}
.evas-modal--danger .evas-modal-icon{
  background: rgba(220,53,69,.12);
  color: #dc3545;
}

.app-header .inner{
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;

  /* Full width header */
  max-width: none;
  margin: 0;
  padding: 0 22px;
}

/* mobile hamburger */
.hamburger{
  display:none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size: 18px;
  font-weight: 900;
}

.app-brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.app-brand img{ height: 34px; width:auto; }
.app-brand .brand-text{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  line-height:1.1;
}
.app-brand .t1{ font-weight:950; letter-spacing:.02em; }
.app-brand .t2{ font-size:12px; color: var(--text-600); margin-top:2px; }

.header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-left:auto;
}

.header-pill{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 9px 12px;
  border:1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
}
.header-pill .muted{ color: var(--text-600); font-size: 12px; font-weight: 700; }
.header-pill strong{ font-weight: 950; }

/* =========================================================
   Body / Sidebar / Content
========================================================= */
.app-body{
  min-height: 100vh;
  padding-top: var(--app-header-h);
}

/* Desktop sidebar fixed */
.app-sidebar{
  position: fixed;
  top: var(--app-header-h);
  left: 0;
  width: var(--app-sidebar-w);
  height: calc(100vh - var(--app-header-h));
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  overflow:auto;
  z-index: 100;
}

.sidebar-wrap{ padding: 18px; }
.sidebar-section{ margin-top: 16px; }

.sidebar-title{
  font-size: 12px;
  color: var(--text-600);
  font-weight: 900;
  letter-spacing:.08em;
  text-transform: uppercase;
  margin: 10px 0 12px;
}

/* Small helper text in sidebar */
.side-help{
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-600);
  line-height: 1.45;
}

.side-nav{ display:flex; flex-direction:column; gap:10px; padding:0; }

/* Top-level items */
.side-nav > a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px;
  border-radius: 16px;
  font-weight: 850;
  color: var(--text-600);
  border: 1px solid transparent;
  background: transparent;
}
.side-nav > a:hover{
  background: rgba(15,23,42,.05);
  color: var(--text-900);
}
.side-nav > a.active{
  background: rgba(8,176,212,.12);
  border-color: rgba(8,176,212,.22);
  color: var(--text-900);
}

.side-count{
  min-width: 34px;
  text-align:center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.05);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-900);
  font-weight: 900;
}

/* Select pill */
.select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
  color: var(--text-900);
  outline: none;
}
.select:focus{
  border-color: rgba(8,176,212,.45);
  box-shadow: 0 0 0 4px rgba(8,176,212,.14);
}

/* Main content fills the remaining space (FULL WIDTH) */
.app-content{
  margin-left: var(--app-sidebar-w);
  width: calc(100% - var(--app-sidebar-w));
  padding: 18px 22px;

  height: calc(100vh - var(--app-header-h));
  overflow: auto;

  display:flex;
  flex-direction:column;
}

/* IMPORTANT: do NOT center/cap the content */
.app-content .container-xl{
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1;
  display:flex;
  flex-direction:column;
}

/* Footer sticks to bottom */
.app-footer{
  margin-top: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  color: var(--text-600);
  font-size: 13px;
}

/* =========================================================
   Dashboard components (KPI / Panels / Tables)
========================================================= */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
  margin:12px 0 14px;
}
.kpi{
  grid-column: span 3;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
.kpi .label{ color: var(--text-600); font-weight:800; font-size:13px; }
.kpi .value{ font-size:28px; font-weight:950; margin-top:6px; letter-spacing:-.02em; }
.kpi .foot{ margin-top:10px; color: var(--text-600); font-size:13px; display:flex; align-items:center; gap:8px; }
.kpi .trend{
  padding:4px 9px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.03);
  color: var(--text-900);
  font-weight:900;
}

.panel{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel-h{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.panel-h .title{ font-weight:950; }
.panel-b{ padding:14px 16px; }

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}
.table th{
  text-align:left;
  font-size:12px;
  color: var(--text-600);
  font-weight:900;
  letter-spacing:.02em;
  padding:12px 12px;
  border-bottom:1px solid var(--border);
  background: rgba(15,23,42,.02);
}
.table td{
  padding:12px 12px;
  border-bottom:1px solid rgba(15,23,42,.06);
  vertical-align:top;
}
.table tr:hover td{ background: rgba(15,23,42,.02); }

/* =========================================================
   Data table enhancements
========================================================= */
.evas-dt-shell{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.evas-dt-wrap{
  overflow:auto;
  border-radius:16px;
}

.evas-dt-toolbar,
.evas-dt-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.evas-dt-control{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color: var(--text-600);
}

.evas-dt-label{
  font-weight:700;
  color: var(--text-600);
}

.evas-dt-search,
.evas-dt-select{
  height:34px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  color: var(--text-900);
  font-weight:600;
}

.evas-dt-search{ min-width:180px; }

.evas-dt-footer{
  font-size:12px;
  color: var(--text-600);
}

.evas-dt-pagination{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}

.evas-dt-page{
  border:1px solid var(--border);
  background:#fff;
  color: var(--text-900);
  padding:6px 10px;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}

.evas-dt-page:hover{ transform: translateY(-1px); }
.evas-dt-page.is-active{
  background: var(--text-900);
  border-color: var(--text-900);
  color:#fff;
  box-shadow: 0 10px 18px rgba(15,23,42,.12);
}
.evas-dt-page.is-disabled{
  opacity:.5;
  cursor:not-allowed;
  transform:none;
}

.evas-dt-ellipsis{
  color: var(--text-600);
  font-weight:700;
  padding:0 4px;
}

.evas-dt-sortable{
  cursor:pointer;
  position:relative;
  padding-right:26px;
  user-select:none;
}

.evas-dt-sortable::before,
.evas-dt-sortable::after{
  content:"";
  position:absolute;
  right:10px;
  border:4px solid transparent;
  opacity:.4;
}

.evas-dt-sortable::before{
  border-bottom-color:#94a3b8;
  top:46%;
}

.evas-dt-sortable::after{
  border-top-color:#94a3b8;
  top:56%;
}

.evas-dt-sortable.is-sort-asc::before{ opacity:1; }
.evas-dt-sortable.is-sort-asc::after{ opacity:.2; }
.evas-dt-sortable.is-sort-desc::before{ opacity:.2; }
.evas-dt-sortable.is-sort-desc::after{ opacity:1; }

.evas-dt tbody tr:nth-child(even) td{ background: rgba(15,23,42,.015); }

.evas-dt-empty td{
  text-align:center;
  padding:18px 12px;
  color: var(--text-600);
  font-weight:600;
}

.main-grid{
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap:14px;
  margin-top:14px;
}

/* =========================================================
   Responsive
   - Mobile: sidebar becomes drawer + hamburger appears
========================================================= */
@media (max-width: 1100px){
  :root{ --app-sidebar-w: 270px; }
  .kpi{ grid-column: span 6; }
  .main-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 980px){
  /* show hamburger */
  .hamburger{ display:inline-flex; }

  /* content goes full width */
  .app-content{
    margin-left: 0;
    width: 100%;
    padding: 16px;
  }

  /* sidebar becomes off-canvas */
  .app-sidebar{
    width: 280px;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 0 22px 70px rgba(0,0,0,.25);
  }

  /* overlay enabled */
  .app-overlay{ display:block; }

  /* When toggled open */
  #nav-toggle:checked ~ .app-overlay{
    opacity: 1;
    pointer-events: auto;
  }
  #nav-toggle:checked ~ .app-body .app-sidebar{
    transform: translateX(0);
  }

  /* header actions wrap nicely */
  .header-actions .btn{ padding: 10px 12px; }
}

@media (max-width: 560px){
  .kpi{ grid-column: span 12; }
  .header-pill{ display:none; } /* keep header clean on tiny screens */
}
/* ===== Header: prevent ugly wrapping ===== */
.app-header .inner{
  flex-wrap: nowrap !important;
  overflow: visible;
}

/* Brand must be able to shrink */
.app-brand{
  min-width: 0 !important;
  flex: 1 1 auto;
}

/* Truncate brand text instead of breaking */
.app-brand .brand-text{
  min-width: 0;
}
.app-brand .t1,
.app-brand .t2{
  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Actions stay on one line */
.header-actions{
  flex: 0 0 auto;
  flex-wrap: nowrap !important;
  white-space: nowrap;
}

/* Hide signed-in pill earlier */
@media (max-width: 760px){
  .header-pill{ display:none !important; }
}

/* Compact buttons on small widths */
@media (max-width: 760px){
  .header-actions .btn{
    padding: 10px 12px;
    border-radius: 12px;
  }
}

/* "More" menu (details) */
.header-more{ position: relative; z-index: 300; }

.header-more details{ position: relative; }

.header-more summary{
  list-style: none;
  cursor: pointer;
}
.header-more summary::-webkit-details-marker{ display:none; }

/* Hide menu until opened */
.header-more .more-menu{ display:none; }

.header-more details[open] .more-menu{ display:block; }

.more-menu{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(2, 10, 20, .14);
  padding: 8px;
  z-index: 200;
}

.more-menu a,
.more-menu form button{
  width: 100%;
  display:flex;
  justify-content:flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 800;
  color: var(--text-900);
  cursor: pointer;
}
.more-menu a:hover,
.more-menu form button:hover{
  background: rgba(15,23,42,.05);
}

/* Hide menu until opened */
.header-more .more-menu { 
  display: none; 
}

/* Show menu when details is open */
.header-more details[open] .more-menu { 
  display: block; 
}

/* On small widths: hide secondary buttons, show More */
@media (max-width: 760px){
  .btn-hide-sm{ display:none !important; }
  .header-more{ display:block !important; }
}

/* On larger widths: show everything, hide More */
@media (min-width: 761px){
  .header-more{ display:none !important; }
}
/* =========================
   Sidebar compact (mobile)
   ========================= */
@media (max-width: 980px){

  /* reduce padding to avoid scroll */
  .sidebar-wrap{ padding: 14px; }

  .sidebar-title{
    margin: 8px 0 10px;
    font-size: 11px;
  }

  .side-nav{ gap: 8px; }

  /* top-level items */
  .side-nav > a,
  .nav-parent{
    padding: 12px 12px;
    border-radius: 14px;
    font-size: 15px;
  }

  /* children items */
  .nav-children{
    margin-top: 0;
    padding: 6px;
    /*gap: 8px;*/
  }

  .nav-child{
    padding: 10px 10px;
    border-radius: 12px;
    font-size: 14px;
  }

  .nav-dot{
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 3px rgba(8,176,212,.12);
  }

  /* client context section */
  .sidebar-section{ margin-top: 12px; }
  .side-help{ margin-top: 8px; font-size: 12px; }

  /* make the select shorter */
  .select{
    padding: 9px 40px 9px 12px;  /* right-padding for arrow */
    font-size: 14px;
    line-height: 1.2;
  }
}

/* =========================
   Select arrow alignment fix
   ========================= */
.select{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* custom arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23475669' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;

  padding-right: 44px; /* ensures text doesn't overlap arrow */
}
/* =========================================================
   Forms (EVAS)
========================================================= */
.form-shell{
  max-width: 980px;
}

.form-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.form-group{
  grid-column: span 6;
  display:flex;
  flex-direction:column;
  gap: 8px;
  min-width: 0;
}

.form-group.full{ grid-column: span 12; }

.form-label{
  font-weight: 900;
  color: var(--text-900);
  font-size: 13px;
}

.form-help{
  font-size: 12.5px;
  color: var(--text-600);
  margin-top: -4px;
}

.input,
.select,
.textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
  color: var(--text-900);
  outline: none;
  transition: box-shadow .12s ease, border-color .12s ease, transform .12s ease;
}

.textarea{ min-height: 110px; resize: vertical; }

.input:focus,
.select:focus,
.textarea:focus{
  border-color: rgba(8,176,212,.45);
  box-shadow: 0 0 0 4px rgba(8,176,212,.14);
}

.input[readonly],
.input[disabled],
.select[disabled],
.textarea[disabled]{
  background: rgba(15,23,42,.03);
  color: rgba(15,23,42,.65);
  cursor: not-allowed;
}

.form-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.form-actions .left,
.form-actions .right{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}

/* Checkbox -> toggle */
.toggle{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  width: fit-content;
}
.toggle{ cursor:pointer; user-select:none; position:relative; }

.toggle input[type="checkbox"]{
  position:absolute;
  width:1px; height:1px;
  margin:-1px; padding:0; border:0;
  overflow:hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* IMPORTANT: use ~ instead of + */
.toggle input[type="checkbox"]:checked ~ .pill{
  background: rgba(8,176,212,.85);
  border-color: rgba(8,176,212,.35);
}
.toggle input[type="checkbox"]:checked ~ .pill::after{
  left: 22px;
}

.toggle .pill{
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15,23,42,.12);
  position: relative;
  border: 1px solid var(--border);
  transition: background .12s ease;
}
.toggle .pill::after{
  content:"";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  position:absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  box-shadow: 0 10px 18px rgba(2,10,20,.18);
  transition: left .12s ease;
}
.toggle input:checked + .pill{
  background: rgba(8,176,212,.85);
  border-color: rgba(8,176,212,.35);
}
.toggle input:checked + .pill::after{ left: 22px; }
.toggle .txt{ font-weight: 900; color: var(--text-900); }

/* Thymeleaf field errors (optional) */
.field-error{
  font-size: 12.5px;
  color: #b91c1c;
  font-weight: 800;
  margin-top: -2px;
}

/* Responsive form */
@media (max-width: 900px){
  .form-group{ grid-column: span 12; }
  .form-shell{ max-width: 100%; }
}

/* =========================================================
   List View
========================================================= */
/* ---------- Generic list/table layout ---------- */
/* List filters row (search, sort, page size, etc.) */
.list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.list-filters .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Meta footer under tables: "Showing X of Y records" */
.list-meta {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #6b7280; /* muted grey */
}

.list-meta-count {
  white-space: nowrap;
}

.list-meta-actions {
  display: flex;
  gap: 0.4rem;
}

/* Generic table wrapper (can reuse across pages) */
.list-table-wrapper {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  overflow-x: auto;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.list-table thead {
  background: #f9fafb;
}

.list-table th,
.list-table td {
  padding: 0.75rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.list-table th {
  font-weight: 600;
  color: #4b5563;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.list-table tbody tr:last-child td {
  border-bottom: none;
}

.list-table tbody tr:hover {
  background: #f9fafb;
}

.list-table .cell-primary {
  font-weight: 500;
  color: #111827;
}

/* Status chips – already used on other pages */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-chip .status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
}

.status-ok {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

.status-ok .status-dot {
  background: #10b981;
}

.status-bad {
  background: rgba(248, 113, 113, 0.08);
  color: #b91c1c;
}

.status-bad .status-dot {
  background: #f97373;
}

/* Actions column */
.list-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------
   Compliance services section (custom styles)
-------------------------------------------------------- */
/* --- Compliance services section --- */

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px 24px;
}

.form-group.full {
  grid-column: 1 / -1; /* Make child span full width */
}

/* Generic card */
.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
  padding: 18px 20px;
}

/* Card header & body (reuse everywhere) */
.card-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.card-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.card-b {
  margin-top: 4px;
}

/* Compliance services layout (reusable for other pill lists) */
.service-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-group-header {
  margin-bottom: 4px;
}

.service-group-title {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.service-subgroups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 4px;
  border-left: 2px solid #e5e7eb;
}

.service-subgroup-title {
  font-weight: 500;
  font-size: 13px;
  color: #374151;
  margin-bottom: 4px;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Pills */
.service-pill {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

.service-pill input[type="checkbox"],
.service-pill input[type="radio"] {
  margin-right: 6px;
}

.service-pill-main {
  display: flex;
  flex-direction: column;
}

.service-pill-name {
  font-size: 13px;
  font-weight: 500;
}

.service-pill-meta {
  font-size: 11px;
  color: #6b7280;
}

.service-pill-desc {
  flex: 1;
  font-size: 12px;
  color: #6b7280;
}

.service-pill-primary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #111827;
}

/*=======*/
/* Validation / alert banner */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #fdf5f5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  font-size: 0.95rem;
}

.alert-banner__icon {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.alert-banner__content {
  flex: 1;
}

.alert-banner__title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-banner__message {
  margin: 0;
  opacity: 0.9;
}

/* Error variant */
.alert-banner--error {
  border-color: #f4c7c7;
  background: linear-gradient(135deg, #fff7f7, #fdeeee);
  color: #7a1f1f;
}

.alert-banner--error .alert-banner__icon {
  background: #d63031;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(214, 48, 49, 0.18);
}

.alert-banner--error .alert-banner__title {
  color: #7a1f1f;
}

/* Success variant */
.alert-banner--success {
  border-color: #b9e5c6;
  background: linear-gradient(135deg, #f2fff6, #e7f8ee);
  color: #0f5132;
}

.alert-banner--success .alert-banner__icon {
  background: #0f9d58;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 157, 88, 0.18);
}

.alert-banner--success .alert-banner__title {
  color: #0f5132;
}

/* Info variant */
.alert-banner--info {
  border-color: #c7d9f4;
  background: linear-gradient(135deg, #f5f9ff, #eaf2ff);
  color: #1f3a63;
}

.alert-banner--info .alert-banner__icon {
  background: #2f6fbd;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(47, 111, 189, 0.18);
}

.alert-banner--info .alert-banner__title {
  color: #1f3a63;
}
