:root{
  --bg:#f7f3ea;          /* 乳白底 */
  --panel:#ffffff;
  --panel2:#fffdf8;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#e5e7eb;

  --accent:#2563eb;
  --accent2:#7c3aed;

  --good:#16a34a;
  --warn:#d97706;
  --bad:#dc2626;

  --shadow: 0 14px 36px rgba(15, 23, 42, .10);
  --shadow2: 0 10px 24px rgba(15, 23, 42, .08);

  --radius: 16px;
  --radius2: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(900px 650px at 20% 5%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 650px at 80% 10%, rgba(124,58,237,.10), transparent 55%),
    radial-gradient(800px 620px at 60% 90%, rgba(22,163,74,.08), transparent 60%),
    var(--bg);
}

.app{display:flex; min-height:100vh;}
.sidebar{
  width:285px; padding:18px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,253,248,.88));
  border-right: 1px solid var(--line);
  display:flex; flex-direction:column; gap:14px;
  position:sticky; top:0; height:100vh;
}

.brand{display:flex; gap:12px; align-items:center; padding:12px; border-radius:var(--radius2);
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(124,58,237,.08));
  box-shadow: var(--shadow);
  border: 1px solid rgba(37,99,235,.10);
}
.brand__logo{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, rgba(37,99,235,.92), rgba(124,58,237,.92));
  display:flex;align-items:center;justify-content:center;
  font-weight:900; color:#ffffff;
}
.brand__title{font-weight:900; letter-spacing:.2px}
.brand__sub{font-size:12px; color:var(--muted); margin-top:2px}

.sidebar__section{padding:10px;}
.sidebar__label{font-size:12px; color:var(--muted); margin:6px 4px 10px;}
.nav{display:flex; flex-direction:column; gap:8px;}
.nav__item{
  width:100%;
  border:1px solid var(--line);
  background: rgba(255,255,255,.72);
  color:var(--text);
  border-radius:14px;
  padding:13px 14px;
  min-height:52px;
  display:flex; align-items:flex-start; gap:10px;
  text-align:left;
  cursor:pointer;
  transition: .15s transform, .15s background, .15s border, .15s box-shadow;
}
.nav__item span{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.2;}
.nav__item:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
}
.nav__item.active{
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(124,58,237,.08));
  border-color: rgba(37,99,235,.22);
}
.nav__dot{width:10px;height:10px;border-radius:10px;background:rgba(124,58,237,.55); box-shadow:0 0 0 4px rgba(124,58,237,.10)}
.nav__item.active .nav__dot{background:rgba(37,99,235,.80); box-shadow:0 0 0 4px rgba(37,99,235,.12)}

.sidebar__footer{margin-top:auto; padding:10px; display:flex; flex-direction:column; gap:10px;}
.userbox{display:flex; gap:10px; align-items:center; padding:10px; border-radius:var(--radius);
  background: rgba(255,255,255,.80);
  border:1px solid var(--line);
}
.userbox__avatar{width:38px;height:38px;border-radius:14px;background:rgba(37,99,235,.10);
  display:flex;align-items:center;justify-content:center;font-weight:900; color:#1d4ed8;}
.userbox__name{font-weight:900}
.userbox__role{font-size:12px; color:var(--muted)}
.row{display:flex; align-items:center;}
.gap{gap:10px}
.tiny{font-size:12px}
.muted{color:var(--muted)}

.main{flex:1; display:flex; flex-direction:column;}
.topbar{
  padding:18px 18px 10px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  align-items:end;
  gap:14px;
}
.topbar__left{justify-self:start;}
.topbar__center{justify-self:center;}
.topbar__right{justify-self:end;}


/* ===== Topbar clocks ===== */
.clockboard{
  display:flex;
  gap:10px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.70);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.clockboard__item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:86px;
  line-height:1.1;
}
.clockboard__label{
  font-size:11px;
  color:var(--muted);
  margin-bottom:4px;
  white-space:nowrap;
}
.clockboard__time{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:14px;
  font-weight:900;
  letter-spacing:.8px;
  color:var(--text);
  white-space:nowrap;
}
@media (max-width: 980px){
  .clockboard__item{min-width:72px;}
  .clockboard__time{font-size:13px;}
}
@media (max-width: 820px){
  .topbar{grid-template-columns: 1fr; align-items:start;}
  .topbar__center{justify-self:start;}
  .topbar__right{justify-self:start;}
}

.h1{font-size:22px; font-weight:1000; letter-spacing:.2px}
.crumb{font-size:12px; color:var(--muted); margin-top:4px}

.search{display:flex; gap:10px; align-items:center;}
.input{
  width:100%;
  padding:10px 12px;
  background: rgba(255,255,255,.88);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:14px;
  outline:none;
}
.input::placeholder{color:rgba(107,114,128,.85)}
.btn{
  border:1px solid rgba(37,99,235,.20);
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(124,58,237,.08));
  color:var(--text);
  padding:12px 14px;
  min-height:44px;
  border-radius:14px;
  cursor:pointer;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  /* Force single-line buttons across the system (no vertical/2-line wrapping) */
  white-space:nowrap;
  word-break:normal;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1;
  max-width:100%;
  transition:.15s transform, .15s filter, .15s box-shadow;
}
.btn:hover{transform: translateY(-1px); filter:brightness(1.02); box-shadow: var(--shadow2);}
.btn.ghost{
  background: rgba(255,255,255,.80);
  border:1px solid var(--line);
}
.btn.danger{
  border-color: rgba(220,38,38,.22);
  background: linear-gradient(135deg, rgba(220,38,38,.10), rgba(124,58,237,.06));
}
.btn.icon{width:44px; min-height:44px; padding:12px 0; text-align:center;}

.content{padding:10px 18px 22px; display:flex; flex-direction:column; gap:14px;}

.grid{display:grid; gap:12px;}
.grid.cols-4{grid-template-columns: repeat(4, minmax(0, 1fr));}
.grid.cols-3{grid-template-columns: repeat(3, minmax(0, 1fr));}
.grid.cols-2{grid-template-columns: repeat(2, minmax(0, 1fr));}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,253,248,.90));
  border:1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding: 14px;
}
.card__title{font-weight:1000; margin-bottom:10px;}
.kpi{display:flex; flex-direction:column; gap:6px;}
.kpi__num{font-size:26px; font-weight:1000}
.kpi__label{font-size:12px; color:var(--muted)}
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.82);
  font-size:12px; color:var(--muted);
}
.dot{width:9px;height:9px;border-radius:99px;}
.dot.good{background:var(--good)}
.dot.warn{background:var(--warn)}
.dot.bad{background:var(--bad)}
.sep{height:1px; background: var(--line); margin:10px 0;}

/* ===== Dashboard: project stats card ===== */
.span-2{grid-column: span 2;}

.projstats{margin-top:6px;}
.projstats__row{
  display:grid;
  grid-template-columns: 1fr 92px;
  gap:10px;
  align-items:center;
  padding:8px 0;
  border-top:1px dashed var(--line);
}
.projstats__head{
  border-top:0;
  padding-top:0;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.projstats__name{
  font-weight:900;
  line-height:1.25;
  white-space:normal;
  word-break:break-word;
}
.projstats__qty,.projstats__qtyhead{
  justify-self:end;
  text-align:right;
  font-weight:1000;
}



.subhead{display:flex; align-items:center; gap:10px; margin:8px 0 6px;}
.subhead__title{font-weight:1000;}
.subhead__line{flex:1; height:1px; background: var(--line);}


.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius: var(--radius);
}
.table th,.table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  font-size:13px;
  vertical-align:middle;
}
.table th{color:var(--muted); font-weight:1000; text-align:left;}
.table td:not(.actions){white-space:normal; overflow-wrap:anywhere;}
.table tr:hover td{background: rgba(37,99,235,.04);}
/* Actions area: keep buttons in a single horizontal row, allow horizontal scroll if needed */
.table td.actions{
  white-space:nowrap;
  /* keep td as table-cell so row borders align */
}
.table td.actions .actions-grid{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:nowrap;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.table td.actions .btn{flex:0 0 auto;}

/* Actions layout: previously 2x2 grid; now force single-line horizontal row */
.actions-grid{display:flex; gap:10px; align-items:center; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch;}
.actions-grid .btn{width:auto; flex:0 0 auto; justify-content:center;}
.mt6{margin-top:6px;}

/* Generic disabled buttons */
.btn[disabled], .btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none !important;
  box-shadow:none !important;
}

/* Tiny checkbox column */
.table th.tiny, .table td.tiny{ width:44px; text-align:center; }
.table td.tiny{ vertical-align:middle; }
.table input[type="checkbox"]{ width:16px; height:16px; accent-color: var(--accent); }

/* Deploy filter chips */
.deploy-chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  padding:10px 2px 2px;
}
.chip{
  border:1px solid var(--line);
  background: rgba(255,255,255,.86);
  border-radius:999px;
  padding:8px 12px;
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  font-weight:1000;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.chip:hover{ background: rgba(37,99,235,.05); border-color: rgba(37,99,235,.28); }
.chip.active{ background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.35); }
.chip__label{ max-width: 160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chip__n{
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:1000;
  background: rgba(15,23,42,.06);
  border:1px solid rgba(229,231,235,.95);
}
.chip.active .chip__n{ background: rgba(37,99,235,.16); border-color: rgba(37,99,235,.22); color: var(--accent); }


/* Card-style rows (used across record tables) */
.table.table--cards{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
  border-radius:0;
  overflow:visible;
  /* remove outer table border/background so only row-cards show */
  background: transparent;
  border: 0;
}
.table--cards thead th{
  border-bottom:0 !important;
  padding-bottom:8px;
  background: transparent;
  white-space: nowrap;
}
.table--cards thead tr{border-bottom:0 !important;}

.table--cards tbody td{
  background: rgba(255,255,255,.92);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}
.table--cards tbody td:first-child{
  border-left:1px solid var(--line);
  border-top-left-radius:14px;
  border-bottom-left-radius:14px;
}
.table--cards tbody td:last-child{
  border-right:1px solid var(--line);
  border-top-right-radius:14px;
  border-bottom-right-radius:14px;
}
.table--cards tbody tr:hover td{
  background: rgba(37,99,235,.04);
}

.pill{
  display:inline-block; white-space:nowrap;
  padding:5px 10px; border-radius:999px;
  font-size:12px; font-weight:1000;
  border:1px solid var(--line);
  background: rgba(255,255,255,.85);
}
.pill.good{color:var(--good); border-color: rgba(22,163,74,.22); background: rgba(22,163,74,.06);}
.pill.warn{color:var(--warn); border-color: rgba(217,119,6,.22); background: rgba(217,119,6,.06);}
.pill.bad{color:var(--bad); border-color: rgba(220,38,38,.22); background: rgba(220,38,38,.06);}

.toolbar{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.toolbar .input{max-width:260px}
.right{margin-left:auto}

.thumb{
  width:42px; height:42px; border-radius:12px; object-fit:cover;
  border:1px solid var(--line);
  background: rgba(0,0,0,.03);
}
.thumb.lg{width:120px; height:120px; border-radius:18px;}
.thumbwrap{display:flex; align-items:center; gap:10px;}
/* Allow long text in flex cells to wrap (avoid squeezing action buttons) */
.thumbwrap > div{min-width:0;}
.thumbwrap .muted{white-space:normal; overflow-wrap:anywhere;}
.filehint{font-size:12px; color:var(--muted); margin-top:6px}

.modal{position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:50;}
.modal.show{display:flex;}
.modal__mask{position:absolute; inset:0; background: rgba(15,23,42,.30);}
.modal__panel{
  position:relative;
  width:min(820px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow:auto;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,253,248,.96));
  border:1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}
.modal__head{display:flex; align-items:center; justify-content:space-between; padding:14px 14px 10px;}
.modal__title{font-weight:1000}
.modal__body{padding: 0 14px 10px;}
.formpanel{padding:12px; border:1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.70); box-shadow: 0 6px 18px rgba(15,23,42,.05);}
.formpanel .sep{margin:10px 0}
.modal__foot{padding: 10px 14px 14px; display:flex; gap:10px; justify-content:flex-end;}
.form{display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px;}
.form .full{grid-column: 1 / -1;}
.label{font-size:12px; color:var(--muted); margin:0 0 6px 2px;}
textarea.input{min-height:90px; resize:vertical;}

@media (max-width: 980px){
  .sidebar{width:250px}
  .grid.cols-4{grid-template-columns: repeat(2, minmax(0, 1fr));}
  .form{grid-template-columns: 1fr;}
}
@media (max-width: 820px){
  .app{flex-direction:column;}
  .sidebar{position:relative; width:100%; height:auto;}
}

/* Wider date inputs (Return date etc.) */
.date-long{ min-width: 220px; width: 100%; }
@media (min-width: 720px){ .date-long{ min-width: 260px; } }

/* Make date inputs wider for readability */
input[type="date"]{ min-width: 220px; }
@media (min-width: 720px){ input[type="date"]{ min-width: 260px; } }

/* Extra wide return-date input */
.date-wide{ min-width: 300px; width: 100%; }
@media (min-width: 720px){ .date-wide{ min-width: 340px; } }

/* Wider date display cells */
.date-cell{ min-width: 140px; }


.langselect{width:auto; min-width:110px; padding:10px 12px; margin-left:10px; cursor:pointer}

.nowrap{white-space:nowrap}

.btn.tiny{padding:6px 10px; font-size:12px}

/* ====== V12 Aesthetic polish (no functional changes) ====== */
:root{
  --ring: rgba(37,99,235,.28);
  --ring2: rgba(124,58,237,.20);
  --gridline: rgba(15,23,42,.030);
  --gridgap: 44px;
  --grad-border: linear-gradient(135deg, rgba(37,99,235,.34), rgba(124,58,237,.22), rgba(22,163,74,.16));
  --grad-border-strong: linear-gradient(135deg, rgba(37,99,235,.55), rgba(124,58,237,.35), rgba(22,163,74,.22));
}

/* Subtle blueprint/grid + diamond texture overlay */
body{
  background:
    radial-gradient(900px 650px at 20% 5%, rgba(37,99,235,.11), transparent 60%),
    radial-gradient(900px 650px at 80% 10%, rgba(124,58,237,.11), transparent 55%),
    radial-gradient(800px 620px at 60% 90%, rgba(22,163,74,.08), transparent 60%),
    repeating-linear-gradient(0deg, var(--gridline) 0 1px, transparent 1px var(--gridgap)),
    repeating-linear-gradient(90deg, var(--gridline) 0 1px, transparent 1px var(--gridgap)),
    var(--bg);
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    repeating-linear-gradient(45deg, rgba(37,99,235,.030) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(-45deg, rgba(124,58,237,.024) 0 1px, transparent 1px 22px),
    radial-gradient(900px 540px at 10% 15%, rgba(255,255,255,.40), transparent 55%),
    radial-gradient(820px 520px at 88% 18%, rgba(255,255,255,.32), transparent 55%),
    radial-gradient(920px 560px at 60% 88%, rgba(255,255,255,.26), transparent 60%);
  opacity:.85;
}

/* Better glass feel */
.sidebar{
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(15,23,42,.10);
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247,243,234,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229,231,235,.85);
}

/* Polished inputs & focus rings */
.input{
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.input:focus{
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 0 0 4px var(--ring);
}

.nav__item:focus, .btn:focus{
  outline: 3px solid rgba(37,99,235,.25);
  outline-offset: 2px;
}

/* Gradient borders for cards */
.card{
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,253,248,.90)) padding-box,
    var(--grad-border) border-box;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.card:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(15,23,42,.12);
}

/* KPI cards: a bit more "wow" */
.card.kpi{
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88)) padding-box,
    var(--grad-border-strong) border-box;
}
.card.kpi::after{
  content:"";
  position:absolute;
  inset:-40px -60px auto -60px;
  height:160px;
  background: radial-gradient(closest-side, rgba(37,99,235,.16), transparent 70%);
  transform: rotate(-8deg);
  pointer-events:none;
}

/* Buttons: clearer depth + nicer hover */
.btn{
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,.60), rgba(255,255,255,.10)) padding-box,
    linear-gradient(135deg, rgba(37,99,235,.28), rgba(124,58,237,.18)) border-box;
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
}
.btn:hover{ box-shadow: 0 14px 28px rgba(15,23,42,.10); }
.btn:active{
  transform: translateY(0px);
  filter: brightness(.99);
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
}
.btn.ghost{
  background: rgba(255,255,255,.75);
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.btn.danger{
  background:
    linear-gradient(180deg, rgba(255,255,255,.56), rgba(255,255,255,.10)) padding-box,
    linear-gradient(135deg, rgba(220,38,38,.26), rgba(124,58,237,.12)) border-box;
}

/* Tables: slightly more premium */
.table{
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(229,231,235,.85);
}
.table thead th{
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.table tr:hover td{ background: rgba(37,99,235,.045); }

/* Modals: add a soft highlight edge */
.modal__panel{
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,.985), rgba(255,253,248,.96)) padding-box,
    var(--grad-border) border-box;
}

/* Selects: nicer arrow area */
select.input{
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(107,114,128,.85) 50%),
    linear-gradient(135deg, rgba(107,114,128,.85) 50%, transparent 50%),
    linear-gradient(to right, rgba(229,231,235,.0), rgba(229,231,235,.0));
  background-position:
    calc(100% - 18px) 55%,
    calc(100% - 12px) 55%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

/* Scrollbars */
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb{
  background: rgba(100,116,139,.28);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-track{ background: rgba(0,0,0,.03); }

@media (prefers-reduced-motion: reduce){
  .btn, .card, .nav__item, .input{ transition: none !important; }
}


/* Fix class naming: lang-select (used in HTML) */
.lang-select{ width:auto; min-width:110px; cursor:pointer }

/* ====== V13 Buttons + KPI cards visual upgrade (no functional changes) ====== */
:root{
  --btn-shadow: 0 12px 26px rgba(15,23,42,.10);
  --btn-shadow-hover: 0 18px 34px rgba(15,23,42,.14);
  --btn-border: linear-gradient(135deg, rgba(37,99,235,.34), rgba(124,58,237,.22), rgba(22,163,74,.14));
  --btn-border-ghost: linear-gradient(135deg, rgba(229,231,235,.95), rgba(229,231,235,.55));
  --kpi-glow: radial-gradient(closest-side, rgba(37,99,235,.18), transparent 70%);
  --kpi-glow2: radial-gradient(closest-side, rgba(124,58,237,.14), transparent 72%);
}

/* Buttons feel more "premium" */
.btn{
  position: relative;
  overflow: hidden;
  min-height: 38px;
  letter-spacing: .15px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,.74), rgba(255,255,255,.20)) padding-box,
    var(--btn-border) border-box;
  box-shadow: var(--btn-shadow);
}
.btn::before{
  content:"";
  position:absolute;
  inset:-40% -50%;
  background: linear-gradient(120deg, rgba(255,255,255,.70), rgba(255,255,255,0) 45%, rgba(255,255,255,.25));
  transform: translateX(-60%) rotate(8deg);
  opacity:.55;
  pointer-events:none;
  transition: transform .35s ease, opacity .35s ease;
}
.btn:hover{
  box-shadow: var(--btn-shadow-hover);
}
.btn:hover::before{
  transform: translateX(-18%) rotate(8deg);
  opacity:.70;
}
.btn:active{
  box-shadow: 0 10px 22px rgba(15,23,42,.10);
}

.btn.ghost{
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.62)) padding-box,
    var(--btn-border-ghost) border-box;
  box-shadow: 0 10px 20px rgba(15,23,42,.08);
}
.btn.ghost::before{ opacity:.35; }

.btn.danger{
  color: #7f1d1d;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.18)) padding-box,
    linear-gradient(135deg, rgba(220,38,38,.34), rgba(124,58,237,.18)) border-box;
}
.btn.danger::before{ opacity:.45; }

/* Smaller action buttons still look consistent */
.btn.tiny{
  padding: 7px 10px;
  min-height: 34px;
  border-radius: 12px;
  font-size: 12px;
}
.actions-grid .btn{
  min-height: 36px;
  border-radius: 14px;
}

/* KPI cards: more depth + nicer number */
.card.kpi{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding: 16px;
  overflow:hidden;
}
.card.kpi::before{
  content:"";
  position:absolute;
  inset:auto -40px -60px auto;
  width:180px;
  height:180px;
  background: var(--kpi-glow2);
  filter: blur(1px);
  transform: rotate(12deg);
  pointer-events:none;
  opacity:.9;
}
.card.kpi::after{
  /* keep the original glow but refine it a bit */
  inset:-50px -70px auto -70px;
  height:190px;
  background: var(--kpi-glow);
  opacity:.95;
}

.card.kpi .kpi__num{
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.6px;
  font-weight: 1000;
  color: var(--text);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)){
  .card.kpi .kpi__num{
    background: linear-gradient(135deg, rgba(37,99,235,1), rgba(124,58,237,1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 6px 14px rgba(15,23,42,.10));
  }
}

.card.kpi .kpi__label{
  font-size: 12px;
  color: rgba(55,65,81,.75);
  font-weight: 900;
}

.card.kpi .sep{
  height: 1px;
  background: linear-gradient(90deg, rgba(37,99,235,.26), rgba(124,58,237,.18), rgba(22,163,74,.12));
  opacity: .95;
  margin: 6px 0;
}

.card.kpi .badge{
  align-self:flex-start;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(229,231,235,.92);
  box-shadow: 0 10px 20px rgba(15,23,42,.08);
}


/* Pager */
.pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:12px;
  padding-top:10px;
  border-top:1px dashed rgba(229,231,235,.9);
  flex-wrap:wrap;
}
.pager__meta{
  font-size:12px;
  color:var(--muted);
}
.pager__controls{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.pager__controls .btn.tiny{
  min-height:34px;
}
.pager__controls .btn[disabled]{
  opacity:.45;
  cursor:not-allowed;
  transform:none !important;
  box-shadow:none !important;
}

/* Topbar export button: keep text in one line (no 2-row wrapping) */
#btnExportCSV,
#btnExportCSV span{
  white-space: nowrap;
  word-break: normal;
}
#btnExportCSV{ min-width: 110px; }


.truncate{max-width:240px;display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom;}


/* Required field mark */
.req{ color:#d40000; font-weight:800; margin-left:6px; }
