/* ============================================================
   HYDROTECH V32 — REFERENCE LOCKED ENTERPRISE UI
   Target: approved Hydrotech dashboard reference.
   No shadows. Strong hierarchy. Colored navigation groups.
   Overflow-safe on 1366–1920 desktop and responsive screens.
   ============================================================ */
:root{
  --v32-blue:#085291;
  --v32-blue-2:#0b6eaf;
  --v32-slate:#68737A;
  --v32-anth:#273238;
  --v32-red:#c64045;
  --v32-cyan:#17a9c3;
  --v32-green:#169c6c;
  --v32-amber:#d9942e;
  --v32-line:#d9e6ed;
  --v32-bg:#f3f8fb;
  --sidebar:226px!important;
}

/* ---------- global safety / typography ---------- */
html.app-active,html.app-active body{overflow-x:hidden!important}
html.app-active body,
html.app-active button,
html.app-active input,
html.app-active select,
html.app-active textarea{
  font-family:"Segoe UI Variable Text","Segoe UI",Inter,Arial,sans-serif!important;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}
html.app-active *,html.app-active *::before,html.app-active *::after{box-sizing:border-box}
html.app-active .main-shell,
html.app-active .content,
html.app-active .page-head,
html.app-active .page-head>*,
html.app-active .grid,
html.app-active .grid>*,
html.app-active .card,
html.app-active .card-head,
html.app-active .card-body,
html.app-active .table-card,
html.app-active .topbar,
html.app-active .topbar>*{min-width:0!important}
html.app-active .content{overflow-x:clip!important;padding:18px 20px 34px!important}
html.app-active h1,html.app-active h2,html.app-active h3,html.app-active h4,
html.app-active .page-title,html.app-active .welcome,html.app-active .card-title,
html.app-active .metric-label,html.app-active .section-title{
  line-height:1.28!important;
  overflow-wrap:break-word;
  word-break:normal;
}
html.app-active .page-sub,html.app-active .welcome-sub,html.app-active .muted,
html.app-active .card-title small,html.app-active .metric-sub{line-height:1.42!important}

/* ---------- shell / sidebar ---------- */
@media(min-width:761px){
  html.app-active #appShell.app-shell{grid-template-columns:226px minmax(0,1fr)!important}
  html.app-active #appShell>.sidebar{width:226px!important;min-width:226px!important;max-width:226px!important}
}
html.app-active .sidebar{background:#fbfdfe!important;border-right:1px solid #d4e2ea!important}
html.app-active .sidebar-brand{height:76px!important;padding:18px 17px!important;border-bottom:1px solid #e1ebf0!important}
html.app-active .nav{padding:8px 9px 16px!important;overflow-x:hidden!important}
html.app-active .nav-section{
  min-height:22px!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  margin:10px 0 4px!important;
  padding:0 10px 0 13px!important;
  font-size:10.5px!important;
  font-weight:400!important;
  line-height:1.2!important;
  letter-spacing:.04em!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
  position:relative!important;
}
html.app-active .nav-section::before{content:"";position:absolute;left:4px;top:4px;bottom:4px;width:4px;border-radius:5px;background:currentColor}
html.app-active .nav-section-general{color:var(--v32-blue)!important}
html.app-active .nav-section-sales{color:#0a66ad!important}
html.app-active .nav-section-purchase{color:#8b6a2e!important}
html.app-active .nav-section-stock{color:var(--v32-slate)!important}
html.app-active .nav-section-shipping{color:#168ca5!important}
html.app-active .nav-section-invoice{color:#315b86!important}
html.app-active .nav-section-finance{color:var(--v32-red)!important}
html.app-active .nav-section-accounting{color:var(--v32-anth)!important}
html.app-active .nav-section-management{color:#5e6a71!important}
html.app-active .nav-item{
  min-height:38px!important;height:auto!important;
  border-radius:9px!important;padding:8px 10px!important;margin:1px 0!important;
  gap:9px!important;color:#526978!important;font-size:11.7px!important;font-weight:400!important;
  line-height:1.2!important;overflow:hidden!important
}
html.app-active .nav-item>span:first-child{flex:0 0 18px!important;display:grid!important;place-items:center!important;color:#68859a!important}
html.app-active .nav-item .nav-label{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
html.app-active .nav-item .count{flex:0 0 auto!important}
html.app-active .nav-item.active{font-weight:400!important;background:#e7f2f8!important;color:var(--v32-blue)!important}
html.app-active .nav-item.active::before{left:-9px!important;width:4px!important;top:5px!important;bottom:5px!important}
html.app-active .nav-group-finance.active{background:#fff0f0!important;color:#a72f35!important}
html.app-active .nav-group-finance.active::before{background:var(--v32-red)!important}
html.app-active .nav-group-accounting.active{background:#eef1f2!important;color:var(--v32-anth)!important}
html.app-active .nav-group-accounting.active::before{background:var(--v32-anth)!important}
html.app-active .nav-group-purchase.active{background:#fff7e9!important;color:#88611f!important}
html.app-active .nav-group-purchase.active::before{background:var(--v32-amber)!important}
html.app-active .nav-group-shipping.active{background:#eaf8fb!important;color:#127d92!important}
html.app-active .nav-group-shipping.active::before{background:var(--v32-cyan)!important}
html.app-active .sidebar-foot{padding:8px!important}
html.app-active .developed{padding:9px 10px!important;border-radius:10px!important}
html.app-active .developed strong{font-size:17px!important;line-height:1.1!important}

/* ---------- topbar ---------- */
html.app-active .topbar{height:72px!important;padding:0 18px!important;gap:10px!important}
html.app-active .global-search{height:42px!important;max-width:720px!important;font-size:12px!important}
html.app-active .top-actions{min-width:0!important;gap:7px!important}
html.app-active .profile{max-width:180px!important;min-width:0!important}
html.app-active .profile>span:nth-child(2){min-width:0!important}
html.app-active .profile strong,html.app-active .profile small{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
@media(max-width:1320px) and (min-width:761px){html.app-active .rate-chip{display:none!important}.profile{max-width:150px!important}}

/* ---------- dashboard hero ---------- */
html.app-active .dashboard-head{
  min-height:116px!important;
  padding:20px 22px!important;
  border:1px solid #d4e4ec!important;
  border-radius:17px!important;
  background:
    radial-gradient(circle at 83% 18%,rgba(23,169,195,.13),transparent 23%),
    linear-gradient(108deg,#ffffff 0%,#f7fbfd 55%,#e8f5fa 100%)!important;
  position:relative!important;overflow:hidden!important;align-items:center!important;
}
html.app-active .dashboard-head::before{
  content:"";position:absolute!important;inset:auto -10% -82% 44%!important;height:185%!important;
  border:1px solid rgba(8,82,145,.12)!important;border-radius:50%!important;transform:rotate(-10deg)!important;background:transparent!important
}
html.app-active .dashboard-head::after{content:"";position:absolute;right:17%;top:23%;width:39%;height:1px;background:linear-gradient(90deg,transparent,rgba(8,82,145,.18),transparent);transform:rotate(-10deg)}
html.app-active .dashboard-copy{position:relative;z-index:4;max-width:600px!important}
html.app-active .welcome{font-size:29px!important;font-weight:400!important;letter-spacing:-.75px!important;margin:0 0 4px!important;color:#182e3c!important}
html.app-active .welcome span{font-weight:400!important;color:#0f2940!important}
html.app-active .welcome-sub{font-size:13px!important;color:#667d8d!important}
html.app-active .dashboard-visual{position:absolute;z-index:2;right:12.5%;top:0;width:34%;height:100%;pointer-events:none;overflow:hidden}
html.app-active .dashboard-visual img{position:absolute;right:14%;bottom:-48%;width:48%;max-height:190px;object-fit:contain;opacity:.55;filter:saturate(.78)}
html.app-active .dashboard-visual span{position:absolute;right:0;top:24%;font-size:12px;line-height:1.45;color:#3471a0;font-weight:400;text-align:left}
html.app-active .dashboard-actions{position:relative!important;z-index:5!important;margin-left:auto!important;align-self:flex-start!important}
html.app-active .dashboard-actions .btn{height:38px!important;background:#fff!important}
@media(max-width:1180px) and (min-width:761px){html.app-active .dashboard-visual{opacity:.58;right:3%;width:40%}.dashboard-visual span{display:none!important}.dashboard-actions{max-width:270px!important;justify-content:flex-end!important}}

/* ---------- KPI cards ---------- */
html.app-active .kpi-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:11px!important;margin:11px 0!important}
html.app-active .metric-card{
  min-height:142px!important;padding:15px 15px 13px!important;border-radius:14px!important;border:1px solid #d7e4ea!important;
  background:#fff!important;position:relative!important;overflow:hidden!important;display:block!important
}
html.app-active .metric-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--v32-blue)}
html.app-active .metric-card::after{content:"";position:absolute;right:-36px;bottom:-45px;width:108px;height:108px;border-radius:50%;background:#f2f7f9;z-index:0}
html.app-active .metric-purple::before{background:var(--v32-slate)!important}.metric-green::before{background:var(--v32-green)!important}.metric-orange::before{background:var(--v32-amber)!important}.metric-cyan::before{background:var(--v32-cyan)!important}.metric-red::before{background:var(--v32-red)!important}
html.app-active .metric-head,html.app-active .metric-body{position:relative;z-index:2}
html.app-active .metric-head{display:flex!important;align-items:center!important;gap:9px!important}
html.app-active .metric-icon{width:39px!important;height:39px!important;border-radius:11px!important;flex:0 0 39px!important}
html.app-active .metric-label{font-size:11.8px!important;font-weight:400!important;color:#354b58!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html.app-active .metric-trend{margin-left:auto!important;flex:0 0 auto!important;font-size:9.4px!important;padding:4px 7px!important}
html.app-active .metric-body{margin-top:8px!important;max-width:66%!important}
html.app-active .metric-value{font-size:25px!important;line-height:1.05!important;font-weight:400!important;letter-spacing:-.4px!important;color:#132f42!important;white-space:nowrap!important}
html.app-active .metric-sub{font-size:9.8px!important;color:#7b8e9a!important;margin-top:7px!important;display:block!important}
html.app-active .metric-spark{position:absolute;z-index:2;right:13px;bottom:14px;height:52px;width:76px;display:flex;align-items:flex-end;justify-content:flex-end;gap:4px;color:var(--v32-blue)}
html.app-active .metric-spark i{display:block;width:6px;min-height:8px;border-radius:4px 4px 1px 1px;background:currentColor;opacity:.72}
html.app-active .metric-purple .metric-spark{color:var(--v32-slate)}.metric-green .metric-spark{color:var(--v32-green)}.metric-orange .metric-spark{color:var(--v32-amber)}.metric-cyan .metric-spark{color:var(--v32-cyan)}.metric-red .metric-spark{color:var(--v32-red)}
@media(max-width:1380px) and (min-width:1101px){html.app-active .metric-value{font-size:22px!important}.metric-label{font-size:10.7px!important}.metric-spark{width:60px!important}}
@media(max-width:1100px) and (min-width:761px){html.app-active .kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}

/* ---------- dashboard panels ---------- */
html.app-active .dash-main{grid-template-columns:minmax(0,1.75fr) minmax(300px,.72fr)!important;gap:11px!important;margin-bottom:11px!important}
html.app-active .panel-stack{gap:11px!important}
html.app-active .card,html.app-active .table-card,html.app-active .info-card{border:1px solid #d8e5eb!important;border-radius:14px!important;background:#fff!important;box-shadow:none!important}
html.app-active .card-head{min-height:51px!important;padding:9px 14px!important;border-bottom:1px solid #e5edf1!important;gap:10px!important}
html.app-active .card-title{font-size:13.2px!important;font-weight:400!important;color:#253c49!important;letter-spacing:-.12px!important}
html.app-active .card-title small{font-size:9.7px!important;font-weight:450!important;color:#7f919c!important;margin-top:2px!important}
html.app-active .card-body{padding:13px 14px!important}
html.app-active .sales-panel{min-height:330px!important}
html.app-active .chart-summary strong{font-size:27px!important;font-weight:400!important;color:#142f41!important}
html.app-active .chart-summary span{font-size:9.4px!important;font-weight:400!important;color:var(--v32-green)!important;background:#eaf8f2!important}
html.app-active .bar-chart{height:205px!important;gap:23px!important;background:repeating-linear-gradient(to top,transparent 0 40px,#edf3f6 41px 42px)!important}
html.app-active .bar.light{background:#bfe2f3!important}.bar.dark{background:var(--v32-blue)!important}
html.app-active .bar{width:18px!important;border-radius:4px 4px 0 0!important}
html.app-active .bar-col label{font-size:9.6px!important;color:#738691!important;bottom:-25px!important}
html.app-active .chart-legend{display:flex;align-items:center;gap:18px;margin-top:27px;font-size:9.5px;color:#657a87;font-weight:400}
html.app-active .chart-legend span{display:flex;align-items:center;gap:6px}.legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.legend-dot.light{background:#8dd4ee}.legend-dot.dark{background:var(--v32-blue)}
html.app-active .funnel-row{font-size:10px!important;grid-template-columns:minmax(90px,120px) minmax(70px,1fr) 32px!important;gap:8px!important}
html.app-active .progress{height:7px!important}.progress>span{background:linear-gradient(90deg,var(--v32-blue),var(--v32-cyan))!important}
html.app-active .donut-wrap{gap:14px!important}.donut{width:132px!important;height:132px!important}.donut:after{inset:25px!important}
html.app-active .dash-bottom{grid-template-columns:1.08fr 1.08fr 1.15fr!important;gap:11px!important}
html.app-active .activity-item,html.app-active .task-item{min-height:48px!important;padding:7px 0!important}
html.app-active .activity-item strong,html.app-active .task-item strong{font-size:10.8px!important;font-weight:400!important;line-height:1.28!important}
html.app-active .activity-item small,html.app-active .task-item small{font-size:9.2px!important;line-height:1.3!important}

/* ---------- page headers / all interior screens ---------- */
html.app-active .page-head:not(.dashboard-head){position:relative!important;padding:16px 18px 16px 20px!important;border-radius:14px!important;background:#fff!important;border:1px solid #dbe7ed!important;overflow:hidden!important}
html.app-active .page-head:not(.dashboard-head)::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--v32-blue)}
html.app-active .page-title{font-size:25px!important;font-weight:400!important;letter-spacing:-.45px!important;color:#183244!important;margin:3px 0 4px!important}
html.app-active .page-sub{font-size:12.2px!important;color:#6e8290!important;max-width:780px!important}
html.app-active .eyebrow{font-size:9.2px!important;font-weight:400!important;letter-spacing:.12em!important;color:var(--v32-blue)!important}
html.app-active .page-actions{max-width:48%!important;justify-content:flex-end!important}
html.app-active .btn{min-height:36px!important;height:auto!important;padding:8px 13px!important;font-size:10.8px!important;font-weight:400!important;line-height:1.2!important;white-space:nowrap!important}
html.app-active .btn.primary{background:var(--v32-blue)!important;border-color:var(--v32-blue)!important}

/* ---------- strong content components ---------- */
html.app-active .mini-stat{min-height:86px!important;padding:13px 14px 12px 16px!important}
html.app-active .mini-stat small{font-size:9.7px!important;font-weight:400!important}.mini-stat strong{font-size:21px!important;font-weight:400!important}
html.app-active .info-card h3,html.app-active .mapping-card h3,html.app-active .migration-source h2{font-size:13.5px!important;font-weight:400!important;line-height:1.3!important;color:#253f4d!important}
html.app-active .big-money{font-size:27px!important;font-weight:400!important}
html.app-active .notice-bar strong{font-size:12.4px!important;font-weight:400!important}.notice-bar small{font-size:10px!important;line-height:1.4!important}
html.app-active .section-title{font-size:12.5px!important;font-weight:400!important;color:#294452!important}

/* ---------- tables / forms / modal overflow safety ---------- */
html.app-active .table-card{max-width:100%!important;overflow:hidden!important}
html.app-active .table-scroll{display:block!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:visible!important;-webkit-overflow-scrolling:touch!important}
html.app-active .table-scroll table{width:100%!important;min-width:720px!important;border-collapse:collapse!important}
html.app-active .dash-bottom .table-scroll table{min-width:500px!important}
html.app-active th{font-size:9.5px!important;font-weight:400!important;line-height:1.25!important;padding:11px 10px!important;white-space:nowrap!important}
html.app-active td{font-size:10.7px!important;line-height:1.35!important;padding:10px!important;vertical-align:middle!important}
html.app-active td .tag{max-width:100%!important}
html.app-active .tag{min-height:22px!important;height:auto!important;padding:4px 8px!important;font-size:9px!important;font-weight:400!important;line-height:1.15!important;white-space:nowrap!important}
html.app-active .form-grid,html.app-active .detail-grid,html.app-active .mapping-grid,html.app-active .migration-stats{grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr))!important}
html.app-active .field,html.app-active .detail-cell,html.app-active .mapping-grid>div,html.app-active .migration-stats>div{min-width:0!important}
html.app-active .field label{font-size:10px!important;font-weight:400!important;line-height:1.3!important;margin-bottom:5px!important}
html.app-active .input,html.app-active .select,html.app-active .textarea{width:100%!important;max-width:100%!important;min-width:0!important;font-size:11px!important;line-height:1.35!important}
html.app-active .modal,html.app-active .drawer{max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important}
html.app-active .modal-body,html.app-active .drawer-body{overflow:auto!important;min-width:0!important}
html.app-active .modal-title{min-width:0!important}.modal-title>div{min-width:0!important}.modal-title strong,.modal-title small{white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.3!important}
html.app-active .modal-title strong{font-size:13px!important;font-weight:400!important}
html.app-active .modal-title small{font-size:9.5px!important}
html.app-active .modal-tabs{overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;scrollbar-width:thin!important}
html.app-active .tab-btn{flex:0 0 auto!important;line-height:1.25!important}

/* ---------- generic long-text safety ---------- */
html.app-active .entity,html.app-active .account-row,html.app-active .statement-list>div,html.app-active .timeline-row{min-width:0!important}
html.app-active .entity>div,html.app-active .account-row>div,html.app-active .timeline-row>div{min-width:0!important}
html.app-active .entity strong,html.app-active .entity small,html.app-active .account-row strong,html.app-active .account-row small{overflow-wrap:anywhere!important;line-height:1.35!important}
html.app-active .integration-hero{min-width:0!important;gap:18px!important}.integration-hero>div{min-width:0!important}.integration-hero p{overflow-wrap:anywhere!important}

/* ---------- responsive ---------- */
@media(max-width:1250px) and (min-width:761px){
  :root{--sidebar:214px!important}
  html.app-active #appShell.app-shell{grid-template-columns:214px minmax(0,1fr)!important}
  html.app-active #appShell>.sidebar{width:214px!important;min-width:214px!important;max-width:214px!important}
  html.app-active .content{padding:16px!important}
  html.app-active .kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html.app-active .dash-main{grid-template-columns:1fr!important}
  html.app-active .dash-bottom{grid-template-columns:1fr 1fr!important}
  html.app-active .dashboard-head{min-height:108px!important}
}
@media(max-width:900px) and (min-width:761px){html.app-active .dash-bottom{grid-template-columns:1fr!important}}
@media(max-width:760px){
  html.app-active .content{padding:12px 10px 28px!important;overflow-x:hidden!important}
  html.app-active .dashboard-head{min-height:150px!important;padding:16px!important;align-items:flex-start!important}
  html.app-active .dashboard-visual{display:none!important}
  html.app-active .dashboard-actions{position:absolute!important;left:16px!important;right:16px!important;bottom:12px!important;max-width:none!important;justify-content:flex-start!important;overflow-x:auto!important;flex-wrap:nowrap!important}
  html.app-active .welcome{font-size:24px!important}.page-title{font-size:22px!important}
  html.app-active .kpi-grid{grid-template-columns:1fr 1fr!important;gap:9px!important}
  html.app-active .metric-card{min-height:132px!important}.metric-value{font-size:22px!important}.metric-spark{width:58px!important}
  html.app-active .dash-main,html.app-active .dash-bottom{grid-template-columns:1fr!important}
  html.app-active .page-head:not(.dashboard-head){display:block!important}.page-actions{max-width:100%!important;justify-content:flex-start!important;margin-top:12px!important;overflow-x:auto!important;flex-wrap:nowrap!important}
  html.app-active .table-scroll table{min-width:660px!important}
  html.app-active .modal,html.app-active .drawer{max-width:100vw!important;max-height:100dvh!important;border-radius:0!important}
}
@media(max-width:480px){
  html.app-active .kpi-grid{grid-template-columns:1fr!important}
  html.app-active .metric-card{min-height:124px!important}
  html.app-active .metric-body{max-width:70%!important}
}
