
/* UPDATE BANNER */
.update-banner{background:#f9731610;border:1px solid #f9731640;border-radius:10px;
  padding:12px 14px;margin-bottom:14px;font-size:13px;color:var(--orange);display:none;gap:10px;flex-wrap:wrap;}
.update-banner.show{display:flex;}
.update-btn{background:var(--orange);color:#070c14;border:none;border-radius:6px;
  padding:7px 14px;font-size:13px;font-weight:800;cursor:pointer;width:100%;}

/* ADD FORM */
.addsec{background:var(--bg2);border:1px solid var(--border2);border-radius:var(--radius);
  padding:16px;margin-bottom:16px;}
.atitle{font-size:11px;font-weight:700;color:var(--muted);letter-spacing:1px;
  text-transform:uppercase;margin-bottom:14px;}
.fgrid{display:flex;flex-direction:column;gap:12px;}
.fgrid-row{display:grid;grid-template-columns:1fr;gap:10px;}
.fgrid-row.main{align-items:end;}
.fgrid-row.support{align-items:end;}
.frow2{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.fl label{display:block;font-size:10px;font-weight:700;color:var(--muted);
  letter-spacing:.5px;text-transform:uppercase;margin-bottom:5px;}
.fl input,.fl select{width:100%;background:var(--bg);border:1px solid var(--border);
  border-radius:9px;padding:11px 13px;color:var(--text);font-size:15px;outline:none;
  -webkit-appearance:none;appearance:none;transition:border-color .2s;}
.fl input:focus,.fl select:focus{border-color:var(--blue);}
.fl input.mono{font-family:'IBM Plex Mono',monospace;}
.fl select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a6a8a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;padding-right:32px;}
.kur-note{font-size:11px;margin-top:4px;}
.kur-note.live{color:var(--green);}
.kur-note.future{color:var(--orange);}
.kur-row{display:flex;align-items:center;gap:8px;}
.kur-val{font-family:'IBM Plex Mono',monospace;font-size:18px;font-weight:700;color:var(--muted2);}
.kur-val.future-kur{color:var(--orange);}
.abtn{width:100%;background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:#070c14;border:none;border-radius:9px;padding:13px;font-weight:800;
  font-size:15px;cursor:pointer;margin-top:4px;}
.abtn:active{opacity:.85;}
.abtn.loading,.mini-btn.loading,.merge-btn.loading,.bdel.loading,.gbtn.loading{pointer-events:none;opacity:.7;}
.abtn.loading::after,.mini-btn.loading::after,.merge-btn.loading::after,.bdel.loading::after,.gbtn.loading::after{
  content:"";display:inline-block;width:14px;height:14px;margin-left:8px;
  border:2px solid transparent;border-top-color:currentColor;border-radius:50%;
  animation:spin .6s linear infinite;vertical-align:middle;}
@keyframes spin{to{transform:rotate(360deg);}}

/* TABLE / CARD LIST */
.tsec{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;}
.thead2{display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;border-bottom:1px solid var(--border);flex-wrap:wrap;gap:8px;}
.ttitle2{font-size:11px;font-weight:700;color:var(--muted);letter-spacing:1px;text-transform:uppercase;}
.ttools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.toolbtn{background:var(--bg3);border:1px solid var(--border);color:var(--text);
  border-radius:8px;padding:8px 12px;font-size:12px;font-weight:700;cursor:pointer;}
.toolbtn:hover{border-color:var(--border2);}
.toolselect{background:var(--bg3);border:1px solid var(--border);color:var(--text);
  border-radius:8px;padding:8px 34px 8px 12px;font-size:12px;font-weight:700;cursor:pointer;
  -webkit-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236a8aaa' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;}
.ftabs{display:flex;gap:6px;flex-wrap:wrap;}
.ftab{padding:4px 12px;border-radius:20px;font-size:11px;font-weight:700;cursor:pointer;
  border:1px solid var(--border);background:var(--bg3);color:var(--muted);}
.ftab.f-all.on{background:var(--bg4);border-color:var(--border2);color:var(--text);}
.ftab.f-nakit.on{background:#22c55e18;border-color:#22c55e;color:#22c55e;}
.ftab.f-kk.on{background:#3a8fff18;border-color:var(--blue);color:var(--blue);}
.ftab.f-cek.on{background:#f0a50018;border-color:var(--accent);color:var(--accent);}
.ftab.f-past.on{background:#5aa9ff18;border-color:#5aa9ff;color:#5aa9ff;}
.ftab.f-future.on{background:#ef444418;border-color:#ef4444;color:#ef4444;}
.tcount{font-size:12px;color:var(--muted);font-family:'IBM Plex Mono',monospace;}


/* SEARCH */
.search-wrap{padding:10px 16px;border-bottom:1px solid var(--border);}
.search-box{display:flex;align-items:center;gap:8px;background:var(--bg);
  border:1px solid var(--border);border-radius:8px;padding:8px 12px;}
.search-box input{background:transparent;border:none;outline:none;color:var(--text);
  font-size:13px;width:100%;font-family:'IBM Plex Sans',sans-serif;}
.search-box input::placeholder{color:var(--muted);}
.search-icon{color:var(--muted);font-size:14px;flex-shrink:0;}
.search-clear{background:transparent;border:none;color:var(--muted);cursor:pointer;
  font-size:16px;padding:0 2px;line-height:1;flex-shrink:0;}
.search-clear:hover{color:var(--text);}
.empty-state{padding:22px 16px;text-align:center;color:var(--muted2);font-size:13px;line-height:1.6;}
.empty-state strong{display:block;color:#eef5ff;font-size:14px;margin-bottom:6px;}

/* MOBILE cards */
.card-list{display:flex;flex-direction:column;}
.hcard{padding:13px 16px;border-bottom:1px solid var(--border);display:flex;flex-direction:column;gap:6px;}
.hcard:last-child{border-bottom:none;}
.hmonth{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 16px;background:#0d1724;border:0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);color:inherit;text-align:left;cursor:pointer;}
.hmonth:hover,.hmonth.open{background:#101a29;}
.hmonth-title{font-size:12px;font-weight:800;color:#eef5ff;text-transform:capitalize;}
.hmonth-sub{font-size:11px;color:var(--muted2);margin-top:2px;}
.hmonth-total{font-family:'IBM Plex Mono',monospace;font-size:12px;font-weight:800;color:var(--accent);text-align:right;}
.month-toggle-icon{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #2b496a;border-radius:999px;background:#0b1725;color:#a7c4e6;font-size:19px;font-weight:800;line-height:1;flex:0 0 auto;}
.hcard-top{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.hcard-islem{font-weight:700;font-size:14px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.hcard-tl{font-family:'IBM Plex Mono',monospace;font-weight:700;font-size:14px;}
.hcard-bot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.hcard-usd{font-family:'IBM Plex Mono',monospace;font-size:13px;color:var(--blue);}
.hcard-meta{font-family:'IBM Plex Mono',monospace;font-size:11px;color:var(--muted2);}
.hcard-del{background:transparent;border:none;color:var(--muted);font-size:18px;
  cursor:pointer;padding:8px 10px;line-height:1;flex-shrink:0;min-width:44px;min-height:44px;
  display:flex;align-items:center;justify-content:center;border-radius:8px;}
.hcard-del:active{color:var(--red);}
.hcard-actions{display:flex;align-items:center;gap:2px;flex-shrink:0;}

/* DESKTOP */
.desktop-table{display:none;}

/* TOTAL BAR */
.total-bar{background:var(--bg4);border-top:2px solid var(--border2);
  padding:14px 16px;display:flex;justify-content:space-between;align-items:center;}
.total-bar-left{font-size:13px;font-weight:800;}
.total-bar-right{display:flex;gap:16px;align-items:baseline;}
.total-tl{font-family:'IBM Plex Mono',monospace;font-weight:800;font-size:16px;}
.total-usd{font-family:'IBM Plex Mono',monospace;font-weight:800;font-size:16px;color:var(--accent);}

.badge{display:inline-block;padding:2px 7px;border-radius:4px;font-size:10px;font-weight:700;letter-spacing:.3px;}
.badge.N{background:#22c55e18;color:#22c55e;border:1px solid #22c55e30;}
.badge.K{background:#3a8fff18;color:#3a8fff;border:1px solid #3a8fff30;}
.badge.C{background:#f0a50018;color:#f0a500;border:1px solid #f0a50030;}
.badge.category{color:#d8e4f2;border:1px solid #2a405c;background:#122033;}
.kur-future-badge{font-size:9px;font-weight:700;background:#f9731618;color:var(--orange);
  border:1px solid #f9731630;border-radius:4px;padding:1px 5px;margin-left:4px;}

.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);
  background:var(--bg2);border:1px solid var(--green);color:var(--green);
  border-radius:8px;padding:9px 20px;font-size:13px;font-weight:700;display:none;z-index:200;white-space:nowrap;}
.toast.on{display:block;}
.back-to-top{position:fixed;bottom:20px;right:20px;width:44px;height:44px;
  background:var(--bg2);border:1px solid var(--border2);color:var(--accent);
  border-radius:50%;font-size:20px;font-weight:800;cursor:pointer;z-index:90;
  display:none;align-items:center;justify-content:center;
  box-shadow:0 4px 16px #00000040;transition:opacity .2s,transform .2s;}
.back-to-top.show{display:flex;}
.back-to-top:hover{transform:translateY(-2px);box-shadow:0 6px 20px #00000050;}
.back-to-top:active{transform:translateY(0);}
.notice-title{color:#eef5ff;font-size:16px;font-weight:800;margin-bottom:10px;}
#atxt{white-space:pre-line;text-align:left;}

.overlay{display:none;position:fixed;inset:0;background:#000000bb;z-index:100;
  align-items:flex-end;justify-content:center;padding:0;}
.overlay.open{display:flex;}
.mbox{background:var(--bg2);border:1px solid var(--border2);border-radius:16px 16px 0 0;
  padding:28px 24px 36px;width:100%;max-width:500px;text-align:center;}
.mbox p{color:var(--text);margin-bottom:20px;font-size:15px;line-height:1.5;}
.macts{display:flex;flex-direction:column;gap:10px;}
.bdel{background:#ef444422;border:1px solid var(--red);color:var(--red);
  border-radius:9px;padding:13px;cursor:pointer;font-weight:700;font-size:15px;}
.bcan{background:var(--bg3);border:1px solid var(--border);color:var(--muted);
  border-radius:9px;padding:13px;cursor:pointer;font-size:15px;}

@media(max-width:767px){
  input,select,button,textarea{font-size:16px;}
  .topbar{
    min-height:52px;
    padding:12px 14px;
    align-items:flex-start;
    gap:10px;
    flex-direction:column;
  }
  .tbrand{width:100%;}
  .tlogo{
    font-size:16px;
    line-height:1.3;
  }
  .tmeta-line{font-size:10px;}
  .urow{
    width:100%;
    overflow-x:auto;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
    padding-bottom:2px;
  }
  .urow::-webkit-scrollbar{display:none;}
  .orgsel{
    min-width:180px;
    max-width:none;
    flex:1 0 180px;
  }
  .sitebar-btn,.sobtn{
    min-height:40px;
    flex-shrink:0;
  }
  .plan-strip{
    margin:10px 14px 0;
  }
  .plan-usage{
    grid-template-columns:1fr;
  }
  .plan-manage a,.plan-manage button{
    width:100%;
    justify-content:center;
    text-align:center;
  }
  .main{
    padding:14px 14px calc(28px + env(safe-area-inset-bottom));
  }
  .workspace-hero{
    padding:14px;
    border-radius:18px;
    margin-bottom:14px;
  }
  .workspace-tabs{
    position:sticky;
    top:calc(env(safe-area-inset-top) + 112px);
    z-index:30;
    margin:0 -2px 12px;
    padding:2px 2px 10px;
    background:linear-gradient(180deg,var(--bg) 0%,rgba(7,12,20,.92) 100%);
    overflow-x:auto;
    flex-wrap:nowrap;
    scrollbar-width:none;
  }
  .workspace-tabs::-webkit-scrollbar{display:none;}
  .workspace-tab{
    white-space:nowrap;
    flex:0 0 auto;
    min-height:40px;
  }
  .stats,
  .entry-stats,
  .dashboard-kpis,
  .report-stats,
  .compare-grid,
  .frow2,
  .range-grid{
    grid-template-columns:1fr;
  }
  .quick-ranges,
  .ttools,
  .ftabs{
    display:flex;
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .quick-ranges::-webkit-scrollbar,
  .ttools::-webkit-scrollbar,
  .ftabs::-webkit-scrollbar{display:none;}
  .supplier-workspace-grid,
  .supplier-metric-grid{
    grid-template-columns:1fr;
  }
  .supplier-overview-grid,
  .supplier-agreement-stats{
    grid-template-columns:1fr;
  }
  .supplier-agreement-row{
    grid-template-columns:1fr;
    gap:8px;
    padding:14px 0;
  }
  .supplier-workspace-row.active{
    padding:12px 0;
    background:transparent;
    border-radius:0;
  }
  .qbtn,.toolbtn,.toolselect,.ftab{
    flex:0 0 auto;
    min-height:38px;
  }
  .thead2,
  .report-head,
  .entry-head,
  .entry-preview-head{
    align-items:flex-start;
  }
  .entry-title{
    font-size:21px;
    max-width:none;
  }
  .entry-badges{
    width:100%;
  }
  .entry-badge{
    flex:1 1 calc(50% - 4px);
    justify-content:center;
    text-align:center;
  }
  .total-bar{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }
  .total-bar-right{
    width:100%;
    justify-content:space-between;
  }
  .toast{
    left:14px;
    right:14px;
    bottom:calc(18px + env(safe-area-inset-bottom));
    transform:none;
    text-align:center;
    white-space:normal;
  }
  .overlay{
    padding-bottom:env(safe-area-inset-bottom);
  }
  .mbox{
    max-width:none;
    max-height:min(88vh,760px);
    overflow:auto;
    padding:24px 18px calc(28px + env(safe-area-inset-bottom));
  }
}

/* Final V2 mobile guard: keep legacy mobile rules from resurfacing the old rail/buttons. */
@media(max-width:767px){
  body.v2-shell .v2-rail{
    display:none !important;
  }
  body.v2-shell .stats{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  body.v2-shell .workspace-tab{
    background:#101a28;
    color:#98afc7;
    border:1px solid #27405c;
    -webkit-appearance:none;
    appearance:none;
  }
  body.v2-shell .workspace-tab.on{
    background:#12233a;
    color:#eef5ff;
    border-color:#3b618e;
  }
}

@media(max-width:360px){
  body.v2-shell .stats{
    grid-template-columns:1fr !important;
  }
}

/* V2 mobile polish: keep the workspace usable in Safari-sized screens. */
@media(max-width:767px){
  body.v2-shell{
    background:linear-gradient(180deg,#050a11 0%,#07101a 100%);
    overflow-x:hidden;
  }
  body.v2-shell .topbar{
    margin:0;
    padding:14px 16px;
    border-bottom:1px solid #1e344f;
    background:rgba(7,12,20,.96);
  }
  body.v2-shell .tlogo{
    font-size:18px;
    letter-spacing:-.03em;
  }
  body.v2-shell .tmeta-line{
    font-size:10px;
    line-height:1.4;
  }
  body.v2-shell .urow{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:8px;
    padding:10px;
    border-radius:18px;
    background:#0d1724;
    border-color:#223a56;
    overflow:visible;
  }
  body.v2-shell .orgsel,
  body.v2-shell .sitebar-btn{
    min-width:0;
    width:100%;
    min-height:44px;
    border-radius:12px;
    border-color:#2a4668;
    background:#111d2c;
    color:#eef5ff;
  }
  body.v2-shell .sitebar-btn{
    width:auto;
    padding:0 12px;
  }
  body.v2-shell .urow img,
  body.v2-shell .uname,
  body.v2-shell .sobtn{
    display:none;
  }
  body.v2-shell .plan-strip{
    margin:12px 16px 0;
    padding:0;
  }
  body.v2-shell .plan-shell{
    padding:14px;
    border-radius:20px;
    background:linear-gradient(180deg,#101a29,#0b141f);
    border-color:#223a56;
  }
  body.v2-shell .plan-shell-head{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    align-items:start;
  }
  body.v2-shell .plan-toggle{
    width:100%;
    align-items:flex-start;
  }
  body.v2-shell .plan-toggle-icon{
    flex:0 0 30px;
  }
  body.v2-shell .plan-shell-copy{
    display:none;
  }
  body.v2-shell .program-date-box{
    justify-content:flex-start;
    gap:8px;
  }
  body.v2-shell .program-date-copy{
    display:none;
  }
  body.v2-shell .program-date-input,
  body.v2-shell .program-date-reset,
  body.v2-shell .plan-pill{
    min-height:42px;
  }
  body.v2-shell .main{
    padding:14px 14px calc(26px + env(safe-area-inset-bottom));
  }
  body.v2-shell .v2-layout{
    display:block;
  }
  body.v2-shell .v2-rail{
    display:none;
  }
  body.v2-shell .workspace-hero{
    padding:14px;
    border-radius:22px;
    border-color:#223a56;
    background:linear-gradient(180deg,#0f1826,#0a131e);
    overflow:hidden;
  }
  body.v2-shell .stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  body.v2-shell .sc{
    min-height:128px;
    padding:16px;
    border-radius:20px;
    min-width:0;
  }
  body.v2-shell .sc .slabel{
    font-size:12px;
    line-height:1.25;
  }
  body.v2-shell .sc .sval{
    font-size:24px;
    line-height:1.08;
    word-break:break-word;
    overflow-wrap:anywhere;
  }
  body.v2-shell .sc.sc-primary .sval{
    font-size:23px;
  }
  body.v2-shell .stat-card-head{
    display:grid;
    gap:10px;
  }
  body.v2-shell .stat-inline-btn{
    width:100%;
    min-height:38px;
  }
  body.v2-shell .workspace-tabs{
    display:flex;
    flex-wrap:nowrap;
    gap:10px;
    margin:14px -2px 0;
    padding:4px 2px 2px;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    background:transparent;
  }
  body.v2-shell .workspace-tabs::-webkit-scrollbar{
    display:none;
  }
  body.v2-shell .workspace-tab{
    flex:0 0 auto;
    min-height:44px;
    padding:0 18px;
    border-radius:999px;
    border:1px solid #27405c;
    background:#101a28;
    color:#98afc7;
    font-weight:800;
    white-space:nowrap;
    box-shadow:none;
  }
  body.v2-shell .workspace-tab.on{
    background:#12233a;
    border-color:#3b618e;
    color:#eef5ff;
    box-shadow:inset 0 0 0 1px #35577f;
  }
  body.v2-shell .entry-sec,
  body.v2-shell .report-sec,
  body.v2-shell .tsec,
  body.v2-shell .calc-hero{
    padding:16px;
    border-radius:22px;
  }
}

@media(max-width:390px){
  body.v2-shell .urow{
    grid-template-columns:1fr 1fr;
  }
  body.v2-shell .orgsel{
    grid-column:1 / -1;
  }
}

/* Final mobile guard: later legacy mobile rules should not bring back the old rail/buttons. */
@media(max-width:767px){
  body.v2-shell .v2-rail{
    display:none !important;
  }
  body.v2-shell .stats{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  body.v2-shell .workspace-tab{
    background:#101a28;
    color:#98afc7;
    border:1px solid #27405c;
    -webkit-appearance:none;
    appearance:none;
  }
  body.v2-shell .workspace-tab.on{
    background:#12233a;
    color:#eef5ff;
    border-color:#3b618e;
  }
}

@media(max-width:360px){
  body.v2-shell .stats{
    grid-template-columns:1fr !important;
  }
}

@media(max-width:430px){
  .stats{grid-template-columns:1fr;}
  .entry-preview-row,
  .top-row,
  .month-row,
  .compare-month-row,
  .cheque-row,
  .timeline-row,
  .merge-row,
  .manage-row{
    grid-template-columns:1fr;
    align-items:flex-start;
  }
  .entry-preview-amount,
  .vendor-amount{
    text-align:left;
  }
  .ring-wrap{
    grid-template-columns:1fr;
  }
  .calc-compare{
    grid-template-columns:1fr;
  }
}

/* DESKTOP OVERRIDES */
@media(min-width:768px){
  .lwrap{grid-template-columns:minmax(0,1.1fr) minmax(380px,.9fr);gap:28px;}
  .lcard{justify-self:end;}
  .lmeta{grid-template-columns:repeat(3,1fr);}
  .main{max-width:1560px;margin:0 auto;padding:24px 20px 32px;}
  .topbar{padding:14px 20px;}
  .plan-strip{max-width:1560px;margin:18px auto 0;padding:0 20px;}
  .stats{grid-template-columns:1.35fr 1.15fr .8fr .8fr;gap:14px;margin-bottom:18px;}
  .entry-layout{grid-template-columns:1fr;gap:18px;}
  .entry-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
  .site-toolbar{grid-template-columns:1fr;align-items:start;}
  .analysis-top{grid-template-columns:repeat(3,1fr);}
  .dashboard-grid{grid-template-columns:1.15fr .85fr;}
  .dashboard-kpis{grid-template-columns:repeat(4,minmax(0,1fr));}
  .plan-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
  .risk-grid{grid-template-columns:repeat(3,1fr);}
  .report-stats{grid-template-columns:repeat(4,1fr);}
  .smart-strip{grid-template-columns:repeat(3,minmax(0,1fr));}
  .dash-grid{grid-template-columns:1.2fr .9fr .9fr;}
  .sval{font-size:22px;}
  .fgrid{display:grid;grid-template-columns:1fr;gap:12px;}
  .fgrid-row.main{grid-template-columns:1.45fr 1.55fr 1fr 1fr;}
  .fgrid-row.support{grid-template-columns:1.15fr .95fr .85fr 1.4fr auto;}
  .frow2{display:contents;}
  .abtn{width:auto;height:42px;padding:0 24px;margin-top:0;white-space:nowrap;}
  .fl input,.fl select{padding:9px 12px;font-size:13px;}
  .card-list{display:none;}
  .desktop-table{display:block;overflow-x:auto;}
  .total-bar{display:none;}
  .overlay{align-items:center;padding:20px;}
  .mbox{border-radius:14px;width:360px;}
  .macts{flex-direction:row;justify-content:center;}
  .bdel,.bcan{padding:9px 24px;font-size:14px;}
  .manage-top{grid-template-columns:1.4fr .9fr;}
  .manage-grid{grid-template-columns:1.2fr .9fr;}
  .workspace-grid,.workspace-panel,.entry-sec,.report-sec,.tsec{width:100%;}
  table{width:100%;border-collapse:collapse;}
  thead tr{background:var(--bg3);}
  th{text-align:left;padding:10px 14px;font-size:10px;font-weight:700;color:var(--muted);
    letter-spacing:1px;text-transform:uppercase;border-bottom:1px solid var(--border);}
  th.r,td.r{text-align:right;}
  tbody tr{border-bottom:1px solid var(--border);transition:background .15s,transform .15s;}
  tbody tr:last-child{border-bottom:none;}
  tbody tr:hover{background:var(--bg3);transform:translateY(-1px);}
  tbody tr.month-group-row{background:#0d1724;border-top:1px solid #263d59;border-bottom:1px solid #263d59;cursor:pointer;}
  tbody tr.month-group-row:hover,tbody tr.month-group-row.open{background:#101a29;transform:none;}
  .month-group-inner{display:flex;align-items:center;justify-content:space-between;gap:14px;color:#eef5ff;font-family:'IBM Plex Mono',monospace;font-size:12px;}
  .month-group-inner > div:first-child{display:flex;align-items:center;gap:10px;min-width:0;}
  .month-group-inner strong{font-family:'IBM Plex Sans',sans-serif;font-size:13px;text-transform:capitalize;letter-spacing:.2px;}
  .month-group-inner span:not(.month-toggle-icon){color:var(--muted2);font-size:11px;font-weight:600;}
  td{padding:11px 14px;font-size:13px;vertical-align:middle;}
  td.ti{font-weight:700;color:#eef5ff;}
  td.tt{font-family:'IBM Plex Mono',monospace;font-weight:700;}
  td.td2{font-family:'IBM Plex Mono',monospace;color:var(--blue);}
  td.tr2{font-family:'IBM Plex Mono',monospace;font-size:11px;color:var(--muted2);}
  tfoot tr{background:var(--bg4);border-top:2px solid var(--border2);}
  tfoot td{font-weight:800;font-size:14px;padding:13px 14px;}
  .kur-cell{display:flex;align-items:center;justify-content:flex-end;gap:6px;}
  .kl{font-family:'IBM Plex Mono',monospace;font-size:12px;color:var(--muted2);}
  .dbtn{background:#0e1825;border:1px solid #233a55;color:var(--muted);cursor:pointer;font-size:14px;
    padding:7px 9px;border-radius:10px;}
  .dbtn:hover{color:var(--red);background:#ef444418;border-color:#a83d3d;}
  .ebtn:hover{color:var(--blue);background:#3a8fff18;border-color:#3a8fff55;}
}

/* V2 SAFE REDESIGN */
@media(min-width:1100px){
  body.v2-shell{
    background:
      radial-gradient(circle at 0% 0%,rgba(58,143,255,.12) 0,transparent 26%),
      radial-gradient(circle at 100% 0%,rgba(240,165,0,.11) 0,transparent 20%),
      linear-gradient(180deg,#050a11 0%,#070d15 38%,#08111b 100%);
  }
  body.v2-shell .topbar{
    max-width:1560px;
    margin:18px auto 0;
    padding:18px 22px;
    border:1px solid rgba(52,79,111,.72);
    border-radius:28px;
    background:rgba(8,14,23,.82);
    box-shadow:0 24px 60px rgba(0,0,0,.24);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    top:14px;
  }
  body.v2-shell .tlogo{
    font-size:22px;
    letter-spacing:-.04em;
  }
  body.v2-shell .tmeta-line{
    font-size:12px;
    color:#88a3bf;
  }
  body.v2-shell .urow{
    padding:10px;
    border-radius:16px;
    background:linear-gradient(180deg,#0f1926,#0b141f);
    border-color:#27405d;
  }
  body.v2-shell .orgsel,
  body.v2-shell .sitebar-btn,
  body.v2-shell .sobtn{
    border-radius:10px;
    border-color:#29415f;
    background:#101a28;
  }
  body.v2-shell .plan-strip{
    max-width:1560px;
    margin:18px auto 0;
    padding:0 18px;
  }
  body.v2-shell .plan-shell{
    border-radius:22px;
    background:
      radial-gradient(circle at top right,rgba(240,165,0,.14) 0,transparent 20%),
      linear-gradient(180deg,#101a29,#0b141f);
    border-color:#243a56;
  }
  body.v2-shell .main{
    max-width:1560px;
    margin:0 auto;
    padding:22px 18px 42px;
  }
  body.v2-shell .v2-layout{
    display:grid;
    grid-template-columns:260px minmax(0,1fr);
    gap:22px;
    align-items:start;
  }
  body.v2-shell .v2-rail{
    position:sticky;
    top:112px;
    display:grid;
    gap:16px;
  }
  body.v2-shell .v2-rail-card,
  body.v2-shell .v2-rail-nav{
    border:1px solid #243a56;
    border-radius:28px;
    background:
      radial-gradient(circle at top left,rgba(58,143,255,.08) 0,transparent 24%),
      linear-gradient(180deg,#0f1825,#0b141f);
    box-shadow:0 20px 48px rgba(0,0,0,.18);
  }
  body.v2-shell .v2-rail-card{
    padding:20px 18px;
  }
  body.v2-shell .v2-rail-kicker{
    font-size:10px;
    font-weight:700;
    letter-spacing:1.2px;
    text-transform:uppercase;
    color:#7d95ad;
    margin-bottom:10px;
  }
  body.v2-shell .v2-rail-title{
    font-size:34px;
    line-height:.93;
    letter-spacing:-.05em;
    font-weight:800;
    color:#eff5ff;
    max-width:8ch;
  }
  body.v2-shell .v2-rail-title span{color:#ffb11e;}
  body.v2-shell .v2-rail-copy{
    margin-top:12px;
    font-size:13px;
    line-height:1.75;
    color:#88a3be;
  }
  body.v2-shell .v2-rail-nav{
    padding:14px;
  }
  body.v2-shell .v2-nav-btn{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:14px 16px;
    border-radius:18px;
    border:1px solid transparent;
    background:transparent;
    color:#e9f1fb;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
    text-align:left;
    transition:all .18s ease;
  }
  body.v2-shell .v2-nav-btn + .v2-nav-btn{margin-top:8px;}
  body.v2-shell .v2-nav-btn:hover{
    background:rgba(255,255,255,.03);
    border-color:#233a56;
  }
  body.v2-shell .v2-nav-btn .v2-nav-meta{
    font-size:10px;
    font-weight:800;
    letter-spacing:1px;
    text-transform:uppercase;
    color:#718aa4;
  }
  body.v2-shell .v2-stage{
    min-width:0;
  }
  body.v2-shell .workspace-hero{
    padding:24px;
    border-radius:30px;
    border-color:#26415e;
    background:
      radial-gradient(circle at top left,rgba(58,143,255,.12) 0,transparent 26%),
      radial-gradient(circle at top right,rgba(240,165,0,.12) 0,transparent 18%),
      linear-gradient(180deg,#0f1826,#0a131e);
    box-shadow:0 28px 70px rgba(0,0,0,.24);
  }
  body.v2-shell .stats{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
  }
  body.v2-shell .sc{
    min-height:136px;
    border-radius:24px;
    border-color:#27415f;
    box-shadow:0 18px 38px rgba(0,0,0,.18);
  }
  body.v2-shell .sc.sc-primary{
    background:
      radial-gradient(circle at top right,rgba(134,239,172,.18) 0,transparent 34%),
      linear-gradient(135deg,#0f2d1f,#123422);
    border-color:#255c3f;
  }
  body.v2-shell .sc.sc-usd{
    background:
      radial-gradient(circle at top right,rgba(123,189,255,.2) 0,transparent 34%),
      linear-gradient(135deg,#0d2440,#12375f);
    border-color:#2b5fa0;
  }
  body.v2-shell .sc.sc-count{
    background:
      radial-gradient(circle at top right,rgba(196,125,255,.18) 0,transparent 34%),
      linear-gradient(135deg,#261543,#3d2265);
    border-color:#6f43b8;
  }
  body.v2-shell .sc.sc-rate{
    background:
      radial-gradient(circle at top right,rgba(255,176,153,.18) 0,transparent 34%),
      linear-gradient(135deg,#3b1d15,#5f2d22);
    border-color:#ad573f;
  }
  body.v2-shell .sc .slabel{
    color:rgba(255,255,255,.72);
  }
  body.v2-shell .sc .sval,
  body.v2-shell .sc .sval.blue,
  body.v2-shell .sc .sval.green,
  body.v2-shell .sc .ssub{
    color:#fff;
  }
  body.v2-shell .workspace-tabs{
    gap:10px;
    padding:6px 0 0;
  }
  body.v2-shell .workspace-tab{
    padding:11px 16px;
    border-radius:999px;
    border-color:#27405c;
    background:rgba(16,26,40,.86);
    color:#98afc7;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
  }
  body.v2-shell .workspace-tab.on{
    background:linear-gradient(135deg,#ffb11e,#ff8a00);
    border-color:transparent;
    color:#08111b;
    box-shadow:0 14px 32px rgba(240,165,0,.2);
  }
  body.v2-shell .workspace-grid,
  body.v2-shell .workspace-panel,
  body.v2-shell .entry-sec,
  body.v2-shell .report-sec,
  body.v2-shell .tsec{
    width:100%;
  }
  body.v2-shell .entry-sec,
  body.v2-shell .report-sec,
  body.v2-shell .tsec{
    padding:24px;
    border-radius:30px;
    border-color:#243a56;
    background:
      radial-gradient(circle at top right,rgba(58,143,255,.08) 0,transparent 22%),
      linear-gradient(180deg,#0f1825,#0b141f);
    box-shadow:0 22px 54px rgba(0,0,0,.2);
  }
  body.v2-shell .entry-layout{
    grid-template-columns:1fr;
    gap:18px;
    align-items:start;
  }
  body.v2-shell .entry-main{
    display:grid;
    gap:16px;
  }
  body.v2-shell .entry-title{
    font-size:46px;
    line-height:.94;
    letter-spacing:-.06em;
    max-width:11ch;
  }
  body.v2-shell .entry-copy{
    font-size:15px;
    max-width:56ch;
    color:#8ca6c1;
  }
  body.v2-shell .entry-side{
    gap:14px;
    grid-template-columns:repeat(3,minmax(0,1fr));
    align-items:start;
  }
  body.v2-shell .entry-stats,
  body.v2-shell .site-toolbar{
    display:contents;
    margin-bottom:0;
  }
  body.v2-shell .entry-badge,
  body.v2-shell .quick-panel,
  body.v2-shell .entry-preview,
  body.v2-shell .entry-stat,
  body.v2-shell .mini-stat,
  body.v2-shell .dash-card,
  body.v2-shell .plan-card,
  body.v2-shell .risk-card,
  body.v2-shell .chart-section{
    border-radius:20px;
    border-color:#26405c;
    background:linear-gradient(180deg,#101a29,#0c1520);
  }
  body.v2-shell .entry-stat,
  body.v2-shell .quick-panel{
    min-height:132px;
    padding:18px;
  }
  body.v2-shell .quick-entry-grid{
    grid-column:span 2;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
  }
  body.v2-shell .entry-stat-value{
    font-size:18px;
  }
  body.v2-shell .entry-stat-sub,
  body.v2-shell .site-meta{
    line-height:1.65;
  }
  body.v2-shell .entry-preview{
    grid-column:1 / -1;
    min-height:100%;
  }
  body.v2-shell #records-section{
    padding:0;
    overflow:hidden;
  }
  body.v2-shell .records-shell{
    padding:22px;
  }
  body.v2-shell .records-toolbar-shell{
    padding:20px;
    border:1px solid #233a55;
    border-radius:24px;
    background:
      radial-gradient(circle at top right,rgba(58,143,255,.08) 0,transparent 24%),
      linear-gradient(180deg,#101927,#0c1520);
    box-shadow:0 18px 40px rgba(0,0,0,.14);
  }
  body.v2-shell .records-toolbar-head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:18px;
    margin-bottom:16px;
    flex-wrap:wrap;
  }
  body.v2-shell .records-toolbar-title{
    font-size:28px;
    line-height:.98;
    letter-spacing:-.04em;
    font-weight:800;
    color:#eff5ff;
    max-width:13ch;
    margin:0 0 6px;
  }
  body.v2-shell .records-toolbar-copy{
    font-size:13px;
    color:#88a3be;
    max-width:56ch;
    margin:0;
  }
  body.v2-shell .records-toolbar-meta{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }
  body.v2-shell .records-mini-pill{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:148px;
    padding:12px 14px;
    border-radius:18px;
    border:1px solid #28415e;
    background:rgba(10,17,26,.7);
  }
  body.v2-shell .records-mini-pill .label{
    font-size:10px;
    font-weight:800;
    letter-spacing:1px;
    text-transform:uppercase;
    color:#7e95ad;
  }
  body.v2-shell .records-mini-pill .value{
    font-size:20px;
    font-weight:800;
    letter-spacing:-.03em;
    color:#eff5ff;
  }
  body.v2-shell .records-mini-pill .sub{
    font-size:12px;
    color:#89a2bc;
  }
  body.v2-shell .records-canvas{
    margin-top:18px;
    padding:18px;
    border-top:1px solid #20354f;
    background:linear-gradient(180deg,#0c1520,#0a121b);
  }
  body.v2-shell .v2-entry-story{
    border:1px solid #26405c;
    border-radius:20px;
    padding:14px;
    background:
      radial-gradient(circle at top right,rgba(58,143,255,.12) 0,transparent 26%),
      linear-gradient(180deg,#101a29,#0d1724);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
  }
  body.v2-shell .v2-story-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    flex-wrap:wrap;
  }
  body.v2-shell .v2-story-kicker{
    font-size:10px;
    font-weight:700;
    letter-spacing:1.2px;
    text-transform:uppercase;
    color:#7d95ad;
    margin-bottom:8px;
  }
  body.v2-shell .v2-story-title{
    font-size:16px;
    line-height:1.1;
    font-weight:800;
    letter-spacing:-.02em;
    color:#eef5ff;
    max-width:none;
  }
  body.v2-shell .v2-story-copy{
    font-size:12px;
    line-height:1.5;
    color:#8aa4be;
    max-width:none;
  }
  body.v2-shell .v2-story-pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
    padding:8px 12px;
    border-radius:999px;
    background:rgba(12,21,32,.84);
    border:1px solid #29425f;
    font-size:10px;
    font-weight:800;
    color:#dce8f5;
  }
  body.v2-shell .v2-story-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
  }
  body.v2-shell .v2-story-card{
    min-height:0;
    padding:12px 14px;
    border-radius:16px;
    border:1px solid #27405c;
    background:linear-gradient(180deg,#0d1724,#0a131f);
    position:relative;
    overflow:hidden;
  }
  body.v2-shell .v2-story-card::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:3px;
    background:#3a8fff;
  }
  body.v2-shell .v2-story-card.warn::before{background:#ffb11e;}
  body.v2-shell .v2-story-card.good::before{background:#22c55e;}
  body.v2-shell .v2-story-label{
    font-size:10px;
    font-weight:700;
    letter-spacing:1px;
    text-transform:uppercase;
    color:#7a93ad;
    margin-bottom:8px;
  }
  body.v2-shell .v2-story-value{
    font-size:16px;
    line-height:1;
    font-weight:800;
    letter-spacing:-.04em;
    color:#eef5ff;
    margin-bottom:6px;
    font-family:'IBM Plex Mono',monospace;
  }
  body.v2-shell .v2-story-text{
    font-size:11px;
    line-height:1.5;
    color:#8aa3bd;
  }
  body.v2-shell .analysis-top{
    display:none;
  }
  body.v2-shell .analysis-tab-meta{
    margin:0 0 16px;
    padding:0;
    font-size:11px;
    color:#7088a1;
  }
  body.v2-shell .overview-spotlight{
    display:grid;
    grid-template-columns:minmax(0,1.3fr) minmax(300px,.7fr);
    gap:14px;
    margin-bottom:14px;
  }
  body.v2-shell .overview-primary{
    min-height:280px;
    padding:24px;
    border-radius:26px;
    border:1px solid #27415f;
    background:
      radial-gradient(circle at top left,rgba(58,143,255,.18) 0,transparent 34%),
      radial-gradient(circle at 85% 22%,rgba(255,177,30,.12) 0,transparent 20%),
      linear-gradient(180deg,#101b2a,#0b141f);
    box-shadow:0 28px 64px rgba(0,0,0,.26);
    position:relative;
    overflow:hidden;
  }
  body.v2-shell .overview-kicker{
    font-size:10px;
    font-weight:800;
    letter-spacing:1.3px;
    text-transform:uppercase;
    color:#7b95b0;
    margin-bottom:10px;
  }
  body.v2-shell .overview-title{
    font-size:42px;
    line-height:.92;
    letter-spacing:-.06em;
    color:#eef5ff;
    max-width:11ch;
    margin-bottom:10px;
  }
  body.v2-shell .overview-title span{color:#ffb11e;}
  body.v2-shell .overview-copy{
    max-width:50ch;
    font-size:13px;
    line-height:1.65;
    color:#8ca6c1;
    margin-bottom:16px;
  }
  body.v2-shell .overview-total{
    font-size:54px;
    line-height:.92;
    letter-spacing:-.06em;
    font-weight:800;
    color:#eef5ff;
    margin-bottom:8px;
  }
  body.v2-shell .overview-total-sub{
    font-size:14px;
    line-height:1.7;
    color:#94b0cb;
    margin-bottom:16px;
    max-width:48ch;
  }
  body.v2-shell .overview-meta-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
  }
  body.v2-shell .overview-meta-pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 14px;
    border-radius:999px;
    border:1px solid #29425f;
    background:rgba(10,18,28,.72);
    color:#dde8f4;
    font-size:12px;
    font-weight:700;
  }
  body.v2-shell .overview-side{
    display:grid;
    gap:12px;
    align-content:start;
  }
  body.v2-shell .overview-side-card{
    min-height:140px;
    padding:20px;
    border-radius:22px;
    border:1px solid #26405c;
    background:linear-gradient(180deg,#101a28,#0c1520);
    box-shadow:0 18px 44px rgba(0,0,0,.16);
  }
  body.v2-shell .overview-side-card.accent{
    background:
      radial-gradient(circle at top right,rgba(255,177,30,.12) 0,transparent 24%),
      linear-gradient(180deg,#101a28,#0c1520);
  }
  body.v2-shell .overview-side-kicker{
    font-size:10px;
    font-weight:800;
    letter-spacing:1.2px;
    text-transform:uppercase;
    color:#7992ab;
    margin-bottom:8px;
  }
  body.v2-shell .overview-side-value{
    font-size:38px;
    line-height:.95;
    letter-spacing:-.05em;
    font-weight:800;
    color:#eef5ff;
    margin-bottom:10px;
  }
  body.v2-shell .overview-side-copy{
    font-size:13px;
    line-height:1.7;
    color:#8ca5bf;
  }
  body.v2-shell #analysis-panel-dashboard .dashboard-kpis{
    display:none;
  }
  body.v2-shell #analysis-panel-dashboard .chart-duo{
    display:grid;
    grid-template-columns:minmax(0,1.6fr) minmax(320px,.72fr);
    gap:18px;
    margin:0 0 14px;
  }
  body.v2-shell #analysis-panel-dashboard .chart-section{
    padding:22px;
    border-radius:24px;
    background:
      radial-gradient(circle at top right,rgba(58,143,255,.08) 0,transparent 22%),
      linear-gradient(180deg,#101a28,#0c1520);
  }
  body.v2-shell #analysis-panel-dashboard .chart-section-title{
    font-size:12px;
    color:#e4edf7;
  }
  body.v2-shell #analysis-panel-dashboard .chart-section-sub{
    color:#7f97af;
  }
  body.v2-shell #analysis-panel-dashboard #chart-trend,
  body.v2-shell #analysis-panel-dashboard #chart-monthly-bars{
    min-height:340px;
  }
  body.v2-shell #analysis-panel-dashboard .dashboard-grid{
    grid-template-columns:1fr;
  }
  body.v2-shell .dashboard-support{
    display:grid;
    grid-template-columns:minmax(0,1.18fr) minmax(320px,.82fr);
    gap:14px;
    margin-top:14px;
  }
  body.v2-shell .dashboard-support .dash-card{
    margin-top:0 !important;
  }
  body.v2-shell .budget-card{
    height:100%;
  }
  body.v2-shell .calc-header{
    margin-bottom:18px;
  }
  body.v2-shell .calc-kicker{
    font-size:10px;
    font-weight:800;
    letter-spacing:1.3px;
    text-transform:uppercase;
    color:#7b95b0;
    margin-bottom:10px;
  }
  body.v2-shell .calc-title{
    font-size:42px;
    line-height:.92;
    letter-spacing:-.06em;
    color:#eef5ff;
    margin-bottom:10px;
    max-width:12ch;
  }
  body.v2-shell .calc-copy{
    max-width:54ch;
    font-size:13px;
    line-height:1.7;
    color:#8ca6c1;
  }
  body.v2-shell .calc-shell{
    gap:16px;
  }
  body.v2-shell .calc-hero{
    padding:22px;
    border-radius:26px;
    border-color:#26415e;
    background:
      radial-gradient(circle at top left,rgba(58,143,255,.12) 0,transparent 26%),
      radial-gradient(circle at top right,rgba(255,177,30,.1) 0,transparent 18%),
      linear-gradient(180deg,#0f1826,#0a131e);
    box-shadow:0 22px 54px rgba(0,0,0,.2);
  }
  body.v2-shell .calc-block{
    padding:18px;
    border-radius:22px;
    border:1px solid #26405c;
    background:linear-gradient(180deg,#101a29,#0c1520);
  }
  body.v2-shell .calc-block-title{
    font-size:22px;
    line-height:1;
    letter-spacing:-.03em;
    color:#eff5ff;
    margin-bottom:8px;
  }
  body.v2-shell .calc-block-copy{
    font-size:13px;
    line-height:1.65;
    color:#89a3bd;
    margin-bottom:16px;
    max-width:62ch;
  }
  body.v2-shell .calc-meta-card,
  body.v2-shell .calc-preview-card,
  body.v2-shell .calc-group-card,
  body.v2-shell .calc-insight-card,
  body.v2-shell .calc-alert,
  body.v2-shell .calc-section,
  body.v2-shell .calc-confidence-bar{
    border-radius:20px;
    border-color:#26405c;
    background:linear-gradient(180deg,#101a29,#0c1520);
  }
  body.v2-shell .calc-stats{
    gap:14px;
    margin-bottom:14px;
  }
  body.v2-shell .calc-sc{
    min-height:136px;
    border-radius:22px;
    border:1px solid #26405c;
    background:linear-gradient(180deg,#101a29,#0c1520);
    box-shadow:0 18px 38px rgba(0,0,0,.16);
  }
  body.v2-shell .calc-sc.primary{
    background:
      radial-gradient(circle at top right,rgba(255,177,30,.16) 0,transparent 32%),
      linear-gradient(180deg,#261b10,#15181f);
    border-color:#6c4f21;
  }
  body.v2-shell .calc-sc .slabel{
    color:#86a0bb;
  }
  body.v2-shell .calc-sc .ssub{
    color:#94aec7;
  }
  body.v2-shell .calc-empty-state{
    border-radius:18px;
    border-color:#29415d;
    background:linear-gradient(180deg,#0d1724,#0a131f);
  }
  body.v2-shell .calc-preset-summary{
    border-radius:16px;
  }
  body.v2-shell .calc-cat-table-wrap{
    border-radius:20px;
    border-color:#243954;
    background:#0b141f;
  }
  body.v2-shell .calc-cat-table th{
    font-size:11px;
    color:#88a2bc;
    border-bottom-color:#233853;
    padding:10px 8px;
  }
  body.v2-shell .calc-cat-table td{
    padding:12px 8px;
    border-bottom-color:#1a2d41;
  }
  body.v2-shell .calc-cat-table tr:hover td{
    background:#0f1825;
  }
  body.v2-shell .param-summary{
    border-radius:16px;
    border-color:#26405c;
    background:linear-gradient(90deg,#0d1724,#122033);
  }
  body.v2-shell #analysis-panel-dashboard .timeline-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  body.v2-shell #analysis-panel-dashboard .timeline-row{
    min-height:96px;
    border-radius:18px;
    padding:14px;
    background:#0d1724;
    border:1px solid #23405a;
  }
  body.v2-shell #analysis-panel-dashboard .timeline-name{
    font-size:12px;
  }
  body.v2-shell #analysis-panel-dashboard .timeline-sub{
    font-size:11px;
  }
  body.v2-shell #analysis-panel-dashboard .stack-legend{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px 18px;
  }
  body.v2-shell #analysis-panel-dashboard .legend-row:nth-child(n+7){
    display:none;
  }
  body.v2-shell #analysis-panel-dashboard .vendor-summary{
    font-size:11px;
    color:#7891ab;
  }
  body.v2-shell #analysis-panel-dashboard .category-distribution-card{
    grid-column:1 / -1;
  }
  body.v2-shell #analysis-panel-dashboard .category-legend{
    gap:12px;
  }
  body.v2-shell #analysis-panel-dashboard #dashboard-category-legend{
    display:flex;
    grid-template-columns:none;
  }
  body.v2-shell #analysis-panel-dashboard #dashboard-category-legend .category-legend-row:nth-child(n+13){
    display:none;
  }
  body.v2-shell #analysis-panel-dashboard .compare-month-list .compare-month-sub{
    display:none;
  }
  body.v2-shell .thead2{
    position:static;
    margin:0;
    padding:0;
    border:none;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    display:grid;
    gap:14px;
  }
  body.v2-shell .ttitle2{
    font-size:12px;
    color:#86a0bb;
  }
  body.v2-shell .ttools{
    gap:10px;
  }
  body.v2-shell .toolbtn,
  body.v2-shell .toolselect{
    border-radius:12px;
    border-color:#29425f;
    background:#101a28;
  }
  body.v2-shell .toolbtn.accent{
    background:linear-gradient(135deg,#ffb11e,#ff8a00);
    border-color:transparent;
    color:#08111b;
  }
  body.v2-shell .search-wrap{
    margin-top:0;
    padding:0;
    border:none;
    background:transparent;
  }
  body.v2-shell .search-box{
    padding:14px 16px;
    border-radius:18px;
    border-color:#27405c;
    background:#0d1724;
  }
  body.v2-shell .desktop-table{
    display:block;
    overflow-x:auto;
    margin-top:0;
    border:1px solid #243a56;
    border-radius:24px;
    background:linear-gradient(180deg,#0f1825,#0b141f);
    box-shadow:0 18px 44px rgba(0,0,0,.16);
  }
  body.v2-shell .records-table-shell{
    margin-top:16px;
    padding:18px;
    border:1px solid #223954;
    border-radius:24px;
    background:linear-gradient(180deg,#0c1520,#0a121b);
  }
  body.v2-shell .records-table-head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    margin-bottom:16px;
    flex-wrap:wrap;
  }
  body.v2-shell .records-table-title{
    font-size:24px;
    line-height:1;
    letter-spacing:-.03em;
    font-weight:800;
    color:#eff5ff;
    margin:0 0 6px;
  }
  body.v2-shell .records-table-copy{
    font-size:13px;
    color:#89a2bc;
    margin:0;
    max-width:56ch;
  }
  body.v2-shell .records-table-stats{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }
  body.v2-shell thead tr{background:#101a28;}
  body.v2-shell th{color:#8aa0b8;border-bottom-color:#243a56;}
  body.v2-shell tbody tr{border-bottom-color:#1c3046;}
  body.v2-shell tbody tr:hover{background:#101a29;}
  body.v2-shell td{color:#dde7f3;}
  body.v2-shell tfoot tr{background:#101a28;border-top-color:#243a56;}
  body.v2-shell .total-bar{
    margin-top:16px;
    border:1px solid #243a56;
    border-radius:18px;
    background:linear-gradient(180deg,#101a28,#0c1520);
  }
  body.v2-shell .dashboard-kpis{
    margin-top:12px;
  }
  @media(max-width:1180px){
    body.v2-shell .v2-layout{
      grid-template-columns:1fr;
      gap:18px;
    }
    body.v2-shell .v2-rail{
      position:static;
      top:auto;
      display:grid;
      gap:12px;
    }
    body.v2-shell .v2-rail-card{
      padding:18px;
    }
    body.v2-shell .v2-rail-nav{
      display:grid;
      grid-template-columns:repeat(3,minmax(0,1fr));
      gap:10px;
      padding:12px;
    }
    body.v2-shell .v2-nav-btn{
      min-height:64px;
      flex-direction:column;
      align-items:flex-start;
      justify-content:center;
      padding:14px;
    }
    body.v2-shell .overview-spotlight,
    body.v2-shell #analysis-panel-dashboard .chart-duo{
      grid-template-columns:1fr;
    }
    body.v2-shell .entry-side{
      grid-template-columns:1fr;
    }
    body.v2-shell .quick-entry-grid,
    body.v2-shell .entry-preview{
      grid-column:auto;
    }
    body.v2-shell .entry-stats,
    body.v2-shell .site-toolbar{
      display:grid;
    }
    body.v2-shell .records-toolbar-head,
    body.v2-shell .records-table-head{
      align-items:flex-start;
    }
    body.v2-shell .v2-story-grid{
      grid-template-columns:1fr;
    }
    body.v2-shell #analysis-panel-dashboard .dashboard-grid,
    body.v2-shell #analysis-panel-dashboard .timeline-list{
      grid-template-columns:1fr;
    }
    .plan-v2-hero,
    .plan-v2-main,
    .plan-v2-foot{
      grid-template-columns:1fr;
    }
  }
  @media(max-width:720px){
    body.v2-shell .topbar{
      margin-top:10px;
      border-radius:20px;
      padding:14px;
    }
    body.v2-shell .v2-rail-nav{
      grid-template-columns:1fr;
    }
    body.v2-shell .v2-rail-copy{
      display:none;
    }
    body.v2-shell .workspace-hero,
    body.v2-shell .entry-sec,
    body.v2-shell .report-sec,
    body.v2-shell .tsec,
    body.v2-shell .calc-hero{
      padding:16px;
      border-radius:22px;
    }
    body.v2-shell .entry-title,
    body.v2-shell .calc-title,
    body.v2-shell .overview-title{
      font-size:28px;
      max-width:none;
    }
    body.v2-shell .overview-total{
      font-size:38px;
    }
    body.v2-shell .overview-side-value{
      font-size:30px;
    }
    body.v2-shell .records-toolbar-shell,
    body.v2-shell .records-table-shell{
      padding:14px;
      border-radius:18px;
    }
    body.v2-shell .records-toolbar-meta,
    body.v2-shell .records-table-stats{
      width:100%;
    }
    body.v2-shell .records-mini-pill{
      flex:1 1 100%;
      min-width:0;
    }
    body.v2-shell .calc-stats,
    body.v2-shell .calc-group-grid,
    body.v2-shell .calc-insight-grid,
    body.v2-shell .dashboard-support{
      grid-template-columns:1fr;
    }
    body.v2-shell .calc-block{
      padding:14px;
      border-radius:18px;
    }
    body.v2-shell .calc-block-title,
    body.v2-shell .records-toolbar-title,
    body.v2-shell .records-table-title{
      font-size:20px;
    }
    body.v2-shell .param-summary{
      padding:10px 12px;
    }
    body.v2-shell .param-summary-total{
      margin-left:0;
      width:100%;
      justify-content:center;
      text-align:center;
    }
    body.v2-shell .records-toolbar-shell,
    body.v2-shell .records-table-shell{
      padding:16px;
      border-radius:20px;
    }
    body.v2-shell .records-toolbar-title{
      font-size:22px;
    }
    body.v2-shell .records-mini-pill{
      min-width:0;
      flex:1 1 140px;
    }
    body.v2-shell .records-table-title{
      font-size:20px;
    }
    body.v2-shell .overview-title{
      font-size:34px;
      max-width:12ch;
    }
    body.v2-shell .overview-total{
      font-size:42px;
    }
    body.v2-shell .overview-primary,
    body.v2-shell .overview-side-card{
      border-radius:22px;
    }
  }
}

/* Final V2 mobile guard: keep legacy mobile rules from resurfacing the old rail/buttons. */
@media(max-width:767px){
  body.v2-shell .v2-rail{
    display:none !important;
  }
  body.v2-shell .stats{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  body.v2-shell .workspace-tab{
    background:#101a28;
    color:#98afc7;
    border:1px solid #27405c;
    -webkit-appearance:none;
    appearance:none;
  }
  body.v2-shell .workspace-tab.on{
    background:#12233a;
    color:#eef5ff;
    border-color:#3b618e;
  }
}

@media(max-width:360px){
  body.v2-shell .stats{
    grid-template-columns:1fr !important;
  }
}
