:root {
    --bg: #eef2f6;
    --panel: #ffffff;
    --ink: #17202b;
    --muted: #667386;
    --line: #d7dee8;
    --accent: #0f766e;
    --sidebar: #111827;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

body.dashboard-screen {
    grid-template-columns: 84px minmax(0, 1fr);
    background:
        radial-gradient(circle at 76% 14%, rgba(21, 196, 216, .16), transparent 28%),
        linear-gradient(135deg, #08276f 0%, #0b57d0 48%, #07318b 100%);
}

body.dashboard-screen aside {
    padding: 18px 12px;
    background: rgba(5, 20, 58, .72);
    backdrop-filter: blur(10px);
}

body.dashboard-screen .brand {
    justify-items: center;
    text-align: center;
    border-bottom-color: rgba(255,255,255,.18);
}

body.dashboard-screen .brand strong,
body.dashboard-screen .brand small {
    display: none;
}

body.dashboard-screen aside a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 8px;
    font-size: .72rem;
    text-align: center;
}

body.dashboard-screen aside a .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

body.dashboard-screen aside a svg {
    width: 22px;
    height: 22px;
}

body.dashboard-screen main {
    padding: 14px;
}

aside {
    padding: 24px 18px;
    background: var(--sidebar);
    color: white;
}

.brand {
    display: grid;
    gap: 6px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    font-weight: 800;
}

.brand small, .kicker, .metric span, small { color: var(--muted); }

aside a {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 18px;
    color: white;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    width: 100%;
    font: inherit;
    text-align: left;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

aside a svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

aside a:hover {
    background: rgba(255,255,255,.14);
}

.login-card {
    max-width: 520px;
    padding: 24px;
}

main {
    min-width: 0;
    padding: 28px;
}

.hero, .card, .metric, .flash {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(17, 24, 39, .07);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 26px;
    margin-bottom: 18px;
}

.hero.compact { padding: 20px 24px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 2rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; margin-top: 18px; }

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

button, .button-link {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    padding: 11px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

button.secondary {
    background: #334155;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.secondary-link {
    background: #334155;
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.report-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.report-form .full {
    grid-column: 1 / -1;
}

.settings-form h2,
.settings-form .full,
.form-actions {
    grid-column: 1 / -1;
}

.settings-form h2 {
    margin: 12px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.settings-form h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    background: white;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0 0 5px;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.muted-note {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 12px;
}

.sync-all-card {
    margin-bottom: 18px;
}

.sync-all-card .section-heading > strong {
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 7px 12px;
    white-space: nowrap;
}

.sync-all-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: .9rem;
}

.sync-all-meta strong {
    color: var(--ink);
}

.table-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(140px, 180px) auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(120px, 150px) minmax(140px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.inline-form input {
    padding: 9px 10px;
}

.certificate-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.certificate-filter-grid .full,
.certificate-filter-grid .form-actions {
    grid-column: 1 / -1;
}

.certificate-sheet {
    width: min(100%, 980px);
    min-height: 1380px;
    margin: 0 auto 28px;
    padding: 56px 64px 38px;
    background: #fffdf8;
    color: #393939;
    border: 1px solid #d8d0c5;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .2);
    font-family: Arial, Helvetica, sans-serif;
    position: relative;
}

.certificate-sheet::before {
    content: "ORIGINAL";
    position: absolute;
    inset: 260px 120px auto;
    height: 520px;
    display: grid;
    place-items: center;
    border: 18px solid rgba(63, 159, 87, .08);
    border-radius: 50%;
    color: rgba(23, 120, 64, .08);
    font-size: 6rem;
    font-weight: 900;
    transform: rotate(-18deg);
    pointer-events: none;
}

.cert-header {
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    gap: 22px;
    align-items: center;
    text-align: center;
}

.cert-emblem {
    width: 120px;
    height: 120px;
    margin: auto;
    border-radius: 50%;
    border: 10px solid #d5ad4d;
    background:
        linear-gradient(145deg, rgba(16, 95, 174, .88), rgba(56, 143, 76, .88)),
        radial-gradient(circle at center, #fff 0 10%, transparent 11%);
    box-shadow: inset 0 0 0 7px rgba(180, 36, 38, .5);
}

.cert-title-block h2,
.cert-title-block h3,
.cert-title-block p {
    margin: 0;
    line-height: 1.25;
}

.cert-title-block h2 {
    font-size: 1.55rem;
    letter-spacing: 0;
    color: #4d5573;
}

.cert-title-block h3 {
    font-size: 1.05rem;
    margin-bottom: 34px;
    color: #5f6680;
}

.cert-title-block p {
    font-size: .98rem;
    font-weight: 700;
    color: #5b6073;
}

.cert-barcode div {
    height: 58px;
    background: repeating-linear-gradient(90deg, #222 0 2px, transparent 2px 5px, #222 5px 8px, transparent 8px 12px);
    margin-bottom: 4px;
}

.cert-barcode span {
    font-size: .68rem;
    letter-spacing: 3px;
}

.cert-main-title {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 22px;
    align-items: end;
    margin: 42px 0 12px;
    font-size: 1.25rem;
    font-weight: 800;
}

.cert-main-title strong {
    text-align: center;
}

.cert-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .92rem;
    background: rgba(255, 255, 255, .65);
    position: relative;
}

.cert-table th,
.cert-table td {
    border: 1px solid #777;
    padding: 8px 10px;
    color: #424242;
    vertical-align: top;
}

.cert-table th {
    text-align: center;
    color: #404040;
    font-size: .92rem;
    background: rgba(255, 255, 255, .55);
}

.cert-table td span {
    display: block;
    text-align: center;
    color: #666;
    margin-bottom: 6px;
    font-weight: 400;
}

.cert-table td b {
    color: #333;
}

.cert-multiline {
    display: block;
    white-space: pre-line;
}

.compact-table td {
    text-align: center;
}

.cert-statement {
    border: 1px solid #777;
    border-top: 0;
    padding: 9px 10px;
    font-size: .9rem;
    line-height: 1.28;
}

.cert-issue-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 8px;
    font-size: .92rem;
}

.cert-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #777;
    min-height: 150px;
}

.cert-signatures > div {
    display: grid;
    align-content: end;
    justify-items: end;
    text-align: right;
    padding: 18px 18px 10px;
    border-left: 1px solid #777;
}

.cert-signatures > div:first-child {
    border-left: 0;
}

.cert-signatures strong,
.cert-signatures b,
.cert-signatures span {
    display: block;
}

.cert-signatures span,
.cert-footer {
    color: #666;
    font-size: .68rem;
}

.cert-footer {
    margin-top: 58px;
    text-align: center;
    font-weight: 700;
}

.grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); }

.card, .metric { padding: 20px; min-width: 0; }

.metric {
    display: grid;
    gap: 8px;
}

.metric strong {
    font-size: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

th, td {
    text-align: left;
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}

td {
    overflow-wrap: anywhere;
}

.table-scroll {
    overflow: auto;
    max-height: 72vh;
}

.pager {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
}

.pager.bottom {
    margin: 14px 0 0;
    align-items: center;
}

.pager-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-size-form {
    min-width: 180px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.export-hero {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(420px, .95fr);
    gap: 14px;
    align-items: end;
    padding: 16px 18px;
    margin-bottom: 12px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.08), transparent 38%),
        linear-gradient(135deg, #0846b8, #062b78 70%);
    color: white;
    box-shadow: 0 18px 40px rgba(8, 70, 184, .22);
    border: 1px solid rgba(255,255,255,.22);
}

.export-hero .kicker,
.export-hero p {
    color: rgba(255, 255, 255, .78);
}

.export-hero h1 {
    margin-bottom: 4px;
    font-size: clamp(1.8rem, 2.6vw, 3rem);
}

.dashboard-filters {
    display: grid;
    grid-template-columns: .6fr 1fr 1fr 1.15fr auto;
    gap: 10px;
    align-items: end;
    margin-top: 10px;
}

.dashboard-filters label {
    color: white;
}

.dashboard-filter-panel {
    align-self: end;
}

.dashboard-filter-panel > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
    color: white;
    cursor: pointer;
    list-style: none;
}

.dashboard-filter-panel > summary::-webkit-details-marker {
    display: none;
}

.dashboard-filter-panel > summary::before {
    content: "▸";
    color: rgba(255, 255, 255, .78);
}

.dashboard-filter-panel[open] > summary::before {
    content: "▾";
}

.dashboard-filter-panel > summary span {
    font-weight: 900;
}

.dashboard-filter-panel > summary strong,
.dashboard-filter-panel > summary em {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: .78rem;
    font-style: normal;
}

.dashboard-filter-panel > summary em {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.advanced-filters {
    grid-column: 1 / -1;
    color: white;
}

.advanced-filters summary {
    width: max-content;
    cursor: pointer;
    color: rgba(255, 255, 255, .86);
    font-weight: 800;
    font-size: .86rem;
}

.advanced-filters div {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 220px));
    gap: 10px;
    margin-top: 10px;
}

.dashboard-filter-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}

.dashboard-filter-actions button {
    min-height: 42px;
    justify-content: center;
}

.today-filter-button {
    background: #0f3f7a;
    border: 1px solid rgba(255, 255, 255, .26);
}

.plant-dashboard {
    display: grid;
    grid-template-columns: 250px minmax(300px, .95fr) minmax(360px, 1.2fr) minmax(300px, .9fr);
    gap: 12px;
    align-items: stretch;
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    grid-auto-flow: dense;
}

.widget {
    min-width: 0;
    align-self: start;
}

.widget-small {
    grid-column: span 3;
}

.widget-medium {
    grid-column: span 4;
}

.widget-large {
    grid-column: span 6;
}

.widget-full {
    grid-column: 1 / -1;
}

.metric-stack.horizontal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: 100%;
}

.summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.summary-metrics .plant-metric {
    min-height: 84px;
    align-content: center;
}

.summary-metrics .plant-metric strong {
    font-size: 1.55rem;
}

.quality-grid,
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.comparison-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quality-grid div,
.comparison-grid div {
    padding: 12px;
    border-radius: 8px;
    background: #eef6ff;
    border: 1px solid #d7e6f7;
}

.quality-grid span,
.comparison-grid span {
    display: block;
    color: #647184;
    font-size: .78rem;
    font-weight: 800;
}

.quality-grid strong,
.comparison-grid strong {
    display: block;
    color: #0b57d0;
    font-size: 1.35rem;
    margin-top: 4px;
}

.comparison-grid small {
    color: #647184;
    font-size: .72rem;
}

.comparison-subhead {
    padding: 10px 12px 0;
    color: #0f3d75;
    font-weight: 900;
    font-size: .82rem;
}

.comparison-grid.compact {
    padding-bottom: 4px;
}

.comparison-grid.compact div {
    padding: 9px;
}

.comparison-grid.compact strong {
    font-size: 1.1rem;
}

.metric-stack {
    display: grid;
    gap: 12px;
}

.plant-metric,
.blue-panel {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .12);
}

.plant-metric {
    min-height: 112px;
    display: grid;
    gap: 8px;
    padding: 15px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(235,247,255,.96));
}

.plant-metric span {
    font-weight: 800;
    color: #1f3c73;
}

.plant-metric strong {
    color: #0b57d0;
    font-size: 1.75rem;
}

.volume-lines {
    display: grid;
    gap: 4px;
}

.volume-lines strong {
    font-size: 1.35rem;
}

.volume-lines em {
    color: #647184;
    font-size: .85rem;
    font-style: normal;
}

.mini-rank {
    display: grid;
    gap: 5px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.mini-rank div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    font-size: .78rem;
}

.mini-rank div span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #475569;
}

.mini-rank div strong {
    font-size: .78rem;
    color: #0b57d0;
}

.blue-panel {
    overflow: hidden;
    background: rgba(248, 251, 255, .96);
    align-self: start;
}

.blue-panel h2 {
    margin: 0;
    padding: 12px 16px;
    background: linear-gradient(90deg, #063b8e, #075bbd);
    color: white;
    text-align: center;
    font-size: .95rem;
    text-transform: uppercase;
}

.blue-panel table {
    background: white;
    font-size: .84rem;
}

.blue-panel tbody tr:nth-child(even) {
    background: #dff5fb;
}

.commodity-panel {
    grid-column: span 1;
}

.monthly-panel {
    grid-column: 1 / span 2;
}

.flow-panel {
    grid-column: 3 / span 2;
}

.monthly-volume-panel {
    grid-column: 1 / span 2;
}

.value-panel {
    grid-column: 3 / span 2;
}

.panel-note {
    margin: 12px 16px 16px;
    color: var(--muted);
    font-weight: 700;
}

.rank-list {
    list-style: none;
    margin: 0;
    padding: 12px 16px;
    display: grid;
    gap: 12px;
}

.rank-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding-left: 10px;
    border-left: 5px solid #d62545;
}

.rank-list span {
    color: #2868a9;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.line-chart {
    min-height: 230px;
    display: grid;
    grid-template-columns: repeat(12, minmax(28px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 20px 18px 16px;
}

.month-bar {
    height: 190px;
    display: grid;
    grid-template-rows: 1fr auto auto;
    gap: 6px;
    justify-items: center;
    color: var(--muted);
    font-size: .78rem;
}

.month-bar span {
    align-self: end;
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #30b44a, #0b7f32);
}

.month-bar em {
    font-style: normal;
    color: #15345d;
    font-weight: 700;
}

.flow-map {
    position: relative;
    min-height: 260px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 45%, rgba(6, 59, 142, .16), transparent 10%),
        radial-gradient(circle at 42% 58%, rgba(6, 59, 142, .18), transparent 13%),
        radial-gradient(circle at 72% 45%, rgba(6, 59, 142, .16), transparent 12%),
        linear-gradient(135deg, #eef3f8, #d9e4ef);
}

.flow-map::before {
    content: "Cambodia Export Flow";
    position: absolute;
    left: 18px;
    bottom: 14px;
    color: rgba(15, 23, 42, .42);
    font-weight: 800;
}

.flow-dot {
    position: absolute;
    display: grid;
    gap: 4px;
    justify-items: center;
}

.flow-dot span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 3px solid white;
    border-radius: 999px;
    background: #0b57d0;
    color: white;
    font-size: .78rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
}

.flow-dot small {
    max-width: 110px;
    color: #16324f;
    font-weight: 800;
    text-align: center;
}

.multi-line-chart {
    position: relative;
    padding: 14px 16px 12px;
    background:
        radial-gradient(circle at 18% 24%, rgba(34, 211, 238, .18), transparent 24%),
        radial-gradient(circle at 82% 42%, rgba(249, 115, 22, .12), transparent 24%),
        linear-gradient(135deg, #071a35, #081f44 54%, #06152b);
    overflow: hidden;
}

.multi-line-chart::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(103, 232, 249, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 232, 249, .035) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.92), rgba(0,0,0,.35));
}

.multi-line-chart svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 210px;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .28));
}

.grid-lines line {
    stroke: rgba(125, 211, 252, .22);
    stroke-width: 1;
}

.multi-line-chart text {
    fill: rgba(223, 249, 255, .72);
    font-size: 13px;
    font-weight: 800;
    text-anchor: middle;
}

.year-line {
    fill: none;
    stroke-width: 6;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter:
        drop-shadow(0 0 4px currentColor)
        drop-shadow(0 0 10px rgba(34, 211, 238, .35));
}

.line-1 { stroke: #22c55e; }
.line-2 { stroke: #22d3ee; }
.line-3 { stroke: #fb7185; }
.line-4 { stroke: #f97316; }
.line-5 { stroke: #a78bfa; }

.line-legend {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 2px;
}

.line-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    color: #dff9ff;
    padding: 6px 9px;
    border: 1px solid rgba(103, 232, 249, .16);
    border-radius: 999px;
    background: rgba(15, 23, 42, .46);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.line-legend span::before {
    content: "";
    width: 18px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 10px currentColor;
}

.line-legend .legend-2::before { background: #22d3ee; }
.line-legend .legend-3::before { background: #fb7185; }
.line-legend .legend-4::before { background: #f97316; }
.line-legend .legend-5::before { background: #a78bfa; }

.monthly-table {
    font-size: .78rem;
}

.export-map-shell {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background:
        radial-gradient(circle at 22% 42%, rgba(34, 211, 238, .18), transparent 18%),
        radial-gradient(circle at 72% 48%, rgba(249, 115, 22, .16), transparent 20%),
        #06152b;
}

body.map-fullscreen-active {
    overflow: hidden;
}

.export-map-shell.is-fullscreen-map {
    position: fixed;
    inset: 12px;
    z-index: 5000;
    border: 1px solid rgba(103, 232, 249, .32);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .58);
}

.export-map-shell.is-fullscreen-map .leaflet-map {
    height: calc(100vh - 24px);
}

.export-map-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 620;
    pointer-events: none;
    background:
        linear-gradient(rgba(103, 232, 249, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 232, 249, .028) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, transparent 42%, rgba(2, 6, 23, .24));
    background-size: 28px 28px, 28px 28px, 100% 100%;
    mix-blend-mode: screen;
}

.leaflet-map {
    height: 430px;
    width: 100%;
    background: #06152b;
    cursor: grab;
}

.map-actions {
    position: absolute;
    z-index: 700;
    left: 62px;
    bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.map-action-button {
    border: 1px solid rgba(103, 232, 249, .32);
    border-radius: 7px;
    padding: 8px 11px;
    background: rgba(6, 78, 118, .82);
    color: #e0faff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
    cursor: pointer;
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.map-action-button.secondary {
    background: rgba(20, 83, 45, .86);
    border-color: rgba(134, 239, 172, .34);
}

.map-action-button:disabled {
    cursor: not-allowed;
    opacity: .48;
    background: rgba(51, 65, 85, .82);
    border-color: rgba(148, 163, 184, .26);
}

.map-action-button:not(:disabled):hover {
    transform: translateY(-1px);
    background: rgba(8, 145, 178, .94);
}

.map-action-button.secondary:not(:disabled):hover {
    background: rgba(22, 163, 74, .94);
}

.leaflet-map:active {
    cursor: grabbing;
}

.leaflet-map .leaflet-control-zoom a {
    background: rgba(4, 18, 39, .86);
    border-color: rgba(103, 232, 249, .2);
    color: #dff9ff;
}

.leaflet-map .leaflet-control-attribution {
    background: rgba(4, 18, 39, .74);
    color: rgba(226, 246, 255, .72);
}

.leaflet-map .leaflet-control-attribution a {
    color: #67e8f9;
}

.leaflet-map .leaflet-control-attribution {
    display: none;
}

.map-world-background {
    filter: drop-shadow(0 0 2px rgba(148, 163, 184, .12));
}

.leaflet-map .leaflet-popup-content-wrapper,
.leaflet-map .leaflet-popup-tip {
    background: rgba(4, 18, 39, .95);
    color: #dff9ff;
    border: 1px solid rgba(103, 232, 249, .24);
    box-shadow: 0 16px 30px rgba(0, 0, 0, .38);
}

.leaflet-map .leaflet-popup-content {
    font-weight: 700;
    line-height: 1.45;
}

.leaflet-map .leaflet-popup-close-button {
    color: #dff9ff;
}

.map-country-border {
    filter:
        drop-shadow(0 0 5px rgba(34, 211, 238, .52))
        drop-shadow(0 10px 18px rgba(0, 0, 0, .28));
}

.map-export-route {
    stroke-dasharray: 4 7;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, .5));
}

.map-export-bubble {
    filter:
        drop-shadow(0 0 8px rgba(34, 211, 238, .74))
        drop-shadow(0 0 18px rgba(249, 115, 22, .24));
}

.map-country-flag {
    width: 28px;
    height: 20px;
    border: 0;
    background: transparent;
    pointer-events: none;
}

.map-country-flag .flag-image,
.map-country-flag .flag-text {
    display: grid;
    place-items: center;
    width: 28px;
    height: 18px;
    border: 1px solid rgba(226, 246, 255, .72);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, .28);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow:
        0 0 8px rgba(34, 211, 238, .35),
        0 8px 14px rgba(0, 0, 0, .26);
    font-size: .62rem;
    font-weight: 900;
    line-height: 1;
    color: #dff9ff;
    opacity: .84;
}

.map-callout-anchor {
    background: transparent;
    border: 0;
}

.map-focus-label,
.map-volume-label {
    border: 0;
    border-radius: 8px;
    padding: 7px 9px;
    background: rgba(255, 255, 255, .95);
    color: #12345c;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
    font-weight: 800;
    font-size: .76rem;
    line-height: 1.35;
    text-align: left;
}

.map-focus-label::before,
.map-volume-label::before {
    display: none;
}

.map-hud {
    position: absolute;
    z-index: 650;
    min-width: 150px;
    max-width: min(230px, 42%);
    padding: 10px 12px;
    border: 1px solid rgba(103, 232, 249, .24);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(4, 18, 39, .88), rgba(7, 41, 76, .72));
    box-shadow: 0 14px 26px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
    color: #dff9ff;
    backdrop-filter: blur(6px);
}

.map-hud-left {
    left: 62px;
    top: 14px;
}

.map-hud-right {
    right: 14px;
    top: 14px;
}

.map-hud-today {
    right: 14px;
    bottom: 14px;
    max-width: min(270px, 48%);
}

.map-hud span,
.map-hud small {
    display: block;
    color: rgba(223, 249, 255, .72);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.map-hud strong {
    display: block;
    margin: 2px 0 4px;
    color: #fff7ed;
    font-size: 1rem;
}

.map-hud div {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
}

.map-hud b {
    color: #22d3ee;
    font-size: 1.45rem;
}

.map-hud em {
    color: rgba(223, 249, 255, .74);
    font-size: .72rem;
    font-style: normal;
    font-weight: 900;
}

.today-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(88px, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.map-hud .today-stat-grid small {
    padding: 7px 8px;
    border: 1px solid rgba(103, 232, 249, .16);
    border-radius: 7px;
    background: rgba(15, 23, 42, .34);
    text-transform: none;
    letter-spacing: 0;
}

.map-hud .today-stat-grid b {
    display: block;
    margin-top: 2px;
    color: #22d3ee;
    font-size: .95rem;
}

body.dashboard-screen .card,
body.dashboard-screen .metric,
body.dashboard-screen .hero,
body.dashboard-screen .plant-metric,
body.dashboard-screen .blue-panel {
    box-shadow: 0 12px 24px rgba(0, 20, 80, .18);
}

body.dashboard-screen .flash {
    display: none;
}

.world-map {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    background: #dce9f4;
}

.world-map svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.world-map rect {
    fill: #dce9f4;
}

.world-map path {
    fill: #aebdca;
    stroke: rgba(255,255,255,.7);
    stroke-width: 4;
}

.map-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    gap: 4px;
    z-index: 2;
}

.map-pin strong {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 3px solid white;
    border-radius: 999px;
    background: #0b57d0;
    color: white;
    font-size: .78rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
}

.map-pin span {
    max-width: 120px;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,.86);
    color: #16324f;
    font-size: .72rem;
    font-weight: 800;
    text-align: center;
}

.pin-2 strong { background: #16a34a; }
.pin-3 strong { background: #d62545; }
.pin-4 strong { background: #f59e0b; }
.pin-5 strong { background: #7c3aed; }
.pin-6 strong { background: #0891b2; }
.pin-7 strong { background: #db2777; }
.pin-8 strong { background: #475569; }

.dot-1 { left: 55%; top: 35%; }
.dot-2 { left: 28%; top: 42%; }
.dot-3 { left: 66%; top: 58%; }
.dot-4 { left: 42%; top: 65%; }
.dot-5 { left: 75%; top: 30%; }
.dot-6 { left: 18%; top: 60%; }
.dot-7 { left: 36%; top: 22%; }
.dot-8 { left: 82%; top: 66%; }

.activity {
    padding: 0;
    margin: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.activity li {
    display: grid;
    gap: 3px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.activity span { color: var(--muted); font-size: .86rem; }

.flash {
    margin-bottom: 14px;
    padding: 14px 16px;
}

.flash.success { border-color: #99d6ba; background: #effaf4; }
.flash.error { border-color: #e6aaa9; background: #fff1f0; }

@media (max-width: 980px) {
    body { grid-template-columns: 1fr; }
    aside { position: static; }
    main { padding: 18px; }
    .hero { display: grid; }
    .actions { justify-content: stretch; }
    .actions form, button { width: 100%; }
    .grid.three, .grid.two { grid-template-columns: 1fr; }
    .settings-form { grid-template-columns: 1fr; }
    .certificate-filter-grid {
        grid-template-columns: 1fr;
    }
    .table-toolbar,
    .inline-form {
        grid-template-columns: 1fr;
    }
    .pager { display: grid; align-items: stretch; }
    .filter-bar { grid-template-columns: 1fr; }
    .export-hero,
    .dashboard-filters,
    .plant-dashboard,
    .widget-grid,
    .metric-stack.horizontal {
        grid-template-columns: 1fr;
    }
    .monthly-panel,
    .flow-panel,
    .value-panel,
    .monthly-volume-panel {
        grid-column: auto;
    }
    body.dashboard-screen {
        grid-template-columns: 1fr;
    }
    body.dashboard-screen .brand strong,
    body.dashboard-screen .brand small {
        display: block;
    }
    .widget-small,
    .widget-medium,
    .widget-large,
    .widget-full {
        grid-column: auto;
    }
}

@media print {
    body {
        display: block;
        background: white;
    }

    aside,
    .no-print {
        display: none !important;
    }

    main {
        padding: 0;
    }

    .certificate-sheet {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 14mm 15mm 10mm;
        border: 0;
        box-shadow: none;
    }
}
