:root{
--navy:#0b1f4d;--navy2:#102b65;--blue:#16479d;--blue2:#1f63c7;
--sky:#edf5ff;--ink:#16213b;--muted:#6f7a91;--line:#e5eaf2;
--bg:#f5f7fb;--card:#fff;--green:#12805c;--greenbg:#eaf8f2;
--red:#bd3b46;--redbg:#fff0f1;--amber:#a56610;--amberbg:#fff8e7;
--shadow:0 10px 26px rgba(18,40,80,.07)
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
background:var(--bg);color:var(--ink)
}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
.app-shell{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:100vh}

/* SIDEBAR — compact and stable */
.sidebar{
background:linear-gradient(180deg,var(--navy) 0%,var(--navy2) 100%);
color:#fff;padding:20px 16px;display:flex;flex-direction:column;
position:sticky;top:0;height:100vh;overflow-y:auto
}
.sidebar-brand{
padding:2px 5px 18px;border-bottom:1px solid rgba(255,255,255,.10);
display:flex;align-items:center;justify-content:center
}
.sidebar-logo{
display:block;width:100%;max-width:205px;height:auto;
border-radius:10px
}
.sidebar nav{padding-top:17px;display:flex;flex-direction:column;gap:5px}
.sidebar nav a{
display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:11px;
color:#dce7ff;font-size:14px;font-weight:600;line-height:1.2
}
.sidebar nav a span{width:22px;text-align:center;opacity:.92;flex:0 0 22px}
.sidebar nav a:hover{background:rgba(255,255,255,.07);color:#fff}
.sidebar nav a.active{
background:rgba(255,255,255,.13);color:#fff;
box-shadow:inset 3px 0 0 #6ea7ff
}
.sidebar-slogan{
margin-top:auto;padding:18px 8px 14px;color:#dbe8ff;font-size:13px;
line-height:1.5;font-weight:650
}
.sidebar-slogan:before{
content:"";display:block;width:34px;height:3px;border-radius:5px;background:#7fb0ff;margin-bottom:10px
}
.sidebar-foot{
padding:14px 8px 2px;border-top:1px solid rgba(255,255,255,.10);
display:flex;align-items:end;justify-content:space-between;gap:10px
}
.sidebar-foot small{display:block;color:#90a8d2}
.sidebar-foot b{font-size:13px}
.sidebar-foot a{font-size:12px;color:#dce7ff}

/* MAIN */
.main{padding:24px 28px 44px;min-width:0}
.topbar{
display:flex;justify-content:space-between;align-items:flex-start;gap:16px;
margin-bottom:20px
}
.topbar h1{margin:0;font-size:27px;letter-spacing:-.45px;line-height:1.15}
.topbar p{margin:5px 0 0;color:var(--muted);font-size:13px}
.top-chip{
font-size:12px;border:1px solid #d9e2f0;background:#fff;border-radius:999px;
padding:8px 11px;color:#536078;white-space:nowrap
}

/* FILTERS */
.filters{
background:#fff;border:1px solid var(--line);border-radius:15px;padding:13px 14px;
display:flex;gap:10px;align-items:end;box-shadow:0 4px 14px rgba(18,40,80,.04);
margin-bottom:18px;flex-wrap:wrap
}
.filters label{
display:grid;gap:5px;font-size:11px;color:var(--muted);font-weight:700;
text-transform:uppercase;letter-spacing:.4px
}
.filters select,.filters input{min-width:130px}

/* BUTTONS */
.btn{
border:0;border-radius:10px;padding:10px 14px;font-weight:800;cursor:pointer;
display:inline-flex;align-items:center;justify-content:center;gap:8px
}
.btn.primary{background:var(--blue);color:#fff}
.btn.primary:hover{background:#0f3f91}
.btn.ghost{background:#eef3fb;color:var(--navy)}
.btn.danger{background:#ffe9eb;color:#a52735}
.btn.wide{width:100%;margin-top:6px}

/* GRID + CARDS */
.grid{display:grid;gap:14px}
.cards{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:14px}
.card{
background:var(--card);border:1px solid var(--line);border-radius:16px;
box-shadow:0 4px 16px rgba(18,40,80,.045)
}
.kpi{padding:17px;min-width:0}
.kpi .label{font-size:12px;color:var(--muted);font-weight:700}
.kpi .value{
font-size:24px;font-weight:900;margin:7px 0 2px;letter-spacing:-.5px;
overflow-wrap:anywhere
}
.kpi .sub{font-size:12px;color:var(--muted);line-height:1.45}
.good{color:var(--green)!important}.bad{color:var(--red)!important}.warn{color:var(--amber)!important}

.section-grid{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);margin-top:14px}
.panel{padding:18px;min-width:0}
.panel h2{font-size:15px;margin:0 0 4px}
.panel .panel-sub{font-size:12px;color:var(--muted);margin-bottom:14px;line-height:1.5}
.chart{
display:block;width:100%;max-width:100%;height:260px;
background:linear-gradient(180deg,#fbfdff,#fff);border-radius:12px;border:1px solid #eef2f7
}
.chart.small{height:220px}

/* TABLES */
.table-wrap{overflow:auto;width:100%}
.data-table{width:100%;border-collapse:collapse;font-size:13px}
.data-table th{
font-size:10px;text-transform:uppercase;letter-spacing:.45px;color:#7a869c;
text-align:left;padding:10px 9px;border-bottom:1px solid var(--line);
white-space:nowrap;background:#fff
}
.data-table td{
padding:11px 9px;border-bottom:1px solid #eff2f6;white-space:nowrap;vertical-align:top
}
.data-table tbody tr:hover td{background:#fbfdff}
.data-table tr:last-child td{border-bottom:0}
.data-table tfoot td{background:#f2f6fc;font-weight:800;border-top:1px solid #dfe7f2}
.rank{
width:28px;height:28px;border-radius:9px;background:#eef3fb;
display:grid;place-items:center;font-weight:900;color:var(--blue)
}
.progress{height:8px;background:#edf1f7;border-radius:999px;overflow:hidden;min-width:110px}
.progress i{display:block;height:100%;background:linear-gradient(90deg,#1b59bd,#3a7ee5);border-radius:999px}

/* METRICS */
.metric-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.metric-item{border:1px solid var(--line);border-radius:12px;padding:13px;min-width:0}
.metric-item small{color:var(--muted);display:block;line-height:1.35}
.metric-item b{font-size:18px;display:block;margin-top:5px;overflow-wrap:anywhere}
.metric-item span{font-size:12px;color:var(--muted)}

/* NOTICES */
.notice{padding:12px 14px;border-radius:11px;margin:12px 0;font-size:13px;line-height:1.5}
.notice.success{background:var(--greenbg);color:#0d694d;border:1px solid #cfeee1}
.notice.danger{background:var(--redbg);color:#9b2834;border:1px solid #ffd1d6}
.notice.info{background:#eef5ff;color:#245292;border:1px solid #d4e5ff}

/* FORMS */
.form-grid{display:grid;gap:12px}
.form-grid label{display:grid;gap:6px;font-size:12px;font-weight:800;color:#536078}
.form-grid input,.form-grid select,.filters select,.filters input,textarea{
border:1px solid #dce3ee;border-radius:10px;padding:11px 12px;background:#fff;
color:var(--ink);outline:none
}
.form-grid input:focus,.filters select:focus,.filters input:focus,textarea:focus{
border-color:#74a4ea;box-shadow:0 0 0 3px #eaf2ff
}
.form-grid hr{border:0;border-top:1px solid var(--line);width:100%}
.password-wrap{display:grid;grid-template-columns:1fr auto}
.password-wrap input{border-radius:10px 0 0 10px}
.eye{
border:1px solid #dce3ee;border-left:0;background:#f4f7fb;
border-radius:0 10px 10px 0;padding:0 12px;cursor:pointer
}
.upload-zone{
border:2px dashed #c9d7ea;border-radius:16px;padding:30px;text-align:center;background:#f9fbff
}
.upload-zone input[type=file]{max-width:100%}
.file-hint{font-size:12px;color:var(--muted);line-height:1.6}
.tag{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:11px;font-weight:800}
.tag.success{background:var(--greenbg);color:var(--green)}
.tag.failed{background:var(--redbg);color:var(--red)}
.tag.processing{background:var(--amberbg);color:var(--amber)}
.empty{padding:35px;text-align:center;color:var(--muted)}
.section-title{display:flex;align-items:center;justify-content:space-between;margin:22px 0 10px}
.section-title h2{margin:0;font-size:17px}
.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
.three-col{grid-template-columns:repeat(3,minmax(0,1fr))}
.stat-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.stat-strip>div{background:#fff;border:1px solid var(--line);padding:14px;border-radius:12px}
.stat-strip small{display:block;color:var(--muted)}
.stat-strip b{display:block;margin-top:5px;font-size:18px}
.danger-zone{border-top:1px solid var(--line);padding-top:12px}
.nowrap{white-space:nowrap}

/* LOGIN — simple and neat */
.auth-bg{
min-height:100vh;display:grid;place-items:center;padding:24px;
background:
radial-gradient(circle at 20% 15%,#e8f1ff,transparent 32%),
linear-gradient(135deg,#f7f9fc,#edf3fb)
}
.auth-card{
width:min(440px,calc(100% - 24px));background:#fff;border:1px solid var(--line);
border-radius:22px;padding:28px;box-shadow:var(--shadow)
}
.auth-card-logo{
display:block;width:100%;max-width:260px;height:auto;margin:0 auto 24px;border-radius:12px
}
.auth-card h1{margin:0 0 6px;font-size:25px;text-align:center}
.auth-card .muted{text-align:center;margin-bottom:22px}
.muted{color:var(--muted)}
.install-wrap{width:min(760px,calc(100% - 32px));padding:30px 0}
.install-card{width:100%}
.server-checks{display:flex;gap:7px;flex-wrap:wrap;margin:14px 0}
.pill{border-radius:999px;padding:6px 9px;font-size:11px;font-weight:800}
.pill.ok{background:var(--greenbg);color:var(--green)}
.pill.bad{background:var(--redbg);color:var(--red)}

/* RESPONSIVE */
@media(max-width:1120px){
.cards{grid-template-columns:repeat(2,minmax(0,1fr))}
.section-grid{grid-template-columns:1fr}
.three-col{grid-template-columns:1fr}
.app-shell{grid-template-columns:220px minmax(0,1fr)}
.main{padding:22px 20px 40px}
.sidebar-logo{max-width:180px}
}
@media(max-width:760px){
.app-shell{display:block}
.sidebar{position:static;height:auto;overflow:visible}
.sidebar nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.sidebar-slogan,.sidebar-foot{display:none}
.main{padding:18px 12px}
.cards,.two-col,.three-col,.stat-strip,.metric-list{grid-template-columns:1fr}
.filters{align-items:stretch;flex-direction:column}
.filters select,.filters input{width:100%}
.topbar{gap:10px}
.top-chip{display:none}
.sidebar-logo{max-width:190px}
}


/* =========================================================
   V26 — HARD FIX LOGO/SIDEBAR
   New stylesheet filename is used to bypass browser cache.
   ========================================================= */
@media (min-width:761px){
  .app-shell{
    grid-template-columns:240px minmax(0,1fr) !important;
  }

  .sidebar{
    width:240px !important;
    min-width:240px !important;
    max-width:240px !important;
    padding:18px 14px !important;
    overflow-x:hidden !important;
  }

  .sidebar-brand{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    padding:4px 0 16px !important;
    overflow:hidden !important;
    justify-content:center !important;
  }

  .sidebar-logo{
    display:block !important;
    width:176px !important;
    min-width:0 !important;
    max-width:176px !important;
    height:auto !important;
    margin:0 auto !important;
    object-fit:contain !important;
    border-radius:8px !important;
  }

  .sidebar nav{
    width:100% !important;
  }

  .sidebar nav a{
    width:100% !important;
    min-width:0 !important;
    padding:10px 11px !important;
    font-size:13.5px !important;
  }

  .sidebar nav a span{
    flex:0 0 20px !important;
    width:20px !important;
  }

  .main{
    min-width:0 !important;
    padding:22px 26px 42px !important;
  }

  .topbar{
    min-height:60px !important;
    align-items:center !important;
    margin-bottom:18px !important;
  }

  .topbar h1{
    font-size:25px !important;
    line-height:1.15 !important;
  }
}

/* Make wide tables scroll inside their card rather than forcing the page wider. */
.card,.panel,.table-wrap{min-width:0 !important}
.table-wrap{max-width:100% !important;overflow-x:auto !important}
.data-table{max-width:none !important}

/* Mobile logo */
@media(max-width:760px){
  .sidebar-logo{
    width:176px !important;
    max-width:176px !important;
    height:auto !important;
    margin:0 auto 0 0 !important;
  }
}


/* =========================================================
   V35 — MOBILE + TABLET COMFORT LAYER
   Desktop stays visually close to V26.
   Tablet/phone use a compact sticky header + hamburger menu.
   ========================================================= */

html,body{max-width:100%;overflow-x:hidden}
button,.btn,a,input,select,textarea{touch-action:manipulation}
.mobile-menu-toggle,.mobile-logout{display:none}

/* Wrapper allows the same logo markup to work on desktop and mobile. */
.sidebar-mobile-head{display:block}

/* Better tap targets without changing desktop density too much. */
.btn{min-height:42px}
.form-grid input,.form-grid select,.filters select,.filters input,textarea{min-height:42px}

/* Wide tables feel better on touch screens. */
.table-wrap{
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  overscroll-behavior-inline:contain;
}
.table-wrap:focus{outline:2px solid #8db7f1;outline-offset:2px}

/* ---------------------------------------------------------
   TABLET: up to 1024px
   Use a top navigation so the 240px sidebar does not steal
   half the display on portrait tablets.
   --------------------------------------------------------- */
@media(max-width:1024px){
  .app-shell{
    display:block !important;
    min-height:100vh;
  }

  .sidebar{
    position:sticky !important;
    top:0 !important;
    z-index:1000 !important;
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    height:auto !important;
    overflow:visible !important;
    padding:0 !important;
    background:linear-gradient(180deg,var(--navy) 0%,var(--navy2) 100%) !important;
    box-shadow:0 5px 18px rgba(7,25,60,.16);
  }

  .sidebar-mobile-head{
    min-height:66px;
    display:flex !important;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:9px max(14px,env(safe-area-inset-right)) 9px max(14px,env(safe-area-inset-left));
  }

  .sidebar-brand{
    border:0 !important;
    padding:0 !important;
    width:auto !important;
    min-width:0 !important;
    justify-content:flex-start !important;
    overflow:visible !important;
  }

  .sidebar-logo{
    width:150px !important;
    max-width:150px !important;
    height:auto !important;
    margin:0 !important;
    border-radius:8px !important;
  }

  .mobile-menu-toggle{
    display:grid !important;
    place-content:center;
    gap:5px;
    flex:0 0 46px;
    width:46px;
    height:46px;
    padding:0;
    border:1px solid rgba(255,255,255,.20);
    border-radius:13px;
    background:rgba(255,255,255,.09);
    cursor:pointer;
  }

  .mobile-menu-toggle span{
    display:block;
    width:22px;
    height:2px;
    border-radius:99px;
    background:#fff;
    transition:transform .2s ease,opacity .2s ease;
  }

  .sidebar.menu-open .mobile-menu-toggle span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  .sidebar.menu-open .mobile-menu-toggle span:nth-child(2){opacity:0}
  .sidebar.menu-open .mobile-menu-toggle span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

  .sidebar nav{
    position:absolute !important;
    top:66px;
    left:10px;
    right:10px;
    z-index:1001;
    width:auto !important;
    max-height:0;
    overflow:hidden;
    opacity:0;
    pointer-events:none;
    padding:0 !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:7px !important;
    background:#0e275c;
    border:1px solid rgba(255,255,255,.12);
    border-radius:0 0 16px 16px;
    box-shadow:0 18px 40px rgba(8,26,62,.28);
    transition:max-height .24s ease,opacity .18s ease,padding .2s ease;
  }

  .sidebar.menu-open nav{
    max-height:calc(100vh - 82px);
    overflow-y:auto;
    opacity:1;
    pointer-events:auto;
    padding:10px !important;
    -webkit-overflow-scrolling:touch;
  }

  .sidebar nav a{
    width:100% !important;
    min-width:0 !important;
    min-height:47px;
    padding:12px 12px !important;
    border-radius:11px !important;
    font-size:14px !important;
    line-height:1.25 !important;
    background:rgba(255,255,255,.045);
  }

  .sidebar nav a.active{
    background:rgba(255,255,255,.15) !important;
    box-shadow:inset 3px 0 0 #80b5ff !important;
  }

  .mobile-logout{
    display:flex !important;
    color:#ffd9dc !important;
    background:rgba(190,55,70,.18) !important;
  }

  .sidebar-slogan,.sidebar-foot{display:none !important}

  .main{
    padding:20px 18px 42px !important;
    min-width:0 !important;
  }

  .topbar{
    min-height:0 !important;
    margin-bottom:16px !important;
    align-items:center !important;
  }

  .topbar h1{
    font-size:24px !important;
    line-height:1.15 !important;
  }

  .topbar p{font-size:12px}

  .top-chip{display:none !important}

  .cards{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .section-grid{grid-template-columns:1fr !important}
  .two-col{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .three-col{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .stat-strip{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .metric-list{grid-template-columns:repeat(2,minmax(0,1fr)) !important}

  .panel{padding:17px}
  .chart{height:245px}

  .filters{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:end !important;
    gap:10px;
  }
  .filters label{min-width:0}
  .filters select,.filters input{width:100%;min-width:0}
  .filters>.btn{min-height:46px}

  .table-wrap{
    border-radius:12px;
    position:relative;
  }
  .data-table{
    font-size:12.5px;
  }
  .data-table th,.data-table td{padding:10px 8px}

  body.mobile-menu-open{overflow:hidden}
}

/* ---------------------------------------------------------
   PHONE: card tables + single-column forms
   --------------------------------------------------------- */
@media(max-width:640px){
  .sidebar-mobile-head{min-height:61px;padding-top:7px;padding-bottom:7px}
  .sidebar nav{top:61px;grid-template-columns:1fr !important}
  .sidebar.menu-open nav{max-height:calc(100vh - 74px)}

  .sidebar-logo{
    width:136px !important;
    max-width:136px !important;
  }

  .mobile-menu-toggle{
    width:44px;height:44px;flex-basis:44px;border-radius:12px
  }

  .main{
    padding:14px 10px calc(34px + env(safe-area-inset-bottom)) !important;
  }

  .topbar{
    margin:2px 2px 13px !important;
  }

  .topbar h1{
    font-size:21px !important;
    letter-spacing:-.25px !important;
  }

  .topbar p{
    margin-top:4px;
    font-size:11.5px;
  }

  .cards,.two-col,.three-col,.stat-strip,.metric-list{
    grid-template-columns:1fr !important;
  }

  .grid{gap:10px}
  .card{border-radius:14px}
  .panel{padding:14px}
  .kpi{padding:15px}
  .kpi .value{font-size:22px;margin-top:5px}
  .kpi .sub{font-size:11.5px}
  .panel h2,.section-title h2{font-size:16px}

  .section-title{
    gap:9px;
    align-items:flex-start;
    flex-direction:column;
    margin:17px 0 9px;
  }
  .section-title>div:last-child{
    width:100%;
    display:grid !important;
    grid-template-columns:1fr !important;
  }
  .section-title .btn{width:100%}

  .filters{
    grid-template-columns:1fr !important;
    padding:12px;
    border-radius:13px;
    gap:9px;
    margin-bottom:13px;
  }

  .filters>.btn,
  .form-grid>.btn,
  .form-grid>button.btn{
    width:100%;
    min-height:48px;
    font-size:15px;
  }

  .form-grid{gap:10px}

  /* 16px prevents iOS Safari from zooming the page on focus. */
  .form-grid input,.form-grid select,.filters select,.filters input,textarea{
    width:100%;
    min-width:0;
    min-height:48px;
    padding:12px;
    font-size:16px;
    border-radius:11px;
  }

  textarea{min-height:96px}
  .form-grid label,.filters label{font-size:11.5px}

  .btn{
    min-height:46px;
    padding:11px 14px;
  }

  .notice{
    padding:11px 12px;
    margin:9px 0 12px;
    font-size:12.5px;
    border-radius:11px;
  }

  .metric-item{padding:12px}
  .metric-item b{font-size:17px}

  .chart,.chart.small{height:220px}

  /* Tables become readable cards on phones. JS adds data-label. */
  .table-wrap{
    overflow:visible !important;
    border-radius:0;
  }

  .data-table.mobile-cards{
    display:block;
    width:100%;
    border-collapse:separate;
  }

  .data-table.mobile-cards thead{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    overflow:hidden !important;
    clip:rect(0 0 0 0) !important;
    white-space:nowrap !important;
  }

  .data-table.mobile-cards tbody,
  .data-table.mobile-cards tfoot{
    display:grid;
    gap:10px;
    width:100%;
  }

  .data-table.mobile-cards tr{
    display:block;
    width:100%;
    background:#fff;
    border:1px solid var(--line);
    border-radius:13px;
    padding:5px 11px;
    box-shadow:0 3px 12px rgba(18,40,80,.035);
  }

  .data-table.mobile-cards td{
    display:grid;
    grid-template-columns:minmax(105px,40%) minmax(0,1fr);
    gap:10px;
    align-items:start;
    width:100%;
    min-height:38px;
    padding:9px 0 !important;
    border-bottom:1px solid #eff2f6 !important;
    white-space:normal !important;
    overflow-wrap:anywhere;
  }

  .data-table.mobile-cards td:last-child{border-bottom:0 !important}

  .data-table.mobile-cards td::before{
    content:attr(data-label);
    color:#7a869c;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.35px;
    line-height:1.35;
  }

  .data-table.mobile-cards td[colspan]{
    display:block;
    text-align:center;
  }
  .data-table.mobile-cards td[colspan]::before{display:none}

  .data-table.mobile-cards td form{
    width:100%;
    min-width:0 !important;
  }

  .data-table.mobile-cards td form .btn,
  .data-table.mobile-cards td form button{
    width:100%;
    min-height:44px;
  }

  .data-table.mobile-cards td form input,
  .data-table.mobile-cards td form select{
    width:100%;
    min-width:0;
    min-height:44px;
    font-size:16px;
  }

  .progress{min-width:0;width:100%}

  .upload-zone{padding:20px 12px}

  .auth-bg{padding:12px}
  .auth-card{
    width:100%;
    max-width:430px;
    padding:22px 17px;
    border-radius:18px;
  }
  .auth-card-logo{max-width:210px !important;margin-bottom:18px !important}
  .auth-card h1{font-size:22px}
}

/* Tiny phones */
@media(max-width:390px){
  .main{padding-left:8px !important;padding-right:8px !important}
  .panel,.kpi{padding:13px}
  .data-table.mobile-cards td{grid-template-columns:94px minmax(0,1fr)}
}


/* V38 - Laporan Tahunan & Perbandingan Bulanan */
.report-year-table th:nth-child(1){background:#dcecff}
.report-year-table th:nth-child(2),.report-year-table th:nth-child(3){background:#fff0b6}
.report-year-table th:nth-child(4),.report-year-table th:nth-child(5){background:#ffe0c4}
.report-year-table th:nth-child(6),.report-year-table th:nth-child(7){background:#efd4e2}
.report-year-table th:nth-child(8),.report-year-table th:nth-child(9){background:#dcefd5}
.report-year-table th:nth-child(10),.report-year-table th:nth-child(11){background:#d8e9fa}
.report-year-table tfoot td{font-weight:800;background:#f5f8fc;border-top:2px solid #cfd8e6}
.report-na-row td:not(:first-child){color:#9aa6b6;background:#fafbfd}
.report-compare-table th{white-space:nowrap}

@media(max-width:640px){
  .report-year-table.mobile-cards tfoot tr{
    border:2px solid #cad6e7;
    background:#f5f8fc;
  }
}


/* V42 — Biaya Bahan Baku Harian */
.material-daily-table th{white-space:nowrap}
.material-daily-table .material-week-total td{
  background:#fff8e7;font-weight:800;border-top:2px solid #f1c866;border-bottom:2px solid #f1c866
}
.material-daily-table tfoot td{
  background:#eef4fb;font-weight:800;border-top:2px solid #9db5d7
}
@media(max-width:640px){
  .material-daily-table.mobile-cards .material-week-total{background:#fff8e7;border-color:#efcc7c}
  .material-daily-table.mobile-cards tfoot tr{background:#eef4fb;border:2px solid #9db5d7}
}

/* V43 — Input Pembelian Bahan lebih sederhana */
.purchase-simple-card{margin-top:14px}
.purchase-form-title{margin-top:0}
.purchase-step{
  display:flex;align-items:center;gap:9px;margin:8px 0 2px;
  color:#17264a;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.35px
}
.purchase-step span{
  display:grid;place-items:center;width:26px;height:26px;border-radius:50%;
  background:#173c78;color:#fff;font-size:12px
}
.field-help{display:block;margin-top:5px;color:#77849a;font-size:11px;line-height:1.35}
.purchase-total-box{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:16px 18px;border:1px solid #cbd9ec;border-radius:14px;
  background:linear-gradient(135deg,#f5f9ff,#eef5ff);margin:4px 0 8px
}
.purchase-total-box small{display:block;color:#71809b;font-size:10px;font-weight:800;letter-spacing:.6px}
.purchase-total-box strong{display:block;margin-top:3px;color:#163d79;font-size:28px;line-height:1.1}
.purchase-total-formula{color:#5d6d87;font-size:13px;font-weight:700;text-align:right}
.purchase-example{
  padding:11px 13px;border-radius:11px;background:#f8fafc;border:1px dashed #ccd7e6;
  color:#56647b;font-size:12px
}
.purchase-save-btn{min-height:50px;font-size:15px}
.payment-date-hidden{display:none !important}

@media(max-width:640px){
  .purchase-total-box{align-items:flex-start;flex-direction:column;padding:14px}
  .purchase-total-box strong{font-size:25px}
  .purchase-total-formula{text-align:left}
  .purchase-step{margin-top:12px}
}


/* =========================================================
   V50.3 — GLOBAL DASHBOARD HORIZONTAL SCROLL FIX
   Prevents the main dashboard area from feeling "locked"
   when a page contains content wider than the viewport.
   Sidebar remains stable; only main content can scroll.
   ========================================================= */

.app-shell{
  min-width:0 !important;
  width:100% !important;
}

.main{
  min-width:0 !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:visible;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y;
  scrollbar-width:auto;
  scrollbar-color:#8faad0 #eef3f8;
}

.main::-webkit-scrollbar{height:12px}
.main::-webkit-scrollbar-track{
  background:#eef3f8;
  border-radius:999px;
}
.main::-webkit-scrollbar-thumb{
  background:#8faad0;
  border:2px solid #eef3f8;
  border-radius:999px;
}

/* Any wide dashboard block must be able to scroll by itself too. */
.table-wrap,
.recap-scroll,
.costsheet-table-wrap,
.costsheet-scroll-shell,
.chart-wrap{
  max-width:100% !important;
  overflow-x:auto !important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y;
}

/* Do not let long cards force the whole layout wider. */
.main > *,
.card,
.panel,
.grid,
.section-grid,
.filters,
.form-grid{
  min-width:0 !important;
}

/* Existing V40 rule hides BODY overflow. Keep the page stable, but the
   .main container above is now the horizontal scroll surface. */
html,body{
  width:100%;
  max-width:100%;
}

/* Mobile/tablet: preserve hamburger behavior, while content itself can
   still be swiped horizontally if a specific page is wider. */
@media(max-width:1024px){
  .main{
    width:100% !important;
    overflow-x:auto !important;
  }
}

/* Safety: if the hamburger body lock was left behind after closing the
   menu, horizontal movement in main content remains available. */
body.mobile-menu-open .main{
  overflow-x:auto !important;
}
