
  :root{
    --navy-900:#0c2338;
    --navy-800:#123049;
    --navy-700:#1a3a5c;
    --navy-600:#264d74;
    --ocean-500:#2b7a9e;
    --ocean-100:#e4eff3;
    --sand-50:#f7f5f0;
    --sand-100:#efece3;
    --ink-900:#152233;
    --ink-500:#5b6b7a;
    --line:#e2ddd1;
    --success-600:#2f9e6f;
    --success-100:#e2f5ec;
    --warn-600:#c96a3e;
    --warn-100:#fbe9e0;
    --radius:10px;
    --shadow:0 1px 2px rgba(12,35,56,.06), 0 4px 16px rgba(12,35,56,.06);
  }
  *{box-sizing:border-box;}
  body{
    margin:0;
    font-family:'Google Sans Text',sans-serif;
    background:var(--sand-50);
    color:var(--ink-900);
    color-scheme:light;
    -webkit-font-smoothing:antialiased;
  }
  .mono{font-family:'Google Sans Text',sans-serif;}

  select,
  select option,
  select optgroup{
    background-color:#fff !important;
    color:var(--ink-900) !important;
    color-scheme:light;
  }
  select option:checked{
    background-color:#fff !important;
    color:var(--ink-900) !important;
  }
  select:disabled,
  select:disabled option{
    background-color:#f7f9fb !important;
    color:#98a5b1 !important;
  }
  .custom-select-wrap{
    position:relative;
    display:inline-block;
    width:100%;
    min-width:0;
    vertical-align:middle;
  }
  .custom-select-native{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    min-width:0 !important;
    padding:0 !important;
    border:0 !important;
    opacity:0 !important;
    pointer-events:none !important;
  }
  .custom-select-trigger{
    width:100%;
    min-width:0;
    min-height:32px;
    padding:7px 34px 7px 9px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    color:var(--ink-900);
    font:500 12px 'Google Sans Text',sans-serif;
    text-align:left;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    cursor:pointer;
    outline:none;
  }
  .custom-select-trigger::after{
    content:'';
    width:8px;
    height:8px;
    border-right:2px solid currentColor;
    border-bottom:2px solid currentColor;
    transform:rotate(45deg) translateY(-2px);
    flex-shrink:0;
    color:var(--ink-900);
  }
  .custom-select-trigger:focus,
  .custom-select-wrap.open .custom-select-trigger{
    border-color:var(--ocean-500);
    box-shadow:0 0 0 3px var(--ocean-100);
  }
  .custom-select-wrap.disabled .custom-select-trigger{
    background:#f7f9fb;
    color:#98a5b1;
    cursor:not-allowed;
  }
  .custom-select-label{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .custom-select-menu{
    position:fixed;
    z-index:900;
    min-width:120px;
    max-height:260px;
    overflow:auto;
    padding:4px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#fff;
    color:var(--ink-900);
    box-shadow:0 10px 28px rgba(12,35,56,.16);
  }
  .custom-select-option{
    min-height:32px;
    padding:8px 10px;
    border-radius:6px;
    background:#fff;
    color:var(--ink-900);
    font:500 12.5px 'Google Sans Text',sans-serif;
    display:flex;
    align-items:center;
    gap:8px;
    cursor:pointer;
    white-space:nowrap;
  }
  .custom-select-option:hover,
  .custom-select-option.active{
    background:var(--ocean-100);
    color:var(--ink-900);
  }
  .custom-select-option.selected{
    background:#fff;
    color:var(--ink-900);
  }
  .custom-select-option.selected::before{
    content:'✓';
    width:14px;
    color:var(--ocean-500);
    font-weight:800;
    flex-shrink:0;
  }
  .custom-select-option:not(.selected)::before{
    content:'';
    width:14px;
    flex-shrink:0;
  }
  .phu-trach-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:76px;
    padding:3px 8px;
    border-radius:999px;
    font-size:11px;
    font-weight:800;
    line-height:1.2;
    white-space:nowrap;
  }
  .phu-trach-nghia-hoa{
    background:#dbeafe;
    color:#1e3a8a;
    border:1px solid #93c5fd;
  }
  .phu-trach-yen-thinh{
    background:#fef3c7;
    color:#92400e;
    border:1px solid #fbbf24;
  }
  .phu-trach-phung-tien{
    background:#fee2e2;
    color:#7f1d1d;
    border:1px solid #fca5a5;
  }
  .phu-trach-unknown{
    background:#f1f5f9;
    color:#475569;
    border:1px solid #cbd5e1;
  }
  .toolbar .custom-select-wrap,
  .title-month-filter .custom-select-wrap,
  .page-size-control .custom-select-wrap{
    width:auto;
  }
  .title-month-filter .custom-select-trigger{
    min-width:92px;
    min-height:24px;
    height:24px;
    padding:2px 24px 2px 7px;
    border:0;
    border-left:1px solid var(--line);
    border-radius:0 6px 6px 0;
    box-shadow:none;
    font:600 11.5px 'Google Sans Text',sans-serif;
  }
  .th-filter.custom-select-native + .custom-select-trigger{
    min-height:24px;
    padding:3px 24px 3px 6px;
    border-radius:5px;
    font-size:11px;
    font-weight:500;
  }
  .th-filter.custom-select-native + .custom-select-trigger.active{
    border-color:var(--ocean-500);
    background:var(--ocean-100);
    color:var(--ocean-500);
    font-weight:600;
  }
  .inline-cell-control.custom-select-native + .custom-select-trigger,
  .entry-table .custom-select-trigger,
  .adsun-sheet .custom-select-trigger,
  .import-table .custom-select-trigger,
  .document-item-table .custom-select-trigger{
    min-height:28px;
    height:32px;
    padding:4px 28px 4px 7px;
    border-radius:6px;
    font-size:12.5px;
  }

  /* ---------- Layout ---------- */
  .app{display:flex; min-height:100vh;}
  .app.auth-hidden{display:none;}
  .login-screen{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:
      radial-gradient(circle at 20% 20%, rgba(43,122,158,.16), transparent 28%),
      linear-gradient(135deg,#f7f5f0 0%,#e4eff3 100%);
  }
  .login-screen[hidden]{display:none;}
  .login-card{
    width:min(390px,100%);
    padding:24px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    box-shadow:var(--shadow);
  }
  .login-brand{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:20px;
  }
  .login-brand img{
    width:42px;
    height:42px;
    object-fit:contain;
  }
  .login-brand h1{
    margin:0;
    font-family:Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    font-size:20px;
    line-height:1.05;
  }
  .login-brand p{
    margin:3px 0 0;
    color:var(--ink-500);
    font-size:12px;
  }
  .login-error{
    display:none;
    margin:0 0 12px;
    padding:10px 12px;
    border:1px solid var(--warn-100);
    border-radius:8px;
    background:#fff8f5;
    color:var(--warn-600);
    font-size:12px;
    line-height:1.45;
  }
  .login-error.show{display:block;}
  .login-help{
    margin:12px 0 0;
    color:var(--ink-500);
    font-size:11.5px;
    line-height:1.45;
  }
  .password-field{
    position:relative;
  }
  .password-field input{
    padding-right:42px;
  }
  .password-toggle{
    position:absolute;
    right:8px;
    top:50%;
    transform:translateY(-50%);
    width:28px;
    height:28px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:var(--ink-500);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
  }
  .password-toggle:hover{
    background:var(--sand-100);
    color:var(--navy-700);
  }
  .sidebar{
    width:196px; flex-shrink:0;
    background:linear-gradient(180deg,var(--navy-900),var(--navy-700));
    color:#fff; padding:15px 10px;
    position:sticky; top:0; height:100vh;
    display:flex; flex-direction:column;
    transition:width .18s ease, padding .18s ease;
    overflow:hidden;
  }
  .sidebar.collapsed{width:54px; padding:15px 7px;}
  .sidebar.collapsed .nav-text, .sidebar.collapsed .brand-text, .sidebar.collapsed .brand-sub, .sidebar.collapsed .sidebar-foot{
    display:none;
  }
  .sidebar.collapsed .nav-item{justify-content:center; padding:10px 0;}
  .sidebar.collapsed .brand-row{justify-content:center;}
  .sidebar.collapsed .sb-toggle{transform:rotate(180deg);}
  .brand-row{display:flex; align-items:center; justify-content:space-between; gap:8px;}
  .sb-toggle{
    width:26px; height:26px; border-radius:7px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.06);
    display:flex; align-items:center; justify-content:center; cursor:pointer; color:#cfe0ec;
    flex-shrink:0; transition:background .15s, transform .18s;
  }
  .sb-toggle:hover{background:rgba(255,255,255,.14);}
  .sb-toggle svg{width:14px;height:14px;}
  .brand{
    font-weight:800;
    padding:4px 6px 3px; display:flex; align-items:center; gap:8px;
    min-width:0;
  }
  .brand-text{
    font-family:Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    font-size:17px; line-height:1.05; letter-spacing:.02em; font-weight:800;
    max-width:118px;
  }
  .brand-logo{
    width:36px; height:36px; border-radius:0; object-fit:contain; flex-shrink:0;
    background:transparent; border:0; box-shadow:none;
  }
  .brand-mark{
    width:36px; height:36px; border-radius:10px; flex-shrink:0;
    display:inline-flex; align-items:center; justify-content:center;
    background:linear-gradient(145deg,#fff8db,#c99a25 56%,#b91928);
    color:#10243a; border:1px solid rgba(255,255,255,.36);
    box-shadow:0 0 0 3px rgba(255,255,255,.08);
    font-size:10px; font-weight:900; letter-spacing:.02em;
  }
  .brand-mark[hidden]{display:none;}
  .brand-sub{font-size:10.5px; color:#9db4c6; padding:1px 7px 15px; font-weight:500;}
  nav{display:flex; flex-direction:column; gap:4px; margin-top:6px; overflow-y:auto; padding-right:2px;}
  .nav-group-block{display:flex; flex-direction:column; gap:3px;}
  .nav-group-toggle{
    margin:9px 4px 1px;
    border:0;
    background:transparent;
    color:#8fa9bd;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:3px 6px;
    border-radius:7px;
    cursor:pointer;
    font-size:10px;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  .nav-group-toggle:hover{background:rgba(255,255,255,.05); color:#cfe0ec;}
  .nav-group-toggle::after{
    content:'';
    width:6px; height:6px;
    border-right:1.5px solid currentColor;
    border-bottom:1.5px solid currentColor;
    transform:rotate(45deg);
    transition:transform .15s ease;
    margin-top:-3px;
    opacity:.8;
  }
  .nav-group-block.collapsed .nav-group-toggle::after{transform:rotate(-45deg); margin-top:0;}
  .nav-group-block.collapsed .nav-group-items{display:none;}
  .nav-group-items{display:flex; flex-direction:column; gap:3px;}
  .nav-item{
    display:flex; align-items:center; gap:10px;
    padding:7px 9px; border-radius:8px;
    color:#c7d6e2; font-size:12.5px; font-weight:500;
    cursor:pointer; position:relative; transition:background .15s, color .15s;
  }
  .nav-item svg{width:17px;height:17px; opacity:.85; flex-shrink:0;}
  .nav-item:hover{background:rgba(255,255,255,.06); color:#fff;}
  .nav-item.active{background:rgba(255,255,255,.1); color:#fff;}
  .nav-item.active::after{
    content:''; position:absolute; left:0; top:8px; bottom:8px; width:3px;
    border-radius:3px;
    background:linear-gradient(180deg,var(--ocean-500),#7fd1c7);
  }
  .nav-group{
    margin:10px 10px 2px;
    color:#7f9ab0;
    font-size:10px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
  }
  .nav-item.nav-child{
    margin-left:10px;
    padding-left:10px;
    font-size:12px;
  }
  .nav-item.nav-child svg{width:14px;height:14px;}
  .sidebar.collapsed .nav-group,.sidebar.collapsed .nav-group-toggle{display:none;}
  .sidebar.collapsed .nav-item.nav-child{margin-left:0; padding-left:0;}
  .sidebar.collapsed .nav-group-block,.sidebar.collapsed .nav-group-items{display:flex;}
  .ops-tabs{
    display:flex;
    gap:6px;
    align-items:center;
    margin:0 0 12px;
    border-bottom:1px solid var(--line);
    padding-bottom:8px;
  }
  .ops-tab{
    border:1px solid var(--line);
    background:#fff;
    color:var(--ink-600);
    border-radius:8px;
    padding:7px 12px;
    font-size:12.5px;
    font-weight:700;
    cursor:pointer;
  }
  .ops-tab.active{
    background:var(--navy-700);
    border-color:var(--navy-700);
    color:#fff;
  }
  .placeholder-panel{
    border:1px solid var(--line);
    background:#fff;
    border-radius:8px;
    padding:22px;
  }
  .placeholder-panel h3{margin:0 0 8px; font-size:18px;}
  .placeholder-panel p{margin:0; color:var(--ink-500);}
  .sidebar-foot{margin-top:auto; padding:10px 8px; font-size:10.5px; color:#7690a5; line-height:1.45;}

  .main{flex:1; min-width:0; display:flex; flex-direction:column;}
  .topbar{
    padding:14px 22px 0; display:flex; align-items:baseline; justify-content:space-between;
    gap:16px;
  }
  .topbar-actions{
    display:flex;
    align-items:center;
    gap:10px;
    margin-left:auto;
  }
  .user-chip{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:2px;
    padding:5px 9px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    box-shadow:0 1px 2px rgba(12,35,56,.04);
  }
  .user-chip b{
    max-width:180px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:12px;
  }
  .user-chip span{
    color:var(--ink-500);
    font-size:10.5px;
    font-weight:700;
    text-transform:uppercase;
  }
  .title-row{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
  }
  .topbar h1{font-size:18px; margin:0 0 1px; font-weight:700; letter-spacing:0;}
  .topbar p{margin:0; color:var(--ink-500); font-size:12px;}
  .title-month-filter{
    display:inline-flex;
    align-items:center;
    gap:6px;
    min-height:30px;
    padding:3px 5px 3px 9px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#fff;
    box-shadow:0 1px 2px rgba(12,35,56,.04);
  }
  .title-month-filter label{
    margin:0;
    color:var(--ink-500);
    font-size:10px;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  .title-month-filter select{
    width:auto;
    min-width:92px;
    height:24px;
    padding:2px 24px 2px 7px;
    border:0;
    border-left:1px solid var(--line);
    border-radius:0 6px 6px 0;
    background:#fff;
    color:var(--ink-900);
    font:600 11.5px 'Google Sans Text',sans-serif;
    outline:none;
    cursor:pointer;
  }
  .title-month-filter select:focus{
    box-shadow:none;
    color:var(--navy-700);
  }
  .title-month-filter{position:relative;}
  .month-filter-btn{
    width:auto;
    min-width:92px;
    height:24px;
    padding:2px 10px;
    border:0;
    border-left:1px solid var(--line);
    border-radius:0 6px 6px 0;
    background:#fff;
    color:var(--ink-900);
    font:600 11.5px 'Google Sans Text',sans-serif;
    outline:none;
    cursor:pointer;
    text-align:left;
  }
  .month-filter-btn:hover{color:var(--navy-700);}
  .month-filter-panel{
    position:absolute;
    top:calc(100% + 6px);
    left:0;
    z-index:50;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    box-shadow:var(--shadow);
    padding:8px;
    min-width:160px;
  }
  .month-filter-actions{padding-bottom:6px; margin-bottom:6px; border-bottom:1px solid var(--line);}
  .month-filter-list{max-height:260px; overflow-y:auto; display:flex; flex-direction:column; gap:2px;}
  .month-filter-item{
    display:flex;
    align-items:center;
    gap:7px;
    padding:5px 6px;
    border-radius:6px;
    font-size:12.5px;
    cursor:pointer;
    white-space:nowrap;
  }
  .month-filter-item:hover{background:var(--sand-50);}
  .month-filter-item input{margin:0; cursor:pointer;}
  .journal-color-panel{
    position:absolute;
    top:calc(100% + 6px);
    left:0;
    z-index:50;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    box-shadow:var(--shadow);
    padding:10px;
    min-width:180px;
  }
  .journal-color-swatches{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px;}
  .journal-color-swatch{
    width:26px; height:26px;
    border-radius:6px;
    border:1px solid rgba(12,35,56,.12);
    cursor:pointer;
    padding:0;
  }
  .journal-color-swatch:hover{transform:scale(1.08); box-shadow:0 0 0 2px rgba(0,119,182,.25);}
  .journal-color-swatch.is-active{box-shadow:0 0 0 2px var(--navy-700), 0 0 0 4px #fff inset; transform:scale(1.05);}
  .journal-color-actions{display:flex; flex-direction:column; gap:4px; padding-top:6px; border-top:1px solid var(--line);}
  .journal-color-actions .btn.is-active{background:var(--ocean-100); border-color:var(--ocean-500); color:var(--navy-700);}
  .journal-color-dot{display:inline-block; width:12px; height:12px; border-radius:50%; border:1px solid rgba(12,35,56,.25); vertical-align:-1px; margin-right:2px;}
  .btn-icon-only{width:38px; height:38px; padding:0; display:inline-flex; align-items:center; justify-content:center;}
  .journal-color-save-row{display:flex; gap:6px; padding-top:6px; margin-top:6px; border-top:1px solid var(--line);}
  .month-filter-icon{
    width:14px;
    height:14px;
    color:var(--ocean-500);
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .content{padding:12px 22px 26px; flex:1;}

  /* ---------- Toolbar ---------- */
  .toolbar{
    display:flex; gap:8px; align-items:center; margin-bottom:14px; flex-wrap:wrap;
  }
  .search{
    flex:1; min-width:220px; position:relative;
  }
  .search input{
    width:100%; padding:8px 11px 8px 32px; border-radius:8px; border:1px solid var(--line);
    background:#fff; font-family:inherit; font-size:12.5px; color:var(--ink-900);
    outline:none; transition:border-color .15s, box-shadow .15s;
  }
  .search input:focus{border-color:var(--ocean-500); box-shadow:0 0 0 3px var(--ocean-100);}
  .search svg{position:absolute; left:11px; top:9.5px; width:15px; height:15px; color:var(--ink-500);}
  select.filter{
    padding:8px 28px 8px 11px; border-radius:8px; border:1px solid var(--line);
    background:#fff; font-family:inherit; font-size:12.5px; color:var(--ink-900); outline:none;
  }
  .btn{
    padding:7px 11px; border-radius:8px; border:none; font-family:inherit; font-weight:600;
    font-size:12px; cursor:pointer; display:inline-flex; align-items:center; gap:6px;
    transition:transform .1s, box-shadow .15s;
  }
  .btn:active{transform:translateY(1px);}
  .btn-primary{background:var(--navy-700); color:#fff;}
  .btn-primary:hover{background:var(--navy-800);}
  .btn-ghost{background:#fff; color:var(--navy-700); border:1px solid var(--line);}
  .btn-ghost:hover{border-color:var(--navy-700);}
  .btn-danger-ghost{background:#fff; color:var(--warn-600); border:1px solid var(--warn-100);}
  .btn-danger-ghost:hover{background:var(--warn-100);}
  .btn-sm{padding:5px 9px; font-size:12px; border-radius:7px;}

  /* ---------- Card / Table ---------- */
  .card{
    background:#fff; border:1px solid var(--line); border-radius:var(--radius);
    box-shadow:var(--shadow); overflow:hidden;
  }
  table{width:100%; border-collapse:collapse; font-size:11.5px;}
  thead th{
    text-align:left; padding:6px 8px; background:var(--sand-100); color:var(--ink-500);
    font-weight:600; font-size:9.5px; text-transform:uppercase; letter-spacing:.03em;
    border-bottom:1px solid var(--line); white-space:nowrap;
  }
  .th-label{
    cursor:pointer; display:inline-flex; align-items:center; gap:4px; user-select:none;
    padding:2px 2px 2px 0;
  }
  .th-label:hover{color:var(--navy-700);}
  .th-arrow{font-size:9px; color:var(--ocean-500);}
  .th-filter{
    display:block; width:100%; margin-top:3px; max-width:100%;
    font-size:10.5px; padding:1px 2px; border-radius:4px; border:1px solid var(--line);
    background:#fff; color:var(--ink-700,#4a5568); cursor:pointer;
  }
  .th-arrow.idle{opacity:.35;}
  .th-filter{
    display:block; margin-top:5px; width:100%; max-width:150px;
    padding:3px 20px 3px 6px; border-radius:5px; border:1px solid var(--line);
    background:#fff; font-family:inherit; font-size:11px; font-weight:500; color:var(--ink-900);
    text-transform:none; letter-spacing:0; outline:none; cursor:pointer;
  }
  .th-filter.active{border-color:var(--ocean-500); background:var(--ocean-100); color:var(--ocean-500); font-weight:600;}
  .th-filter-combo{cursor:text;}
  /* Fix nhỏ (theo phản hồi): dòng lọc riêng, tách khỏi dòng tiêu đề (chỉ sort) */
  tr.th-filter-row th, tr.th-filter-row td.th-filter-row-cell{
    background:var(--th-bg,#f4f6f9); border-top:1px solid var(--line);
    padding:4px 8px; vertical-align:middle;
  }
  tr.th-filter-row .th-filter{margin-top:0; max-width:100%;}
  .journal-filter-loading{font-size:12px; color:var(--ink-500); margin-left:8px;}
  tbody td{
    padding:6px 8px; border-bottom:1px solid #f0ede4; color:var(--ink-900); vertical-align:middle;
    white-space:nowrap; max-width:200px; overflow:hidden; text-overflow:ellipsis;
  }
  tbody td.wrap{white-space:normal; text-overflow:clip; max-width:260px;}
  tbody tr:last-child td{border-bottom:none;}
  tbody tr:hover{background:#fbfaf7;}
  tbody tr.journal-row-editing{background:#fffdf5;}
  tbody tr.journal-row-editing td{vertical-align:top;}
  .row-actions{display:flex; gap:6px; justify-content:flex-end;}
  .icon-btn{
    width:25px; height:25px; border-radius:7px; border:1px solid var(--line); background:#fff;
    display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--ink-500);
    transition:all .12s;
  }
  .icon-btn:hover{border-color:var(--navy-700); color:var(--navy-700);}
  .icon-btn svg{width:14px;height:14px;}
  .money-positive{color:#16803c !important; font-weight:700;}
  .check-col{width:36px; text-align:center;}
  .id-col{width:70px; min-width:70px; text-align:center;}
  .id-cell{
    width:70px; min-width:70px; text-align:center;
    font-family:'Google Sans Text',sans-serif;
    font-weight:600; color:var(--ink-500);
    user-select:text;
  }
  .row-check{
    width:15px; height:15px; accent-color:var(--navy-700); cursor:pointer;
  }
  .bulk-hint{font-size:12.5px; color:var(--ink-500); font-weight:600;}
  .entry-summary-bar{font-size:12.5px; color:var(--ink-500); font-weight:600; padding:4px 2px 8px; margin-top:-4px;}
  .page-size-control{
    display:inline-flex; align-items:center; gap:7px; color:var(--ink-500);
    font-size:12.5px; font-weight:600;
  }
  .page-size-control select{
    padding:7px 24px 7px 9px; border-radius:8px; border:1px solid var(--line);
    background:#fff; color:var(--ink-900); font:inherit; font-size:12.5px; outline:none;
  }
  .inline-cell-control{
    width:100%; min-width:96px;
    padding:5px 7px; border-radius:7px; border:1px solid var(--line);
    background:#fff; color:var(--ink-900); font:inherit; font-size:12px;
    outline:none;
  }
  .inline-cell-control:focus{
    border-color:var(--ocean-500);
    box-shadow:0 0 0 3px var(--ocean-100);
  }
  .inline-check{
    display:inline-flex; align-items:center; justify-content:center;
    width:100%; min-width:58px;
  }
  .inline-check input{width:16px; height:16px; accent-color:var(--navy-700); cursor:pointer;}
  .bbgn-inline-status{
    display:block; min-height:14px; margin-top:2px;
    font-size:10.5px; line-height:14px; white-space:nowrap;
  }
  .bbgn-inline-status.bbgn-inline-saving{color:var(--ink-500,#7a8699);}
  .bbgn-inline-status.bbgn-inline-saved{color:var(--ocean-600,#0e7a5f);}
  .bbgn-inline-status.bbgn-inline-error{color:#c0392b; font-weight:600;}

  .badge{
    display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:100px;
    font-size:11.5px; font-weight:600;
  }
  .badge-ok{background:var(--success-100); color:var(--success-600);}
  .badge-ok::before{content:''; width:6px;height:6px;border-radius:50%; background:var(--success-600);}
  .badge-warn{background:var(--warn-100); color:var(--warn-600);}
  .badge-warn::before{content:''; width:6px;height:6px;border-radius:50%; background:var(--warn-600);}
  .badge-neutral{background:var(--ocean-100); color:var(--ocean-500);}
  .amount-stack{display:flex; flex-direction:column; align-items:flex-end; gap:3px;}
  .amount-sub{font-size:11px; color:var(--ink-500); font-weight:500; white-space:nowrap;}
  .amount-stack.compact{gap:1px; line-height:1.08;}
  .settlement-compact{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;font-size:10.5px;color:var(--success-600);font-weight:700;white-space:nowrap;}
  .settlement-dot{width:6px;height:6px;border-radius:50%;background:var(--success-600);flex:0 0 6px;}
  .loai-badge{
    display:inline-flex; align-items:center; gap:7px;
    min-width:82px; padding:4px 8px; border-radius:999px;
    font-size:11px; font-weight:700; letter-spacing:.01em;
    color:var(--ink-900); border:1px solid transparent;
  }
  .loai-badge::before{
    content:''; width:11px; height:11px; border-radius:50%;
    border:1px solid rgba(18,35,52,.18); flex-shrink:0;
  }
  .loai-xuat{background:#fff0ee; border-color:#ffd3cc;}
  .loai-xuat::before{background:#ffc8c1;}
  .loai-nhap{background:#eff9e9; border-color:#d1edbf;}
  .loai-nhap::before{background:#cef0b9;}
  .loai-bai{background:#fff7df; border-color:#f4dea0;}
  .loai-bai::before{background:#ffe29a;}
  .loai-gia-cong,.loai-van-chuyen{background:#edf7f8; border-color:#c8e4e9;}
  .loai-gia-cong::before,.loai-van-chuyen::before{background:#c5dfe5;}

  .empty{padding:48px 20px; text-align:center; color:var(--ink-500);}
  .empty svg{width:34px;height:34px; color:var(--line); margin-bottom:10px;}
  .empty p{margin:2px 0; font-size:13.5px;}
  .empty .hint{font-size:12.5px; color:#98a5b1;}

  .skeleton{padding:16px 14px;}
  .skel-line{height:14px; border-radius:5px; background:linear-gradient(90deg,#eee,#f6f5f2,#eee); background-size:200% 100%; animation:shimmer 1.3s infinite; margin-bottom:10px;}
  @keyframes shimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}

  /* ---------- Modal ---------- */
  .overlay{
    position:fixed; inset:0; background:rgba(12,25,38,.45); backdrop-filter:blur(2px);
    display:none; align-items:flex-start; justify-content:center; padding:5vh 16px; z-index:50; overflow-y:auto;
  }
  .overlay.show{display:flex;}
  .modal{
    background:#fff; border-radius:14px; width:100%; max-width:560px; box-shadow:0 20px 60px rgba(12,35,56,.25);
    animation:pop .16s ease-out;
  }
  .modal-wide,.modal.wide{max-width:min(1180px,94vw);}
  .import-table-wrap{max-height:52vh; overflow:auto; border:1px solid var(--line); border-radius:10px;}
  .import-table{width:100%; border-collapse:collapse; font-size:12px;}
  .import-table th{position:sticky; top:0; background:#f3f6f9; padding:7px 8px; text-align:left; border-bottom:1px solid var(--line); white-space:nowrap;}
  .import-table td{padding:6px 8px; border-bottom:1px solid #f0f2f5; white-space:nowrap;}
  .import-table input,.import-table select{
    width:100%; min-width:92px; height:28px; padding:3px 6px; border:1px solid transparent; border-radius:6px;
    background:transparent; font:600 12px 'Google Sans Text',sans-serif; color:var(--ink-900); outline:none;
  }
  .import-table input:focus,.import-table select:focus{border-color:var(--ocean-500); background:#fff; box-shadow:0 0 0 2px rgba(28,111,148,.12);}
  .import-table .import-num{min-width:70px; text-align:right; font-variant-numeric:tabular-nums;}
  .import-table .import-wide{min-width:150px;}
  .import-row-err{background:#fff3f2;}
  .import-row-dup{background:#fff8e8;}
  .import-badge{display:inline-block; padding:1px 7px; border-radius:20px; font-size:11px; font-weight:600;}
  .import-badge.ok{background:#e5f5ec; color:#1c8a4e;}
  .import-badge.err{background:#fde8e6; color:#c0372a;}
  .import-badge.dup{background:#fdf1d6; color:#96700c;}
  .import-summary{display:flex; gap:16px; padding:10px 0; font-size:13px; flex-wrap:wrap;}
  .import-summary b{font-weight:700;}
  @keyframes pop{from{opacity:0; transform:translateY(6px) scale(.98);} to{opacity:1; transform:translateY(0) scale(1);}}
  .modal-head{
    padding:18px 22px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center;
  }
  .modal-head h3{margin:0; font-size:16px; font-weight:700;}
  .modal-close{background:none;border:none;cursor:pointer;color:var(--ink-500); width:28px;height:28px; border-radius:7px; display:flex; align-items:center; justify-content:center;}
  .modal-close:hover{background:var(--sand-100);}
  .modal-body{padding:20px 22px; display:grid; gap:14px;}
  .modal-loading{min-height:94px;display:flex;align-items:center;justify-content:center;gap:10px;color:var(--ink-500);font-size:13px;font-weight:600;}
  .modal-loading::before{content:'';width:17px;height:17px;border:2px solid var(--line);border-top-color:var(--ocean-500);border-radius:50%;animation:modalSpin .75s linear infinite;}
  @keyframes modalSpin{to{transform:rotate(360deg)}}
  .modal-foot{padding:16px 22px 20px; display:flex; justify-content:flex-end; gap:8px; border-top:1px solid var(--line);}
  .modal-bbgn{max-width:760px;}
  .bbgn-preview-card{
    border:1px solid var(--line); border-radius:10px; background:#fff; overflow:hidden;
    box-shadow:none;
  }
  .bbgn-preview-table{width:100%; border-collapse:collapse; table-layout:fixed;}
  .bbgn-preview-table td{
    padding:8px 12px; border-bottom:1px solid #eee9df; color:var(--ink-900);
    font-size:12.5px; line-height:1.35; white-space:normal; max-width:none; overflow:visible;
    text-overflow:clip; vertical-align:middle;
  }
  .bbgn-preview-table tr:last-child td{border-bottom:none;}
  .bbgn-label{
    width:240px; color:var(--ink-500)!important; font-weight:700;
  }
  .bbgn-value{font-weight:500;}
  .bbgn-control{
    width:100%; height:32px; min-width:0; padding:6px 9px;
    border:1px solid var(--line); border-radius:7px; background:#fff;
    color:var(--ink-900); font:500 12.5px 'Google Sans Text',sans-serif; outline:none;
  }
  textarea.bbgn-control{height:auto; min-height:72px; resize:vertical; line-height:1.45;}
  .bbgn-control:focus{border-color:var(--ocean-500); box-shadow:0 0 0 3px var(--ocean-100);}
  .bbgn-control[readonly]{background:#f7f9fb; color:var(--ink-900);}
  .bbgn-field-note{margin:5px 0 0; color:var(--ink-500); font-size:11.5px; font-weight:500;}
  .bbgn-check{
    display:inline-flex; align-items:center; gap:8px; font-size:12.5px;
    font-weight:700; color:var(--ink-900);
  }
  .bbgn-check input{width:15px; height:15px; accent-color:var(--navy-700);}
  .bbgn-save-default{
    display:flex; align-items:center; gap:8px; margin:12px; font-size:12.5px;
    font-weight:700; color:var(--ink-900);
  }
  .bbgn-save-default input{width:15px; height:15px; accent-color:var(--navy-700);}
  .bbgn-site-item{
    padding:7px 0; border-bottom:1px dashed #e7e1d6; display:grid; gap:3px;
  }
  .bbgn-site-item:last-child{border-bottom:none;}
  .bbgn-site-item b{color:var(--ink-500); font-weight:700;}
  .bbgn-inline-fields{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
  .bbgn-inline-fields label{display:block; margin-bottom:5px; color:var(--ink-500); font-size:11.5px; font-weight:700;}
  .field-row{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
  .field label{display:block; font-size:11.5px; font-weight:600; color:var(--ink-500); margin-bottom:5px;}
  .field input, .field select, .field textarea{
    width:100%; padding:7px 9px; border-radius:8px; border:1px solid var(--line);
    font-family:inherit; font-size:12px; color:var(--ink-900); outline:none; background:#fff;
  }
  .field input:focus, .field select:focus, .field textarea:focus{border-color:var(--ocean-500); box-shadow:0 0 0 3px var(--ocean-100);}
  .field .req{color:var(--warn-600);}
  .field-note{font-size:11.5px; color:#98a5b1; margin-top:4px;}
  /* Tính năng mới (30/07/2026): "Nhập từ ảnh" - đọc phiếu cân/xuất kho */
  .ocr-setup-card{max-width:720px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:20px;}
  .ocr-setup-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:16px 0;}
  .ocr-vattu-mode{display:flex; gap:16px; margin-bottom:6px; font-size:12.5px;}
  .ocr-vattu-mode label{display:flex; align-items:center; gap:5px; cursor:pointer;}
  .ocr-upload-zone{border:1px dashed var(--line); border-radius:10px; padding:16px; text-align:center; margin-top:8px;}
  .req{color:var(--red-600, #d4322c);}
  .ocr-review-toolbar{display:flex; align-items:center; gap:14px; margin-bottom:12px; flex-wrap:wrap;}
  .ocr-review-table{width:100%; border-collapse:collapse;}
  .ocr-review-table th, .ocr-review-table td{padding:6px 8px; border-bottom:1px solid var(--line); font-size:12px; vertical-align:top;}
  .ocr-review-table input[type="text"], .ocr-review-table input[type="date"], .ocr-review-table input[type="number"]{width:100%; min-width:90px; padding:4px 6px; border:1px solid var(--line); border-radius:6px; font-size:12px;}
  .ocr-thumb{width:60px; height:60px; object-fit:cover; border-radius:6px; cursor:pointer; border:1px solid var(--line);}
  .ocr-dup-warn{font-size:10.5px; color:#b5750a; margin-top:3px;}
  .ocr-row-error{background:#fff5f5;}

  /* ---------- Toast ---------- */
  .toast-wrap{position:fixed; bottom:20px; right:20px; display:flex; flex-direction:column; gap:8px; z-index:100;}
  .toast{
    background:var(--navy-900); color:#fff; padding:11px 16px; border-radius:9px; font-size:13px;
    box-shadow:0 10px 30px rgba(0,0,0,.25); display:flex; align-items:center; gap:9px;
    animation:slidein .18s ease-out; max-width:340px;
  }
  .toast.err{background:#7a2a20;}
  @keyframes slidein{from{opacity:0; transform:translateX(14px);} to{opacity:1; transform:translateX(0);}}

  .count-pill{font-size:12px; color:var(--ink-500); font-weight:500;}
  .tabs-hint{font-size:12px; color:var(--ink-500); margin-top:2px;}

  /* ---------- Nhập chuyến ---------- */
  .entry-row{
    background:#fff; border:1px solid var(--line); border-radius:11px;
    padding:16px 18px 13px; margin-bottom:14px; box-shadow:var(--shadow);
  }
  .entry-row-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:11px;}
  .entry-row-tools{display:flex; gap:6px; align-items:center;}
  .row-index{
    font-size:12px; font-weight:700; color:var(--ocean-500); background:var(--ocean-100);
    padding:2px 10px; border-radius:100px;
  }
  .entry-head-left{display:flex; gap:8px; align-items:center;}
  .entry-loai-mini{
    width:118px; padding:5px 8px; border-radius:8px; border:1px solid var(--line);
    background:#fff; color:var(--ink-900); font:600 12px 'Google Sans Text',sans-serif; outline:none;
  }
  .entry-grid{display:grid; grid-template-columns:repeat(12,minmax(82px,1fr)); gap:11px;}
  .entry-grid .field label{font-size:11.5px; margin-bottom:5px;}
  .entry-grid .field input, .entry-grid .field select{padding:8px 10px; font-size:13.5px;}
  .entry-grid .field.need-input input,
  .entry-grid .field.need-input select{background:#fffdf5; border-color:#ead9ad;}
  .entry-grid .field.auto-lookup input,
  .entry-grid .field.auto-lookup select{background:#f4fbfd; border-color:#c8e4e9;}
  .entry-col-date,.entry-col-time,.entry-col-qty,.entry-col-ticket,.entry-col-measure{grid-column:span 1;}
  .entry-col-vehicle,.entry-col-source,.entry-col-site,.entry-col-material{grid-column:span 2;}
  .entry-col-driver{grid-column:span 2;}
  .entry-col-note{grid-column:span 2;}
  .entry-preview{
    margin-top:12px; padding:9px 10px; border:1px dashed #c8e4e9; border-radius:9px;
    background:#f4fbfd; display:flex; gap:20px; flex-wrap:wrap; font-size:12.5px; color:var(--ink-500);
  }
  .entry-preview b{color:var(--ink-900); font-family:'Google Sans Text',sans-serif; font-weight:600;}
  .entry-actions{display:flex; justify-content:space-between; align-items:center; margin:16px 0 22px;}
  .section-title{font-size:14.5px; font-weight:700; margin:26px 0 10px; display:flex; align-items:center; gap:8px;}
  .section-title svg{width:16px;height:16px; color:var(--ocean-500);}

  /* ---------- Định vị Adsun ---------- */
  .adsun-toolbar{display:flex; gap:8px; align-items:center; margin-bottom:10px; flex-wrap:wrap;}
  .adsun-toolbar input{
    width:58px; height:30px; padding:4px 7px; border:1px solid var(--line);
    border-radius:7px; background:#fff; color:var(--ink-900); font:600 12px 'Google Sans Text',sans-serif;
  }
  .adsun-sheet-wrap{overflow:auto; max-height:72vh; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:var(--shadow);}
  .adsun-sheet{min-width:2670px; table-layout:fixed; border-collapse:separate; border-spacing:0; font-size:13px;}
  .adsun-sheet th{
    position:sticky; top:0; z-index:2; border-right:1px solid #ded8ca;
    height:36px; padding:5px 6px; font-size:10px; line-height:1.15;
  }
  .adsun-th{
    display:flex; align-items:center; justify-content:space-between; gap:4px;
    min-width:0;
  }
  .adsun-th span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .adsun-sort-btn{
    width:17px; height:17px; flex-shrink:0; border:1px solid rgba(21,34,51,.16);
    border-radius:5px; background:rgba(255,255,255,.62); color:var(--ink-500);
    font-size:9px; line-height:1; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
    padding:0;
  }
  .adsun-sort-btn:hover,.adsun-sort-btn.active{border-color:var(--ocean-500); color:var(--ocean-500); background:#fff;}
  .adsun-sheet td{
    height:38px; padding:2px; border-right:1px solid #f0ede4; max-width:none; overflow:visible; text-overflow:clip;
    background:#fff; vertical-align:middle;
  }
  .adsun-sheet tbody tr:hover td{background:#fbfaf7;}
  .adsun-sheet input,.adsun-sheet select{
    width:100%; min-width:0; height:32px; padding:4px 6px; border:1px solid transparent; border-radius:4px;
    background:transparent; color:var(--ink-900); font:500 13px 'Google Sans Text',sans-serif; outline:none;
  }
  .adsun-sheet input:focus,.adsun-sheet select:focus{
    border-color:var(--ocean-500); box-shadow:inset 0 0 0 1px var(--ocean-500); background:#fff;
  }
  .adsun-sheet input[data-adsun-number]{text-align:right; font-variant-numeric:tabular-nums;}
  .adsun-ro{
    height:32px; padding:7px 6px; font-size:12.5px; font-weight:600;
    color:var(--ink-900); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .adsun-region-a,.adsun-region-a input,.adsun-region-a select{background:#fffdf5;}
  .adsun-region-b,.adsun-region-b input,.adsun-region-b select{background:#f4fbfd;}
  .adsun-region-c,.adsun-region-c input,.adsun-region-c select{background:#f7f9fb;}
  .adsun-row-issue td{background:#fff5f2!important;}
  .adsun-row-saved td{background:#f3fbf7!important;}
  .adsun-status{display:inline-flex; align-items:center; padding:2px 7px; border-radius:999px; font-size:10.5px; font-weight:700; white-space:nowrap;}
  .adsun-status.draft,.adsun-status.need_review{background:var(--ocean-100); color:var(--ocean-500);}
  .adsun-status.ready{background:var(--success-100); color:var(--success-600);}
  .adsun-status.saved{background:#e5f5ec; color:#1c8a4e;}
  .adsun-status.issue{background:var(--warn-100); color:var(--warn-600);}
  .adsun-actions{display:flex; gap:4px; padding:2px; align-items:center;}
  .adsun-actions .btn{padding:4px 6px; font-size:10.5px; white-space:nowrap;}
  .adsun-note{font-size:12px; color:var(--ink-500); margin:0 0 10px;}

  /* ---------- Autocomplete gõ tự do (biển số, tài xế...) ---------- */
  .ac-box{
    position:fixed; background:#fff; color:var(--ink-900); border:1px solid var(--line); border-radius:9px;
    box-shadow:0 10px 28px rgba(12,35,56,.16); z-index:600; max-height:220px; overflow-y:auto;
    padding:4px;
  }
  .ac-item{padding:7px 10px; font-size:12.5px; border-radius:6px; cursor:pointer; white-space:nowrap;}
  .ac-item:hover, .ac-item.hi{background:var(--ocean-100); color:var(--ocean-500);}
  .journal-filter-autocomplete{
    position:relative;
  }
  .journal-filter-autocomplete input{
    padding-right:28px;
  }
  .journal-filter-dropdown-btn{
    position:absolute;
    right:5px;
    top:50%;
    transform:translateY(-50%);
    width:22px;
    height:22px;
    border:0;
    background:transparent;
    color:var(--ink-500);
    cursor:pointer;
    border-radius:5px;
  }
  .journal-filter-dropdown-btn:hover{
    background:var(--ocean-100);
    color:var(--ocean-500);
  }

  /* ---------- Bảng nhập chuyến gọn ---------- */
  .entry-toolbar{
    display:flex; justify-content:space-between; align-items:center; gap:8px;
    padding:0 0 9px; margin-bottom:8px; flex-wrap:wrap;
  }
  .entry-toolbar-left,.entry-toolbar-right{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
  .entry-toolbar input[type=number]{
    width:58px; height:30px; padding:4px 7px; border:1px solid var(--line);
    border-radius:7px; background:#fff; color:var(--ink-900); font:600 12px 'Google Sans Text',sans-serif;
  }
  .table-scroll{max-height:56vh; overflow:auto;}
  .table-scroll thead th{position:sticky; top:0; z-index:5;}
  .entry-table{min-width:1760px; table-layout:fixed; font-size:12.5px;}
  .entry-table th{height:34px; padding:5px 6px; font-size:10px;}
  .entry-table td{height:38px; padding:2px; white-space:nowrap; max-width:none; overflow:visible;}
  .entry-table input, .entry-table select{
    width:100%; min-width:0; height:32px; padding:4px 6px; font-size:12.5px; border:1px solid transparent;
    border-radius:5px; font-family:inherit; outline:none; background:#f4fbfd;
  }
  .entry-table input:focus, .entry-table select:focus{border-color:var(--ocean-500); box-shadow:inset 0 0 0 1px var(--ocean-500); background:#fff;}
  .entry-table input.entry-active-cell, .entry-table select.entry-active-cell{
    border-color:#1a73e8; box-shadow:inset 0 0 0 2px #1a73e8; background:#fff;
  }
  .entry-table input.entry-editing, .entry-table select.entry-editing{
    border-color:#0b57d0; box-shadow:inset 0 0 0 2px #0b57d0, 0 0 0 2px rgba(26,115,232,.12); background:#fff;
  }
  .entry-table input.entry-range-cell, .entry-table select.entry-range-cell{
    background:#eaf4ff!important;
    box-shadow:inset 0 0 0 1px rgba(43,122,158,.35);
  }
  .entry-table input.entry-range-anchor, .entry-table select.entry-range-anchor{
    box-shadow:inset 0 0 0 2px var(--ocean-500), 0 0 0 2px rgba(43,122,158,.12)!important;
  }
  .entry-table input.entry-cell-error, .entry-table select.entry-cell-error{
    border-color:#c0372a!important;
    box-shadow:inset 0 0 0 1px #c0372a, 0 0 0 2px rgba(192,55,42,.12)!important;
    background:#fff5f2!important;
  }
  .entry-sort-header{
    width:100%;
    border:0;
    background:transparent;
    color:inherit;
    font:inherit;
    text-transform:inherit;
    letter-spacing:inherit;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:4px;
    padding:0;
    text-align:left;
  }
  .entry-sort-arrow{font-size:9px; color:var(--ocean-500);}
  .entry-sort-arrow.idle{opacity:.35;}
  .entry-table input.need-input,.entry-table select.need-input{background:#fffdf5;}
  .entry-table input[disabled]{background:#f7f9fb; color:#98a5b1;}
  .entry-table input[data-formula-number], .entry-table input[data-entry-number]{text-align:right; font-variant-numeric:tabular-nums;}
  .entry-table input[type=date], .entry-table input[type=time]{min-width:0;}
  .entry-fill-handle{
    position:fixed; width:9px; height:9px; background:var(--ocean-500);
    border:1px solid #fff; box-shadow:0 1px 4px rgba(15,23,42,.25);
    border-radius:2px; z-index:9999; cursor:crosshair; display:none;
  }
  .entry-fill-handle.active{display:block;}
  .entry-table .col-noixuat, .entry-table .col-congtrinh, .entry-table .col-vattu{min-width:110px;}
  .entry-table .col-num{min-width:52px;}
  .entry-table .col-ghichu{min-width:120px;}
  .entry-table .preview-cell{height:32px; padding:7px 6px; color:var(--ink-900); font-size:12px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .entry-table .entry-actions-cell{display:flex; gap:4px; align-items:center; justify-content:center; height:32px;}
  .document-table td{max-width:260px;}
  .document-status{display:inline-flex; padding:3px 8px; border-radius:999px; font-size:10.5px; font-weight:800;}
  .document-status.draft{background:var(--ocean-100); color:var(--ocean-500);}
  .document-status.exported{background:var(--success-100); color:var(--success-600);}
  .document-status.signed{background:#e8f3ff; color:#1f5f9f;}
  .document-status.cancelled{background:var(--warn-100); color:var(--warn-600);}
  .document-item-table input,.document-item-table select{
    width:100%; height:32px; padding:4px 7px; border:1px solid var(--line); border-radius:6px;
    font:inherit; font-size:12.5px; background:#fff; outline:none;
  }
  .document-item-table input:focus,.document-item-table select:focus{border-color:var(--ocean-500); box-shadow:0 0 0 2px var(--ocean-100);}
  .legal-preview{background:#f7f9fb; border:1px solid var(--line); border-radius:8px; padding:9px 10px; font-size:12px; color:var(--ink-500); line-height:1.5;}
  .legal-preview b{color:var(--ink-900);}
  .recent-wrap{max-height:26vh; overflow:auto;}
  .recent-wrap thead th{position:sticky; top:0; z-index:5;}
  .recent-wrap table{font-size:11px;}
  .recent-wrap td{padding:4px 6px;}
  .journal-table-wrap{overflow:auto; max-height:68vh;}
  .journal-table-wrap thead th{position:sticky; top:0; z-index:5;}
  .pager{
    display:flex; align-items:center; justify-content:flex-end; gap:8px;
    margin-top:10px; flex-wrap:wrap;
  }
  .pager-info{font-size:12.5px; color:var(--ink-500); font-weight:600; margin-right:auto;}
  .journal-filters{
    display:grid; grid-template-columns:repeat(auto-fit,minmax(128px,1fr)); gap:7px;
    margin-bottom:10px;
  }
  .journal-multi-filter{
    position:relative;
    min-width:150px;
  }
  .journal-multi-trigger{
    width:100%;
    height:32px;
    padding:6px 10px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    color:var(--ink-900);
    font:500 12px 'Google Sans Text',sans-serif;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    cursor:pointer;
  }
  .journal-multi-trigger:hover{
    border-color:var(--ocean-500);
  }
  .journal-multi-trigger.open{
    border-color:var(--ocean-500);
    box-shadow:0 0 0 3px var(--ocean-100);
  }
  .journal-multi-arrow{
    font-size:10px;
    color:var(--ink-500);
  }
  .journal-multi-menu{
    position:absolute;
    top:calc(100% + 4px);
    left:0;
    z-index:500;
    min-width:190px;
    padding:6px;
    background:#fff;
    color:var(--ink-900);
    border:1px solid var(--line);
    border-radius:9px;
    box-shadow:0 10px 28px rgba(12,35,56,.16);
  }
  .journal-multi-option{
    display:flex;
    align-items:center;
    gap:8px;
    padding:7px 9px;
    border-radius:6px;
    font-size:12px;
    font-weight:500;
    cursor:pointer;
    white-space:nowrap;
  }
  .journal-multi-option:hover{
    background:var(--ocean-100);
  }
  .journal-multi-option input{
    width:15px;
    height:15px;
    accent-color:var(--navy-700);
  }
  .summary-grid{
    display:grid;
    grid-template-columns:minmax(96px,.7fr) minmax(96px,.7fr) repeat(3,minmax(120px,1fr)) minmax(180px,1.25fr);
    gap:7px;
    margin-bottom:10px;
  }
  .summary-box{
    background:#fff; border:1px solid var(--line); border-radius:10px;
    padding:7px 10px; box-shadow:var(--shadow);
  }
  .summary-box span{
    display:block; font-size:9.5px; font-weight:700; color:var(--ink-500);
    text-transform:uppercase; letter-spacing:.03em; margin-bottom:3px;
  }
  .summary-box b{font-size:15px; font-family:'Google Sans Text',sans-serif;}
  .summary-box.compact{padding:7px 10px;}
  .summary-box.compact b{font-size:14px;}
  .summary-box.money b{color:var(--navy-700);}
  .report-controls{
    display:grid; grid-template-columns:repeat(4,minmax(140px,1fr)); gap:10px;
    margin-bottom:12px;
  }
  .report-controls .field:last-child{grid-column:1/-1;}
  .report-sheet-grid{
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px;
    margin-top:12px;
  }
  .report-sheet-grid.daily-four-grid{align-items:stretch;}
  .report-detail-grid{grid-template-columns:minmax(0,3fr) minmax(0,7fr);}
  .report-block.revenue:nth-child(1), .report-block.revenue:nth-child(2){min-width:0;}
  .report-block{
    background:#f8fafc; border:1px solid #0f172a; border-radius:8px;
    overflow:hidden; box-shadow:0 2px 8px rgba(12,35,56,.12);
  }
  .report-block.revenue{min-height:560px;}
  .report-block.combined-summary{min-height:560px; display:flex; flex-direction:column;}
  .report-block.full{grid-column:1/-1;}
  .report-title{
    background:#1f2d46; color:#fff; padding:7px 10px;
    font-family:'Times New Roman',serif;
    font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:.03em;
    line-height:1.15;
  }
  .report-title.center{text-align:center; font-size:20px; padding:6px 10px 4px;}
  .report-title.center span{display:block;}
  .report-title.center b{display:block; font-size:21px; margin-top:2px;}
  .report-title.compact{
    font-family:'Times New Roman',serif; font-size:17px; letter-spacing:.04em;
    text-align:center; padding:9px 10px;
  }
  .report-table-wrap{overflow:auto; background:#fff;}
  .report-table{
    width:100%; border-collapse:collapse; font-size:12px;
    font-family:'Times New Roman',serif;
    color:#2d3748;
  }
  .report-table th{
    background:#3f5f7d; color:#fff; border:1px solid #111827;
    padding:6px 7px; white-space:nowrap; font-weight:800; text-align:center;
    font-size:13px;
  }
  .report-table td{
    border:1px dotted #111827; padding:5px 7px; white-space:nowrap; max-width:none;
    background:#f8fafc;
  }
  .report-table.revenue-table th{padding:5px 6px; font-size:12.5px;}
  .report-table.revenue-table td{height:20px; padding:3px 5px;}
  .report-table.detail-table th{font-size:15px; padding:7px 8px;}
  .report-table.detail-table td{height:22px; padding:4px 8px; font-size:13.5px;}
  .report-table.detail-table td:first-child{font-weight:700;}
  .combined-detail-body{display:grid; gap:0; flex:1; background:#fff;}
  .combined-section-title{
    background:#1f2d46; color:#fff; border-top:1px solid #111827; border-bottom:1px solid #111827;
    min-height:44px; padding:6px 10px; text-align:center; font:800 15px 'Times New Roman',serif;
    display:flex; align-items:center; justify-content:center;
    text-transform:uppercase; letter-spacing:.04em;
  }
  .report-table.material-split th{font-size:14px;}
  .report-table.material-split td{font-size:13px;}
  .report-table.material-split td:nth-child(1),
  .report-table.material-split td:nth-child(5){font-weight:800; text-align:left;}
  .report-table.material-split .split-gap{background:#fff!important; width:10px; padding:0; border:0!important;}
  .report-table.material-split th:nth-child(3),
  .report-table.material-split td:nth-child(3){border-right:0;}
  .report-table.material-split th:nth-child(5),
  .report-table.material-split td:nth-child(5){border-left:0;}
  .report-table.material-split th.split-gap{background:#fff!important;}
  .combined-summary .report-table th,
  .combined-summary .report-table td{font-size:14px;}
  .combined-summary .report-table td.num,
  .combined-summary .report-table td.money-col{font-size:14px; font-weight:700;}
  .report-table.material-detail td:first-child{text-align:left;}
  .report-table.service-detail td:nth-child(1){font-weight:700;}
  .report-table.service-detail td:nth-child(4){font-weight:800; font-style:italic; text-align:center;}
  .report-table tbody tr:nth-child(even) td{background:#f3f6f9;}
  .report-table td.num{text-align:right; font-family:'Times New Roman',serif;}
  .report-table td.center{text-align:center;}
  .report-table td.strong{text-align:center; font-weight:800; font-size:14px;}
  .report-table td.material{font-style:italic; text-align:center;}
  .report-table td.money-col{font-weight:900; font-size:13.5px;}
  .report-total td{
    background:#e7c255 !important; color:#8b1a12;
    font-weight:900; border:1px solid #111827;
    font-size:15px;
  }
  .report-total-split td{
    background:#e7c255 !important; color:#8b1a12;
    font-weight:900; border:1px solid #111827; font-size:15px;
    vertical-align:middle; line-height:1.15;
  }
  .report-total-split .service-type{
    background:#c9d8eb !important; color:#111827; text-align:center;
    font-style:normal; font-weight:900;
  }
  .report-table.service-detail .report-total-split td{
    font-style:normal;
  }
  .report-total-split .total-label{
    text-align:center; font-size:20px; letter-spacing:.03em;
  }
  .report-total-split .total-spacer{background:#e7c255!important;}
  .report-total-split td.num,
  .report-total-split td.money-col{
    text-align:right; font-size:15px; font-style:normal;
  }
  .report-total td.num{font-size:16px;}
  .report-total td.num{color:#8b1a12;}
  .report-note{
    background:#fff7df; color:#8a5a00; border:1px solid #f4dea0;
    border-radius:10px; padding:10px 12px; margin:10px 0; font-weight:700;
  }
  .saved-report-actions{display:flex; gap:6px; justify-content:flex-end;}
  .delete-confirm-icon{
    width:34px;
    height:34px;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--warn-100);
    color:var(--warn-600);
    flex-shrink:0;
  }
  .delete-confirm-message{
    padding:4px 0;
    font-size:13px;
    line-height:1.55;
    color:var(--ink-900);
  }
  .delete-confirm-detail{
    margin-top:10px;
    padding:10px 12px;
    border:1px solid var(--warn-100);
    border-radius:9px;
    background:#fff8f5;
    color:var(--ink-500);
    font-size:12px;
  }
  .btn-danger-confirm{
    background:var(--warn-600);
    color:#fff;
  }
  .btn-danger-confirm:hover{
    filter:brightness(.95);
  }
  @media (max-width:760px){
    .title-row{align-items:flex-start;}
    .title-month-filter{width:max-content;}
    .sidebar{position:fixed; z-index:40; transform:translateX(-100%); transition:transform .2s;}
    .sidebar.open{transform:translateX(0);}
    .field-row{grid-template-columns:1fr;}
    .journal-filters,.summary-grid,.report-controls,.report-sheet-grid,.report-detail-grid{grid-template-columns:1fr;}
    .report-block.full{grid-column:auto;}
    .topbar,.content{padding-left:18px; padding-right:18px;}
  }
  .debt-back{margin-bottom:10px}
  .debt-toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:14px}
  .debt-toolbar .field{min-width:150px;margin:0}.debt-cards{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:12px;margin-bottom:16px}
  .debt-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:15px}.debt-card span{font-size:11px;color:var(--muted);text-transform:uppercase;font-weight:700}.debt-card b{display:block;margin-top:7px;font-size:20px;color:var(--navy-800)}
  .main,.content,.card,.debt-table-wrap{min-width:0}
  .debt-table-wrap{display:block;width:100%;max-width:100%;background:#fff;border:1px solid var(--line);border-radius:12px;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch}.debt-table{width:max-content;min-width:100%;border-collapse:collapse}.debt-table th{position:sticky;top:0;background:#f5f7fa;color:#526273;font-size:11px;text-transform:uppercase;text-align:left;padding:10px;border-bottom:1px solid var(--line)}.debt-table td{padding:9px 10px;border-bottom:1px solid #edf0f3;font-size:12px;white-space:nowrap}.debt-table td.num,.debt-table th.num{text-align:right;font-variant-numeric:tabular-nums}.debt-table tr.clickable{cursor:pointer}.debt-table tr.clickable:hover{background:#f7fbff}.debt-paid{color:#15803d;font-weight:700}.debt-positive,.debt-balance-positive{color:#b42318;font-weight:700}.debt-negative,.debt-balance-negative{color:#087443;font-weight:700}.debt-balance-zero{color:#64748b;font-weight:600}
  .debt-table.compact td{padding:5px 10px;font-size:11.5px}.debt-table.compact th{padding:7px 10px}.debt-actions{display:flex;gap:5px;align-items:center;white-space:nowrap}.debt-link{border:0;background:none;color:var(--navy-700);font-weight:700;text-decoration:underline;cursor:pointer;padding:0}
  .debt-matrix{width:max-content;min-width:1320px}.debt-matrix th{top:0;z-index:2}.debt-matrix .week-head{background:var(--navy-800);color:#fff;text-align:center;font-size:13px}.debt-matrix .week-total{background:#fff;color:#b42318;font-weight:800;text-align:center}.debt-matrix .sticky-col{position:sticky;left:0;z-index:3;background:#fff}.debt-matrix .sticky-col-2{position:sticky;left:220px;z-index:3;background:#fff}.debt-matrix th.sticky-col,.debt-matrix th.sticky-col-2{background:var(--navy-800);color:#fff}.debt-matrix .customer-col{min-width:220px;font-weight:800}.debt-matrix .owner-col{min-width:150px}.debt-matrix .opening{background:#e8f3e4}.debt-matrix .closing{background:#f7d7d7;font-weight:800}.debt-matrix .zero{color:#6b7280}.debt-matrix button.debt-link{font-size:12px}.debt-status{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:700;background:var(--ocean-100);color:var(--ocean-500)}.debt-status.ok{background:var(--success-100);color:var(--success-600)}.debt-status.warn{background:var(--warn-100);color:var(--warn-600)}
  .debt-matrix{border-collapse:separate;border-spacing:0}.debt-matrix th,.debt-matrix td{border-right:1px solid #cfd8e3;border-bottom:1px solid #cfd8e3}.debt-matrix th:first-child,.debt-matrix td:first-child{border-left:1px solid #cfd8e3}.debt-matrix thead tr:first-child th{border-top:1px solid #cfd8e3}.debt-matrix th:nth-child(5n+3),.debt-matrix td:nth-child(5n+3){border-left:2px solid #8ea2b8}.debt-matrix .week-head{border-left:2px solid #8ea2b8}.debt-matrix .sticky-col,.debt-matrix .sticky-col-2{box-shadow:2px 0 0 rgba(15,23,42,.08);background-clip:padding-box}
  @media(max-width:900px){.debt-cards{grid-template-columns:1fr 1fr}}
  .bill-drop{border:1px dashed var(--line);border-radius:12px;padding:14px;background:var(--sand-50)}
  .bill-review{display:grid;gap:10px;margin-top:14px}
  .bill-row{display:grid;grid-template-columns:72px 130px minmax(180px,1fr) 150px minmax(190px,1fr) 34px;gap:8px;align-items:end;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fff}
  .bill-row img{width:72px;height:72px;object-fit:contain;border:1px solid var(--line);border-radius:8px;background:#f8fafc;cursor:zoom-in}
  .bill-row .field{margin:0}.bill-row label{font-size:10px}.bill-row input,.bill-row select{min-width:0}
  .bill-status{font-size:12px;color:var(--ink-500);margin-top:8px}.bill-status.ok{color:var(--success-600)}.bill-status.err{color:var(--warn-600)}
  .bill-lightbox{position:fixed;inset:0;z-index:5000;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(7,18,30,.9);cursor:zoom-out}
  .bill-lightbox[hidden]{display:none}
  .bill-lightbox img{display:block;max-width:min(1100px,96vw);max-height:92vh;object-fit:contain;border-radius:10px;background:#fff;box-shadow:0 16px 50px rgba(0,0,0,.45);cursor:default}
  .bill-lightbox-close{position:fixed;top:16px;right:18px;width:40px;height:40px;border:0;border-radius:50%;background:#fff;color:var(--navy-900);font-size:22px;font-weight:700;cursor:pointer;box-shadow:var(--shadow)}
  .dccn-excel-crop{max-height:68vh;overflow:auto;background:#e9edf2;border:1px solid #cbd3dc;border-radius:10px;padding:10px}.dccn-excel{width:1040px;min-width:1040px;background:#fff;color:#111;font-family:"Times New Roman",serif;font-size:14px;box-shadow:0 2px 8px #0002}.dccn-excel-cols{display:grid;grid-template-columns:38px 72px 142px 90px 172px 172px 172px 218px;position:sticky;top:0;z-index:3}.dccn-excel-cols div{height:24px;display:flex;align-items:center;justify-content:center;background:#f3f4f6;border-right:1px solid #d1d5db;border-bottom:1px solid #bfc5cc;font-family:Arial,sans-serif;font-size:12px;color:#4b5563}.dccn-excel-body{display:grid;grid-template-columns:38px 1fr}.dccn-rownums{background:#f3f4f6;border-right:1px solid #bfc5cc}.dccn-rownums div{height:24px;display:flex;align-items:center;justify-content:center;border-bottom:1px solid #e2e5e9;font-family:Arial,sans-serif;font-size:11px;color:#5b6470}.dccn-paper{padding:10px 0 26px}.dccn-paper-top{display:grid;grid-template-columns:1fr 1fr;padding:0 10px}.dccn-nation{text-align:center;font-weight:700;line-height:1.45}.dccn-doc-title{text-align:center;font-size:20px;font-weight:700;margin:34px 0}.dccn-doc-line{margin:5px 10px}.dccn-doc-party{font-weight:700;margin:15px 10px 0}.dccn-doc-indent{margin-left:24px}.dccn-grid{width:100%;border-collapse:collapse;table-layout:fixed;margin-top:24px}.dccn-grid th,.dccn-grid td{border:1px solid #111;height:27px;padding:3px 6px;vertical-align:middle}.dccn-grid th{background:#f2f2f2;text-align:center;font-weight:700}.dccn-grid .center{text-align:center}.dccn-grid .num{text-align:right}.dccn-grid .total{font-weight:700}.dccn-grid .closing{background:#fff200;color:#e00000;font-weight:700}.dccn-doc-conclusion{margin:20px 10px 0;font-style:italic}.dccn-doc-words{margin:6px 10px;font-weight:700}.dccn-doc-sign{display:grid;grid-template-columns:1fr 1fr;text-align:center;font-weight:700;margin-top:30px;padding-bottom:70px}
  /* DCCN preview: one complete Excel-like printable page, fitted to the modal. */
  .dccn-preview-stage{height:calc(100vh - 245px);min-height:430px;overflow:hidden;background:#747b84;border:1px solid #cbd3dc;border-radius:8px;display:flex;align-items:flex-start;justify-content:center;padding:12px}
  .dccn-preview-sheet{width:794px;min-width:794px;box-sizing:border-box;background:#fff;color:#000;font-family:"Times New Roman",serif;font-size:12px;line-height:1.25;transform-origin:top center;box-shadow:0 2px 14px #0006;padding:4px 5px 36px}
  .dccn-preview-sheet .dccn-paper{padding:0}.dccn-preview-sheet .dccn-paper-top{padding:0 2px}.dccn-preview-sheet .dccn-doc-title{font-size:17px;margin:28px 0 25px}.dccn-preview-sheet .dccn-doc-line{margin:4px 2px}.dccn-preview-sheet .dccn-doc-party{margin:12px 2px 0}.dccn-preview-sheet .dccn-doc-indent{margin-left:18px}.dccn-preview-sheet .dccn-grid{margin-top:18px}.dccn-preview-sheet .dccn-grid th,.dccn-preview-sheet .dccn-grid td{height:23px;padding:2px 4px}.dccn-preview-sheet .dccn-doc-conclusion{margin:17px 2px 0}.dccn-preview-sheet .dccn-doc-words{margin:5px 2px}.dccn-preview-sheet .dccn-doc-sign{margin-top:28px;padding-bottom:55px}
  #dccnExcelPreview .dccn-excel-crop{height:calc(100vh - 245px);min-height:430px;max-height:none;overflow:hidden;background:#747b84;display:flex;align-items:flex-start;justify-content:center;padding:12px}
  #dccnExcelPreview .dccn-excel{width:794px;min-width:794px;font-size:12px;line-height:1.25;transform-origin:top center;box-shadow:0 2px 14px #0006}
  #dccnExcelPreview .dccn-excel-cols,#dccnExcelPreview .dccn-rownums{display:none}
  #dccnExcelPreview .dccn-excel-body{display:block}
  #dccnExcelPreview .dccn-paper{padding:4px 5px 36px}#dccnExcelPreview .dccn-paper-top{padding:0 2px}#dccnExcelPreview .dccn-doc-title{font-size:17px;margin:28px 0 25px}#dccnExcelPreview .dccn-doc-line{margin:4px 2px}#dccnExcelPreview .dccn-doc-party{margin:12px 2px 0}#dccnExcelPreview .dccn-doc-indent{margin-left:18px}#dccnExcelPreview .dccn-grid{margin-top:18px}#dccnExcelPreview .dccn-grid th,#dccnExcelPreview .dccn-grid td{height:23px;padding:2px 4px}#dccnExcelPreview .dccn-doc-conclusion{margin:17px 2px 0}#dccnExcelPreview .dccn-doc-words{margin:5px 2px}#dccnExcelPreview .dccn-doc-sign{margin-top:28px;padding-bottom:55px}
  @media(max-width:900px){.bill-row{grid-template-columns:64px 1fr 1fr}.bill-row img{width:64px;height:64px}.bill-row .bill-company{grid-column:2/4}.bill-row .bill-remove{grid-column:3;justify-self:end}}
  @media print{body.debt-print .sidebar,body.debt-print .topbar,body.debt-print .debt-toolbar{display:none!important}body.debt-print .main{margin:0!important;width:100%!important}body.debt-print .content{padding:0!important}body.debt-print .debt-table-wrap{border:0;overflow:visible}body.debt-print .debt-table{min-width:0;font-size:10px}}
  .payroll-toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:14px}
  .payroll-snapshot-row{display:flex;align-items:center;gap:10px;margin:-6px 0 14px;font-size:12.5px}
  .payroll-snapshot-badge{color:var(--ink-500,#7a8699)}
  .payroll-snapshot-badge b{color:var(--ink-900);font-weight:700}
  .payroll-snapshot-new{color:var(--ocean-600,#0e7a5f);font-weight:600}
  .btn-xs{padding:3px 10px;font-size:11.5px;border-radius:6px}
  .payroll-toolbar .field{min-width:145px;margin:0}
  .payroll-toolbar .field.search{min-width:220px;flex:1}
  .payroll-summary{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:10px;margin-bottom:14px}
  .payroll-summary .summary-box{background:#fff;border:1px solid var(--line);border-radius:8px;padding:12px}
  .payroll-summary .summary-box span{display:block;color:var(--ink-500);font-size:10.5px;text-transform:uppercase;font-weight:800}
  .payroll-summary .summary-box b{display:block;margin-top:5px;font-size:17px;color:var(--navy-800);font-variant-numeric:tabular-nums}
  .payroll-table-wrap{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:auto;max-height:calc(100vh - 230px)}
  .payroll-table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}
  .payroll-table th{position:sticky;top:0;z-index:2;background:#f5f7fa;color:#526273;font-size:10.5px;text-transform:uppercase;text-align:center;vertical-align:middle;padding:12px 8px;border-bottom:1px solid var(--line);white-space:normal;line-height:1.25;overflow:visible;overflow-wrap:anywhere}
  .payroll-table td{padding:8px;border-bottom:1px solid #edf0f3;font-size:12px;white-space:nowrap;vertical-align:middle}
  .payroll-table tbody tr{cursor:pointer}
  .payroll-table tbody tr:hover{background:#f7fbff}
  .payroll-table tbody tr.payroll-warn{background:#fff8f0}
  .payroll-table tfoot td{position:sticky;bottom:0;background:#fff;border-top:2px solid var(--line);font-weight:800}
  .payroll-table .num{text-align:right;font-variant-numeric:tabular-nums}
  .payroll-table .center{text-align:center}
  .payroll-table .employee-cell{text-align:left;min-width:180px;max-width:260px;white-space:normal}
  .payroll-table .workday-col{text-align:center;min-width:72px}
  .payroll-table .money-col{min-width:116px}
  .payroll-table .negative{color:#b42318!important;font-weight:800}
  .payroll-bangke-table thead th{height:58px;min-height:58px;font-size:12px!important;line-height:1.18;white-space:normal;overflow-wrap:anywhere;padding:12px 8px!important}
  .payroll-bangke-table th{font-size:12px!important;line-height:1.18;white-space:normal;overflow-wrap:anywhere}
  .payroll-bangke-table td{font-size:13px!important;padding:8px 10px!important}
  .payroll-bangke-table .bangke-sticky{position:sticky;z-index:4;background:#fff}
  .payroll-bangke-table thead .bangke-sticky{z-index:7;background:#f5f7fa!important}
  .payroll-bangke-table tfoot .bangke-sticky{z-index:6;background:#fff!important}
  .payroll-bangke-table .sticky-stt{left:0;width:48px;min-width:48px;max-width:48px}
  .payroll-bangke-table .sticky-code{left:48px;width:82px;min-width:82px;max-width:82px}
  .payroll-bangke-table .sticky-name{left:130px;width:230px;min-width:230px;max-width:230px}
  .payroll-bangke-table tbody tr:nth-child(even) .bangke-sticky{background:#f8fbfd}
  .payroll-bangke-table tbody tr:hover .bangke-sticky{background:#eef6fb}
  .salary-exact-table .negative{color:#b42318!important;font-weight:800}
  .payroll-workday-cell{display:flex;align-items:center;justify-content:flex-end;gap:6px}
  .payroll-workday-input{width:58px;height:30px;padding:3px 7px;text-align:right;font:inherit;font-variant-numeric:tabular-nums;background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;appearance:textfield;-moz-appearance:textfield}
  .payroll-workday-input:hover{background:#f5f8fb;border-color:#d6dee8}
  .payroll-workday-input:focus{background:#fff;border-color:var(--ocean-500);box-shadow:0 0 0 3px rgba(0,119,182,.14);outline:none}
  /* FIX (2026-07-30) THEO YÊU CẦU USER: ô "Số lượt cuốc VƯƠNG" nằm ngay sát cột
     "Công thực tế" - trước đây 2 ô này trông giống hệt nhau (cùng kiểu số nhỏ),
     từng có dòng chữ "30.000/lượt" để phân biệt nhưng đã bị bỏ theo đúng thiết
     kế gộp cột đã chốt trước đó, khiến dễ gõ nhầm ô. Thêm màu nền/viền RIÊNG,
     CHỈ áp dụng cho đúng ô của VƯƠNG (qua class .payroll-vuong-input) - thuần
     hiển thị, KHÔNG đổi field lưu/logic/dữ liệu. */
  .payroll-vuong-cell{position:relative}
  .payroll-vuong-input{background:#fff7e6;border-color:#e8c56a}
  .payroll-vuong-input:hover{background:#fdf0d5;border-color:#d9ae3f}
  .payroll-vuong-input:focus{background:#fff;border-color:#c9962a;box-shadow:0 0 0 3px rgba(201,150,42,.18)}
  .payroll-vuong-hint{position:absolute;top:-15px;right:0;font-size:9.5px;font-weight:700;color:#a9781f;letter-spacing:.02em;white-space:nowrap}
  .payroll-workday-input::-webkit-outer-spin-button,.payroll-workday-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
  .payroll-reset-inline{width:22px;height:22px;border:0;border-radius:50%;background:#eef2f6;color:#526273;cursor:pointer;font-weight:900;line-height:1}
  .payroll-reset-inline:hover{background:#dfe7ef;color:#173b63}
  .payroll-save-note{min-width:38px;font-size:11px;color:var(--ink-500);text-align:left}
  .payroll-save-note.saved{color:var(--success-600);font-weight:800}
  .payroll-status{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;background:var(--ocean-100);color:var(--ocean-500)}
  .payroll-status.ready{background:var(--success-100);color:var(--success-600)}
  .payroll-status.warn{background:var(--warn-100);color:var(--warn-600)}
  .payroll-status.danger{background:#fff1f0;color:#b42318}
  .payroll-salary-table th.sticky-col,.payroll-salary-table td.sticky-col{position:sticky;z-index:4;background:#fff}
  .payroll-salary-table th.sticky-col{z-index:6;background:#f5f7fa}
  .payroll-salary-table .sticky-stt{left:0;min-width:52px}
  .payroll-salary-table .sticky-code{left:52px;min-width:86px}
  .payroll-salary-table .sticky-name{left:138px;min-width:180px}
  .payroll-salary-table tbody tr:hover td.sticky-col{background:#f7fbff}
  .payroll-salary-table tbody tr.payroll-warn td.sticky-col{background:#fff8f0}
  .payroll-input-cell{width:58px;height:30px;padding:3px 7px;text-align:right;font:inherit;font-variant-numeric:tabular-nums;background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;appearance:textfield;-moz-appearance:textfield}
  .payroll-input-cell:hover{background:#f5f8fb;border-color:#d6dee8}
  .payroll-input-cell:focus{background:#fff;border-color:var(--ocean-500);box-shadow:0 0 0 3px rgba(0,119,182,.14);outline:none}
  .payroll-input-cell::-webkit-outer-spin-button,.payroll-input-cell::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
  .payroll-cell-wrap{display:flex;align-items:center;justify-content:flex-end;gap:6px;width:100%;min-width:0}
  .payroll-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:14px}
  .payroll-detail-section{border:1px solid var(--line);border-radius:8px;padding:12px;background:#fff}
  .payroll-detail-section h4{margin:0 0 8px;color:var(--navy-800)}
  .payroll-detail-row{display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid #edf0f3;padding:6px 0;font-size:12px}
  .payroll-detail-row:last-child{border-bottom:0}
  .payroll-rates-screen{font-family:'Google Sans Text',sans-serif}
  .payroll-tabs{display:flex;gap:6px;align-items:center;margin:0 0 12px;border-bottom:1px solid var(--line);overflow:auto}
  .payroll-tab{border:0;border-bottom:3px solid transparent;background:transparent;color:var(--ink-500);padding:9px 11px;font-weight:800;font-size:12px;cursor:pointer;white-space:nowrap}
  .payroll-tab.active{color:var(--navy-800);border-bottom-color:var(--ocean-500)}
  .payroll-book-screen{display:flex;flex-direction:column;gap:12px}
  .payroll-book-actions{display:flex;gap:8px;align-items:center;margin-left:auto}
  .payroll-click-money{border:0;background:transparent;color:var(--ocean-500);font:inherit;font-weight:800;text-decoration:underline;text-underline-offset:2px;cursor:pointer;padding:0}
  .payroll-click-money:hover{color:var(--navy-800)}
  .payroll-cost-cards{grid-template-columns:repeat(3,minmax(190px,1fr))}
  .payroll-cost-table tbody tr,.payroll-book-table tbody tr{cursor:default}
  .payroll-cost-table th,.payroll-bangke-table th{min-height:44px}
  .payroll-cost-table .company-cell{min-width:120px;text-align:center}
  .payroll-cost-table tfoot td{font-weight:900}
  .payroll-col-trip{background:#e8f2ff!important}
  .payroll-col-fee{background:#eaf7e8!important}
  .payroll-col-gross{background:#fff8cc!important;font-weight:800}
  .payroll-col-advance{background:#fff0dc!important}
  .payroll-col-loan{background:#fce8ef!important}
  .payroll-col-company{background:#e6f2ff!important}
  .payroll-col-personal{background:#edf8e8!important}
  .payroll-recovery-check{width:18px;height:18px;accent-color:#2f9e6f;cursor:pointer}
  .payroll-bulk-help{margin:0 0 10px;padding:10px 12px;border-radius:8px;background:#f5f8fb;color:var(--ink-500);font-size:12px;line-height:1.5}
  .payroll-bulk-text{width:100%;min-height:120px;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre}
  .payroll-draft-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}
  .payroll-draft-table input{width:100%;min-width:110px;border:1px solid var(--line);border-radius:6px;padding:6px 7px;font:inherit}
  .payroll-draft-table tr.row-error td{background:#fff1f0}
  .payroll-draft-table .draft-status{min-width:90px;color:var(--ink-500);font-size:11px;white-space:normal}
  .payroll-draft-table .draft-status.error{color:#b42318;font-weight:700}
  .payroll-draft-table .draft-status.saved{color:var(--success-600);font-weight:800}
  .payroll-empty-note{padding:28px;text-align:center;color:var(--ink-500)}
  .payroll-form-grid{display:grid;grid-template-columns:repeat(2,minmax(210px,1fr));gap:12px}
  .payroll-form-grid .field{margin:0}
  .payroll-mini-note{font-size:11px;color:var(--ink-500);margin-top:3px}
  .payroll-tab-badge{display:inline-flex;min-width:20px;height:20px;margin-left:5px;padding:0 6px;border-radius:999px;align-items:center;justify-content:center;background:var(--warn-100);color:var(--warn-600);font-size:11px}
  .payroll-rates-table tbody tr{cursor:default}
  .payroll-rates-table tbody tr.editing{background:#f0f8ff}
  .payroll-rates-table td.route-text{max-width:250px;overflow:hidden;text-overflow:ellipsis}
  .payroll-rate-input{width:120px;height:30px;padding:4px 7px;border:1px solid var(--line);border-radius:6px;font:inherit;font-variant-numeric:tabular-nums}
  .payroll-rate-input.money{text-align:right}
  .payroll-rate-input.note{width:210px}
  .payroll-rate-input:disabled{background:#f7f9fb;color:#718096}
  .payroll-action-row{display:flex;gap:6px;align-items:center;white-space:nowrap}
  .payroll-source-badge{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;background:#f1f5f9;color:#475569}
  .payroll-source-badge.manual{background:#e2f5ec;color:#2f9e6f}
  .payroll-source-badge.sheet{background:#e4eff3;color:#2b7a9e}
  .payroll-source-badge.default{background:#fff7df;color:#8a5a00}
  .payroll-source-badge.none{background:#f1f5f9;color:#64748b}
  .payroll-effective-fee{background:#f0f8ff;font-weight:800;color:var(--navy-800)}
  .payroll-pagination{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px;color:var(--ink-500);font-size:12px}
  .payroll-missing-count{display:inline-flex;min-width:24px;justify-content:center;padding:2px 7px;border-radius:999px;background:var(--warn-100);color:var(--warn-600);font-weight:800}
  .payroll-missing-count.hot{background:#fff1f0;color:#b42318}
  .payroll-sort-btn{width:100%;min-height:26px;border:0;background:transparent;color:inherit;font:inherit;font-weight:800;text-transform:inherit;text-align:inherit;padding:0;display:inline-flex;align-items:center;justify-content:inherit;gap:5px;cursor:pointer}
  .payroll-sort-icon{min-width:10px;color:var(--ocean-500);font-size:10px}
  .payroll-filter-note{margin:-4px 0 8px;color:var(--ink-500);font-size:12px}
  .period-severity{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;background:var(--success-100);color:var(--success-600)}
  .period-severity.warn{background:var(--warn-100);color:var(--warn-600)}
  .period-severity.block{background:#fff1f0;color:#b42318}
  .driver-journal-sheet{--journal-green-dark:#6f9f3a;--journal-green-header:#8dc641;--journal-green-light:#eef6e8;--journal-border:#7f8a78;--journal-money:#fff200;background:#fff;border:1px solid var(--journal-border);overflow:auto;color:#111;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .driver-journal-summary-table,.driver-journal-data-table{border-collapse:collapse;table-layout:fixed;width:1265px;font-family:Arial,sans-serif;font-size:12px}
  .driver-journal-summary-table th,.driver-journal-summary-table td,.driver-journal-data-table th,.driver-journal-data-table td{border:1px solid var(--journal-border);padding:4px 6px;vertical-align:middle;white-space:normal;overflow:visible;overflow-wrap:anywhere}
  .driver-journal-summary-table .top-label{background:var(--journal-green-dark);color:#fff;font-weight:800;text-align:center}
  .driver-journal-summary-table .top-value{background:var(--journal-green-light);font-weight:800;text-align:center}
  .driver-journal-summary-table .metric-label{background:var(--journal-green-light);font-weight:800;text-align:center}
  .driver-journal-summary-table .metric-value{background:var(--journal-money);font-weight:800;text-align:right;font-variant-numeric:tabular-nums}
  .driver-journal-title{box-sizing:border-box;width:1265px;border-left:1px solid var(--journal-border);border-right:1px solid var(--journal-border);background:var(--journal-green-dark);color:#fff;font-size:18px;font-weight:900;line-height:1.25;text-align:center;padding:7px 8px}
  .driver-journal-data-table thead th{background:var(--journal-green-header);text-align:center;font-weight:900}
  .driver-journal-data-table tbody tr:nth-child(odd){background:#fff}
  .driver-journal-data-table tbody tr:nth-child(even){background:var(--journal-green-light)}
  .driver-journal-data-table tbody tr:hover{background:#e2f1d8}
  .driver-journal-data-table .num,.driver-journal-summary-table .num{text-align:right;font-variant-numeric:tabular-nums}
  .driver-journal-data-table .center,.driver-journal-summary-table .center{text-align:center}
  .driver-journal-data-table .text{text-align:left}
  .vehicle-journal-data-table{width:1645px!important;table-layout:fixed}
  .vehicle-journal-data-table th{white-space:normal;line-height:1.12;text-align:center;overflow-wrap:normal;word-break:normal}
  .vehicle-journal-data-table td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .vehicle-journal-data-table .num{text-align:right;font-variant-numeric:tabular-nums}
  .vehicle-journal-data-table .center{text-align:center}
  .vehicle-journal-data-table .text{text-align:left}
  .vehicle-journal-data-table .ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  @media print{
    body.print-driver-journal .sidebar,body.print-driver-journal .topbar,body.print-driver-journal .payroll-toolbar,body.print-driver-journal .payroll-summary,body.print-driver-journal .toast-wrap{display:none!important}
    body.print-driver-journal .main{margin:0!important;width:100%!important}
    body.print-driver-journal .content{padding:0!important}
    body.print-driver-journal .driver-journal-sheet{border:0;overflow:visible;-webkit-print-color-adjust:exact;print-color-adjust:exact}
    body.print-driver-journal .driver-journal-summary-table,body.print-driver-journal .driver-journal-data-table,body.print-driver-journal .driver-journal-title{width:100%;font-size:9.2pt}
    body.print-driver-journal .driver-journal-data-table thead{display:table-header-group}
    body.print-driver-journal .driver-journal-data-table tbody tr:hover{background:inherit}
    @page{size:A4 landscape;margin:8mm}
    body.print-payslip .sidebar,body.print-payslip .topbar,body.print-payslip .payroll-toolbar,body.print-payslip .toast-wrap{display:none!important}
    body.print-payslip .main{margin:0!important;width:100%!important}
    body.print-payslip .content{padding:0!important}
    body.print-payslip .payslip-sheet{border:0;width:100%}
  }
  /* V13.5.25: layout web phỏng theo đúng bố cục file Excel (màu nền xen kẽ ở khối
     thông tin nhân viên, header bảng nền xám xanh chữ trắng, viền đồng nhất mỏng,
     Khoản vay chữ đỏ, ô Tổng thực nhận nổi bật) thay vì bảng kẻ ô đơn điệu trước đó. */
  .payslip-sheet{background:#fff;border:1px solid #444;color:#202124;width:100%;max-width:760px;margin:0 auto;font-family:'Google Sans Text',Arial,sans-serif;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .payslip-company{text-align:center;font-size:18px;font-weight:800;padding:10px 8px 0;color:#980000}
  .payslip-title{text-align:center;font-size:18px;font-weight:800;padding:2px 8px 10px;border-bottom:1px solid #444}
  .payslip-info{width:100%;border-collapse:collapse;font-size:14px;table-layout:fixed}
  .payslip-info td{padding:5px 8px;font-weight:700;border:1px solid #444;word-break:break-word}
  .payslip-info .lbl{width:110px}
  .payslip-info tr.info-dark td{background:#78909C;color:#fff}
  .payslip-info tr.info-light td{background:#EBEFF1}
  .payslip-body{width:100%;border-collapse:collapse;font-size:14px;table-layout:fixed}
  /* V13.5.25-hotfix: đổi cột từ px cố định (tổng 948px, VƯỢT khung 760px gây tràn
     ngang) sang % (tổng đúng 100% khung), giữ nguyên tỉ lệ cột STT/nhãn/số tiền theo
     đúng bản Excel gốc (6.4 : 33.6 : 22.1). */
  .payslip-body col:nth-child(1),.payslip-body col:nth-child(4){width:5%}
  .payslip-body col:nth-child(2),.payslip-body col:nth-child(5){width:27%}
  .payslip-body col:nth-child(3),.payslip-body col:nth-child(6){width:18%}
  .payslip-body th,.payslip-body td{border:1px solid #444;padding:5px 8px;overflow-wrap:break-word}
  .payslip-body thead th{text-align:center;font-weight:800;background:#78909C;color:#fff}
  .payslip-body td.num{text-align:right;font-variant-numeric:tabular-nums}
  .payslip-body td.payslip-bold{font-weight:700}
  .payslip-body td.payslip-sub{font-weight:400;padding-left:16px}
  .payslip-body td.payslip-red{color:#FF0000}
  .payslip-total-row td{font-weight:800;background:#EBEFF1}
  .payslip-footer-line{padding:6px 8px;font-size:14px;border:1px solid #444;border-top:0}
  .payslip-final-row{display:flex;align-items:stretch;font-weight:800;border:1px solid #444;border-top:0}
  .payslip-final-row .lbl{flex:0 0 55%;background:#EBEFF1;padding:8px;display:flex;align-items:center}
  .payslip-final-row .amount{flex:1;background:#78909C;color:#fff;font-size:18px;text-align:center;display:flex;align-items:center;justify-content:center;padding:8px}
  .payslip-sign{text-align:center;font-size:14px;font-weight:700;padding:16px 8px 20px;line-height:1.5}
  :root{
    --salary-header-blue:#d9e7f5;
    --salary-title-red:#c00000;
    --salary-yellow:#fff200;
    --salary-company-green:#d9ead3;
    --salary-personal-peach:#fce5cd;
    --salary-total-peach:#f4cccc;
    --salary-section-blue:#d9eaf7;
    --salary-grid:#333333;
  }
  .salary-exact-screen,.salary-exact-screen button,.salary-exact-screen input,.salary-exact-screen select,.salary-exact-screen table{font-family:"Times New Roman",Times,serif}
  .salary-exact-screen .payroll-toolbar{margin-bottom:10px}
  .salary-exact-screen .payroll-summary{margin-bottom:12px}
  .salary-exact-block{margin:0 0 22px;border:1px solid #b8c1cc;border-radius:10px;background:#fff;overflow:hidden}
  .salary-exact-title{margin:0;min-height:46px;display:flex;align-items:center;justify-content:center;padding:8px 16px;border:0;border-bottom:1px solid #b8c1cc;background:#fff;color:var(--salary-title-red);font-family:"Times New Roman",Times,serif;font-size:22px;line-height:1.1;font-weight:700;text-align:center}
  .salary-exact-block>.payroll-table-wrap{border:0;border-radius:0;max-width:100%}
  .salary-exact-table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content;min-width:0;font-family:"Times New Roman",Times,serif;font-size:14px;line-height:1.15}
  .salary-exact-table th,.salary-exact-table td{box-sizing:border-box;border:0;border-right:1px solid var(--salary-grid);border-bottom:1px solid var(--salary-grid);padding:5px 7px;overflow:hidden;background-clip:padding-box;white-space:nowrap;background:#fff}
  .salary-exact-table tr>:first-child{border-left:1px solid var(--salary-grid)}
  .salary-exact-table thead tr:first-child>*{border-top:1px solid var(--salary-grid)}
  .salary-exact-table thead th{position:sticky;z-index:20;background:var(--salary-header-blue);color:#526174;text-align:center;font-size:13px;font-weight:700;line-height:1.05;white-space:normal;overflow-wrap:normal;word-break:normal}
  .salary-exact-table thead tr:first-child th{top:0;height:38px;min-height:38px;vertical-align:middle}
  .salary-exact-table thead tr:nth-child(2) th{top:38px;height:36px;min-height:36px;vertical-align:middle}
  .salary-exact-table thead th[rowspan="2"]{top:0;height:74px;min-height:74px;vertical-align:middle}
  .salary-exact-table .salary-yellow{background:var(--salary-yellow)}
  .salary-exact-table .salary-company{background:var(--salary-company-green)}
  .salary-exact-table .salary-personal{background:var(--salary-personal-peach)}
  .salary-exact-table .salary-total{background:var(--salary-total-peach);color:var(--salary-title-red);font-weight:800}
  .salary-exact-table .section-row td{background:var(--salary-section-blue);font-weight:800;text-align:left}
  .salary-exact-table .salary-subtotal td{background:#f3f6fa;font-weight:800;border-top:1.5px solid #334155}
  .salary-exact-table .warn-row td{background:#fff8f0}
  .salary-exact-table .text{text-align:left}
  .salary-exact-table .center{text-align:center}
  .salary-exact-table .money{text-align:right!important;font-variant-numeric:tabular-nums}
  .salary-exact-table .money .payroll-cell-wrap{justify-content:flex-end!important}
  .salary-exact-table .money input{text-align:right!important}
  .salary-exact-table .sticky-col{position:sticky;z-index:8;background:#fff;background-clip:padding-box}
  .salary-exact-table th.sticky-col{z-index:30;background:var(--salary-header-blue)}
  .salary-exact-table .sticky-code{left:0;width:84px;min-width:84px;max-width:84px}
  .salary-exact-table .sticky-stt{left:84px;width:46px;min-width:46px;max-width:46px}
  .salary-exact-table .sticky-name{left:130px;width:220px;min-width:220px;max-width:220px}
  .salary-exact-table .sticky-position{left:350px;width:190px;min-width:190px;max-width:190px;border-right:2px solid #334155!important;box-shadow:5px 0 7px -6px rgba(15,23,42,.8)}
  .salary-exact-table td.sticky-name,.salary-exact-table td.sticky-position{white-space:nowrap;text-overflow:ellipsis}
  .salary-exact-table tbody tr:hover td{background:#f7fbff}
  .salary-exact-table tbody tr:hover td.sticky-col{background:#f7fbff}
  .salary-exact-table .warn-row td.sticky-col{background:#fff8f0}
  .salary-exact-table .salary-subtotal td.sticky-col{background:#f3f6fa}
  .salary-exact-input{width:100%;min-width:0;box-sizing:border-box;height:24px;padding:2px 5px;text-align:right;font-family:"Times New Roman",Times,serif;font-variant-numeric:tabular-nums;background:transparent;border:1px solid transparent;border-radius:4px;appearance:textfield;-moz-appearance:textfield}
  .salary-exact-input:hover{background:#f5f8fb;border-color:#d6dee8}
  .salary-exact-input:focus{background:#fff;border-color:var(--ocean-500);box-shadow:0 0 0 2px rgba(0,119,182,.14);outline:none}
  .salary-exact-input::-webkit-outer-spin-button,.salary-exact-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
  .salary-exact-note{display:inline-block;min-width:24px;font-size:10px;color:var(--ink-500)}
  .salary-exact-note.saved{color:var(--success-600);font-weight:800}
  @media(max-width:1099px){
    .salary-exact-table .sticky-name,.salary-exact-table .sticky-position{position:static;left:auto;width:auto;min-width:0;max-width:none;border-right:1px solid var(--salary-grid)!important;box-shadow:none}
    .salary-exact-table th.sticky-name,.salary-exact-table th.sticky-position{z-index:20}
  }
  .payroll-state{background:#fff;border:1px solid var(--line);border-radius:10px;padding:28px;text-align:center;color:var(--ink-500)}
  .payroll-state h3{margin:0 0 8px;color:var(--ink-900)}
  .payroll-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
  .payroll-detail-head h4{margin:0;font-size:15px}
  @media(max-width:900px){
    .payroll-summary{grid-template-columns:1fr 1fr}
    .payroll-table-wrap{max-height:none}
  }
  @media(max-width:640px){
    .payroll-summary{grid-template-columns:1fr}
    .payroll-toolbar .field,.payroll-toolbar .field.search{min-width:100%;width:100%}
  }
  .sidebar nav{
    overflow-y:auto;
    scrollbar-width:thin;
    scrollbar-color:rgba(180,200,216,.55) transparent;
    scrollbar-gutter:stable;
    padding-right:7px;
  }
  .sidebar nav::-webkit-scrollbar,
  .payroll-table-wrap::-webkit-scrollbar,
  .journal-table-wrap::-webkit-scrollbar,
  .debt-table-wrap::-webkit-scrollbar{width:6px;height:6px}
  .sidebar nav::-webkit-scrollbar-track,
  .payroll-table-wrap::-webkit-scrollbar-track,
  .journal-table-wrap::-webkit-scrollbar-track,
  .debt-table-wrap::-webkit-scrollbar-track{background:transparent}
  .sidebar nav::-webkit-scrollbar-thumb,
  .payroll-table-wrap::-webkit-scrollbar-thumb,
  .journal-table-wrap::-webkit-scrollbar-thumb,
  .debt-table-wrap::-webkit-scrollbar-thumb{background:rgba(180,200,216,.48);border-radius:999px}
  .sidebar nav::-webkit-scrollbar-thumb:hover,
  .payroll-table-wrap::-webkit-scrollbar-thumb:hover,
  .journal-table-wrap::-webkit-scrollbar-thumb:hover,
  .debt-table-wrap::-webkit-scrollbar-thumb:hover{background:rgba(210,224,235,.75)}
  .production-table-wrap{border:1px solid #dfe5eb;border-radius:8px;overflow:auto;background:#fff}
  .journal-table-wrap table,
  .production-table,
  .payroll-bangke-table,
  .payroll-cost-table,
  .payroll-rates-table,
  .payroll-book-table,
  .debt-table{border-collapse:separate;border-spacing:0}
  .journal-table-wrap th,.journal-table-wrap td,
  .production-table th,.production-table td,
  .payroll-bangke-table th,.payroll-bangke-table td,
  .payroll-cost-table th,.payroll-cost-table td,
  .payroll-rates-table th,.payroll-rates-table td,
  .payroll-book-table th,.payroll-book-table td,
  .debt-table th,.debt-table td{border-right:1px solid #dfe5eb;border-bottom:1px solid #dfe5eb}
  .journal-table-wrap th:last-child,.journal-table-wrap td:last-child,
  .production-table th:last-child,.production-table td:last-child,
  .payroll-bangke-table th:last-child,.payroll-bangke-table td:last-child,
  .payroll-cost-table th:last-child,.payroll-cost-table td:last-child,
  .payroll-rates-table th:last-child,.payroll-rates-table td:last-child,
  .payroll-book-table th:last-child,.payroll-book-table td:last-child,
  .debt-table th:last-child,.debt-table td:last-child{border-right:0}
  .journal-table-wrap tbody tr:nth-child(even):not(.journal-row-editing),
  .production-table tbody tr:nth-child(even),
  .payroll-bangke-table tbody tr:nth-child(even),
  .payroll-cost-table tbody tr:nth-child(even),
  .payroll-rates-table tbody tr:nth-child(even),
  .payroll-book-table tbody tr:nth-child(even),
  .debt-table tbody tr:nth-child(even){background:#f8fbfd}
  .journal-table-wrap tbody tr:hover,
  .production-table tbody tr:hover,
  .payroll-bangke-table tbody tr:hover,
  .payroll-cost-table tbody tr:hover,
  .payroll-rates-table tbody tr:hover,
  .payroll-book-table tbody tr:hover,
  .debt-table tbody tr:hover{background:#eef6fb}
  .journal-table-wrap th,.production-table th,
  .payroll-bangke-table thead th,.payroll-cost-table thead th,
  .payroll-rates-table thead th,.payroll-book-table thead th,
  .debt-table th{
    background:#f4f6f8!important;
    color:#334155;
    font-weight:800;
    text-align:center!important;
    vertical-align:middle;
    white-space:normal;
    line-height:1.18;
    padding:6px 8px;
  }
  .journal-table-wrap td,.production-table td,
  .payroll-bangke-table td,.payroll-cost-table td,
  .payroll-rates-table td,.payroll-book-table td,
  .debt-table td{padding:5px 8px;line-height:1.2}
  .payroll-bangke-table .employee-cell div{display:none}
  .payroll-bangke-table .employee-cell b{font-weight:700}
  .salary-exact-table thead th,
  .salary-exact-table thead th.money,
  .salary-exact-table thead th.num,
  .salary-exact-table thead th.text,
  .salary-exact-table thead th.center{
    text-align:center!important;
    vertical-align:middle!important;
    white-space:normal;
  }
  .salary-explain-cell{cursor:help}
  .salary-explain-cell:hover{outline:2px solid rgba(0,119,182,.18);outline-offset:-2px}
  .payroll-group-filter{position:relative;min-width:260px}
  .payroll-group-menu{position:absolute;z-index:30;top:calc(100% + 6px);left:0;width:min(320px,80vw);max-height:320px;overflow:auto;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:8px;padding:8px}
  .payroll-group-option{display:flex;align-items:flex-start;gap:8px;padding:7px 8px;border-radius:6px;line-height:1.25;white-space:normal}
  .payroll-group-option:hover{background:var(--soft)}
  .payroll-group-option input{margin-top:2px;flex:0 0 auto}
  .payroll-group-footer{position:sticky;bottom:-8px;background:var(--surface);border-top:1px solid var(--line);display:flex;gap:8px;padding:8px 0 0;margin-top:6px}
  table.debt-matrix{width:max-content!important;min-width:max-content!important;table-layout:fixed}
  .debt-matrix th,.debt-matrix td{font-size:13.5px!important}
  .debt-matrix td{padding:7px 10px!important}
  .debt-matrix thead .week-head{background:#123b5d!important;color:#fff!important;border-color:#0d2f4c!important;font-size:14px!important}
  .debt-matrix thead .week-total{background:#eef6fb!important;color:#062f4d!important;border-color:#c5dbe8!important;font-weight:900;font-size:13px!important}
  .debt-matrix thead tr:last-child th{background:#f7fbfe!important;color:#1f3b4f!important;font-size:12.5px!important}
  table.debt-matrix thead tr > th.customer-col,
  table.debt-matrix thead tr > th.owner-col{background:#123b5d!important;color:#fff!important;border-color:#0d2f4c!important;opacity:1;text-shadow:none}
  table.debt-matrix .owner-col{width:158px!important;min-width:158px!important;max-width:158px!important}
  table.debt-matrix .customer-col{width:230px!important;min-width:230px!important;max-width:230px!important}
  table.debt-matrix .sticky-col-2{left:158px!important}
  table.debt-matrix .weekly-opening{width:135px!important;min-width:135px!important;max-width:135px!important}
  table.debt-matrix .weekly-revenue{width:150px!important;min-width:150px!important;max-width:150px!important}
  table.debt-matrix .weekly-payment{width:150px!important;min-width:150px!important;max-width:150px!important}
  table.debt-matrix .weekly-adjustment{width:118px!important;min-width:118px!important;max-width:118px!important}
  table.debt-matrix .weekly-closing{width:145px!important;min-width:145px!important;max-width:145px!important}
  table.debt-matrix tbody .customer-col{text-align:left;white-space:normal;line-height:1.18}
  table.debt-matrix thead .customer-col,table.debt-matrix thead .owner-col{text-align:center!important;white-space:normal;line-height:1.15}
  table.debt-matrix tbody .owner-col .phu-trach-badge{max-width:138px;overflow:hidden;text-overflow:ellipsis}
  table.debt-matrix button.debt-link{font-size:13.5px!important}
  .journal-table-wrap table{table-layout:fixed;width:max-content;min-width:100%}
  /* V13.5.10: khoá cứng độ rộng TỪNG cột theo đúng vị trí (!important) — phòng
     trường hợp nội dung (kể cả dropdown lọc mới thêm) làm co giãn cột ngoài ý
     muốn, nhất là các cột đang ghim (freeze) đến hết Số xe/Sà lan. */
.journal-table-wrap th:nth-child(1),.journal-table-wrap td:nth-child(1){width:44px!important;min-width:44px!important;max-width:44px!important}
.journal-table-wrap th:nth-child(2),.journal-table-wrap td:nth-child(2){width:64px!important;min-width:64px!important;max-width:64px!important}
.journal-table-wrap th:nth-child(3),.journal-table-wrap td:nth-child(3){width:76px!important;min-width:76px!important;max-width:76px!important}
.journal-table-wrap th:nth-child(4),.journal-table-wrap td:nth-child(4){width:104px!important;min-width:104px!important;max-width:104px!important}
.journal-table-wrap th:nth-child(5),.journal-table-wrap td:nth-child(5){width:84px!important;min-width:84px!important;max-width:84px!important}
.journal-table-wrap th:nth-child(6),.journal-table-wrap td:nth-child(6){width:112px!important;min-width:112px!important;max-width:112px!important}
.journal-table-wrap th:nth-child(7),.journal-table-wrap td:nth-child(7){width:150px!important;min-width:150px!important;max-width:150px!important}
.journal-table-wrap th:nth-child(8),.journal-table-wrap td:nth-child(8){width:200px!important;min-width:200px!important;max-width:200px!important}
.journal-table-wrap th:nth-child(9),.journal-table-wrap td:nth-child(9){width:160px!important;min-width:160px!important;max-width:160px!important}
.journal-table-wrap th:nth-child(10),.journal-table-wrap td:nth-child(10){width:110px!important;min-width:110px!important;max-width:110px!important}
.journal-table-wrap th:nth-child(11),.journal-table-wrap td:nth-child(11){width:56px!important;min-width:56px!important;max-width:56px!important}
.journal-table-wrap th:nth-child(12),.journal-table-wrap td:nth-child(12){width:96px!important;min-width:96px!important;max-width:96px!important}
.journal-table-wrap th:nth-child(13),.journal-table-wrap td:nth-child(13){width:86px!important;min-width:86px!important;max-width:86px!important}
.journal-table-wrap th:nth-child(14),.journal-table-wrap td:nth-child(14){width:86px!important;min-width:86px!important;max-width:86px!important}
.journal-table-wrap th:nth-child(15),.journal-table-wrap td:nth-child(15){width:86px!important;min-width:86px!important;max-width:86px!important}
.journal-table-wrap th:nth-child(16),.journal-table-wrap td:nth-child(16){width:110px!important;min-width:110px!important;max-width:110px!important}
.journal-table-wrap th:nth-child(17),.journal-table-wrap td:nth-child(17){width:140px!important;min-width:140px!important;max-width:140px!important}
.journal-table-wrap th:nth-child(18),.journal-table-wrap td:nth-child(18){width:96px!important;min-width:96px!important;max-width:96px!important}
.journal-table-wrap th:nth-child(19),.journal-table-wrap td:nth-child(19){width:76px!important;min-width:76px!important;max-width:76px!important}
.journal-table-wrap th:nth-child(20),.journal-table-wrap td:nth-child(20){width:76px!important;min-width:76px!important;max-width:76px!important}
.journal-table-wrap th:nth-child(21),.journal-table-wrap td:nth-child(21){width:126px!important;min-width:126px!important;max-width:126px!important}
.journal-table-wrap th:nth-child(22),.journal-table-wrap td:nth-child(22){width:72px!important;min-width:72px!important;max-width:72px!important}
.journal-table-wrap th:nth-child(23),.journal-table-wrap td:nth-child(23){width:220px!important;min-width:220px!important;max-width:220px!important}
.journal-table-wrap th:nth-child(24),.journal-table-wrap td:nth-child(24){width:54px!important;min-width:54px!important;max-width:54px!important}

  .journal-table-wrap thead th{position:sticky;top:0;z-index:5;background:#f4f6f8!important;box-shadow:0 1px 0 #dfe5eb;max-height:42px;overflow:hidden}
  .journal-table-wrap .check-col{width:44px!important;min-width:44px!important;max-width:44px!important;text-align:center}
  .journal-table-wrap th,.journal-table-wrap td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .journal-table-wrap td:nth-child(6),.journal-table-wrap td:nth-child(7),.journal-table-wrap td:nth-child(8),.journal-table-wrap td:nth-child(21),.journal-table-wrap td:nth-child(23){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .journal-table-wrap td:nth-child(10),.journal-table-wrap td:nth-child(11),.journal-table-wrap td:nth-child(12),.journal-table-wrap td:nth-child(13),.journal-table-wrap td:nth-child(14),.journal-table-wrap td:nth-child(15),.journal-table-wrap td:nth-child(16),.journal-table-wrap td:nth-child(18),.journal-table-wrap td:nth-child(19){white-space:nowrap}
  .payroll-journal-book{display:flex;flex-direction:column;gap:12px}
  #payrollJournalBody{min-height:220px}
  .salary-money-input{width:100%;min-width:0;box-sizing:border-box;height:24px;padding:2px 5px;text-align:right;font-family:"Times New Roman",Times,serif;font-variant-numeric:tabular-nums;background:transparent;border:1px solid transparent;border-radius:4px}
  .salary-exact-table td.salary-input-overridden{background:#fff3cd}
  .salary-money-input:hover{background:#f5f8fb;border-color:#d6dee8}
  .salary-money-input:focus{background:#fff;border-color:var(--ocean-500);box-shadow:0 0 0 2px rgba(0,119,182,.14);outline:none}
  /* ===== Báo cáo Tổng hợp (mới, V13.5.36) ===== */
  .report-sheet-grid.bcth-grid-3{grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:16px;}
  .report-sheet-grid.bcth-grid-4{grid-template-columns:repeat(2,minmax(380px,1fr));gap:16px;}
  @media (max-width:820px){ .report-sheet-grid.bcth-grid-4{grid-template-columns:1fr;} }
  .gia-history-block{max-height:720px; overflow-y:auto;}
  .gia-history-section-title{font-weight:700; font-size:13px; color:var(--ink-900); background:var(--sand-100); padding:6px 10px; margin:10px 0 6px; border-radius:6px;}
  .gia-history-ct{font-weight:700; font-size:13px; color:var(--navy-700); margin:10px 0 4px;}
  .gia-history-vt{font-weight:600; font-size:12.5px; color:var(--ink-500); margin:6px 0 2px 8px;}
  .gia-history-nx{font-size:12px; font-weight:600; color:var(--warn-600); margin:4px 0 2px 16px;}
  .gia-history-empty{font-size:12.5px; color:var(--ink-500); font-style:italic; padding:6px 10px;}
  .gia-history-table{width:calc(100% - 8px); margin:0 0 6px 8px; font-size:12px;}
  .gia-history-table td{padding:3px 6px;}
  .gia-history-tang td{color:var(--success-600);}
  .gia-history-giam td{color:var(--warn-600);}
  .bcth-revenue-table td{padding:6px 8px;}
  .bcth-block .report-table td:first-child{white-space:normal;word-break:break-word;}
  .bcth-block .report-table{font-size:14px;}
  .bcth-block .report-table th{font-size:15px;}
  .bcth-block .report-title.center{font-size:22px;}
  .bcth-block .report-title.center b{font-size:23px;}
  .bcth-company-row td{background:#eef3f8;border-top:1px solid var(--line);}
  .bcth-site-row .bcth-site-name{padding-left:22px;color:#526273;}
  .bcth-tabs{margin-bottom:12px;}
  .bcth-block{font-family:'Google Sans Text',sans-serif;border-width:1.5px;}
  .bcth-block .report-title{font-family:'Google Sans Text',sans-serif;}
  .bcth-block .report-table{font-family:'Google Sans Text',sans-serif;}
  .bcth-block.phu-trach-phung-tien{border-color:#fca5a5;}
  .bcth-block.phu-trach-phung-tien .report-title{background:#8a1f2b;}
  .bcth-block.phu-trach-phung-tien .report-table th{background:#c0362f;}
  .bcth-block.phu-trach-phung-tien .bcth-company-row td{background:#fdecea;}
  .bcth-block.phu-trach-nghia-hoa{border-color:#93c5fd;}
  .bcth-block.phu-trach-nghia-hoa .report-title{background:#1e3a8a;}
  .bcth-block.phu-trach-nghia-hoa .report-table th{background:#2f6fed;}
  .bcth-block.phu-trach-nghia-hoa .bcth-company-row td{background:#e8f0fe;}
  .bcth-block.phu-trach-yen-thinh{border-color:#fbbf24;}
  .bcth-block.phu-trach-yen-thinh .report-title{background:#8a5a12;}
  .bcth-block.phu-trach-yen-thinh .report-table th{background:#c9820f;}
  .bcth-block.phu-trach-yen-thinh .bcth-company-row td{background:#fdf3de;}
  .bcth-block.phu-trach-unknown{border-color:#cbd5e1;}
  .bcth-block.phu-trach-unknown .report-title{background:#334155;}
  .bcth-material-block{padding:0;overflow:hidden;border-width:1.5px;border-color:#cbd5e1;min-height:0!important;}
  .bcth-material-group-title{font-family:'Google Sans Text',sans-serif;font-weight:800;font-size:20px;letter-spacing:.02em;background:#1f2a37;color:#fff;padding:14px 18px;text-align:center;}
  .bcth-entity-section{font-family:'Google Sans Text',sans-serif;}
  .bcth-entity-heading{font-weight:800;font-size:19px;letter-spacing:.02em;padding:10px 16px;color:#fff;text-align:center;}
  .bcth-entity-section.phu-trach-phung-tien .bcth-entity-heading{background:#8a1f2b;}
  .bcth-entity-section.phu-trach-nghia-hoa .bcth-entity-heading{background:#1e3a8a;}
  .bcth-entity-section.phu-trach-yen-thinh .bcth-entity-heading{background:#8a5a12;}
  .bcth-entity-section.phu-trach-unknown .bcth-entity-heading{background:#334155;}
  .bcth-entity-section .report-table{font-size:16px;}
  .bcth-entity-section .report-table th{font-size:15px;background:#eef1f5;color:#1f2a37;}
  .bcth-entity-section .report-table td{padding:7px 9px;}
  .bcth-vattu-table{margin-bottom:2px;}
  .bcth-gap-sm{height:10px;background:#fff;}
  .bcth-gap-lg{height:22px;background:#fff;border-top:2px solid #e2e8f0;border-bottom:2px solid #e2e8f0;}
  .bcth-section-gap{height:22px;}
  .bcth-material-grid{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start;}
  .bcth-material-block{flex:0 0 760px;max-width:760px;}
  @media (max-width:900px){.bcth-material-block{flex:1 1 100%;max-width:100%;}}
  .bcth-boiduong-price-row{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#f7f2e3;border-bottom:1px solid #e5ddc4;font-family:'Google Sans Text',sans-serif;font-weight:700;color:#5a4a1f;}
  .bcth-boiduong-price-row input{width:120px;padding:6px 8px;border:1px solid #cbd5e1;border-radius:6px;font-family:'Google Sans Text',sans-serif;font-size:15px;text-align:right;}
  .bcth-boiduong-table{font-size:16px;}
  .bcth-boiduong-table th{font-size:15px;background:#eef1f5;color:#1f2a37;}
  .bcth-boiduong-table td{padding:7px 9px;}

  /* ===== PHT responsive shell: desktop / laptop / tablet / phone =====
     Chi them lop hien thi cho PWA da co san, khong doi luu chuyen, tinh gia,
     payroll, Supabase RPC hay bat ky co che nghiep vu nao. */
  .mobile-menu-btn{display:none}
  html{min-height:100%;-webkit-text-size-adjust:100%}
  body{min-height:100%;overscroll-behavior-y:none}
  .app{min-height:100dvh}
  input,select,textarea,button{font-size:16px}
  @media (min-width:761px){
    input,select,textarea,button{font-size:inherit}
  }
  @media (max-width:1180px){
    .sidebar{width:172px}
    .brand-text{font-size:15px;max-width:96px}
    .nav-item{gap:8px;padding:7px 8px;font-size:12px}
    .topbar{padding:12px 16px 0}
    .content{padding:10px 16px 22px}
    .journal-filters{grid-template-columns:repeat(4,minmax(150px,1fr))}
    .summary-grid,.payroll-summary,.debt-cards{grid-template-columns:repeat(2,minmax(160px,1fr))}
    .toolbar,.entry-toolbar,.payroll-toolbar,.debt-toolbar{gap:8px}
    .modal{width:min(940px,calc(100vw - 28px))}
  }
  @media (max-width:900px){
    .topbar{align-items:flex-start}
    .topbar-actions{align-items:flex-end;gap:8px}
    .user-chip b{max-width:120px}
    .journal-filters{grid-template-columns:repeat(2,minmax(150px,1fr))}
    .field-row,.payroll-form-grid{grid-template-columns:1fr}
    .search,.payroll-toolbar .field.search{min-width:220px}
    .entry-toolbar,.toolbar,.payroll-toolbar,.debt-toolbar{align-items:stretch}
    .entry-toolbar-left,.entry-toolbar-right{width:100%;justify-content:flex-start}
    .table-scroll,.journal-table-wrap,.payroll-table-wrap,.debt-table-wrap,.report-table-wrap,.recent-wrap{
      max-width:100%;
      overflow:auto;
      -webkit-overflow-scrolling:touch;
      touch-action:pan-x pan-y;
    }
    .entry-table{min-width:1380px}
    .journal-table-wrap{max-height:calc(100dvh - 310px)}
    .payroll-table-wrap{max-height:calc(100dvh - 270px)}
    .modal{max-height:calc(100dvh - 24px)}
    .overlay{padding:12px}
  }
  @media (max-width:760px){
    body.sidebar-open{overflow:hidden}
    .app{display:block}
    .mobile-menu-btn{
      display:inline-flex;
      width:42px;
      height:42px;
      align-items:center;
      justify-content:center;
      flex:0 0 auto;
      border:1px solid var(--line);
      border-radius:10px;
      background:#fff;
      color:var(--navy-800);
      box-shadow:0 1px 3px rgba(12,35,56,.08);
    }
    .mobile-menu-btn svg{width:20px;height:20px}
    .sidebar{
      width:min(310px,84vw)!important;
      padding:16px 12px calc(16px + env(safe-area-inset-bottom))!important;
      position:fixed!important;
      inset:0 auto 0 0;
      height:100dvh;
      z-index:90!important;
      transform:translateX(-104%);
      box-shadow:20px 0 48px rgba(4,18,32,.32);
      transition:transform .22s ease!important;
    }
    .sidebar.open{transform:translateX(0)}
    .sidebar.collapsed{
      width:min(310px,84vw)!important;
      padding:16px 12px calc(16px + env(safe-area-inset-bottom))!important;
    }
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .brand-text,
    .sidebar.collapsed .brand-sub,
    .sidebar.collapsed .sidebar-foot{display:initial}
    .sidebar.collapsed .nav-group-toggle{display:flex}
    .sidebar.collapsed .nav-group-block,.sidebar.collapsed .nav-group-items{display:flex}
    .sidebar.collapsed .nav-item{justify-content:flex-start;padding:9px 10px}
    .sidebar.collapsed .nav-item.nav-child{margin-left:10px;padding-left:10px}
    .sidebar.collapsed .brand-row{justify-content:space-between}
    .sidebar.collapsed .sb-toggle{transform:none}
    .brand-text{font-size:16px;max-width:150px}
    .brand-sub{display:block!important}
    .nav-item{min-height:40px;font-size:13px}
    .nav-group-toggle{min-height:32px}
    body.sidebar-open::before{
      content:'';
      position:fixed;
      inset:0;
      z-index:80;
      background:rgba(6,18,30,.42);
      backdrop-filter:blur(1px);
    }
    .main{min-height:100dvh;width:100%}
    .topbar{
      position:sticky;
      top:0;
      z-index:30;
      display:grid;
      grid-template-columns:auto minmax(0,1fr);
      align-items:start;
      gap:10px;
      padding:calc(10px + env(safe-area-inset-top)) 12px 8px;
      background:rgba(247,245,240,.96);
      backdrop-filter:blur(12px);
      border-bottom:1px solid rgba(226,221,209,.72);
    }
    .topbar>div:first-of-type{min-width:0}
    .topbar-actions{
      grid-column:1/-1;
      width:100%;
      margin-left:0;
      justify-content:space-between;
      flex-wrap:wrap;
    }
    .title-row{gap:8px}
    .topbar h1{font-size:18px;line-height:1.18}
    .topbar p{font-size:12px;line-height:1.3}
    .title-month-filter{min-height:34px;max-width:100%;overflow:hidden}
    .title-month-filter select{min-width:86px;height:28px}
    .user-chip{align-items:flex-start}
    .count-pill{min-height:28px;display:inline-flex;align-items:center}
    .content{padding:12px 12px calc(22px + env(safe-area-inset-bottom))}
    .ops-tabs,.payroll-tabs,.bcth-tabs{
      overflow-x:auto;
      white-space:nowrap;
      -webkit-overflow-scrolling:touch;
      padding-bottom:8px;
    }
    .ops-tab,.payroll-tab{min-height:38px}
    .toolbar,.entry-toolbar,.payroll-toolbar,.debt-toolbar{
      display:grid;
      grid-template-columns:1fr;
      align-items:stretch;
      gap:9px;
    }
    .toolbar .btn,.entry-toolbar .btn,.payroll-toolbar .btn,.debt-toolbar .btn,.btn{
      min-height:40px;
      justify-content:center;
    }
    .btn-sm{min-height:36px}
    .search,.toolbar .search,.payroll-toolbar .field,.payroll-toolbar .field.search,
    .debt-toolbar .field,.field,.page-size-control{
      width:100%;
      min-width:0!important;
    }
    .field input,.field select,.search input,select.filter,.journal-filter-autocomplete input{
      min-height:42px;
      font-size:16px;
    }
    .custom-select-trigger{min-height:42px;font-size:16px}
    .custom-select-menu,.ac-box{
      max-width:calc(100vw - 20px);
      font-size:15px;
    }
    .journal-filters,.summary-grid,.payroll-summary,.debt-cards,.report-controls,.report-sheet-grid,.report-detail-grid{
      grid-template-columns:1fr!important;
    }
    .summary-box,.debt-card{padding:13px 14px}
    .summary-box b,.debt-card b{font-size:19px}
    .entry-toolbar-left,.entry-toolbar-right{display:grid;grid-template-columns:1fr;gap:8px}
    .entry-toolbar input[type=number]{width:78px}
    .table-scroll,.journal-table-wrap,.payroll-table-wrap,.debt-table-wrap,.report-table-wrap,.recent-wrap{
      border-radius:10px;
      margin-left:-2px;
      margin-right:-2px;
      max-height:calc(100dvh - 330px);
    }
    .entry-table{min-width:1180px;font-size:12px}
    .entry-table th{font-size:10px}
    .entry-table input,.entry-table select{min-height:34px;font-size:14px}
    .journal-table-wrap table{font-size:12px}
    .journal-table-wrap th,.journal-table-wrap td{padding-top:7px;padding-bottom:7px}
    .payroll-table th{font-size:11px}
    .payroll-table td{font-size:12.5px}
    .debt-matrix .owner-col{min-width:130px!important;width:130px!important;max-width:130px!important}
    .debt-matrix .customer-col{min-width:190px!important;width:190px!important;max-width:190px!important}
    .debt-matrix .sticky-col-2{left:130px!important}
    .modal{
      width:100%!important;
      max-width:none!important;
      height:auto;
      max-height:100dvh;
      border-radius:14px 14px 0 0;
      margin-top:auto;
    }
    .overlay{
      align-items:flex-end;
      padding:0;
    }
    .modal-head{padding:15px 16px}
    .modal-body{padding:14px 16px;max-height:calc(100dvh - 135px)}
    .modal-foot{
      padding:12px 16px calc(12px + env(safe-area-inset-bottom));
      display:grid;
      grid-template-columns:1fr;
    }
    .modal-foot .btn{width:100%}
    .bill-row{grid-template-columns:58px 1fr!important}
    .bill-row .field,.bill-row .bill-company,.bill-row .bill-remove{grid-column:auto!important}
    .bill-row .bill-company{grid-column:1/-1!important}
    .bill-row img{width:58px;height:58px}
  }
  @media (max-width:430px){
    .topbar{grid-template-columns:auto minmax(0,1fr)}
    .topbar h1{font-size:17px}
    .topbar-actions{gap:7px}
    .title-month-filter{width:100%}
    .title-month-filter select{flex:1}
    .summary-box b,.debt-card b{font-size:18px}
    .journal-table-wrap,.table-scroll,.payroll-table-wrap,.debt-table-wrap{max-height:calc(100dvh - 350px)}
  }
