@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
:root{--orange:#ff5a1f;--orange-dark:#e94b12;--ink:#142232;--muted:#66778b;--line:#ffd0bd;--soft:#fff5ef;--bg:#fffdfb;--green:#14865c;--red:#d9485f;--shadow:0 7px 24px rgba(74,42,22,.06)}
*{box-sizing:border-box}body{margin:0;background:linear-gradient(180deg,#fff 0%,#fffaf6 100%);color:var(--ink);font-family:Inter,Arial,sans-serif;font-size:14px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 30px;border-bottom:1px solid #f2e8e2;background:#fff;position:sticky;top:0;z-index:5}.brand{display:flex;align-items:center;gap:20px;color:inherit;text-decoration:none}.brand-logo{display:block;width:200px;height:auto;max-height:82px;object-fit:contain;object-position:left center;flex:0 0 auto}.brand-divider{height:58px;width:2px;background:#202020}.brand strong{display:block;font-size:clamp(24px,3vw,42px);letter-spacing:.5px;line-height:1.05;color:var(--orange);font-weight:900}.brand small{display:block;font-size:15px;color:#52677e;margin-top:5px}.top-actions{display:flex;align-items:center;gap:12px}.page{max-width:1600px;margin:auto;padding:24px 30px 44px;min-height:75vh}.button{border:1px solid transparent;border-radius:11px;padding:11px 17px;font:600 14px Inter,Arial,sans-serif;cursor:pointer;transition:.18s}.button:hover{transform:translateY(-1px)}.button.primary{background:var(--orange);color:#fff;box-shadow:0 4px 10px #ff5a1f2a}.button.primary:hover{background:var(--orange-dark)}.button.outline{background:#fff;color:var(--orange);border-color:var(--orange)}.button.outline:hover{background:var(--soft)}.full{width:100%}.clock-panel{display:flex;justify-content:center;max-width:520px;margin:4px auto 22px;border:1px solid var(--orange);border-radius:16px;background:#fffaf7;padding:15px 18px;gap:18px}.clock-side{display:flex;align-items:center;gap:12px;flex:1;min-width:0}.clock-side+.clock-side{border-left:1px solid #ff9b75;padding-left:18px}.flag{font-size:26px}.clock-side b,.clock-side small{display:block}.clock-side b{font-size:13px}.clock-side strong{display:block;font-size:clamp(22px,2.5vw,34px);letter-spacing:1px;margin:4px 0}.clock-side small{color:var(--muted)}.section-title{font-size:clamp(21px,2.5vw,30px);border-left:5px solid var(--orange);padding-left:14px;margin:20px 0 14px;letter-spacing:-.5px}.department-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.department-card{min-height:275px;border:1px solid var(--orange);border-radius:14px;background:#fff;display:flex;flex-direction:column;align-items:center;text-align:center;padding:18px 15px 16px;color:var(--ink);text-decoration:none;box-shadow:0 2px 0 rgba(255,90,31,.02);transition:transform .18s,box-shadow .18s}.department-card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}.dept-icon{width:66px;height:66px;display:grid;place-items:center;border-radius:50%;background:#fff0e7;font-size:34px}.department-card h2{font-size:15px;line-height:1.45;margin:12px 0 8px;max-width:220px}.dept-metric{margin-top:8px;color:var(--orange);font-weight:800;font-size:26px}.dept-caption{color:var(--muted);font-size:11px;margin-top:2px}.arrow{margin-top:auto;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--orange);color:white;font-size:22px}.public-note{text-align:center;color:var(--muted);font-size:12px;margin:18px 0 0}.page-heading{display:flex;align-items:center;gap:18px;margin:5px 0 22px}.page-heading h1{font-size:clamp(25px,3vw,36px);margin:3px 0}.page-heading .pill{margin-left:auto}.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.4px;color:var(--orange);margin:0}.pill{border-radius:99px;background:#fff0e7;color:#b94212;padding:7px 11px;font-size:11px;font-weight:700;white-space:nowrap}.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}.kpi-card{border:1px solid var(--line);border-radius:13px;padding:17px;background:#fff;box-shadow:var(--shadow)}.kpi-card span{font-size:12px;color:var(--muted);font-weight:600}.kpi-card strong{display:block;font-size:30px;margin:7px 0 3px}.kpi-card small{font-size:11px;color:var(--muted)}.panel{background:#fff;border:1px solid var(--line);border-radius:14px;padding:18px;margin:16px 0;box-shadow:var(--shadow)}.panel h2{font-size:17px;margin:0 0 5px}.panel p{margin:0;color:var(--muted);font-size:12px;line-height:1.6}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:16px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 14px}.toolbar input{max-width:500px}.table-wrap{overflow:auto;border:1px solid #f4e4db;border-radius:9px}table{border-collapse:collapse;width:100%;min-width:900px;font-size:12px}th{background:#fff2e9;color:#7d452d;text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.35px}td,th{padding:11px 12px;border-bottom:1px solid #f2e9e3;vertical-align:top}tbody tr:hover{background:#fffaf6}tbody tr:last-child td{border-bottom:0}.status{display:inline-block;border-radius:99px;padding:4px 8px;background:#f1f5f9;font-size:10px;font-weight:700}.status.approved{background:#e4f7ee;color:#14764f}.status.rejected{background:#ffe8eb;color:#b52e45}.status.pending{background:#fff0d8;color:#9b5b00}.row-actions{display:flex;gap:6px}.mini-button{border:1px solid var(--line);background:#fff;border-radius:7px;padding:5px 8px;cursor:pointer;color:#8b421f;font-size:11px}.mini-button.danger{color:#b52e45}.empty-state,.loading-card{padding:34px 18px;text-align:center;color:var(--muted);background:#fffaf7;border:1px dashed var(--line);border-radius:10px}.loading-card{grid-column:1/-1}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid label,.dialog-content label{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:12px}.form-actions{grid-column:1/-1;display:flex;align-items:center;gap:12px}.input, input, select, textarea{font:400 13px Inter,Arial,sans-serif}input,select,textarea{width:100%;border:1px solid #d9e0e7;border-radius:8px;padding:11px 12px;background:#fff;color:var(--ink);outline:none}input:focus,select:focus,textarea:focus{border-color:var(--orange);box-shadow:0 0 0 3px #ff5a1f1a}textarea{resize:vertical}.dialog{border:0;border-radius:16px;padding:0;width:min(460px,calc(100% - 28px));box-shadow:0 20px 80px #1522323b}.dialog::backdrop{background:#17233170;backdrop-filter:blur(3px)}.dialog-content{position:relative;padding:28px;display:flex;flex-direction:column;gap:14px}.dialog-content h2{font-size:24px;margin:0}.dialog-content>p{margin:0}.dialog-close{position:absolute;right:14px;top:10px;border:0;background:transparent;font-size:28px;cursor:pointer;color:var(--muted)}.error{color:var(--red);font-size:12px;min-height:16px}.notice{max-width:1000px;margin:0 auto 16px;padding:12px 14px;border-radius:9px;background:#fff0e7;color:#7d3717;border:1px solid var(--line)}.notice.error-notice{background:#fff0f0;border-color:#ffc6cc;color:#a22638}.muted{color:var(--muted);font-size:12px}.hidden{display:none!important}.footer{padding:0;color:var(--muted);font-size:11px;background:#fffaf6}.footer-art{width:100%;height:200px;background:linear-gradient(180deg,#fffaf6 0%,#fff1e8 100%);background-image:none;border-top:1px solid #f0e2d9}.footer-caption{padding:13px 30px;display:flex;justify-content:space-between;gap:10px;background:#fff}.footer-caption span:first-child{color:var(--orange);font-weight:800;letter-spacing:.8px}
@media(max-width:1100px){.department-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.department-card{min-height:245px}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.brand-logo{width:170px}.brand strong{font-size:28px}}
@media(max-width:700px){.topbar{padding:14px 16px;align-items:flex-start;flex-direction:column}.brand{gap:12px}.brand-logo{width:150px;max-height:62px}.brand-divider{height:48px}.brand strong{font-size:25px}.brand small{font-size:12px}.top-actions{width:100%;justify-content:space-between}.page{padding:18px 14px 30px}.clock-panel{padding:12px;gap:10px}.clock-side{gap:7px}.clock-side+.clock-side{padding-left:10px}.clock-side b{font-size:10px}.clock-side strong{font-size:20px}.clock-side small{font-size:9px}.flag{font-size:20px}.department-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.department-card{min-height:225px;padding:15px 8px}.department-card h2{font-size:12px}.dept-icon{width:55px;height:55px;font-size:29px}.dept-metric{font-size:22px}.kpi-grid{gap:9px}.kpi-card{padding:13px}.kpi-card strong{font-size:25px}.page-heading{flex-wrap:wrap;gap:10px}.page-heading .pill{margin-left:0}.form-grid{grid-template-columns:1fr}.form-actions{grid-column:1}.panel{padding:13px}.panel-heading{align-items:flex-start}.footer-art{height:130px;background-position:center}.footer-caption{padding:14px 16px;flex-direction:column}.toolbar{align-items:stretch;flex-direction:column}}

/* Main overview: fit the reference composition into one desktop viewport. */
@media (min-width: 1101px) {
  body:has(#overview-view:not(.hidden)) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body:has(#overview-view:not(.hidden)) .topbar {
    flex: 0 0 auto;
    min-height: 98px;
    padding: 12px 30px;
  }
  body:has(#overview-view:not(.hidden)) .brand-logo {
    width: 200px;
    max-height: 82px;
  }
  body:has(#overview-view:not(.hidden)) .page {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 10px 30px 10px;
    display: flex;
    flex-direction: column;
  }
  body:has(#overview-view:not(.hidden)) #overview-view {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body:has(#overview-view:not(.hidden)) .clock-panel {
    flex: 0 0 auto;
    margin: 0 auto 8px;
    padding: 10px 18px;
    min-height: 94px;
  }
  body:has(#overview-view:not(.hidden)) .section-title {
    flex: 0 0 auto;
    margin: 3px 0 9px;
  }
  body:has(#overview-view:not(.hidden)) .department-grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
  }
  body:has(#overview-view:not(.hidden)) .department-card {
    min-height: 0;
    height: 100%;
    border-radius: 13px;
    padding: 18px 15px 18px;
    box-shadow: none;
  }
  body:has(#overview-view:not(.hidden)) .dept-icon {
    width: 66px;
    height: 66px;
    flex: 0 0 auto;
  }
  body:has(#overview-view:not(.hidden)) .department-card h2 {
    margin-top: 10px;
  }
  body:has(#overview-view:not(.hidden)) .dept-metric {
    margin-top: 8px;
  }
  body:has(#overview-view:not(.hidden)) .arrow {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }
  body:has(#overview-view:not(.hidden)) .public-note {
    display: none;
  }
  body:has(#overview-view:not(.hidden)) .footer {
    flex: 0 0 clamp(150px, 22.5vh, 200px);
    height: clamp(150px, 22.5vh, 200px);
    min-height: 0;
    overflow: hidden;
  }
  body:has(#overview-view:not(.hidden)) .footer-art {
    height: 100%;
    border-top: 0;
    background-size: cover;
    background-position: center center;
  }
  body:has(#overview-view:not(.hidden)) .footer-caption {
    display: none;
  }
}
@media (max-height: 760px) and (min-width: 1101px) {
  body:has(#overview-view:not(.hidden)) .topbar { min-height: 82px; padding-top: 8px; padding-bottom: 8px; }
  body:has(#overview-view:not(.hidden)) .brand-logo { width: 170px; max-height: 66px; }
  body:has(#overview-view:not(.hidden)) .brand-divider { height: 50px; }
  body:has(#overview-view:not(.hidden)) .brand strong { font-size: clamp(25px, 2.5vw, 36px); }
  body:has(#overview-view:not(.hidden)) .clock-panel { min-height: 78px; padding: 7px 15px; }
  body:has(#overview-view:not(.hidden)) .clock-side strong { font-size: 27px; }
  body:has(#overview-view:not(.hidden)) .section-title { font-size: 24px; }
  body:has(#overview-view:not(.hidden)) .footer { flex-basis: 18vh; height: 18vh; }
}
@media (max-width: 1100px) {
  body:has(#overview-view:not(.hidden)) { overflow-x: hidden; }
}

/* FIT & Technical's wider source-sheet form and CSV controls */
.sample-form-grid { margin: 8px 0 14px; }
.sample-form-grid .full-span { grid-column: 1 / -1; }
.csv-label { display: inline-flex; align-items: center; cursor: pointer; }
#records-area .table-wrap { overflow-x: auto; }
#records-area table { min-width: 1500px; }
#records-area td { max-width: 360px; white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
#records-area th { white-space: nowrap; }

/* FIT & Tech sample filters and compact table rows */
.record-filters{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;margin:12px 0 8px}
.record-filters label{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:700;color:#526173}
.record-filters input,.record-filters select{padding:8px 9px;font-size:12px;min-width:0}
.toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#records-area .table-wrap{overflow:auto;max-height:70vh}
#records-area table{table-layout:fixed;min-width:1600px;font-size:11px}
#records-area th,#records-area td{padding:5px 7px;vertical-align:middle}
#records-area th{position:sticky;top:0;z-index:1}
#records-area td{height:34px;max-height:34px}
#records-area .cell-clip{max-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4}
#records-area th:nth-child(1){width:90px} #records-area th:nth-child(2),#records-area th:nth-child(3){width:105px}
#records-area th:nth-child(4){width:105px} #records-area th:nth-child(5){width:190px} #records-area th:nth-child(6){width:190px}
#records-area th:nth-child(7){width:130px} #records-area th:nth-child(8){width:90px} #records-area th:nth-child(9),#records-area th:nth-child(10){width:95px}
#records-area th:nth-child(11){width:300px} #records-area th:nth-child(12),#records-area th:nth-child(13){width:150px}
#records-area th:nth-child(14){width:90px} #records-area th.actions-column{width:125px}
@media(max-width:900px){.record-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.toolbar{align-items:flex-start;flex-direction:column}}
@media(max-width:520px){.record-filters{grid-template-columns:1fr}.toolbar-actions{width:100%}}
.print-content{display:none}
@media print{
  @page{size:A4 landscape;margin:10mm}
  body.printing-dashboard>*:not(#print-content){display:none!important}
  body.printing-dashboard #print-content{display:block!important;color:#111;background:#fff;font:9pt Arial,sans-serif}
  body.printing-dashboard .print-header{margin-bottom:12px;border-bottom:2px solid #ff5a1f;padding-bottom:8px}
  body.printing-dashboard .print-header h1{font-size:20pt;color:#ff5a1f;margin:0 0 4px}
  body.printing-dashboard .print-header h2{font-size:14pt;margin:0 0 4px}
  body.printing-dashboard .print-header p,body.printing-dashboard .print-note{font-size:8pt;color:#444;margin:4px 0 10px}
  body.printing-dashboard .print-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}
  body.printing-dashboard .print-kpis .kpi-card{padding:8px;border:1px solid #ddd;box-shadow:none;break-inside:avoid}
  body.printing-dashboard .print-kpis .kpi-card strong{font-size:18pt;margin:4px 0}
  body.printing-dashboard .print-table{width:100%;min-width:0;table-layout:auto;border-collapse:collapse;font-size:7pt}
  body.printing-dashboard .print-table th{background:#ffefe5!important;color:#222;text-transform:none;letter-spacing:0;font-size:7pt;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  body.printing-dashboard .print-table th,body.printing-dashboard .print-table td{border:1px solid #bbb;padding:4px;vertical-align:top;overflow-wrap:anywhere}
  body.printing-dashboard .print-table tr{break-inside:avoid}
}


/* Analytics charts */
.analytics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0}
.analytics-grid .panel{min-width:0;margin:0}.supplier-chart-panel{grid-column:1/-1}
.chart-bars{display:flex;flex-direction:column;gap:10px;min-height:40px}
.chart-row{display:grid;grid-template-columns:minmax(90px,150px) minmax(0,1fr);gap:10px;align-items:center;font-size:12px}
.chart-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-series{display:flex;flex-direction:column;gap:4px;min-width:0}
.chart-bar-wrap{display:flex;align-items:center;gap:6px;min-width:0}.chart-value{min-width:22px;color:#5b6470;font-size:10px}.chart-bar{height:9px;min-width:2px;border-radius:0 5px 5px 0;background:#ff5a1f}.series-1{background:#178b63}.series-2{background:#df5961}
@media(max-width:760px){.analytics-grid{grid-template-columns:1fr}.supplier-chart-panel{grid-column:auto}.chart-row{grid-template-columns:95px minmax(0,1fr)}}
@media print{.analytics-grid{display:grid!important;grid-template-columns:1fr 1fr!important;break-inside:avoid}.chart-bar{print-color-adjust:exact;-webkit-print-color-adjust:exact}}

.print-charts{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}.print-charts section{border:1px solid #ddd;padding:8px;break-inside:avoid}.print-charts h3{font-size:12px;margin:0 0 8px}.print-kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.print-kpis .kpi-card{padding:8px;min-width:0}.print-kpis .kpi-card strong{font-size:18px}

/* Corrected analytics presentation */
.chart-bar { box-shadow: 0 4px 0 rgba(20,45,80,.14), 4px 0 0 rgba(20,45,80,.08); border-radius: 3px 5px 5px 3px; transform: perspective(240px) rotateY(-7deg); transform-origin: left center; }
.series-0 { background: linear-gradient(90deg,#2878d0,#66b2f0); }
.series-1 { background: linear-gradient(90deg,#24a47a,#6bd6ac); }
.series-2 { background: linear-gradient(90deg,#df5b63,#ff9ca2); }
.series-3 { background: linear-gradient(90deg,#8b5bd6,#c4a5ff); }
.series-4 { background: linear-gradient(90deg,#ed9b35,#ffd083); }
.pie-layout { display:flex; align-items:center; gap:24px; flex-wrap:wrap; padding:12px 4px; }
.pie-3d { width:190px; height:190px; border-radius:50%; flex:0 0 190px; box-shadow:inset -12px -12px 18px #0002, 0 14px 0 -5px #a7b4c5, 0 18px 14px #0002; border:1px solid #ffffffaa; }
.pie-legend { flex:1; min-width:210px; display:grid; gap:10px; }
.pie-legend>div { display:grid; grid-template-columns:12px 1fr auto; gap:9px; align-items:center; font-size:13px; }
.pie-legend i { width:11px;height:11px;border-radius:3px;display:inline-block; }
.pie-legend strong { font-variant-numeric:tabular-nums; }
.line-chart-wrap { width:100%; overflow-x:auto; }
.line-chart-wrap svg { display:block; width:100%; min-width:520px; height:auto; }
@media print { .pie-3d { print-color-adjust:exact; -webkit-print-color-adjust:exact; } .chart-bar { print-color-adjust:exact; -webkit-print-color-adjust:exact; } }
