/* Glowbal Dashboard UI2 – contrast correction overlay for the installed UI1.
   Loaded LAST. No API, DB, GRN calculations or navigation changes.
   Surfaces are explicitly paired with readable text colors. */
:root{
 --g-ui2-ink:#221c24; --g-ui2-secondary:#514751; --g-ui2-muted:#665b65;
 --g-ui2-light:#ffffff; --g-ui2-soft:#fcfafb; --g-ui2-line:#e4d4da;
 --g-ui2-dark:#1d1a1e; --g-ui2-ink-on-dark:#fff6f8;
 --g-ui2-muted-on-dark:#e5cbd4; --g-ui2-red:#b50c2e;
}
/* Light workspace and panels. Explicit text colors beat earlier dark-theme heading rules. */
#app .content, #app .content>.view{color:var(--g-ui2-ink)!important}
#app .content>.view h1,#app .content>.view h2,#app .content>.view h3,
#app .content>.view h4,#app .gg-intro h2,#app .gg-insights-head h3,
#app .gg-panel h4,#app .content .panel>h2,#app .content .panel-head h2{
 color:var(--g-ui2-ink)!important;opacity:1!important;text-shadow:none!important;
}
#app .gg-intro p,#app .gg-scope,#app .gg-empty,#app .gg-legend,
#app .gg-bar-head,#app .gg-bar-row>span,#app .gg-panel p,
#app .gg-stat span,#app .content .panel p,
#app .content>.view .grn-report-subtitle,#app .content>.view .grn-report-note,
#app .content>.view .grn-selection-count{
 color:var(--g-ui2-secondary)!important;opacity:1!important;
}
/* Overview injected insight panels must be light AND legible; the former panels were
   dark with white type, now UI1 makes them pale but retained faded heading colors. */
#app .gg-panel,#app .gg-stat{
 background:rgba(255,255,255,.96)!important;color:var(--g-ui2-ink)!important;
 border-color:var(--g-ui2-line)!important;
}
#app .gg-stat strong,#app .gg-panel strong,#app .gg-bar-row strong{
 color:var(--g-ui2-ink)!important;opacity:1!important;
}
#app .gg-ring-core{background:#39101e!important;color:#fff!important}
#app .gg-track{background:#eadde2!important}
#app .gg-scope{background:#fff!important;border-color:#debfc9!important}
/* Other light card families whose typography previously inherited the dark palette. */
#app .view .panel,#app .view .card,#app .view .grn-report-section,
#app .view .grn-shipment-picker,#app .view .grn-analytics-panel,
#app .view .grn-analytics-metrics>div{
 background:rgba(255,255,255,.96)!important;color:var(--g-ui2-ink)!important;
 border-color:var(--g-ui2-line)!important;
}
#app .view .grn-report-section h2,#app .view .grn-report-section h3,
#app .view .grn-analytics-panel h2,#app .view .grn-analytics-panel h3,
#app .view .grn-analytics-metrics strong,#app .view .grn-analytics-metrics span,
#app .view .grn-report-shipment-info strong{
 color:var(--g-ui2-ink)!important;opacity:1!important;
}
#app .view .grn-analytics-metrics span{color:var(--g-ui2-secondary)!important}
/* The GRN summary was rendered as raw strong+span pairs; UI2 creates clear tiles. */
#app .view .metrics.grn-metrics{
 display:grid!important;grid-template-columns:repeat(auto-fit,minmax(160px,1fr))!important;
 gap:10px!important;margin:16px 0 22px!important;
}
#app .view .metrics.grn-metrics>div{
 display:flex!important;flex-direction:column!important;align-items:flex-start!important;
 justify-content:center!important;gap:4px!important;min-width:0!important;
 border:1px solid var(--g-ui2-line)!important;background:#fff!important;
 border-radius:12px!important;padding:12px 14px!important;
 overflow-wrap:anywhere!important;
}
#app .view .metrics.grn-metrics>div>strong{
 color:var(--g-ui2-ink)!important;font-size:clamp(18px,1.55vw,24px)!important;
 font-weight:800!important;line-height:1.2!important;
}
#app .view .metrics.grn-metrics>div>span{
 color:var(--g-ui2-secondary)!important;font-size:12px!important;line-height:1.45!important;
}
/* Carton cards have truly dark surfaces; retain them and fix their near-black labels. */
#app .view .grn-carton-card{
 background:#1f1e21!important;color:var(--g-ui2-ink-on-dark)!important;
 border-color:#4b4045!important;border-left:4px solid #e21b43!important;
 min-width:0!important;
}
#app .view .grn-carton-card>strong,#app .view .grn-carton-card>span,
#app .view .grn-carton-card>small,#app .view .grn-carton-card h3{
 color:var(--g-ui2-ink-on-dark)!important;opacity:1!important;overflow-wrap:anywhere;
}
#app .view .grn-carton-card>small{color:var(--g-ui2-muted-on-dark)!important}
#app .view .grn-carton-card .grn-carton-progress>span{
 background:#350c17!important;border:1px solid #60404b!important;
 color:#fff!important;min-width:0!important;
}
#app .view .grn-carton-progress b{color:#fff!important;opacity:1!important}
#app .view .grn-carton-progress .ok b{color:#7ef2aa!important}
#app .view .grn-carton-progress .warn b{color:#ffce72!important}
#app .view .grn-carton-progress .bad b{color:#ff9aa9!important}
#app .view .grn-carton-progress small{color:#f0dce3!important;opacity:1!important}
#app .view .grn-pill{color:#fff!important;opacity:1!important}
/* Preserve dark KPI cards, make their labels and numbers white. */
#app .view .metric,#app .view .stats-card{
 background:linear-gradient(135deg,#6c2439,#35111e)!important;
 color:var(--g-ui2-ink-on-dark)!important;border-color:#8b4056!important;
}
#app .view .metric span,#app .view .stats-card span,#app .view .metric small{
 color:var(--g-ui2-muted-on-dark)!important;opacity:1!important;
}
#app .view .metric b,#app .view .metric strong,#app .view .stats-card b,
#app .view .stats-card strong{color:#fff!important;opacity:1!important}
/* Dark gradient report cards: contrast is intentionally opposite to white panels. */
#app .view .operation-card,#app .view .progress-card,#app .view .category-card{
 color:var(--g-ui2-ink-on-dark)!important;
}
#app .view .operation-card h3,#app .view .operation-card p,
#app .view .progress-card h3,#app .view .category-card h3{
 color:var(--g-ui2-ink-on-dark)!important;opacity:1!important;
}
#app .view .operation-card small,#app .view .operation-card .subtext{
 color:var(--g-ui2-muted-on-dark)!important;
}
/* Ensure dark GRN tools and row-detail flyouts retain light typography. */
#app .view .grn-carton-filter,#app .view .grn-bulk-toolbar,
#app .view .grn-row-details,#app .view .grn-filter,
#app .view .grn-issues,#app .view .grn-field-row{
 background:#31121c!important;color:#fff4f6!important;
}
#app .view .grn-carton-filter label,#app .view .grn-bulk-toolbar label,
#app .view .grn-row-details span,#app .view .grn-row-details small,
#app .view .grn-issues label{color:#fff1f4!important}
/* Tables, fields and modal surfaces are light in UI1. */
#app .view th,#app .view table thead th{color:#4a2835!important;background:#f6edf1!important}
#app .view td{color:var(--g-ui2-ink)!important}
#app .view label,#app .permission-grid label{color:var(--g-ui2-ink)!important}
#app .view input:not([type=checkbox]):not([type=radio]),
#app .view select,#app .view textarea,
dialog input:not([type=checkbox]):not([type=radio]),dialog select,dialog textarea{
 color:var(--g-ui2-ink)!important;background:#fff!important;
 border-color:#bfabb5!important;
}
#app .view :is(input,textarea)::placeholder,dialog :is(input,textarea)::placeholder{
 color:#665d66!important;opacity:1!important;
}
#app .view option,dialog option{color:#201a20!important;background:#fff!important}
dialog,dialog .panel,dialog .card{color:var(--g-ui2-ink)!important;background:#fcfafb!important}
dialog h1,dialog h2,dialog h3,dialog h4,dialog p,dialog label,dialog small{
 color:var(--g-ui2-ink)!important;opacity:1!important;
}
/* Status colors must stay semantic and readable. */
#app .view .status,#app .view .ok{color:#12683c!important}
#app .view .bad,#app .view .error{color:#ad1231!important}
#app .view .grn-carton-card .bad{color:#ffacb8!important}
#app .view .grn-carton-card .ok{color:#8af2b4!important}
#app aside .account,#app aside nav button{color:#fff0f3!important}
#app :is(button,a,input,select,textarea):focus-visible,dialog :is(button,input,select,textarea):focus-visible{
 outline:3px solid #ffbf50!important;outline-offset:2px!important;
}
#app :is(button,.secondary):disabled{opacity:.65;cursor:not-allowed}
@media(max-width:700px){#app .view .metrics.grn-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:420px){#app .view .metrics.grn-metrics{grid-template-columns:1fr!important}}
