/* BaharSoft Itvata — Forge Desktop theme
   A visual-only layer. Application behaviour and local data flows remain unchanged. */

:root{
  --forge-ink:#07111f;
  --forge-navy:#0d1e33;
  --forge-slate:#183149;
  --forge-canvas:#2b1d05;
  --forge-paper:#211604;
  --forge-line:#9c7214;
  --forge-text:#fffdf6;
  --forge-muted:#e1d3aa;
  --forge-clay:#d6a21f;
  --forge-clay-dark:#976307;
  --forge-cyan:#12a9b9;
  --forge-gold:#f2c14e;
  --forge-green:#178861;
  --forge-red:#c43f4e;
}

html,body{
  background:var(--forge-ink)!important;
  color:var(--forge-text);
}

body{
  font-family:"Noto Sans Bengali","SolaimanLipi","Segoe UI",Arial,sans-serif;
}

button,a,input,select,textarea{transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease,transform .18s ease}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(18,169,185,.35)!important;outline-offset:2px!important}

/* Sign-in experience */
#authView.auth-page{
  background:
    radial-gradient(circle at 18% 15%,rgba(214,162,31,.22),transparent 34%),
    radial-gradient(circle at 88% 82%,rgba(18,169,185,.16),transparent 30%),
    linear-gradient(135deg,#050b13 0%,#0a1727 44%,#0d2136 100%)!important;
}

#authView .auth-split-card{
  width:min(1026px,calc(100vw - 12px))!important;
  height:min(720px,calc(100vh - 12px))!important;
  min-height:0!important;
  border:1px solid rgba(145,173,199,.24)!important;
  border-radius:28px!important;
  background:#0b1726!important;
  box-shadow:0 32px 100px rgba(0,0,0,.58),0 0 0 1px rgba(255,255,255,.03) inset!important;
}

#authView .auth-showcase::after{
  background:linear-gradient(180deg,rgba(3,9,16,.14),rgba(5,13,22,.65) 50%,rgba(5,13,22,.96))!important;
}

#authView .auth-showcase-content{max-width:480px}
#authView .auth-showcase h1{font-size:42px!important;letter-spacing:-.6px}
#authView .auth-showcase p{color:#d9e7f2!important;font-size:16px!important;line-height:1.65}
#authView .auth-feature{
  border:1px solid rgba(255,255,255,.13)!important;
  background:rgba(4,13,23,.52)!important;
  backdrop-filter:blur(9px);
  border-radius:13px!important;
  color:#eef7ff!important;
  box-shadow:0 8px 24px rgba(0,0,0,.14);
}

#authView .auth-control-panel{
  background:linear-gradient(150deg,#102338 0%,#0b1828 52%,#0e2033 100%)!important;
}

#authView .auth-installer-center{
  border-color:#29435c!important;
  background:rgba(5,15,26,.44)!important;
  box-shadow:0 12px 30px rgba(0,0,0,.16);
}

#authView .auth-device-card{
  border-color:#314b64!important;
  background:linear-gradient(180deg,#172b40,#102236)!important;
  color:#edf6ff!important;
}
#authView .auth-device-card:hover{border-color:var(--forge-cyan)!important;background:linear-gradient(180deg,#1b384e,#142c41)!important;transform:translateY(-2px)}
#authView .auth-device-card.recommended{border-color:var(--forge-clay)!important;box-shadow:0 0 0 2px rgba(214,162,31,.18)}

#authView .auth-tabs{background:#081624!important;border-color:#29435c!important}
#authView .auth-tab{color:#9fb4c8!important}
#authView .auth-tab.active{color:#fff!important;background:linear-gradient(135deg,var(--forge-clay),var(--forge-clay-dark))!important;box-shadow:0 8px 22px rgba(214,162,31,.24)!important}
#authView .auth-heading h2{color:#fff!important}
#authView .auth-heading p,#authView .login-demo-notice{color:#9fb4c8!important}
#authView .auth-form label{color:#c8d7e5!important;font-size:14px!important}
#authView .auth-form input{
  min-height:45px;
  border-color:#35506a!important;
  background:#091727!important;
  color:#fff!important;
}
#authView .auth-form input::placeholder{color:#6f879d}
#authView .auth-form input:focus{border-color:var(--forge-cyan)!important;box-shadow:0 0 0 4px rgba(18,169,185,.13)!important}
#authView .primary{background:linear-gradient(135deg,var(--forge-clay),var(--forge-clay-dark))!important;box-shadow:0 10px 24px rgba(214,162,31,.22)!important}
#authView .ghost{border-color:#36516a!important;background:#12263a!important;color:#e7f1f8!important}
#authView .local-note{border-color:rgba(23,136,97,.42)!important;background:rgba(23,136,97,.13)!important;color:#bcebd8!important}
#authView .auth-footer{color:#7fd4dc!important}
#authView .link-btn{color:#7fd4dc!important}

/* Main workspace */
@media (min-width:1024px){
  #appView.app-shell:not(.hidden){
    --desktop-side:220px!important;
    left:50%!important;
    top:50%!important;
    right:auto!important;
    bottom:auto!important;
    transform:translate(-50%,-50%)!important;
    width:min(1352px,calc(100vw - 12px))!important;
    height:min(812px,calc(100vh - 12px))!important;
    min-height:0!important;
    max-width:1352px!important;
    max-height:812px!important;
    border-radius:16px!important;
    background:var(--forge-canvas)!important;
    border:1px solid rgba(133,160,184,.28)!important;
    box-shadow:0 28px 80px rgba(0,0,0,.42)!important;
  }

  #appView.app-shell:not(.hidden) .sidebar{
    height:100%!important;
    min-height:0!important;
    background:
      radial-gradient(circle at 20% 0%,rgba(214,162,31,.15),transparent 28%),
      linear-gradient(180deg,#091727 0%,#0d2033 56%,#10293e 100%)!important;
    border-right:1px solid rgba(160,187,211,.17)!important;
    box-shadow:12px 0 34px rgba(7,17,31,.14)!important;
  }

  #appView.app-shell:not(.hidden) .side-brand{
    min-height:68px!important;
    padding:11px 13px!important;
    gap:10px!important;
    border-bottom:1px solid rgba(255,255,255,.09)!important;
    background:rgba(255,255,255,.025)!important;
  }
  #appView.app-shell:not(.hidden) .side-brand img{width:42px!important;height:42px!important;border-radius:12px!important;box-shadow:0 9px 22px rgba(0,0,0,.28)!important}
  #appView.app-shell:not(.hidden) .side-brand strong{font-size:15px!important;line-height:1.2!important;color:#fff!important}
  #appView.app-shell:not(.hidden) .side-brand small{font-size:10px!important;line-height:1.2!important;color:#7fd4dc!important}

  #appView.app-shell:not(.hidden) .sidebar-search-wrap{padding:9px 11px!important;gap:5px!important;color:#8da5ba!important;font-size:11px!important}
  #appView.app-shell:not(.hidden) .sidebar-search-wrap input{height:36px!important;min-height:36px!important;padding:7px 10px!important;border-radius:10px!important;border-color:#29435c!important;background:#071421!important;color:#fff!important;font-size:12px!important}
  #appView.app-shell:not(.hidden) .sidebar-search-wrap input:focus{border-color:var(--forge-cyan)!important;box-shadow:0 0 0 3px rgba(18,169,185,.13)!important}

  #appView.app-shell:not(.hidden) .module-nav{padding:8px!important;gap:4px!important}
  #appView.app-shell:not(.hidden) .nav-btn,
  #appView.app-shell:not(.hidden) .nav-group-btn{
    min-height:38px!important;
    padding:7px 9px!important;
    border-radius:10px!important;
    border:1px solid transparent!important;
    background:transparent!important;
    color:#c8d6e4!important;
    font-size:11.5px!important;
    font-weight:800!important;
    gap:8px!important;
    box-shadow:none!important;
  }
  #appView.app-shell:not(.hidden) .nav-btn:hover,
  #appView.app-shell:not(.hidden) .nav-group-btn:hover{background:rgba(255,255,255,.06)!important;border-color:rgba(127,212,220,.15)!important;color:#fff!important;transform:translateX(2px)!important}
  #appView.app-shell:not(.hidden) .nav-btn.active,
  #appView.app-shell:not(.hidden) .nav-group.has-active>.nav-group-btn{
    background:linear-gradient(135deg,rgba(214,162,31,.98),rgba(151,99,7,.98))!important;
    border-color:rgba(255,226,153,.42)!important;
    color:#fff!important;
    box-shadow:0 9px 20px rgba(125,38,11,.26)!important;
  }
  #appView.app-shell:not(.hidden) .nav-group-icon{width:26px!important;height:26px!important;border-radius:8px!important;font-size:14px!important;background:rgba(255,255,255,.08)!important}
  #appView.app-shell:not(.hidden) .nav-group-arrow{font-size:18px!important;color:#7fd4dc!important}
  #appView.app-shell:not(.hidden) .side-bottom{padding:8px!important;gap:6px!important;border-color:rgba(255,255,255,.09)!important}
  #appView.app-shell:not(.hidden) .side-action{min-height:36px!important;padding:7px 9px!important;border-radius:10px!important;font-size:11px!important;background:rgba(255,255,255,.055)!important;border-color:rgba(255,255,255,.12)!important}

  #appView.app-shell:not(.hidden) .workspace{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;background:var(--forge-canvas)!important}
  #appView.app-shell:not(.hidden) .topbar{
    min-height:68px!important;
    padding:9px 16px!important;
    gap:10px!important;
    border-bottom:1px solid rgba(200,214,227,.88)!important;
    background:rgba(255,255,255,.88)!important;
    backdrop-filter:blur(16px)!important;
    box-shadow:0 7px 24px rgba(22,39,57,.055)!important;
  }
  #appView.app-shell:not(.hidden) .topbar h2{font-size:21px!important;line-height:1.18!important;color:var(--forge-text)!important;letter-spacing:-.2px!important}
  #appView.app-shell:not(.hidden) .topbar p{font-size:11px!important;line-height:1.2!important;margin-top:3px!important;color:var(--forge-muted)!important}
  #appView.app-shell:not(.hidden) .top-actions{gap:6px!important}
  #appView.app-shell:not(.hidden) .top-actions button,
  #appView.app-shell:not(.hidden) .top-actions .badge{height:34px!important;min-height:34px!important;padding:6px 10px!important;border-radius:10px!important;font-size:10px!important}
  #appView.app-shell:not(.hidden) .topbar .ghost{border-color:#cfdbe6!important;background:#fff!important;color:#24415b!important;box-shadow:0 4px 12px rgba(16,41,62,.05)!important}
  #appView.app-shell:not(.hidden) .topbar .ghost:hover{border-color:var(--forge-cyan)!important;color:#0a7280!important;transform:translateY(-1px)!important}
  #appView.app-shell:not(.hidden) .badge{border-color:#c6dbe7!important;background:#edf8fa!important;color:#0d7883!important}

  #appView.app-shell:not(.hidden) #content.content,
  #appView.app-shell:not(.hidden) #content.daily-module-content{
    padding:13px 15px 16px!important;
    background:
      radial-gradient(circle at 100% 0%,rgba(18,169,185,.055),transparent 30%),
      linear-gradient(180deg,#f4f7fa,#edf2f7)!important;
  }

  #appView.app-shell:not(.hidden) .cards{gap:10px!important}
  #appView.app-shell:not(.hidden) .stat{
    min-height:76px!important;
    padding:12px 14px!important;
    border:1px solid var(--forge-line)!important;
    border-radius:14px!important;
    background:linear-gradient(145deg,#fff,#f8fbfd)!important;
    box-shadow:0 8px 22px rgba(24,49,73,.07)!important;
  }
  #appView.app-shell:not(.hidden) .stat small{font-size:11px!important;color:var(--forge-muted)!important}
  #appView.app-shell:not(.hidden) .stat strong{font-size:20px!important;line-height:1.15!important;margin-top:5px!important;color:var(--forge-text)!important}

  #appView.app-shell:not(.hidden) .panel{
    margin-top:10px!important;
    padding:13px 14px!important;
    border:1px solid var(--forge-line)!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.94)!important;
    box-shadow:0 10px 28px rgba(24,49,73,.065)!important;
  }
  #appView.app-shell:not(.hidden) .panel::before{display:block!important;height:3px!important;background:linear-gradient(90deg,var(--forge-clay),var(--forge-gold),var(--forge-cyan))!important}
  #appView.app-shell:not(.hidden) .panel-head{margin-bottom:10px!important;padding-bottom:8px!important;gap:8px!important;border-bottom:1px solid #e6edf3!important}
  #appView.app-shell:not(.hidden) .panel h3,
  #appView.app-shell:not(.hidden) .panel-head h3{font-size:16px!important;line-height:1.22!important;color:var(--forge-text)!important}
  #appView.app-shell:not(.hidden) .panel-subtitle{font-size:10.5px!important;line-height:1.35!important;color:var(--forge-muted)!important}

  #appView.app-shell:not(.hidden) #content .primary,
  #appView.app-shell:not(.hidden) #content .secondary,
  #appView.app-shell:not(.hidden) #content .ghost,
  #appView.app-shell:not(.hidden) #content .danger-btn{min-height:34px!important;padding:6px 11px!important;border-radius:9px!important;font-size:11px!important;box-shadow:none!important}
  #appView.app-shell:not(.hidden) #content .primary{background:linear-gradient(135deg,var(--forge-clay),var(--forge-clay-dark))!important;box-shadow:0 7px 17px rgba(151,99,7,.18)!important}
  #appView.app-shell:not(.hidden) #content .secondary{border-color:#b8dde1!important;background:#eaf8f9!important;color:#0c7781!important}
  #appView.app-shell:not(.hidden) #content .ghost{border-color:#d2dee8!important;background:#fff!important;color:#344d63!important}

  #appView.app-shell:not(.hidden) .field{gap:4px!important}
  #appView.app-shell:not(.hidden) .field label{font-size:11px!important;color:#405469!important}
  #appView.app-shell:not(.hidden) .field input,
  #appView.app-shell:not(.hidden) .field select,
  #appView.app-shell:not(.hidden) .field textarea{min-height:36px!important;padding:7px 9px!important;border:1px solid #cbd8e3!important;border-radius:9px!important;background:#fff!important;color:var(--forge-text)!important;font-size:11.5px!important}
  #appView.app-shell:not(.hidden) .field input:focus,
  #appView.app-shell:not(.hidden) .field select:focus,
  #appView.app-shell:not(.hidden) .field textarea:focus{border-color:var(--forge-cyan)!important;box-shadow:0 0 0 3px rgba(18,169,185,.12)!important}
  #appView.app-shell:not(.hidden) .field-help{font-size:9px!important;line-height:1.35!important}

  #appView.app-shell:not(.hidden) .table-wrap{border:1px solid var(--forge-line)!important;border-radius:11px!important;background:#fff!important}
  #appView.app-shell:not(.hidden) .data-table th{background:#edf3f7!important;color:#344c62!important;font-size:10.5px!important;letter-spacing:.15px!important}
  #appView.app-shell:not(.hidden) .data-table th,
  #appView.app-shell:not(.hidden) .data-table td{padding:7px 8px!important;border-color:#e3ebf1!important;font-size:10.5px!important;line-height:1.35!important}
  #appView.app-shell:not(.hidden) .data-table tr:hover td{background:#f3fafb!important}
  #appView.app-shell:not(.hidden) .mini{padding:5px 8px!important;border-radius:7px!important;font-size:9.5px!important}
  #appView.app-shell:not(.hidden) .empty{padding:20px!important;font-size:11px!important;color:var(--forge-muted)!important}

  /* Dashboard cards become the visual signature of the Forge theme. */
  #appView.app-shell:not(.hidden) .dashboard-main-panel{padding:14px!important;overflow:visible!important}
  #appView.app-shell:not(.hidden) .dashboard-main-head{margin-bottom:12px!important;padding-bottom:8px!important}
  #appView.app-shell:not(.hidden) .dashboard-main-head .panel-subtitle{font-size:10.5px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-card{
    min-height:104px!important;
    padding:13px 12px!important;
    grid-template-columns:42px minmax(0,1fr) 25px!important;
    gap:10px!important;
    border:1px solid #d8e3ec!important;
    border-radius:15px!important;
    background:linear-gradient(145deg,#ffffff,#f5f9fc)!important;
    color:var(--forge-text)!important;
    box-shadow:0 9px 22px rgba(24,49,73,.07)!important;
  }
  #appView.app-shell:not(.hidden) .dashboard-option-card::after{left:0!important;top:14px!important;bottom:14px!important;width:4px!important;border-radius:0 4px 4px 0!important}
  #appView.app-shell:not(.hidden) .dashboard-option-card:hover{transform:translateY(-3px)!important;border-color:#a9c8d3!important;background:#fff!important;box-shadow:0 15px 30px rgba(24,49,73,.12)!important}
  #appView.app-shell:not(.hidden) .dashboard-option-icon{width:42px!important;height:42px!important;border-radius:12px!important;font-size:19px!important;background:#e9f3f6!important;color:#12374a!important;border:1px solid #d5e7eb!important}
  #appView.app-shell:not(.hidden) .dashboard-option-copy{gap:4px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-copy b{font-size:13px!important;line-height:1.25!important;color:var(--forge-text)!important}
  #appView.app-shell:not(.hidden) .dashboard-option-copy small{font-size:9.5px!important;line-height:1.35!important;color:var(--forge-muted)!important;-webkit-line-clamp:2!important}
  #appView.app-shell:not(.hidden) .dashboard-option-arrow{width:25px!important;height:25px!important;border-radius:8px!important;background:#e9f0f5!important;color:#567087!important;font-size:13px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-card:hover .dashboard-option-arrow{background:var(--forge-clay)!important;color:#fff!important;transform:translateX(2px)!important}
  #appView.app-shell:not(.hidden) .dashboard-option-serial{top:7px!important;right:9px!important;font-size:8.5px!important;color:#8495a5!important}

  #appView.app-shell:not(.hidden) .report-grid{gap:8px!important}
  #appView.app-shell:not(.hidden) .report-item{min-height:60px!important;padding:10px!important;border:1px solid var(--forge-line)!important;border-radius:11px!important;background:#fff!important;font-size:10.5px!important;line-height:1.35!important;box-shadow:0 5px 15px rgba(24,49,73,.04)!important}
  #appView.app-shell:not(.hidden) .report-item b{font-size:11px!important;line-height:1.25!important;margin-bottom:4px!important;color:#30475c!important}
  #appView.app-shell:not(.hidden) .module-card{min-height:66px!important;padding:10px!important;border:1px solid var(--forge-line)!important;border-radius:11px!important;background:#fff!important}
  #appView.app-shell:not(.hidden) .module-card b{font-size:11.5px!important}
  #appView.app-shell:not(.hidden) .module-card small{font-size:9.5px!important}

  /* Keep the specialist daily workspace dense, but not microscopic. */
  #appView.app-shell:not(.hidden).daily-mode #content.daily-module-content{gap:10px!important;padding:10px!important}
  #appView.app-shell:not(.hidden).daily-mode #content.daily-module-content>.daily-entry-panel,
  #appView.app-shell:not(.hidden).daily-mode #content.daily-module-content>.daily-ledger-panel{padding:10px!important;border:1px solid var(--forge-line)!important;border-radius:14px!important;background:#fff!important}
  #appView.daily-mode .daily-entry-panel>.panel-head h3,
  #appView.daily-mode .daily-v14-ledger-toolbar h3{font-size:16px!important}
  #appView.daily-mode .daily-entry-line .field input,
  #appView.daily-mode .daily-entry-line .field textarea,
  #appView.daily-mode .daily-entry-line .field select,
  #appView.daily-mode .expense-head-input-row input{height:34px!important;min-height:34px!important;font-size:10.5px!important}
  #appView.daily-mode .daily-v14-stat strong{font-size:12px!important}
  #appView.daily-mode .daily-v14-stat small,
  #appView.daily-mode .daily-v14-stat em{font-size:8.5px!important}
  #appView.daily-mode .daily-v14-sales-table th,
  #appView.daily-mode .daily-v14-sales-table td,
  #appView.daily-mode .daily-v14-recent-table th,
  #appView.daily-mode .daily-v14-recent-table td,
  #appView.daily-mode .daily-ledger-half-table th,
  #appView.daily-mode .daily-ledger-half-table td{font-size:8.5px!important;line-height:1.3!important}
}

@media (min-width:1440px){
  #appView.app-shell:not(.hidden){--desktop-side:220px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-card{min-height:114px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-copy b{font-size:14px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-copy small{font-size:10.5px!important}
}

@media (min-width:1024px) and (max-height:700px){
  #appView.app-shell:not(.hidden){
    top:50%!important;
    bottom:auto!important;
    height:calc(100vh - 12px)!important;
    min-height:0!important;
    max-height:812px!important;
    border-radius:14px!important;
  }
  #appView.app-shell:not(.hidden) .topbar{min-height:58px!important}
  #appView.app-shell:not(.hidden) .side-brand{min-height:58px!important}
  #appView.app-shell:not(.hidden) #content.content,
  #appView.app-shell:not(.hidden) #content.daily-module-content{padding-top:9px!important;padding-bottom:9px!important}
  #appView.app-shell:not(.hidden) .dashboard-option-card{min-height:86px!important;padding-top:9px!important;padding-bottom:9px!important}
  #appView.app-shell:not(.hidden) .stat{min-height:64px!important;padding-top:9px!important;padding-bottom:9px!important}
}

/* Preserve the existing mobile layout; align its palette with the new theme. */
@media (max-width:1023px){
  #appView .topbar{background:rgba(255,255,255,.93)!important;border-color:var(--forge-line)!important}
  #appView .sidebar{background:linear-gradient(180deg,#091727,#10293e)!important}
  #appView .primary{background:linear-gradient(135deg,var(--forge-clay),var(--forge-clay-dark))!important}
  #appView .panel,#appView .stat{border-color:var(--forge-line)!important}
}

/* Golden desktop refinement + compact Delivery Slip layout */
@media (min-width:1024px){
  #appView.app-shell:not(.hidden) .sidebar{
    background:
      radial-gradient(circle at 18% 0%,rgba(242,193,78,.15),transparent 30%),
      linear-gradient(180deg,#151107 0%,#211909 55%,#2c210c 100%)!important;
    border-right-color:rgba(242,193,78,.18)!important;
  }
  #appView.app-shell:not(.hidden) .side-brand small,
  #appView.app-shell:not(.hidden) .nav-group-arrow{color:#f3ce72!important}
  #appView.app-shell:not(.hidden) .sidebar-search-wrap input{border-color:#57451e!important;background:#100d07!important}
  #appView.app-shell:not(.hidden) .sidebar-search-wrap input:focus{border-color:#e4b63d!important;box-shadow:0 0 0 3px rgba(214,162,31,.15)!important}
  #appView.app-shell:not(.hidden) .topbar .ghost:hover{border-color:#d6a21f!important;color:#7a5108!important}
  #appView.app-shell:not(.hidden) .badge{border-color:#ead59e!important;background:#fff8e5!important;color:#79520a!important}
  #appView.app-shell:not(.hidden) .panel::before{background:linear-gradient(90deg,#9a670b,#d6a21f,#f2c14e,#d6a21f)!important}
  #appView.app-shell:not(.hidden) .field input:focus,
  #appView.app-shell:not(.hidden) .field select:focus,
  #appView.app-shell:not(.hidden) .field textarea:focus{border-color:#d6a21f!important;box-shadow:0 0 0 3px rgba(214,162,31,.14)!important}
  #appView.app-shell:not(.hidden) #content .secondary{border-color:#e6cd8e!important;background:#fff8e6!important;color:#79520a!important}
  #appView.app-shell:not(.hidden) .dashboard-option-icon{background:#fff8e6!important;color:#6f4a06!important;border-color:#eedba7!important}

  #appView.app-shell:not(.hidden) .standalone-delivery-panel{padding:10px 12px!important}
  #appView.app-shell:not(.hidden) .standalone-delivery-panel>.panel-head{margin-bottom:8px!important;padding-bottom:7px!important}
  #appView.app-shell:not(.hidden) #deliveryForm.delivery-form-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-flow:row dense!important;
    align-items:start!important;
    gap:7px 10px!important;
  }
  #appView.app-shell:not(.hidden) #deliveryForm .delivery-full{grid-column:1/-1!important}
  #appView.app-shell:not(.hidden) #deliveryForm .delivery-customer{grid-column:span 1!important}
  #appView.app-shell:not(.hidden) #deliveryForm .delivery-address,
  #appView.app-shell:not(.hidden) #deliveryForm .delivery-wide{grid-column:span 2!important}
  #appView.app-shell:not(.hidden) #deliveryForm .form-actions{width:100%!important;align-self:end!important}
  #appView.app-shell:not(.hidden) #deliveryForm .form-actions button{width:100%!important;min-height:36px!important}
  #appView.app-shell:not(.hidden) #deliveryForm .field textarea{min-height:48px!important;height:48px!important;resize:vertical!important}
  #appView.app-shell:not(.hidden) #deliveryForm .field-help{margin-top:1px!important;line-height:1.2!important}
  #appView.app-shell:not(.hidden) #deliveryForm .quantity-edit-row{min-width:0!important}
}

/* V15 Golden Canvas — every application page uses the same golden background system. */
html,body{background:#2b1d05!important}
#appView.app-shell:not(.hidden){background:#e4bd4f!important}
#appView.app-shell:not(.hidden) .workspace{
  background:linear-gradient(145deg,#f4df9a 0%,#e8c45c 52%,#d9a92f 100%)!important;
}
#appView.app-shell:not(.hidden) .topbar{
  background:linear-gradient(180deg,rgba(255,245,204,.98),rgba(239,209,119,.98))!important;
  border-bottom-color:#c99516!important;
  box-shadow:0 7px 22px rgba(86,55,4,.12)!important;
}
#appView.app-shell:not(.hidden) #content.content,
#appView.app-shell:not(.hidden) #content.daily-module-content{
  background:
    radial-gradient(circle at 100% 0%,rgba(255,250,226,.52),transparent 30%),
    linear-gradient(150deg,#f7e7ac 0%,#edcf70 55%,#e4b946 100%)!important;
}

#appView.app-shell:not(.hidden) .panel,
#appView.app-shell:not(.hidden) .stat,
#appView.app-shell:not(.hidden) .module-card,
#appView.app-shell:not(.hidden) .report-item,
#appView.app-shell:not(.hidden) .settings-card,
#appView.app-shell:not(.hidden) .daily-paper,
#appView.app-shell:not(.hidden) .daily-v14-card,
#appView.app-shell:not(.hidden) .daily-entry-panel,
#appView.app-shell:not(.hidden) .daily-ledger-panel{
  background:linear-gradient(145deg,#fff9df,#f9e9ae)!important;
  border-color:#d4a62d!important;
  box-shadow:0 9px 24px rgba(102,68,8,.10)!important;
}
#appView.app-shell:not(.hidden) .panel-head{border-bottom-color:#e2c269!important}
#appView.app-shell:not(.hidden) .panel h3,
#appView.app-shell:not(.hidden) .panel-head h3,
#appView.app-shell:not(.hidden) .topbar h2{color:#2f2209!important}
#appView.app-shell:not(.hidden) .panel-subtitle,
#appView.app-shell:not(.hidden) .topbar p{color:#715b26!important}

#appView.app-shell:not(.hidden) .dashboard-option-card,
#appView.app-shell:not(.hidden) .daily-business-summary>div,
#appView.app-shell:not(.hidden) .daily-four-summary>div{
  background:linear-gradient(145deg,#fffaf0,#f7e4a1)!important;
  border-color:#d9b44e!important;
  color:#34260a!important;
  box-shadow:0 8px 19px rgba(90,59,5,.09)!important;
}
#appView.app-shell:not(.hidden) .dashboard-option-card:hover{
  background:linear-gradient(145deg,#fffdf5,#f4d77d)!important;
  border-color:#bd8710!important;
}
#appView.app-shell:not(.hidden) .dashboard-option-copy b,
#appView.app-shell:not(.hidden) .stat strong,
#appView.app-shell:not(.hidden) .report-item b{color:#3e2c07!important}
#appView.app-shell:not(.hidden) .dashboard-option-copy small,
#appView.app-shell:not(.hidden) .stat small{color:#77602a!important}

#appView.app-shell:not(.hidden) .module-guide{
  background:linear-gradient(135deg,#5c3d06,#8b620d)!important;
  border-color:#c99516!important;
  color:#fff6d7!important;
  box-shadow:0 8px 18px rgba(78,47,2,.18)!important;
}
#appView.app-shell:not(.hidden) .module-guide b,
#appView.app-shell:not(.hidden) .module-guide p{color:#fff6d7!important}
#appView.app-shell:not(.hidden) .module-guide .guide-icon{background:linear-gradient(135deg,#f3c84e,#b87a08)!important;color:#2e1d03!important}

#appView.app-shell:not(.hidden) .field input,
#appView.app-shell:not(.hidden) .field select,
#appView.app-shell:not(.hidden) .field textarea,
#appView.app-shell:not(.hidden) input,
#appView.app-shell:not(.hidden) select,
#appView.app-shell:not(.hidden) textarea{
  background:#fffaf0!important;
  border-color:#d8b85f!important;
  color:#2e230d!important;
}
#appView.app-shell:not(.hidden) input[readonly]{background:#f4e4b0!important;color:#68501c!important}
#appView.app-shell:not(.hidden) .field label{color:#4b390f!important}
#appView.app-shell:not(.hidden) .field-help{color:#80682f!important}

#appView.app-shell:not(.hidden) .table-wrap,
#appView.app-shell:not(.hidden) .daily-table-wrap,
#appView.app-shell:not(.hidden) .daily-entry-table-wrap{background:#fff8dc!important;border-color:#d5ad42!important}
#appView.app-shell:not(.hidden) .data-table th,
#appView.app-shell:not(.hidden) .daily-entry-table th,
#appView.app-shell:not(.hidden) .daily-ledger-table th{background:#e2ba4d!important;color:#3e2b05!important;border-color:#c99618!important}
#appView.app-shell:not(.hidden) .data-table td,
#appView.app-shell:not(.hidden) .daily-entry-table td,
#appView.app-shell:not(.hidden) .daily-ledger-table td{background:#fff9e5!important;border-color:#ead89c!important;color:#3a2d11!important}
#appView.app-shell:not(.hidden) .data-table tr:hover td{background:#f7e7ad!important}

#appView.app-shell:not(.hidden) .ghost,
#appView.app-shell:not(.hidden) .secondary,
#appView.app-shell:not(.hidden) .mini{background:#fff7dc!important;border-color:#d7b75d!important;color:#62460b!important}
#appView.app-shell:not(.hidden) .primary{background:linear-gradient(135deg,#d8a51e,#946006)!important;color:#fff!important}
#appView.app-shell:not(.hidden) .badge{background:#fff2bf!important;border-color:#d8ae3e!important;color:#69490a!important}
#appView.app-shell:not(.hidden) .empty{color:#78612e!important}

#appView.app-shell:not(.hidden) .modal{background:rgba(44,29,4,.62)!important}
#appView.app-shell:not(.hidden) .modal-card,
#appView.app-shell:not(.hidden) .modal-body{background:#fff4c8!important;border-color:#d5a82e!important}

#authView.auth-page{
  background:
    radial-gradient(circle at 18% 15%,rgba(244,199,76,.34),transparent 34%),
    radial-gradient(circle at 88% 82%,rgba(185,124,12,.25),transparent 31%),
    linear-gradient(135deg,#2a1a03 0%,#5a3a05 50%,#8a620f 100%)!important;
}
#authView .auth-split-card{border-color:#c99b25!important;box-shadow:0 32px 100px rgba(50,31,2,.58)!important}
#authView .auth-control-panel{background:linear-gradient(150deg,#5a3a07 0%,#2d1e07 52%,#513606 100%)!important}
#authView .auth-installer-center{border-color:#9a711d!important;background:rgba(33,20,2,.45)!important}
#authView .auth-device-card{border-color:#9b7628!important;background:linear-gradient(180deg,#62430c,#382606)!important}
#authView .auth-tabs{background:#2a1c05!important;border-color:#8e681c!important}
#authView .auth-form input{background:#fff8df!important;border-color:#b78b2e!important;color:#2e2108!important}

/* V15.1 Dark Golden — exact reference background #2B1D05 on every page. */
:root{
  --dark-gold-page:#2b1d05;
  --dark-gold-surface:#382708;
  --dark-gold-surface-2:#211604;
  --dark-gold-line:#9c7214;
  --dark-gold-accent:#e0ad27;
  --dark-gold-text:#fffdf6;
  --dark-gold-muted:#e1d3aa;
}
html,body{background:var(--dark-gold-page)!important;color:var(--dark-gold-text)!important}
#appView.app-shell:not(.hidden),
#appView.app-shell:not(.hidden) .workspace,
#appView.app-shell:not(.hidden) #content.content,
#appView.app-shell:not(.hidden) #content.daily-module-content{
  background:var(--dark-gold-page)!important;
  color:var(--dark-gold-text)!important;
}
#appView.app-shell:not(.hidden) .topbar{
  background:var(--dark-gold-page)!important;
  border-bottom-color:var(--dark-gold-line)!important;
  box-shadow:0 7px 22px rgba(0,0,0,.32)!important;
}
#appView.app-shell:not(.hidden) .topbar h2,
#appView.app-shell:not(.hidden) .topbar p{color:var(--dark-gold-text)!important}

#appView.app-shell:not(.hidden) .panel,
#appView.app-shell:not(.hidden) .stat,
#appView.app-shell:not(.hidden) .module-card,
#appView.app-shell:not(.hidden) .report-item,
#appView.app-shell:not(.hidden) .settings-card,
#appView.app-shell:not(.hidden) .daily-paper,
#appView.app-shell:not(.hidden) .daily-v14-card,
#appView.app-shell:not(.hidden) .daily-entry-panel,
#appView.app-shell:not(.hidden) .daily-ledger-panel,
#appView.app-shell:not(.hidden) .dashboard-option-card,
#appView.app-shell:not(.hidden) .daily-business-summary>div,
#appView.app-shell:not(.hidden) .daily-four-summary>div{
  background:var(--dark-gold-surface)!important;
  border-color:var(--dark-gold-line)!important;
  color:var(--dark-gold-text)!important;
  box-shadow:0 10px 26px rgba(0,0,0,.24)!important;
}
#appView.app-shell:not(.hidden) .panel-head{border-bottom-color:#70500d!important}
#appView.app-shell:not(.hidden) .panel h3,
#appView.app-shell:not(.hidden) .panel-head h3,
#appView.app-shell:not(.hidden) .panel-subtitle,
#appView.app-shell:not(.hidden) .stat small,
#appView.app-shell:not(.hidden) .stat strong,
#appView.app-shell:not(.hidden) .dashboard-option-copy b,
#appView.app-shell:not(.hidden) .dashboard-option-copy small,
#appView.app-shell:not(.hidden) .report-item,
#appView.app-shell:not(.hidden) .report-item b,
#appView.app-shell:not(.hidden) .module-card b,
#appView.app-shell:not(.hidden) .module-card small,
#appView.app-shell:not(.hidden) .empty{color:var(--dark-gold-text)!important}
#appView.app-shell:not(.hidden) .panel-subtitle,
#appView.app-shell:not(.hidden) .dashboard-option-copy small,
#appView.app-shell:not(.hidden) .stat small,
#appView.app-shell:not(.hidden) .field-help{color:var(--dark-gold-muted)!important}
#appView.app-shell:not(.hidden) .dashboard-option-card:hover{background:#49330a!important;border-color:var(--dark-gold-accent)!important}
#appView.app-shell:not(.hidden) .dashboard-option-icon,
#appView.app-shell:not(.hidden) .dashboard-option-arrow{background:#171001!important;border-color:#987016!important;color:#f2c450!important}

/* Every textbox/select/textarea: pure black background with white text. */
#appView.app-shell:not(.hidden) input,
#appView.app-shell:not(.hidden) select,
#appView.app-shell:not(.hidden) textarea,
#authView input,
#authView select,
#authView textarea,
.modal input,
.modal select,
.modal textarea{
  background:#000!important;
  background-image:none!important;
  color:#fff!important;
  caret-color:#fff!important;
  border-color:#b1841d!important;
  box-shadow:none!important;
}
#appView.app-shell:not(.hidden) input::placeholder,
#appView.app-shell:not(.hidden) textarea::placeholder,
#authView input::placeholder,
#authView textarea::placeholder,
.modal input::placeholder,
.modal textarea::placeholder{color:#c9c3b3!important;opacity:1!important}
#appView.app-shell:not(.hidden) select option,
#authView select option,
.modal select option{background:#000!important;color:#fff!important}
#appView.app-shell:not(.hidden) input[readonly],
#appView.app-shell:not(.hidden) input:disabled,
#appView.app-shell:not(.hidden) select:disabled,
#appView.app-shell:not(.hidden) textarea:disabled{background:#090909!important;color:#e9e9e9!important;opacity:1!important}
#appView.app-shell:not(.hidden) input:focus,
#appView.app-shell:not(.hidden) select:focus,
#appView.app-shell:not(.hidden) textarea:focus,
#authView input:focus,
#authView select:focus,
#authView textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus{border-color:#f0bd31!important;box-shadow:0 0 0 3px rgba(224,173,39,.28)!important;outline:none!important}
#appView.app-shell:not(.hidden) input[type="date"]::-webkit-calendar-picker-indicator{filter:invert(1) sepia(1) saturate(4);cursor:pointer}
#appView.app-shell:not(.hidden) input:-webkit-autofill,
#authView input:-webkit-autofill{-webkit-text-fill-color:#fff!important;box-shadow:0 0 0 1000px #000 inset!important;transition:background-color 9999s ease-out 0s}
#appView.app-shell:not(.hidden) .field label{color:var(--dark-gold-text)!important}

#appView.app-shell:not(.hidden) .module-guide{background:#110b01!important;border-color:#a67b18!important;color:#fff!important}
#appView.app-shell:not(.hidden) .module-guide b,
#appView.app-shell:not(.hidden) .module-guide p{color:#fff!important}
#appView.app-shell:not(.hidden) .table-wrap,
#appView.app-shell:not(.hidden) .daily-table-wrap,
#appView.app-shell:not(.hidden) .daily-entry-table-wrap{background:var(--dark-gold-surface-2)!important;border-color:var(--dark-gold-line)!important}
#appView.app-shell:not(.hidden) .data-table th,
#appView.app-shell:not(.hidden) .daily-entry-table th,
#appView.app-shell:not(.hidden) .daily-ledger-table th{background:#5a3f0a!important;color:#fff!important;border-color:#8d6715!important}
#appView.app-shell:not(.hidden) .data-table td,
#appView.app-shell:not(.hidden) .daily-entry-table td,
#appView.app-shell:not(.hidden) .daily-ledger-table td{background:#1a1102!important;color:#fff!important;border-color:#62470d!important}
#appView.app-shell:not(.hidden) .data-table tr:hover td{background:#3f2c08!important}
#appView.app-shell:not(.hidden) .ghost,
#appView.app-shell:not(.hidden) .secondary,
#appView.app-shell:not(.hidden) .mini{background:#171001!important;border-color:#a77b18!important;color:#fff!important}
#appView.app-shell:not(.hidden) .primary{background:linear-gradient(135deg,#e0ad27,#8e5c05)!important;color:#fff!important}
#appView.app-shell:not(.hidden) .badge{background:#171001!important;border-color:#b8891d!important;color:#ffe59b!important}

.modal{background:rgba(0,0,0,.72)!important}
.modal-card,.modal-head,.modal-body{background:var(--dark-gold-page)!important;border-color:var(--dark-gold-line)!important;color:#fff!important}
#authView.auth-page{background:var(--dark-gold-page)!important}
#authView .auth-split-card,
#authView .auth-control-panel{background:var(--dark-gold-page)!important;border-color:var(--dark-gold-line)!important}
#authView .auth-installer-center,
#authView .auth-device-card{background:var(--dark-gold-surface)!important;border-color:var(--dark-gold-line)!important;color:#fff!important}

/* V15.3 Desktop app window controls */
.app-window-controls{display:inline-flex;align-items:center;gap:4px;margin-left:3px;padding-left:7px;border-left:1px solid #79580f}
.app-window-controls .window-control{
  display:inline-grid!important;
  place-items:center!important;
  width:30px!important;
  min-width:30px!important;
  height:30px!important;
  min-height:30px!important;
  padding:0!important;
  border:1px solid #9d7418!important;
  border-radius:7px!important;
  background:#171001!important;
  color:#fff!important;
  font-family:"Segoe UI Symbol","Segoe UI",Arial,sans-serif!important;
  font-size:15px!important;
  line-height:1!important;
  box-shadow:none!important;
}
.app-window-controls .window-control:hover{background:#5e4108!important;border-color:#e0ad27!important}
.app-window-controls .window-control.close:hover{background:#b42318!important;border-color:#ff7b70!important}
#appView.app-shell:not(.hidden).app-window-maximized{
  left:0!important;
  top:0!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  width:100vw!important;
  height:100vh!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  border-radius:0!important;
  border:0!important;
}
@media(max-width:1023px){.app-window-controls{display:none!important}}

/* V15.4 Unit picker — icon only, no surrounding button border. */
#appView .v121-quantity-field .v121-quantity-input-row{
  grid-template-columns:minmax(0,1fr) 22px!important;
  gap:5px!important;
}
#appView .v121-quantity-input-row>.v121-unit-tool{
  width:22px!important;
  min-width:22px!important;
  height:22px!important;
  min-height:22px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  outline:0!important;
}
#appView .v121-unit-tool::before{width:18px!important;height:18px!important}
#appView .v121-quantity-input-row>.v121-unit-tool:hover,
#appView .v121-quantity-input-row>.v121-unit-tool:focus-visible{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  outline:0!important;
  filter:brightness(1.2) drop-shadow(0 0 3px rgba(224,173,39,.45));
}

/* V15.5 Draggable and resizable desktop window */
@media(min-width:1024px){
  #appView.app-shell:not(.hidden) .topbar{cursor:grab;touch-action:none}
  #appView.app-shell:not(.hidden).app-window-interacting .topbar{cursor:grabbing;user-select:none}
  #appView.app-shell:not(.hidden) .topbar button,
  #appView.app-shell:not(.hidden) .topbar input,
  #appView.app-shell:not(.hidden) .topbar select,
  #appView.app-shell:not(.hidden) .top-actions{cursor:default}
  #appView.app-shell:not(.hidden).app-window-free{right:auto!important;bottom:auto!important;max-width:none!important;max-height:none!important}
  .app-resize-handle{position:absolute;z-index:150;display:block;touch-action:none;background:transparent}
  .app-resize-handle.n{left:14px;right:14px;top:0;height:7px;cursor:n-resize}
  .app-resize-handle.s{left:14px;right:14px;bottom:0;height:7px;cursor:s-resize}
  .app-resize-handle.e{top:14px;bottom:14px;right:0;width:7px;cursor:e-resize}
  .app-resize-handle.w{top:14px;bottom:14px;left:0;width:7px;cursor:w-resize}
  .app-resize-handle.ne,.app-resize-handle.nw,.app-resize-handle.se,.app-resize-handle.sw{width:15px;height:15px}
  .app-resize-handle.ne{right:0;top:0;cursor:ne-resize}.app-resize-handle.nw{left:0;top:0;cursor:nw-resize}
  .app-resize-handle.se{right:0;bottom:0;cursor:se-resize}.app-resize-handle.sw{left:0;bottom:0;cursor:sw-resize}
  .app-resize-handle.se::after{content:"";position:absolute;right:3px;bottom:3px;width:7px;height:7px;border-right:2px solid #e0ad27;border-bottom:2px solid #e0ad27;opacity:.9}
  #appView.app-window-maximized .app-resize-handle{display:none!important}
}

/* V17.3 — responsive layout for desktop, laptop, tablet and mobile. */
html,
body{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
}
#authView,
#appView,
.workspace,
.content,
.panel,
.daily-module-content,
.daily-entry-panel,
.daily-ledger-panel,
.daily-paper,
.daily-paper-inner{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.table-wrap,
.daily-table-wrap,
.daily-entry-table-wrap{
  max-width:100%!important;
  overflow:auto!important;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
}

@media(max-width:1279px){
  body{
    min-height:100dvh!important;
    height:auto!important;
    padding:0!important;
  }
  #appView.app-shell:not(.hidden){
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    top:auto!important;
    transform:none!important;
    display:block!important;
    width:100%!important;
    max-width:none!important;
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    overflow:visible!important;
  }
  #appView .workspace{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:100dvh!important;
    overflow:visible!important;
  }
  #appView .sidebar{
    position:fixed!important;
    inset:0 auto 0 0!important;
    z-index:1002!important;
    width:min(286px,88vw)!important;
    height:100dvh!important;
    max-height:100dvh!important;
    transform:translateX(-105%)!important;
    transition:transform .22s ease!important;
    overflow-y:auto!important;
    border-radius:0 12px 12px 0!important;
    box-shadow:14px 0 36px rgba(0,0,0,.45)!important;
  }
  #appView .sidebar.open{transform:translateX(0)!important}
  #appView .sidebar-backdrop.show{
    display:block!important;
    position:fixed!important;
    inset:0!important;
    z-index:1001!important;
    background:rgba(0,0,0,.58)!important;
  }
  #appView #menuBtn{display:inline-grid!important;place-items:center!important;flex:0 0 38px!important}
  #appView .topbar{
    position:sticky!important;
    top:0!important;
    z-index:900!important;
    width:100%!important;
    min-height:58px!important;
    padding:7px 10px!important;
    gap:7px!important;
    flex-wrap:wrap!important;
  }
  #appView .topbar>div:not(.top-actions){min-width:0!important;flex:1 1 180px!important}
  #appView .topbar h2{font-size:clamp(17px,4.5vw,21px)!important;line-height:1.15!important}
  #appView .topbar p{font-size:9px!important;white-space:normal!important}
  #appView .top-actions{
    flex:1 1 100%!important;
    width:100%!important;
    margin:0!important;
    gap:5px!important;
    overflow-x:auto!important;
    padding-bottom:2px!important;
    scrollbar-width:thin;
  }
  #appView .top-actions>*{flex:0 0 auto!important}
  #appView .window-control,
  #appView .window-size-badge,
  #appView .app-resize-handle{display:none!important}
  #appView .content{
    width:100%!important;
    height:auto!important;
    min-height:calc(100dvh - 58px)!important;
    margin:0!important;
    padding:10px!important;
    overflow:visible!important;
  }
  #appView .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #appView .form-grid,
  #appView .settings-grid,
  #appView .report-grid,
  #appView .module-list{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  #appView.daily-mode .daily-module-content{
    display:block!important;
    width:100%!important;
    height:auto!important;
    padding:0!important;
    overflow:visible!important;
  }
  #appView.daily-mode .daily-entry-panel,
  #appView.daily-mode .daily-ledger-panel{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 0 10px!important;
    border-radius:12px!important;
    overflow:visible!important;
  }
  #appView.daily-mode .daily-pane-expand-btn{display:none!important}
  #appView.daily-mode .daily-entry-panel .panel-head,
  #appView.daily-mode .daily-ledger-panel .daily-paper-head{
    min-height:0!important;
    height:auto!important;
    flex-wrap:wrap!important;
    gap:6px!important;
  }
  #appView.daily-mode .daily-top-actions,
  #appView.daily-mode .panel-actions{flex-wrap:wrap!important}
  #appView.daily-mode .daily-smart-columns{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:9px!important;
    height:auto!important;
    min-height:0!important;
  }
  #appView.daily-mode .daily-entry-card,
  #appView.daily-mode .daily-income-card,
  #appView.daily-mode .daily-expense-card{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  #appView.daily-mode .daily-entry-rows{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  #appView.daily-mode .daily-l-group-grid{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:5px!important;
  }
  #appView.daily-mode .daily-entry-group-controls{
    flex-wrap:wrap!important;
    overflow:visible!important;
    height:auto!important;
  }
  #appView.daily-mode .daily-entry-group-controls>span{flex:1 1 94px!important}
  #appView.daily-mode .daily-entry-group-controls>.mini-row-btn{margin-left:auto!important}

  #appView.daily-mode .daily-grid-row{
    position:relative!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    padding:7px!important;
    border:1px solid #d5a11e!important;
    border-radius:8px!important;
    background:#071528!important;
  }
  #appView.daily-mode .daily-grid-row>.daily-grid-serial{display:none!important}
  #appView.daily-mode .daily-grid-row>.field,
  #appView.daily-mode .daily-grid-row>.daily-grid-quantity-stack,
  #appView.daily-mode .daily-grid-row .daily-grid-quantity-stack>.field,
  #appView.daily-mode .daily-grid-row>.daily-grid-row-actions{
    grid-column:1!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }
  #appView.daily-mode .daily-grid-row>.field,
  #appView.daily-mode .daily-grid-row .daily-grid-quantity-stack>.field{position:relative!important;padding:0!important}
  #appView.daily-mode .daily-grid-row .field>label,
  #appView.daily-mode .daily-grid-row .field-help{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
  }
  #appView.daily-mode .daily-grid-row input,
  #appView.daily-mode .daily-grid-row select,
  #appView.daily-mode .daily-grid-row textarea{
    width:100%!important;
    min-width:0!important;
    min-height:40px!important;
    height:40px!important;
    margin:0!important;
    padding:7px 43px 7px 9px!important;
    font-size:14px!important;
  }
  #appView.daily-mode .daily-grid-row .field>.field-voice-button{
    position:absolute!important;
    right:5px!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    display:inline-grid!important;
    place-items:center!important;
    width:31px!important;
    min-width:31px!important;
    height:31px!important;
    min-height:31px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:6px!important;
    z-index:3!important;
  }
  #appView.daily-mode .daily-grid-row .expense-head-input-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 33px!important;
    gap:5px!important;
  }
  #appView.daily-mode .daily-grid-row .expense-head-input-row>input[name="head[]"]{padding-right:43px!important}
  #appView.daily-mode .daily-grid-row .expense-head-input-row>.expense-head-toggle{
    right:40px!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    width:31px!important;
    min-width:31px!important;
    height:31px!important;
    min-height:31px!important;
  }
  #appView.daily-mode .daily-grid-row .expense-head-input-row>.field-voice-button{
    position:static!important;
    grid-column:2!important;
    transform:none!important;
    align-self:center!important;
  }
  #appView.daily-mode .daily-grid-row>.daily-grid-row-actions{
    position:static!important;
    display:flex!important;
    justify-content:flex-end!important;
    height:auto!important;
    padding:0!important;
  }
  #appView.daily-mode .daily-grid-row>.daily-grid-row-actions:has(.daily-line-remove-btn[hidden]){display:none!important}
  #appView.daily-mode .daily-grid-row .daily-line-remove-btn:not([hidden]){
    width:auto!important;
    min-width:68px!important;
    min-height:30px!important;
  }
  #appView.daily-mode .daily-form-actions{position:static!important;flex-wrap:wrap!important}
  #appView.daily-mode .daily-four-summary,
  #appView.daily-mode .daily-business-summary,
  #appView.daily-mode .daily-three-summary{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
    width:100%!important;
  }
  #appView.daily-mode .daily-four-summary>div,
  #appView.daily-mode .daily-business-summary>div,
  #appView.daily-mode .daily-three-summary>div{min-width:0!important;width:auto!important}
  #appView.daily-mode .daily-ledger-split,
  #appView.daily-mode .daily-today-split{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    height:auto!important;
  }
  #appView.daily-mode .daily-ledger-split>* ,
  #appView.daily-mode .daily-today-split>*{
    width:100%!important;
    min-width:0!important;
    min-height:210px!important;
    max-height:330px!important;
    overflow:auto!important;
  }
  #appView.daily-mode .daily-recent-wrap,
  #appView.daily-mode .daily-sales-wrap{max-height:340px!important;overflow:auto!important}

  #authView:not(.hidden){
    position:relative!important;
    inset:auto!important;
    display:block!important;
    width:100%!important;
    max-width:none!important;
    min-height:100dvh!important;
    height:auto!important;
    padding:8px!important;
    overflow:visible!important;
  }
  #authView .auth-split-card{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    top:auto!important;
    transform:none!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto 1fr!important;
    width:100%!important;
    max-width:720px!important;
    height:auto!important;
    min-height:calc(100dvh - 16px)!important;
    max-height:none!important;
    margin:0 auto!important;
    border-radius:14px!important;
    overflow:visible!important;
  }
  #authView .auth-showcase{display:none!important}
  #authView .auth-control-panel{
    grid-column:1!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    padding:14px!important;
    overflow:visible!important;
  }
  #authView .auth-window-bar{
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    flex-wrap:wrap!important;
  }
  #authView .auth-window-controls,
  #authView .auth-window-size-badge,
  #authView .auth-resize-handle{display:none!important}
  #authView .installer-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #authView input,
  #authView select,
  #authView textarea{font-size:16px!important;max-width:100%!important}
}

@media(max-width:767px){
  #appView .content{padding:7px!important}
  #appView .cards,
  #appView .form-grid,
  #appView .settings-grid,
  #appView .report-grid,
  #appView .module-list{grid-template-columns:1fr!important}
  #appView .panel{padding:9px!important;border-radius:10px!important}
  #appView .panel-head{align-items:stretch!important;flex-direction:column!important}
  #appView .panel-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
  #appView .panel-actions>button{width:100%!important}
  #appView.daily-mode .daily-l-group-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  #appView.daily-mode .daily-entry-panel,
  #appView.daily-mode .daily-ledger-panel{border-radius:9px!important}
  #appView.daily-mode .daily-paper-inner{padding:8px!important}
  #appView.daily-mode .daily-title-wrap h1{font-size:20px!important}
  #appView.daily-mode .daily-date-box{width:100%!important}
  #appView.daily-mode .daily-entry-group-controls>.mini-row-btn{flex:1 1 100%!important;width:100%!important;margin:0!important}
  #appView.daily-mode .daily-entry-group-controls>span{flex:1 1 calc(50% - 4px)!important}
  .data-table,
  .daily-ledger-table,
  .daily-entry-table{font-size:12px!important}
  #authView{padding:0!important}
  #authView .auth-split-card{min-height:100dvh!important;border-radius:0!important;border-left:0!important;border-right:0!important}
  #authView .auth-control-panel{padding:10px!important}
}

@media(max-width:480px){
  #appView .top-actions .badge{display:none!important}
  #appView .top-actions button{min-height:34px!important;padding:6px 8px!important;font-size:10px!important}
  #appView.daily-mode .daily-four-summary,
  #appView.daily-mode .daily-business-summary,
  #appView.daily-mode .daily-three-summary{grid-template-columns:1fr!important}
  #appView.daily-mode .daily-entry-group-controls>span{flex:1 1 100%!important}
  #authView .installer-grid{grid-template-columns:1fr!important}
  #authView .auth-tabs{grid-template-columns:1fr 1fr!important}
}
@media(max-width:1023px){.app-resize-handle{display:none!important}}

/* V15.6 — every editable text/combobox is black with clearly visible white text. */
#appView.app-shell:not(.hidden) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
#appView.app-shell:not(.hidden) select,
#appView.app-shell:not(.hidden) textarea,
#authView input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
#authView select,
#authView textarea,
.modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
.modal select,
.modal textarea{
  background-color:#000!important;
  background-image:none!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  caret-color:#fff!important;
  color-scheme:dark!important;
  border-color:#c49422!important;
  opacity:1!important;
}
#appView.app-shell:not(.hidden) input:disabled,
#appView.app-shell:not(.hidden) input[readonly],
#appView.app-shell:not(.hidden) select:disabled,
#appView.app-shell:not(.hidden) textarea:disabled,
#authView input:disabled,
#authView input[readonly],
#authView select:disabled,
#authView textarea:disabled{background-color:#080808!important;color:#e8e8e8!important;-webkit-text-fill-color:#e8e8e8!important;opacity:1!important}
#appView.app-shell:not(.hidden) input::placeholder,
#appView.app-shell:not(.hidden) textarea::placeholder,
#authView input::placeholder,
#authView textarea::placeholder,
.modal input::placeholder,
.modal textarea::placeholder{color:#bdb7a8!important;-webkit-text-fill-color:#bdb7a8!important;opacity:1!important}
#appView.app-shell:not(.hidden) select option,
#appView.app-shell:not(.hidden) select optgroup,
#authView select option,
#authView select optgroup,
.modal select option,
.modal select optgroup{background:#000!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
#appView.app-shell:not(.hidden) input[type="date"]::-webkit-calendar-picker-indicator,
#appView.app-shell:not(.hidden) input[type="time"]::-webkit-calendar-picker-indicator,
#appView.app-shell:not(.hidden) input[type="datetime-local"]::-webkit-calendar-picker-indicator,
#authView input[type="date"]::-webkit-calendar-picker-indicator{filter:invert(1) sepia(1) saturate(3)!important;opacity:1!important}

/* Login/Register uses the same movable, resizable dark-golden desktop window. */
#authView .auth-split-card{position:relative!important;grid-template-rows:38px minmax(0,1fr)!important;background:var(--dark-gold-page)!important;color:#fff!important;overflow:hidden!important}
#authView .auth-window-bar{
  grid-column:1/-1;grid-row:1;display:flex;align-items:center;justify-content:space-between;
  min-width:0;padding:4px 8px 4px 12px;border-bottom:1px solid var(--dark-gold-line);
  background:#211604;color:#fff;z-index:140;cursor:grab;touch-action:none;user-select:none;
}
#authView .auth-window-title{display:flex;align-items:center;gap:7px;min-width:0}
#authView .auth-window-title img{width:23px;height:23px;border-radius:6px}
#authView .auth-window-title b{font-size:13px;white-space:nowrap}
#authView .auth-window-title small{font-size:9px;color:#e8c86f;border-left:1px solid #76550f;padding-left:7px}
#authView .auth-window-controls{display:inline-flex;align-items:center;gap:4px}
#authView .auth-window-control{display:grid;place-items:center;width:28px;min-width:28px;height:28px;min-height:28px;padding:0;border:1px solid #9d7418;border-radius:7px;background:#171001;color:#fff;font:14px/1 "Segoe UI Symbol","Segoe UI",Arial,sans-serif;cursor:pointer}
#authView .auth-window-control:hover{background:#5e4108;border-color:#e0ad27}
#authView .auth-window-control.close:hover{background:#b42318;border-color:#ff7b70}
#authView .auth-showcase,#authView .auth-control-panel{grid-row:2;min-height:0}
#authView .auth-showcase{grid-column:1;background:radial-gradient(circle at 25% 20%,#634709 0,transparent 38%),linear-gradient(150deg,#382708,#211604)!important}
#authView .auth-control-panel{grid-column:2;background:var(--dark-gold-page)!important}
#authView .auth-showcase::after{background:linear-gradient(180deg,rgba(43,29,5,.28),rgba(43,29,5,.82) 55%,#2b1d05)!important}
#authView .auth-heading h2,#authView .auth-heading p,#authView .login-demo-notice,#authView .auth-form label,#authView .auth-footer,#authView .link-btn{color:#fff!important}
#authView .auth-feature,#authView .auth-installer-center,#authView .login-installer-files,#authView .local-note{background:#171001!important;border-color:#9c7214!important;color:#fff!important}
#authView .auth-device-card,#authView .login-installer-btn,#authView .auth-guide-row button,#authView .ghost{background:#211604!important;border-color:#a77b18!important;color:#fff!important}
#authView .auth-device-card:hover,#authView .login-installer-btn:hover,#authView .auth-guide-row button:hover{background:#5a3f0a!important;border-color:#e0ad27!important;color:#fff!important}
#authView .auth-tabs{background:#171001!important;border-color:#9c7214!important}
#authView .auth-tab{color:#e1d3aa!important}
#authView .auth-tab.active,#authView .primary{background:linear-gradient(135deg,#e0ad27,#8e5c05)!important;color:#fff!important;border-color:#e0ad27!important}
#authView .auth-installer-head small,#authView .auth-device-card small,#authView .login-installer-title small,#authView .login-installer-note{color:#e1d3aa!important}
#authView .auth-split-card.auth-window-interacting .auth-window-bar{cursor:grabbing}

@media(min-width:1024px){
  #authView .auth-split-card.auth-window-free{position:fixed!important;right:auto!important;bottom:auto!important;max-width:none!important;max-height:none!important;margin:0!important}
  #authView .auth-split-card.auth-window-maximized{position:fixed!important;left:0!important;top:0!important;right:auto!important;bottom:auto!important;transform:none!important;width:100vw!important;height:100vh!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;border:0!important;border-radius:0!important;margin:0!important}
  #authView .auth-resize-handle{position:absolute;z-index:160;display:block;touch-action:none;background:transparent}
  #authView .auth-resize-handle.n{left:14px;right:14px;top:0;height:7px;cursor:n-resize}
  #authView .auth-resize-handle.s{left:14px;right:14px;bottom:0;height:7px;cursor:s-resize}
  #authView .auth-resize-handle.e{top:14px;bottom:14px;right:0;width:7px;cursor:e-resize}
  #authView .auth-resize-handle.w{top:14px;bottom:14px;left:0;width:7px;cursor:w-resize}
  #authView .auth-resize-handle.ne,#authView .auth-resize-handle.nw,#authView .auth-resize-handle.se,#authView .auth-resize-handle.sw{width:15px;height:15px}
  #authView .auth-resize-handle.ne{right:0;top:0;cursor:ne-resize}#authView .auth-resize-handle.nw{left:0;top:0;cursor:nw-resize}
  #authView .auth-resize-handle.se{right:0;bottom:0;cursor:se-resize}#authView .auth-resize-handle.sw{left:0;bottom:0;cursor:sw-resize}
  #authView .auth-resize-handle.se::after{content:"";position:absolute;right:3px;bottom:3px;width:7px;height:7px;border-right:2px solid #e0ad27;border-bottom:2px solid #e0ad27}
  #authView .auth-split-card.auth-window-maximized .auth-resize-handle{display:none!important}
}
@media(max-width:1023px){
  #authView .auth-resize-handle{display:none!important}
  #authView .auth-window-controls{display:none!important}
  #authView .auth-split-card{grid-template-columns:1fr!important;grid-template-rows:38px auto!important}
  #authView .auth-control-panel{grid-column:1!important;grid-row:2!important}
}

/* V15.7 — exact requested normal sizes and hard override for every note field. */
body #appView.app-shell:not(.hidden) textarea,
body #appView.app-shell:not(.hidden) input[name="notes"],
body #appView.app-shell:not(.hidden) input[name="note"],
body #appView.app-shell:not(.hidden) input[id*="note" i],
body #appView.app-shell:not(.hidden) [contenteditable="true"].note-box,
body .modal textarea,
body .modal input[name="notes"],
body .modal input[name="note"]{
  background:#000!important;
  background-color:#000!important;
  background-image:none!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  caret-color:#fff!important;
  border-color:#c49422!important;
  color-scheme:dark!important;
  opacity:1!important;
}
body #appView.app-shell:not(.hidden) textarea::placeholder,
body #appView.app-shell:not(.hidden) input[name="notes"]::placeholder,
body #appView.app-shell:not(.hidden) input[name="note"]::placeholder,
body #appView.app-shell:not(.hidden) input[id*="note" i]::placeholder,
body .modal textarea::placeholder,
body .modal input[name="notes"]::placeholder,
body .modal input[name="note"]::placeholder{
  color:#c9c3b3!important;
  -webkit-text-fill-color:#c9c3b3!important;
  opacity:1!important;
}

/* V15.8 — live Width × Height readout for Login and Main windows. */
.window-size-indicator{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:94px!important;
  height:28px!important;
  padding:3px 8px!important;
  border:1px solid #a77b18!important;
  border-radius:7px!important;
  background:#000!important;
  color:#ffe59b!important;
  -webkit-text-fill-color:#ffe59b!important;
  font-family:Consolas,"Segoe UI",Arial,sans-serif!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:1!important;
  letter-spacing:.1px!important;
  white-space:nowrap!important;
  box-shadow:inset 0 0 0 1px rgba(224,173,39,.08)!important;
}
#appView .top-actions>.window-size-indicator{margin-left:2px!important}
#authView .auth-window-controls>.window-size-indicator{margin-right:3px!important}
@media(max-width:1023px){.window-size-indicator{display:none!important}}

/* V16.0 — each Daily Entry/Ledger half can become a movable, resizable work window. */
#appView .daily-pane-toggle{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-height:30px!important;padding:5px 10px!important;border:1px solid #d5a11e!important;
  border-radius:8px!important;background:#000!important;color:#ffe59b!important;
  font-size:10px!important;font-weight:900!important;line-height:1!important;white-space:nowrap!important;
  box-shadow:0 0 0 1px rgba(224,173,39,.08) inset!important;cursor:pointer!important;
}
#appView .daily-pane-toggle-group{display:inline-flex!important;align-items:center!important;gap:5px!important;padding:2px!important;border:1px solid #76550f!important;border-radius:9px!important;background:#171001!important}
#appView .daily-pane-toggle-group .daily-pane-toggle{min-height:27px!important;padding:4px 8px!important;border-radius:6px!important}
#appView .daily-pane-toggle:hover,#appView .daily-pane-toggle.active{background:#8e5c05!important;color:#fff!important;border-color:#f0bd31!important}
#appView .daily-ledger-toolbar-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:7px!important;min-width:0!important}

@media(min-width:1024px){
  #appView .daily-entry-panel.daily-pane-expanded,
  #appView .daily-ledger-panel.daily-pane-expanded{
    position:fixed!important;z-index:2000!important;display:block!important;margin:0!important;
    min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;
    padding:10px!important;border:2px solid #d5a11e!important;border-radius:14px!important;
    overflow:auto!important;background:#2b1d05!important;color:#fff!important;
    box-shadow:0 28px 90px rgba(0,0,0,.72),0 0 0 1px rgba(255,229,155,.18) inset!important;
  }
  #appView .daily-pane-expanded>.panel-head,
  #appView .daily-pane-expanded .daily-v14-ledger-toolbar{
    position:sticky!important;top:-10px!important;z-index:920!important;margin-top:-10px!important;
    padding-top:10px!important;background:#211604!important;border-bottom:1px solid #9c7214!important;
    cursor:grab!important;touch-action:none!important;
  }
  #appView .daily-pane-expanded.daily-pane-interacting>.panel-head,
  #appView .daily-pane-expanded.daily-pane-interacting .daily-v14-ledger-toolbar{cursor:grabbing!important;user-select:none!important}
  #appView .daily-pane-expanded .daily-v14-ledger-view{height:auto!important;min-height:100%!important;overflow:visible!important}
  #appView .daily-pane-expanded #recordTable{min-height:0!important;overflow:visible!important}
  #appView .daily-pane-resize-handle{position:absolute!important;z-index:950!important;display:block!important;touch-action:none!important;background:transparent!important}
  #appView .daily-pane-resize-handle.n{left:16px;right:16px;top:0;height:8px;cursor:n-resize}
  #appView .daily-pane-resize-handle.s{left:16px;right:16px;bottom:0;height:8px;cursor:s-resize}
  #appView .daily-pane-resize-handle.e{top:16px;bottom:16px;right:0;width:8px;cursor:e-resize}
  #appView .daily-pane-resize-handle.w{top:16px;bottom:16px;left:0;width:8px;cursor:w-resize}
  #appView .daily-pane-resize-handle.ne,#appView .daily-pane-resize-handle.nw,#appView .daily-pane-resize-handle.se,#appView .daily-pane-resize-handle.sw{width:18px;height:18px}
  #appView .daily-pane-resize-handle.ne{right:0;top:0;cursor:ne-resize}#appView .daily-pane-resize-handle.nw{left:0;top:0;cursor:nw-resize}
  #appView .daily-pane-resize-handle.se{right:0;bottom:0;cursor:se-resize}#appView .daily-pane-resize-handle.sw{left:0;bottom:0;cursor:sw-resize}
  #appView .daily-pane-resize-handle.se::after{content:"";position:absolute;right:3px;bottom:3px;width:9px;height:9px;border-right:2px solid #f0bd31;border-bottom:2px solid #f0bd31}
  #appView.daily-pane-popout-active,
  #appView.daily-pane-popout-active .workspace,
  #appView.daily-pane-popout-active #content{overflow:visible!important}
}
@media(max-width:1023px){
  #appView .daily-pane-toggle-group{display:none!important}
  #appView .daily-pane-toggle{display:none!important}
  #appView .daily-pane-resize-handle{display:none!important}
}

/* V16.3 — each pane keeps its own compact header control; no shared/extra bar. */
#appView.daily-mode .daily-v14-loan-grid{
  display:flex!important;grid-template-columns:none!important;flex-wrap:nowrap!important;gap:3px!important;
  width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;padding:2px 0 4px!important;
  scrollbar-width:thin!important;scrollbar-color:#a77b18 #171001!important;
}
#appView.daily-mode .daily-v14-loan-grid .loan-income-code{
  flex:0 0 42px!important;width:42px!important;min-width:42px!important;height:24px!important;min-height:24px!important;
  padding:2px 3px!important;border-radius:5px!important;font-size:8px!important;line-height:1!important;
}

/* V16.4 — expanded Entry matches the supplied full-window reference. */
@media(min-width:1024px){
  #appView .daily-entry-panel.daily-pane-expanded{
    padding:6px!important;
    border-radius:8px!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded>.panel-head{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    min-height:38px!important;
    margin:0 0 7px!important;
    padding:5px 0 6px!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded>.panel-head>div:first-child{min-width:0!important}
  #appView .daily-entry-panel.daily-pane-expanded>.panel-head h3{
    margin:0!important;
    font-size:15px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-top-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    flex-wrap:nowrap!important;
    gap:4px!important;
    margin-left:auto!important;
    white-space:nowrap!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-top-actions button{
    height:29px!important;
    min-height:29px!important;
    padding:4px 8px!important;
    font-size:9px!important;
    border-radius:7px!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-v14-toolbar{
    grid-template-columns:minmax(160px,185px) minmax(0,1fr)!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-smart-columns{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:6px!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-v14-summary-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    overflow:visible!important;
  }
}

/* V16.5 — keep the four summary boxes at the very bottom and give rows the free height. */
@media(min-width:1024px){
  #appView .daily-entry-panel.daily-pane-expanded{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded>.panel-head{
    flex:0 0 auto!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded>.module-guide{
    display:none!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded>.daily-v14-form{
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    overflow:hidden!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-smart-columns{
    min-height:0!important;
    height:100%!important;
    align-items:stretch!important;
    overflow:hidden!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-entry-section{
    min-height:0!important;
    height:100%!important;
    overflow:hidden!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-entry-rows{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    height:auto!important;
    align-content:start!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-smart-actions{
    flex:0 0 auto!important;
    margin:0!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded>.daily-v14-summary-grid{
    flex:0 0 auto!important;
    width:100%!important;
    margin-top:6px!important;
  }
}

/* V16.6 — expanded Ledger gives all spare height to the income/expense grid. */
@media(min-width:1024px){
  #appView .daily-ledger-panel.daily-pane-expanded{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  #appView .daily-ledger-panel.daily-pane-expanded>#recordTable{
    flex:1 1 auto!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView .daily-ledger-panel.daily-pane-expanded .daily-v14-ledger-view{
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView .daily-ledger-panel.daily-pane-expanded .daily-v14-ledger-card{
    display:flex!important;
    flex-direction:column!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView .daily-ledger-panel.daily-pane-expanded .daily-v14-ledger-card>.daily-v14-section-head{
    flex:0 0 auto!important;
  }
  #appView .daily-ledger-panel.daily-pane-expanded .daily-v14-ledger-split{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView .daily-ledger-panel.daily-pane-expanded .daily-ledger-half-wrap{
    height:100%!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:auto!important;
  }
  #appView .daily-ledger-panel.daily-pane-expanded .daily-v14-recent-card{
    align-self:stretch!important;
  }
}

/* V16.7 — income and expense editors are functional GridView rows. */
#appView.daily-mode .daily-entry-grid-head{display:none}
#appView.daily-mode .daily-grid-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:6px!important;
  align-items:end!important;
}
#appView.daily-mode .daily-grid-row>.daily-grid-serial,
#appView.daily-mode .daily-grid-row>.daily-grid-description,
#appView.daily-mode .daily-grid-row>.daily-grid-note{grid-column:1/-1!important}
#appView.daily-mode .daily-grid-row-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  min-width:0!important;
}
#appView.daily-mode .daily-grid-row-actions .daily-line-remove-btn{
  width:28px!important;
  min-width:28px!important;
  height:28px!important;
  min-height:28px!important;
  padding:0!important;
}
#appView.daily-mode .daily-grid-quantity-stack{display:grid!important;gap:4px!important;min-width:0!important}

@media(min-width:1024px){
  #appView .daily-entry-panel.daily-pane-expanded .daily-entry-grid-head{
    display:grid!important;
    align-items:center!important;
    min-height:27px!important;
    border:1px solid #76550f!important;
    border-bottom:0!important;
    border-radius:7px 7px 0 0!important;
    background:#4a3207!important;
    color:#ffe59b!important;
    font-size:8px!important;
    font-weight:900!important;
    line-height:1.1!important;
    overflow:hidden!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-income-grid-head,
  #appView .daily-entry-panel.daily-pane-expanded .daily-income-grid-row{
    grid-template-columns:44px minmax(0,2fr) minmax(82px,.72fr) minmax(0,1.2fr) 30px!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-expense-grid-head,
  #appView .daily-entry-panel.daily-pane-expanded .daily-expense-grid-row{
    grid-template-columns:44px minmax(0,1.7fr) minmax(0,1.25fr) minmax(82px,.68fr) minmax(0,1fr) 30px!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-entry-grid-head>span{
    min-width:0!important;
    height:100%!important;
    display:flex!important;
    align-items:center!important;
    padding:4px 5px!important;
    border-right:1px solid #76550f!important;
    overflow:hidden!important;
    white-space:nowrap!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-entry-grid-head>span:last-child{border-right:0!important;justify-content:center!important}
  #appView .daily-entry-panel.daily-pane-expanded .daily-entry-rows{
    gap:0!important;
    border:1px solid #76550f!important;
    border-radius:0 0 7px 7px!important;
    background:#0a170f!important;
    padding:0!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row{
    align-items:center!important;
    gap:0!important;
    padding:0!important;
    border:0!important;
    border-bottom:1px solid #d5a11e!important;
    border-radius:0!important;
    background:#071528!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row:last-child{border-bottom:2px solid #d5a11e!important}
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row>*{
    grid-column:auto!important;
    min-width:0!important;
    height:100%!important;
    padding:4px!important;
    border-right:1px solid #76550f!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row>*:last-child{border-right:0!important}
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-serial{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:8px!important;
    white-space:nowrap!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row .field>label,
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row .field-help{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row input,
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row select,
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row textarea,
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row .expense-head-input-row input{
    width:100%!important;
    height:31px!important;
    min-height:31px!important;
    margin:0!important;
    padding:4px 6px!important;
    font-size:9px!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row-actions{
    align-items:center!important;
    justify-content:center!important;
  }
  #appView .daily-entry-panel.daily-pane-expanded .daily-grid-row-actions .daily-line-remove-btn{
    width:24px!important;
    min-width:24px!important;
    height:24px!important;
    min-height:24px!important;
    font-size:12px!important;
  }
}

/* V16.9 — normal two-pane mode uses every pixel and never clips codes/expense fields. */
@media(min-width:1024px){
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded),
  #appView.daily-mode .daily-ledger-panel:not(.daily-pane-expanded){
    display:flex!important;
    flex-direction:column!important;
    min-width:0!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded)>.panel-head{
    flex:0 0 auto!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded)>.daily-v14-form{
    flex:1 1 auto!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-v14-loan-grid{
    display:grid!important;
    grid-template-columns:repeat(8,minmax(0,1fr))!important;
    gap:3px!important;
    width:100%!important;
    overflow:visible!important;
    padding:1px 0!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-v14-loan-grid .loan-income-code{
    width:auto!important;
    min-width:0!important;
    height:23px!important;
    min-height:23px!important;
    padding:2px!important;
    font-size:7.5px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-smart-columns{
    min-width:0!important;
    min-height:0!important;
    height:100%!important;
    align-items:stretch!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-entry-section{
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:100%!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-entry-rows{
    flex:1 1 auto!important;
    min-width:0!important;
    min-height:0!important;
    max-height:none!important;
    height:auto!important;
    align-content:start!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-grid-row,
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-grid-row>*{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .expense-head-combo,
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .expense-head-input-row,
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .v121-quantity-input-row{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .expense-head-input-row{
    grid-template-columns:minmax(0,1fr) 36px!important;
    gap:4px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .expense-head-input-row>.expense-head-toggle{
    right:40px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-smart-actions{
    flex:0 0 auto!important;
    margin:0!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded)>.daily-v14-summary-grid{
    flex:0 0 auto!important;
    width:100%!important;
    margin-top:5px!important;
  }

  #appView.daily-mode .daily-ledger-panel:not(.daily-pane-expanded)>#recordTable{
    flex:1 1 auto!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-ledger-panel:not(.daily-pane-expanded) .daily-v14-ledger-view{
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-ledger-panel:not(.daily-pane-expanded) .daily-v14-ledger-card{
    display:flex!important;
    flex-direction:column!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-ledger-panel:not(.daily-pane-expanded) .daily-v14-ledger-split{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #appView.daily-mode .daily-ledger-panel:not(.daily-pane-expanded) .daily-ledger-half-wrap{
    height:100%!important;
    min-height:0!important;
    overflow-y:auto!important;
  }
}

/* V17.0 — normal Income group: only three compact rows with an in-field mic. */
@media(min-width:1024px){
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row{
    position:relative!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:4px!important;
    align-items:stretch!important;
    padding:5px!important;
    border:1px solid #d5a11e!important;
    border-radius:7px!important;
    background:#071528!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row>.daily-grid-serial{
    display:none!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row>.field{
    position:relative!important;
    grid-column:1!important;
    display:block!important;
    width:100%!important;
    min-width:0!important;
    padding:0!important;
    margin:0!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row>.field>label{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row>.field>input{
    display:block!important;
    width:100%!important;
    height:31px!important;
    min-height:31px!important;
    padding:4px 31px 4px 7px!important;
    margin:0!important;
    font-size:9px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row>.field>.field-voice-button{
    position:absolute!important;
    right:4px!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    display:inline-grid!important;
    place-items:center!important;
    width:23px!important;
    min-width:23px!important;
    height:23px!important;
    min-height:23px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:5px!important;
    background:#07192d!important;
    color:#fff!important;
    font-size:12px!important;
    z-index:3!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row>.daily-grid-row-actions{
    position:absolute!important;
    right:2px!important;
    top:2px!important;
    width:auto!important;
    height:auto!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    z-index:5!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row>.daily-grid-row-actions .daily-line-remove-btn{
    width:20px!important;
    min-width:20px!important;
    height:20px!important;
    min-height:20px!important;
    border-radius:4px!important;
    font-size:11px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row:has(.daily-line-remove-btn:not([hidden]))>.daily-grid-description>input{
    padding-right:53px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-income-grid-row:has(.daily-line-remove-btn:not([hidden]))>.daily-grid-description>.field-voice-button{
    right:27px!important;
  }
}

/* V17.1 — normal Expense group without instructional clutter. */
@media(min-width:1024px){
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row{
    position:relative!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(88px,.72fr)!important;
    gap:4px!important;
    align-items:end!important;
    padding:5px!important;
    border:1px solid #d5a11e!important;
    border-radius:7px!important;
    background:#071528!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-serial{
    display:none!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-description,
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-note{
    grid-column:1/-1!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-quantity-stack{grid-column:1!important}
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-amount{grid-column:2!important}
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.field,
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row .daily-grid-quantity-stack>.field{
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    padding:0!important;
    margin:0!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row .field>label,
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row .field-help{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row input{
    height:31px!important;
    min-height:31px!important;
    margin:0!important;
    font-size:8.5px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-amount>input,
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-note>input{
    padding:4px 31px 4px 7px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.field>.field-voice-button{
    position:absolute!important;
    right:4px!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    display:inline-grid!important;
    place-items:center!important;
    width:23px!important;
    min-width:23px!important;
    height:23px!important;
    min-height:23px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:5px!important;
    background:#07192d!important;
    color:#fff!important;
    font-size:12px!important;
    z-index:3!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row .expense-head-input-row{
    grid-template-columns:minmax(0,1fr) 25px!important;
    gap:3px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row .expense-head-input-row>input[name="head[]"]{
    padding:4px 56px 4px 7px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row .expense-head-input-row>.expense-head-toggle{
    right:29px!important;
    width:23px!important;
    min-width:23px!important;
    height:23px!important;
    min-height:23px!important;
    border:0!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row .expense-head-input-row>.field-voice-button{
    grid-column:2!important;
    position:static!important;
    transform:none!important;
    display:inline-grid!important;
    place-items:center!important;
    width:23px!important;
    min-width:23px!important;
    height:23px!important;
    min-height:23px!important;
    align-self:center!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:5px!important;
    background:#07192d!important;
    color:#fff!important;
    font-size:12px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-row-actions{
    position:absolute!important;
    right:2px!important;
    top:2px!important;
    width:auto!important;
    height:auto!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    z-index:5!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row>.daily-grid-row-actions .daily-line-remove-btn{
    width:20px!important;
    min-width:20px!important;
    height:20px!important;
    min-height:20px!important;
    border-radius:4px!important;
    font-size:11px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-expense-grid-row:has(.daily-line-remove-btn:not([hidden]))>.daily-grid-description{
    padding-right:22px!important;
  }
}

/* V17.2 — live head count and one auto number per Save batch. */
#appView.daily-mode .daily-entry-group-controls{
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  width:100%!important;
  min-width:0!important;
  min-height:29px!important;
  padding:3px!important;
  border:1px solid #76550f!important;
  border-radius:7px!important;
  background:#03070c!important;
  color:#fff!important;
  overflow:hidden!important;
}
#appView.daily-mode .daily-entry-group-controls>span{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  min-width:0!important;
  height:23px!important;
  padding:3px 5px!important;
  border:1px solid #3f4d5f!important;
  border-radius:5px!important;
  background:#101820!important;
  color:#dce8f5!important;
  font-size:8px!important;
  font-weight:800!important;
  line-height:1!important;
  white-space:nowrap!important;
}
#appView.daily-mode .daily-entry-group-controls>span b{
  color:#ffe59b!important;
  font-family:Consolas,"Segoe UI",Arial,sans-serif!important;
  font-size:9px!important;
}
#appView.daily-mode .daily-entry-group-controls>.mini-row-btn{
  flex:0 0 auto!important;
  height:25px!important;
  min-height:25px!important;
  padding:3px 7px!important;
  margin:0!important;
  border-radius:6px!important;
  font-size:8px!important;
  white-space:nowrap!important;
}
#appView.daily-mode .daily-entry-group-controls.income-controls>span:last-child,
#appView.daily-mode .daily-entry-group-controls.expense-controls>span:nth-child(2){
  flex:1 1 auto!important;
}
@media(min-width:1024px){
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-entry-group-controls{
    gap:3px!important;
    min-height:27px!important;
    padding:2px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-entry-group-controls>span{
    height:22px!important;
    padding:2px 4px!important;
    font-size:7px!important;
  }
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-entry-group-controls>span b{font-size:8px!important}
  #appView.daily-mode .daily-entry-panel:not(.daily-pane-expanded) .daily-entry-group-controls>.mini-row-btn{
    height:23px!important;
    min-height:23px!important;
    padding:2px 5px!important;
    font-size:7px!important;
  }
}

/* V17.3 cascade lock — keep responsive rules after all legacy desktop rules. */
@media(max-width:1279px){
  #appView.app-shell:not(.hidden){
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    top:auto!important;
    transform:none!important;
    display:block!important;
    width:100%!important;
    max-width:none!important;
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    margin:0!important;
    border-radius:0!important;
    overflow:visible!important;
  }
  #appView .workspace{display:block!important;width:100%!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
  #appView .sidebar{
    position:fixed!important;
    inset:0 auto 0 0!important;
    z-index:1002!important;
    width:min(286px,88vw)!important;
    height:100dvh!important;
    transform:translateX(-105%)!important;
  }
  #appView .sidebar.open{transform:translateX(0)!important}
  #appView #menuBtn{display:inline-grid!important}
  #appView .app-window-controls,
  #appView .window-size-indicator,
  #appView .app-resize-handle{display:none!important}
  #appView .content{width:100%!important;height:auto!important;min-height:0!important;overflow:visible!important}
  #appView.daily-mode .daily-module-content{display:block!important;width:100%!important;height:auto!important;overflow:visible!important}
  #appView.daily-mode .daily-entry-panel,
  #appView.daily-mode .daily-ledger-panel{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 0 10px!important;
    overflow:visible!important;
  }
  #appView.daily-mode .daily-pane-toggle-group,
  #appView.daily-mode .daily-pane-toggle,
  #appView.daily-mode .daily-pane-resize-handle{display:none!important}
  #appView.daily-mode .daily-smart-columns{grid-template-columns:1fr!important;height:auto!important;min-height:0!important}
  #appView.daily-mode .daily-entry-section,
  #appView.daily-mode .daily-entry-rows{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
  #appView.daily-mode .daily-grid-row{
    grid-template-columns:1fr!important;
    align-items:stretch!important;
  }
  #appView.daily-mode .daily-grid-row>*{grid-column:1!important;min-width:0!important}
  #appView.daily-mode .daily-grid-row>.daily-grid-serial{display:none!important}
  #appView.daily-mode .daily-grid-row>.daily-grid-row-actions{position:static!important;height:auto!important;justify-content:flex-end!important}
  #appView.daily-mode .daily-v14-ledger-view,
  #appView.daily-mode #recordTable{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
  #appView.daily-mode .daily-v14-ledger-split{grid-template-columns:1fr!important;height:auto!important;min-height:0!important;overflow:visible!important}
  #appView.daily-mode .daily-ledger-half-wrap{width:100%!important;min-width:0!important;min-height:210px!important;max-height:340px!important;overflow:auto!important}
  #authView:not(.hidden){position:relative!important;inset:auto!important;width:100%!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
  #authView .auth-split-card{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    top:auto!important;
    transform:none!important;
    grid-template-columns:1fr!important;
    width:100%!important;
    max-width:720px!important;
    height:auto!important;
    min-height:calc(100dvh - 16px)!important;
    max-height:none!important;
    margin:0 auto!important;
  }
  #authView .auth-showcase{display:none!important}
  #authView .auth-control-panel{grid-column:1!important;width:100%!important;height:auto!important;overflow:visible!important}
  #authView .auth-window-controls,
  #authView .window-size-indicator,
  #authView .auth-resize-handle{display:none!important}
}

/* V17.4 — compact add-row plus icons on every screen size. */
#appView.daily-mode .daily-entry-group-controls>.daily-row-add-icon{
  flex:0 0 24px!important;
  display:inline-grid!important;
  place-items:center!important;
  width:24px!important;
  min-width:24px!important;
  max-width:24px!important;
  height:24px!important;
  min-height:24px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid #d5a11e!important;
  border-radius:6px!important;
  background:#071528!important;
  color:#ffe59b!important;
  font-size:17px!important;
  font-weight:900!important;
  line-height:1!important;
  cursor:pointer!important;
}
#appView.daily-mode .daily-entry-group-controls>.daily-row-add-icon:hover,
#appView.daily-mode .daily-entry-group-controls>.daily-row-add-icon:focus-visible{
  background:#8e5c05!important;
  color:#fff!important;
  outline:2px solid #f0bd31!important;
  outline-offset:1px!important;
}

/* V17.5 — remove remaining white surfaces from the dark-golden application. */
#appView.app-shell:not(.hidden) #content.content,
#appView.app-shell:not(.hidden) #content.daily-module-content,
#appView.app-shell:not(.hidden).daily-mode #content.daily-module-content,
#appView.app-shell:not(.hidden).daily-mode #content.daily-module-content>.daily-entry-panel,
#appView.app-shell:not(.hidden).daily-mode #content.daily-module-content>.daily-ledger-panel,
#appView.app-shell:not(.hidden) .daily-entry-panel,
#appView.app-shell:not(.hidden) .daily-ledger-panel,
#appView.app-shell:not(.hidden) .daily-smart-form,
#appView.app-shell:not(.hidden) .daily-smart-columns,
#appView.app-shell:not(.hidden) .daily-v14-form,
#appView.app-shell:not(.hidden) .daily-v14-ledger-view,
#appView.app-shell:not(.hidden) .daily-v14-ledger-card,
#appView.app-shell:not(.hidden) .daily-v14-recent-card,
#appView.app-shell:not(.hidden) .daily-paper,
#appView.app-shell:not(.hidden) .daily-paper-inner,
#appView.app-shell:not(.hidden) #recordTable{
  background:var(--dark-gold-page)!important;
  color:var(--dark-gold-text)!important;
}
#appView.app-shell:not(.hidden) .daily-entry-section,
#appView.app-shell:not(.hidden) .daily-income-section,
#appView.app-shell:not(.hidden) .daily-expense-section,
#appView.app-shell:not(.hidden) .daily-v14-card,
#appView.app-shell:not(.hidden) .daily-v14-loan-card,
#appView.app-shell:not(.hidden) .daily-ledger-half-wrap,
#appView.app-shell:not(.hidden) .daily-recent-wrap,
#appView.app-shell:not(.hidden) .daily-sales-wrap{
  background:var(--dark-gold-surface-2)!important;
  border-color:var(--dark-gold-line)!important;
  color:var(--dark-gold-text)!important;
}
#appView.app-shell:not(.hidden) .topbar .ghost,
#appView.app-shell:not(.hidden) .daily-top-actions .ghost,
#appView.app-shell:not(.hidden) .daily-v14-section-head .ghost,
#appView.app-shell:not(.hidden) .daily-v14-ledger-toolbar .ghost{
  background:#171001!important;
  color:#fff!important;
  border-color:#a77b18!important;
  box-shadow:none!important;
}
#appView.app-shell:not(.hidden) .empty,
#appView.app-shell:not(.hidden) .daily-empty{
  background:transparent!important;
  color:var(--dark-gold-muted)!important;
}

/* V17.6 — zero white backgrounds across every application control and scrollbar. */
#appView.app-shell:not(.hidden) button:not(.primary),
#appView.app-shell:not(.hidden) .ghost,
#appView.app-shell:not(.hidden) .secondary,
#appView.app-shell:not(.hidden) .mini,
#appView.app-shell:not(.hidden) [role="button"],
#authView button:not(.primary),
#authView .ghost,
#authView [role="button"],
.modal button:not(.primary),
.modal .ghost,
.modal [role="button"]{
  background:#171001!important;
  background-image:none!important;
  color:#fff!important;
  border-color:#a77b18!important;
  box-shadow:none!important;
}
#appView.app-shell:not(.hidden) button:not(.primary):hover,
#appView.app-shell:not(.hidden) button:not(.primary):focus-visible,
#authView button:not(.primary):hover,
#authView button:not(.primary):focus-visible,
.modal button:not(.primary):hover,
.modal button:not(.primary):focus-visible{
  background:#5a3f0a!important;
  color:#fff!important;
  border-color:#e0ad27!important;
}
#appView.app-shell:not(.hidden) button.active:not(.primary),
#appView.app-shell:not(.hidden) .nav-item.active,
#authView button.active:not(.primary){
  background:linear-gradient(135deg,#d9a51e,#8e5c05)!important;
  color:#fff!important;
  border-color:#e0ad27!important;
}
#appView.app-shell:not(.hidden).daily-mode .daily-entry-group-controls>button.daily-row-add-icon{
  background:#071528!important;
  color:#ffe59b!important;
  border-color:#d5a11e!important;
}
#appView.app-shell:not(.hidden) *,
#authView *,
.modal *{
  scrollbar-color:#a77b18 #171001;
}
#appView.app-shell:not(.hidden) *::-webkit-scrollbar,
#authView *::-webkit-scrollbar,
.modal *::-webkit-scrollbar{width:9px;height:9px}
#appView.app-shell:not(.hidden) *::-webkit-scrollbar-track,
#authView *::-webkit-scrollbar-track,
.modal *::-webkit-scrollbar-track,
#appView.app-shell:not(.hidden) *::-webkit-scrollbar-corner,
#authView *::-webkit-scrollbar-corner,
.modal *::-webkit-scrollbar-corner{background:#171001!important}
#appView.app-shell:not(.hidden) *::-webkit-scrollbar-thumb,
#authView *::-webkit-scrollbar-thumb,
.modal *::-webkit-scrollbar-thumb{
  background:#76550f!important;
  border:2px solid #171001!important;
  border-radius:999px!important;
}
#appView.app-shell:not(.hidden) *::-webkit-scrollbar-thumb:hover,
#authView *::-webkit-scrollbar-thumb:hover,
.modal *::-webkit-scrollbar-thumb:hover{background:#c38e1a!important}

/* V17.7 — separate Income/Expense Save controls and strict dark action buttons. */
#appView.daily-mode .daily-section-save{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  width:100%!important;
  margin-top:auto!important;
  padding:6px 0 0!important;
  border-top:1px solid #76550f!important;
  background:transparent!important;
}
#appView.daily-mode .daily-section-save>.daily-kind-save{
  width:auto!important;
  min-width:82px!important;
  min-height:31px!important;
  padding:5px 10px!important;
  border:1px solid #e0ad27!important;
  border-radius:7px!important;
  background:linear-gradient(135deg,#e0ad27,#8e5c05)!important;
  color:#fff!important;
  font-size:10px!important;
  font-weight:900!important;
}
#appView.app-shell:not(.hidden).daily-mode button.daily-row-add-icon,
#appView.app-shell:not(.hidden).daily-mode button.daily-line-remove-btn,
#appView.app-shell:not(.hidden).daily-mode button.daily-clear-btn{
  background:#071528!important;
  background-image:none!important;
  color:#fff!important;
  border-color:#a77b18!important;
  box-shadow:none!important;
}
#appView.app-shell:not(.hidden).daily-mode button.daily-row-add-icon{color:#ffe59b!important}
#appView.app-shell:not(.hidden).daily-mode button.daily-line-remove-btn:hover,
#appView.app-shell:not(.hidden).daily-mode button.daily-clear-btn:hover{
  background:#5a3f0a!important;
  border-color:#e0ad27!important;
}
@media(max-width:767px){
  #appView.daily-mode .daily-section-save>.daily-kind-save{width:100%!important;min-height:40px!important;font-size:13px!important}
}

/* V17.8 — final all-page white-background purge, including native selects. */
#appView.app-shell:not(.hidden),
#appView.app-shell:not(.hidden) .workspace,
#appView.app-shell:not(.hidden) .content,
#authView,
#authView .auth-split-card,
#authView .auth-control-panel,
.modal,
.modal-card,
.modal-head,
.modal-body{
  color-scheme:dark!important;
}
#appView.app-shell:not(.hidden) select,
#authView select,
.modal select,
#appView.app-shell:not(.hidden) #deliverySaleSelect,
#appView.app-shell:not(.hidden) #deliveryVehicleCode{
  -webkit-appearance:none!important;
  appearance:none!important;
  background-color:#000!important;
  background-image:linear-gradient(45deg,transparent 50%,#e0ad27 50%),linear-gradient(135deg,#e0ad27 50%,transparent 50%)!important;
  background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%!important;
  background-size:5px 5px,5px 5px!important;
  background-repeat:no-repeat!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border-color:#b1841d!important;
  padding-right:30px!important;
  box-shadow:none!important;
}
#appView.app-shell:not(.hidden) select option,
#appView.app-shell:not(.hidden) select optgroup,
#authView select option,
#authView select optgroup,
.modal select option,
.modal select optgroup{
  background:#000!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
#appView.app-shell:not(.hidden) input,
#appView.app-shell:not(.hidden) textarea,
#authView input,
#authView textarea,
.modal input,
.modal textarea{
  background-color:#000!important;
  background-image:none!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
#appView.app-shell:not(.hidden) input[type="file"]::file-selector-button,
#authView input[type="file"]::file-selector-button,
.modal input[type="file"]::file-selector-button{
  background:#171001!important;
  color:#fff!important;
  border:1px solid #a77b18!important;
  border-radius:6px!important;
}
#appView.app-shell:not(.hidden) .panel,
#appView.app-shell:not(.hidden) .stat,
#appView.app-shell:not(.hidden) .module-card,
#appView.app-shell:not(.hidden) .report-item,
#appView.app-shell:not(.hidden) .settings-card,
#appView.app-shell:not(.hidden) .dashboard-option-card,
#appView.app-shell:not(.hidden) .delivery-panel,
#appView.app-shell:not(.hidden) .choice-manager-panel,
#appView.app-shell:not(.hidden) .daily-paper,
#appView.app-shell:not(.hidden) .table-wrap,
#appView.app-shell:not(.hidden) .daily-table-wrap,
#appView.app-shell:not(.hidden) .daily-entry-table-wrap,
#appView.app-shell:not(.hidden) .data-table.responsive-data-table,
#appView.app-shell:not(.hidden) .data-table.responsive-data-table tr,
#appView.app-shell:not(.hidden) .warning,
#appView.app-shell:not(.hidden) .success{
  background-color:var(--dark-gold-surface)!important;
  background-image:none!important;
  color:var(--dark-gold-text)!important;
  border-color:var(--dark-gold-line)!important;
}
#appView.app-shell:not(.hidden) button:not(.primary),
#appView.app-shell:not(.hidden) .ghost,
#appView.app-shell:not(.hidden) .secondary,
#appView.app-shell:not(.hidden) .mini,
#authView button:not(.primary),
.modal button:not(.primary){
  background-color:#171001!important;
  background-image:none!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border-color:#a77b18!important;
}
#appView.app-shell:not(.hidden) input:-webkit-autofill,
#appView.app-shell:not(.hidden) textarea:-webkit-autofill,
#appView.app-shell:not(.hidden) select:-webkit-autofill,
#authView input:-webkit-autofill,
#authView textarea:-webkit-autofill,
#authView select:-webkit-autofill{
  -webkit-text-fill-color:#fff!important;
  box-shadow:0 0 0 1000px #000 inset!important;
  -webkit-box-shadow:0 0 0 1000px #000 inset!important;
}

/* V17.9 — application-wide dark surfaces for every module/page. */
#appView.app-shell:not(.hidden) .content,
#appView.app-shell:not(.hidden) .content>*,
#appView.app-shell:not(.hidden) .content form,
#appView.app-shell:not(.hidden) .content fieldset,
#appView.app-shell:not(.hidden) .content section,
#appView.app-shell:not(.hidden) .content article,
#appView.app-shell:not(.hidden) .content details,
#appView.app-shell:not(.hidden) .content summary,
#appView.app-shell:not(.hidden) .content [class*="panel"],
#appView.app-shell:not(.hidden) .content [class*="card"],
#appView.app-shell:not(.hidden) .content [class*="surface"],
#appView.app-shell:not(.hidden) .content [class*="toolbar"],
#appView.app-shell:not(.hidden) .content [class*="filter"],
#appView.app-shell:not(.hidden) .content [class*="preview"],
#appView.app-shell:not(.hidden) .content [class*="manager"]{
  background-color:var(--dark-gold-surface)!important;
  background-image:none!important;
  color:var(--dark-gold-text)!important;
}
#appView.app-shell:not(.hidden) .content form,
#appView.app-shell:not(.hidden) .content fieldset{
  background-color:transparent!important;
}
#appView.app-shell:not(.hidden) .content .table-wrap,
#appView.app-shell:not(.hidden) .content .daily-table-wrap,
#appView.app-shell:not(.hidden) .content .daily-entry-table-wrap,
#appView.app-shell:not(.hidden) .content table,
#appView.app-shell:not(.hidden) .content tbody,
#appView.app-shell:not(.hidden) .content tr{
  background-color:#171001!important;
  background-image:none!important;
  color:#fff!important;
}
#appView.app-shell:not(.hidden) .content thead,
#appView.app-shell:not(.hidden) .content th{
  background-color:#5a3f0a!important;
  background-image:none!important;
  color:#fff!important;
  border-color:#8d6715!important;
}
#appView.app-shell:not(.hidden) .content td{
  background-color:#1a1102!important;
  background-image:none!important;
  color:#fff!important;
  border-color:#62470d!important;
}
#appView.app-shell:not(.hidden) .content input,
#appView.app-shell:not(.hidden) .content select,
#appView.app-shell:not(.hidden) .content textarea,
#appView.app-shell:not(.hidden) .content output,
#authView input,
#authView select,
#authView textarea,
.modal input,
.modal select,
.modal textarea{
  color-scheme:dark!important;
  background-color:#000!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border-color:#b1841d!important;
}
#appView.app-shell:not(.hidden) .content button:not(.primary),
#appView.app-shell:not(.hidden) .content a[class],
#authView button:not(.primary),
#authView a[class],
.modal button:not(.primary),
.modal a[class]{
  background-color:#171001!important;
  background-image:none!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border-color:#a77b18!important;
}
#appView.app-shell:not(.hidden) .content .primary,
#authView .primary,
.modal .primary{
  background:linear-gradient(135deg,#e0ad27,#8e5c05)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border-color:#e0ad27!important;
}
#appView.app-shell:not(.hidden) .content .empty,
#appView.app-shell:not(.hidden) .content [class*="empty"]{
  background-color:transparent!important;
  background-image:none!important;
  color:var(--dark-gold-muted)!important;
}
#authView .auth-feature,
#authView .auth-installer-center,
#authView .auth-device-card,
#authView .login-installer-files,
#authView .local-note,
#authView .auth-tabs,
.modal-card,
.modal-head,
.modal-body{
  background-color:var(--dark-gold-surface-2)!important;
  background-image:none!important;
  color:#fff!important;
  border-color:var(--dark-gold-line)!important;
}

/* V18.0 — specificity lock: no legacy white action button can win. */
html body #appView.app-shell:not(.hidden) #content button:not(.primary),
html body #appView.app-shell:not(.hidden) #content input[type="button"],
html body #appView.app-shell:not(.hidden) #content input[type="reset"],
html body #appView.app-shell:not(.hidden) .topbar button:not(.primary),
html body #appView.app-shell:not(.hidden) .panel-actions button:not(.primary),
html body #appView.app-shell:not(.hidden) .row-actions button:not(.primary),
html body #appView.app-shell:not(.hidden) .form-actions button:not(.primary),
html body #appView.app-shell:not(.hidden) .daily-smart-actions button:not(.primary),
html body #appView.app-shell:not(.hidden) .daily-entry-group-controls button:not(.primary),
html body #appView.app-shell:not(.hidden) .daily-v14-section-head button:not(.primary),
html body #appView.app-shell:not(.hidden) .daily-v14-ledger-toolbar button:not(.primary),
html body #authView.auth-page button:not(.primary),
html body .modal button:not(.primary){
  background:#171001!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border:1px solid #a77b18!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
html body #appView.app-shell:not(.hidden) #content button:not(.primary):hover,
html body #appView.app-shell:not(.hidden) #content button:not(.primary):focus-visible,
html body #appView.app-shell:not(.hidden) .topbar button:not(.primary):hover,
html body #authView.auth-page button:not(.primary):hover,
html body .modal button:not(.primary):hover{
  background:#5a3f0a!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border-color:#e0ad27!important;
}
html body #appView.app-shell:not(.hidden) #content button.primary,
html body #appView.app-shell:not(.hidden) #content input[type="submit"],
html body #authView.auth-page button.primary,
html body .modal button.primary{
  background:linear-gradient(135deg,#e0ad27,#8e5c05)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border:1px solid #e0ad27!important;
  box-shadow:none!important;
}
html body #appView.app-shell:not(.hidden) #content button:disabled,
html body #authView.auth-page button:disabled,
html body .modal button:disabled{
  background:#211604!important;
  color:#9e9274!important;
  -webkit-text-fill-color:#9e9274!important;
  border-color:#5d4511!important;
  opacity:1!important;
}
html body #appView.app-shell:not(.hidden) #content button.daily-row-add-icon,
html body #appView.app-shell:not(.hidden) #content button.daily-line-remove-btn{
  background:#071528!important;
  color:#ffe59b!important;
  -webkit-text-fill-color:#ffe59b!important;
  border-color:#d5a11e!important;
}

/* V18.1 — keep daily ledger text and actions inside their own cells. */
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-wrap{
  min-width:0!important;
  max-width:100%!important;
  overflow:auto!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table col.daily-half-col-sl{width:8%!important}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table col.daily-half-col-desc{width:66%!important}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table col.daily-half-col-money{width:26%!important}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table th,
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table td{
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table .daily-desc-cell{
  position:relative!important;
  width:auto!important;
  padding:6px!important;
  white-space:normal!important;
  vertical-align:top!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table .expense-ledger-text{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  padding:0!important;
  margin:0!important;
  overflow:hidden!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  line-height:1.25!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table .daily-memo-no{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin-top:3px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table .daily-inline-actions{
  position:static!important;
  transform:none!important;
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:3px!important;
  width:100%!important;
  max-width:100%!important;
  margin:4px 0 0!important;
  overflow:hidden!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table .daily-inline-actions .daily-action{
  flex:0 0 18px!important;
  width:18px!important;
  min-width:18px!important;
  max-width:18px!important;
  height:18px!important;
  min-height:18px!important;
  padding:0!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-half-table .daily-money-cell{
  width:auto!important;
  min-width:0!important;
  padding:6px 4px!important;
  overflow:hidden!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:break-all!important;
  text-align:right!important;
  font-size:8.5px!important;
}

/* V18.2 — wider right-side Expense ledger on desktop. */
@media(min-width:1280px){
  html body #appView.app-shell:not(.hidden).daily-mode #content .daily-v14-ledger-split,
  html body #appView.app-shell:not(.hidden).daily-mode #content .daily-ledger-split{
    display:grid!important;
    grid-template-columns:minmax(0,44fr) minmax(0,56fr)!important;
    gap:7px!important;
  }
  html body #appView.app-shell:not(.hidden).daily-mode #content .income-ledger-half,
  html body #appView.app-shell:not(.hidden).daily-mode #content .expense-ledger-half{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
}

/* V18.3 — compact, functional search boxes in the two marked daily-page headers. */
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-v14-toolbar{
  display:grid!important;
  grid-template-columns:minmax(150px, .9fr) minmax(170px, 1.1fr)!important;
  align-items:end!important;
  gap:8px!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-v14-toolbar .daily-form-chip-note{
  display:none!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-entry-search-field,
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-sales-search-field{
  display:grid!important;
  min-width:0!important;
  gap:3px!important;
  margin:0!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-entry-search-field label,
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-sales-search-field span{
  color:#fff4cf!important;
  font-size:9px!important;
  font-weight:800!important;
  line-height:1.1!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content #dailyLedgerSearch,
html body #appView.app-shell:not(.hidden).daily-mode #content #dailySalesSearch{
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  min-width:0!important;
  height:31px!important;
  min-height:31px!important;
  margin:0!important;
  padding:5px 28px 5px 9px!important;
  border:1px solid #d5a11e!important;
  border-radius:7px!important;
  background:#080a0d!important;
  background-image:none!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-size:10px!important;
  box-shadow:none!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content #dailyLedgerSearch::placeholder,
html body #appView.app-shell:not(.hidden).daily-mode #content #dailySalesSearch::placeholder{
  color:#b9ae91!important;
  -webkit-text-fill-color:#b9ae91!important;
  opacity:1!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content #dailyLedgerSearch:focus,
html body #appView.app-shell:not(.hidden).daily-mode #content #dailySalesSearch:focus{
  border-color:#ffd45f!important;
  outline:2px solid rgba(255,212,95,.18)!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-sales-section-head{
  display:grid!important;
  grid-template-columns:max-content minmax(135px,1fr) max-content!important;
  align-items:end!important;
  gap:8px!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content .daily-sales-section-head .daily-sales-search-field{
  width:100%!important;
  max-width:230px!important;
  justify-self:center!important;
}
html body #appView.app-shell:not(.hidden).daily-mode #content tr.daily-search-hidden{
  display:none!important;
}

@media(max-width:760px){
  html body #appView.app-shell:not(.hidden).daily-mode #content .daily-v14-toolbar{
    grid-template-columns:1fr!important;
  }
  html body #appView.app-shell:not(.hidden).daily-mode #content .daily-sales-section-head{
    grid-template-columns:1fr auto!important;
    align-items:end!important;
  }
  html body #appView.app-shell:not(.hidden).daily-mode #content .daily-sales-section-head .daily-sales-search-field{
    grid-column:1 / -1!important;
    grid-row:2!important;
    max-width:none!important;
  }
}

/* V18.4 — shorter, compact Login/Register window while preserving every control. */
@media(min-width:1024px){
  html body #authView.auth-page .auth-split-card:not(.auth-window-maximized):not(.auth-window-free){
    width:min(1026px,calc(100vw - 20px))!important;
    height:min(720px,calc(100vh - 20px))!important;
    min-height:0!important;
    max-height:720px!important;
    border-radius:20px!important;
  }
  html body #authView.auth-page .auth-showcase{
    padding:22px 28px!important;
  }
  html body #authView.auth-page .auth-showcase-content{
    margin-top:8px!important;
  }
  html body #authView.auth-page .auth-showcase .brand-icon{
    width:52px!important;
    height:52px!important;
    border-radius:14px!important;
  }
  html body #authView.auth-page .auth-showcase h1{
    margin:14px 0 6px!important;
    font-size:34px!important;
    line-height:1.08!important;
  }
  html body #authView.auth-page .auth-showcase p{
    margin:0 0 13px!important;
    font-size:14px!important;
    line-height:1.4!important;
  }
  html body #authView.auth-page .auth-feature{
    margin:6px 0!important;
    padding:8px 11px!important;
    border-radius:10px!important;
    font-size:12px!important;
    line-height:1.25!important;
  }
  html body #authView.auth-page .auth-control-panel{
    padding:10px 16px 8px!important;
    overflow-y:auto!important;
  }
  html body #authView.auth-page .auth-installer-center{
    margin:0 0 7px!important;
    padding:7px!important;
    border-radius:10px!important;
  }
  html body #authView.auth-page .auth-installer-head{
    margin-bottom:5px!important;
  }
  html body #authView.auth-page .auth-installer-head b{font-size:12px!important}
  html body #authView.auth-page .auth-installer-head small,
  html body #authView.auth-page .auth-installer-head .platform-hint{font-size:8px!important}
  html body #authView.auth-page .auth-device-grid{gap:5px!important}
  html body #authView.auth-page .auth-device-card{
    min-height:54px!important;
    padding:5px 2px!important;
    gap:2px!important;
    border-radius:7px!important;
  }
  html body #authView.auth-page .auth-device-card span{font-size:16px!important}
  html body #authView.auth-page .auth-device-card b{font-size:9px!important}
  html body #authView.auth-page .auth-device-card small{font-size:7px!important}
  html body #authView.auth-page .auth-guide-row{
    gap:6px!important;
    margin-top:4px!important;
  }
  html body #authView.auth-page .auth-guide-row button{
    min-height:0!important;
    font-size:7px!important;
    line-height:1.1!important;
  }
  html body #authView.auth-page .auth-tabs{
    margin:0 0 7px!important;
    padding:3px!important;
    border-radius:9px!important;
  }
  html body #authView.auth-page .auth-tab{
    min-height:30px!important;
    padding:6px!important;
    border-radius:7px!important;
    font-size:12px!important;
  }
  html body #authView.auth-page .auth-form{gap:5px!important}
  html body #authView.auth-page .auth-heading h2{
    margin:2px 0!important;
    font-size:20px!important;
    line-height:1.15!important;
  }
  html body #authView.auth-page .auth-heading p,
  html body #authView.auth-page .auth-heading .login-demo-notice{
    margin:0 0 2px!important;
    font-size:10px!important;
    line-height:1.25!important;
  }
  html body #authView.auth-page .auth-form label{
    font-size:12px!important;
    line-height:1.15!important;
  }
  html body #authView.auth-page .auth-form input{
    min-height:36px!important;
    height:36px!important;
    margin-top:3px!important;
    padding:7px 10px!important;
    border-radius:8px!important;
    font-size:13px!important;
  }
  html body #authView.auth-page .auth-form .primary,
  html body #authView.auth-page #demoLoginBtn{
    min-height:36px!important;
    padding:7px 10px!important;
    border-radius:8px!important;
    font-size:13px!important;
  }
  html body #authView.auth-page .login-installer-files{
    margin-top:4px!important;
    padding:6px!important;
    border-radius:8px!important;
  }
  html body #authView.auth-page .login-installer-title{
    margin-bottom:4px!important;
  }
  html body #authView.auth-page .login-installer-grid{gap:4px!important}
  html body #authView.auth-page .login-installer-btn{
    min-height:27px!important;
    padding:4px 5px!important;
    border-radius:6px!important;
    font-size:8px!important;
  }
  html body #authView.auth-page .login-installer-note{
    margin-top:4px!important;
    font-size:7px!important;
    line-height:1.25!important;
  }
  html body #authView.auth-page .auth-status{
    margin:5px 0 0!important;
    padding:6px 8px!important;
  }
  html body #authView.auth-page .local-note{
    margin:5px 0 3px!important;
    padding:6px 8px!important;
    border-radius:7px!important;
    font-size:8px!important;
    line-height:1.25!important;
  }
  html body #authView.auth-page .auth-footer{
    margin-top:3px!important;
    font-size:8px!important;
  }
}

/* V18.5 — compact Login window border positioning. */
@media(min-width:1024px){
  html body #authView.auth-page{
    place-items:center!important;
    padding:10px!important;
  }
  html body #authView.auth-page .auth-split-card:not(.auth-window-maximized):not(.auth-window-free){
    margin:0 auto!important;
    border-radius:20px!important;
  }
}

/* V18.6 — center the Normal Login window and lock resize anchors to its border. */
@media(min-width:1024px){
  html body #authView.auth-page .auth-split-card:not(.auth-window-maximized):not(.auth-window-free){
    align-self:center!important;
    justify-self:center!important;
  }
  html body #authView.auth-page .auth-resize-handle.s{bottom:0!important}
  html body #authView.auth-page .auth-resize-handle.e{right:0!important}
  html body #authView.auth-page .auth-resize-handle.w{left:0!important}
  html body #authView.auth-page .auth-resize-handle.n{top:0!important}
  html body #authView.auth-page .auth-resize-handle.se{right:0!important;bottom:0!important}
  html body #authView.auth-page .auth-resize-handle.sw{left:0!important;bottom:0!important}
  html body #authView.auth-page .auth-resize-handle.ne{right:0!important;top:0!important}
  html body #authView.auth-page .auth-resize-handle.nw{left:0!important;top:0!important}
  html body #authView.auth-page .auth-resize-handle.se::after{
    right:5px!important;
    bottom:5px!important;
  }
}

/* V18.7 — Login stays shorter; Register grows downward to contain every field. */
@media(min-width:1024px){
  html body #authView.auth-page .auth-split-card:not(.auth-window-maximized):not(.auth-window-free):has(#loginForm:not(.hidden)){
    height:min(640px,calc(100vh - 20px))!important;
    max-height:640px!important;
  }
  html body #authView.auth-page .auth-split-card:not(.auth-window-maximized):not(.auth-window-free):has(#registerForm:not(.hidden)){
    height:min(700px,calc(100vh - 20px))!important;
    max-height:700px!important;
  }
}
