:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #142033;
    --muted: #66758a;
    --line: #d9e3ef;
    --primary: #175cd3;
    --primary-dark: #123f8c;
    --green: #138a65;
    --amber: #b7791f;
    --red: #c73535;
    --shadow: 0 18px 42px rgba(18, 32, 51, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Aptos, Segoe UI, Arial, sans-serif;
}

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.page-grid.two {
    grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.accent-panel {
    background: #eef8f2;
    border-color: #bee5ce;
}

.section-head,
.button-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.form-stack,
.form-grid {
    display: grid;
    gap: 14px;
}

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

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

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
}

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

.primary-button,
.secondary-button,
.mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    padding: 11px 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    background: var(--primary);
    color: #fff;
}

.secondary-button {
    background: #eef4ff;
    color: var(--primary-dark);
}

.mini-button {
    padding: 7px 10px;
    background: #edf2f7;
    color: var(--ink);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

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

.data-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf2f7;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.pill.high,
.pill.critical,
.pill.major,
.pill.danger {
    background: #ffe8e8;
    color: var(--red);
}

.pill.medium,
.pill.minor {
    background: #fff4db;
    color: var(--amber);
}

.pill.low {
    background: #e7f7ef;
    color: var(--green);
}

.pill.status-completed {
    background: #dcfae6;
    color: #067647;
    border: 1px solid #abefc6;
}

.pill.status-overdue {
    background: #fff3e0;
    color: #b54708;
    border: 1px solid #fedf89;
}

.pill.status-ongoing,
.pill.status-in-progress {
    background: #dff4ff;
    color: #026aa2;
    border: 1px solid #b9e6fe;
}

.pill.status-planned,
.pill.status-open {
    background: #eef4ff;
    color: #155eef;
    border: 1px solid #c7d7fe;
}

.pill.status-closed,
.pill.supplier-approved {
    background: #dcfae6;
    color: #067647;
    border: 1px solid #abefc6;
}

.pill.supplier-conditional {
    background: #fff8db;
    color: #a15c07;
    border: 1px solid #fde68a;
}

.pill.supplier-blocked {
    background: #fee4e2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.clean-list,
.timeline {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.clean-list li,
.timeline li {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.timeline li {
    display: grid;
    gap: 3px;
}

.timeline small {
    color: var(--muted);
}

.split-metrics,
.integration-grid,
.heatmap,
.insight-list {
    display: grid;
    gap: 12px;
}

.split-metrics {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 16px;
}

.split-metrics div,
.integration-grid div,
.insight-list div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.split-metrics strong {
    display: block;
    font-size: 28px;
}

.check-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.report-sheet {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.signature-box {
    margin-top: 16px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--green);
    font-weight: 800;
}

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

.heatmap span {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 8px;
    background: #e7f7ef;
}

.heatmap .medium {
    background: #fff4db;
}

.heatmap .high {
    background: #ffe8e8;
}

@media (max-width: 980px) {
    .app-shell,
    .page-grid.two,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .sidebar-card {
        position: static;
        margin-top: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .global-search {
        width: 100%;
    }
}

button, input, select, textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: #0f2238;
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    margin-bottom: 32px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #43b581;
    font-weight: 800;
}

.brand small, .sidebar-card small {
    display: block;
    color: #aac0d8;
    margin-top: 3px;
}

.nav-list {
    display: grid;
    gap: 8px;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d9e7f5;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
}

.nav-list a span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, .12);
    font-size: 11px;
    font-weight: 800;
}

.nav-list a.active,
.nav-list a:hover {
    background: rgba(255, 255, 255, .12);
}

.nav-list a.active span {
    background: #43b581;
    color: #082017;
}

.sidebar-card {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #43b581;
}

.main-content {
    min-width: 0;
    padding: 24px;
}

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

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1, h2, h3, h4, p { margin-top: 0; }

.topbar h1 {
    margin: 0;
    font-size: 28px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.global-search {
    width: min(360px, 42vw);
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.global-search span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.global-search input {
    border: 0;
    padding: 4px;
}

.topbar-link {
    padding: 11px 14px;
    border-radius: 8px;
    background: #fff4e0;
    color: #8a5200;
    font-weight: 800;
    text-decoration: none;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.user-chip span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e2f2ff;
    color: var(--primary-dark);
    font-weight: 800;
}

.hero-panel,
.screen-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #eef7ff 100%);
    box-shadow: var(--shadow);
}

.dashboard-hero h2 {
    max-width: 860px;
    margin-bottom: 0;
    font-size: 28px;
}

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

.hero-actions a,
.panel-title a {
    text-decoration: none;
}

.executive-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.executive-kpis article {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.executive-kpis span,
.executive-kpis small,
.muted {
    color: var(--muted);
}

.executive-kpis strong {
    display: block;
    margin: 7px 0;
    font-size: 28px;
}

.dashboard-board,
.page-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.page-layout.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.large-panel {
    grid-column: span 2;
}

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

.panel-title h3,
.panel h3 {
    margin-bottom: 4px;
}

.panel-title p {
    color: var(--muted);
    margin-bottom: 0;
}

.trend-chart {
    height: 260px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
    padding: 16px;
    border-radius: 8px;
    background: #f8fbff;
}

.trend-chart div {
    height: 100%;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 5px;
    position: relative;
    padding-bottom: 24px;
}

.trend-chart span {
    width: 18px;
    border-radius: 7px 7px 0 0;
    background: #c7d7ec;
}

.trend-chart .done {
    background: var(--primary);
}

.trend-chart .overdue {
    background: var(--red);
}

.trend-chart small {
    position: absolute;
    bottom: 0;
    color: var(--muted);
}

.risk-donut {
    width: 190px;
    height: 190px;
    margin: 8px auto 16px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: conic-gradient(var(--red) 0 34%, var(--amber) 34% 68%, var(--green) 68% 100%);
    color: #fff;
}

.risk-donut strong {
    font-size: 26px;
}

.risk-donut span {
    font-size: 13px;
}

.legend-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.legend-row span,
.pill {
    display: inline-block;
}

.legend-row span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 2px;
}

.high { background: var(--red); }
.med { background: var(--amber); }
.low { background: var(--green); }

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

.schedule-list li {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.schedule-list em {
    color: var(--primary);
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
}

.stacked-status {
    display: grid;
    gap: 12px;
}

.stacked-status div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.stacked-status span {
    grid-column: 1 / -1;
    height: 10px;
    border-radius: 999px;
    background: var(--primary);
}

.stacked-status em {
    color: var(--muted);
    font-style: normal;
}

.clean-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.clean-table th {
    background: #eaf2ff;
    color: var(--primary-dark);
}

.clean-table th,
.clean-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.clean-table tr:last-child td {
    border-bottom: 0;
}

.pill {
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

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

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

.role-grid div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.role-grid span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.month-grid span {
    min-height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.month-grid .busy {
    background: #fff4e0;
    border-color: #ffd991;
}

.month-grid .active {
    background: #dbeafe;
    border-color: #90b9ff;
    color: var(--primary);
    font-weight: 800;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 26px;
    margin-bottom: 20px;
}

.hero-panel h2 {
    margin-bottom: 8px;
    font-size: 26px;
}

.hero-panel p {
    color: var(--muted);
    max-width: 820px;
    line-height: 1.5;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 104px);
    gap: 10px;
}

.hero-metrics div {
    padding: 14px;
    border-radius: 8px;
    background: #edf5ff;
    text-align: center;
}

.hero-metrics strong {
    display: block;
    font-size: 24px;
}

.hero-metrics span {
    color: var(--muted);
    font-size: 12px;
}

.screen-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.screen-card {
    padding: 18px;
    min-height: 300px;
}

.screen-card.wide {
    grid-column: span 2;
}

.screen-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.screen-no {
    min-width: 38px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eaf2ff;
    color: var(--primary);
    font-weight: 800;
}

.screen-header h3 {
    margin-bottom: 4px;
    font-size: 18px;
}

.screen-header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 11px;
}

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

.primary-button,
.secondary-button {
    border: 0;
    border-radius: 8px;
    padding: 11px 14px;
    cursor: pointer;
    font-weight: 800;
}

.primary-button {
    background: var(--primary);
    color: #fff;
}

.secondary-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--primary-dark);
}

.login-panel,
.template-list,
.task-list,
.notification-stack,
.integration-list {
    display: grid;
    gap: 10px;
}

.segmented,
.answer-buttons,
.calendar-strip,
.workflow,
.thumb-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.segmented span,
.calendar-strip span,
.workflow span,
.thumb-row span {
    padding: 9px 10px;
    border-radius: 8px;
    background: #eef3f8;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.segmented .active,
.calendar-strip .active,
.workflow .active {
    background: #dbeafe;
    color: var(--primary);
}

.metric-row,
.management-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric,
.management-grid div {
    padding: 14px;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid var(--line);
}

.metric span,
.management-grid span,
.management-grid small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.metric strong,
.management-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
}

.metric.danger strong { color: var(--red); }

.dashboard-layout,
.analytics-layout,
.report-preview,
.admin-layout {
    display: grid;
    grid-template-columns: 1.1fr .8fr 1fr;
    gap: 14px;
}

.chart-card,
.risk-ring,
.report-page,
.recommendation,
.config-panel,
.supplier-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    padding: 14px;
}

.chart-bars {
    height: 138px;
    display: flex;
    align-items: end;
    gap: 10px;
}

.chart-bars span {
    flex: 1;
    min-width: 16px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #43b581, var(--primary));
}

.risk-ring {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: conic-gradient(var(--green) 0 86%, #e6edf5 86% 100%);
}

.risk-ring strong {
    font-size: 32px;
}

.alert-list,
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
}

.alert-list li,
.timeline li {
    padding: 11px;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid var(--line);
}

.alert-list span,
.timeline span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.template-list button,
.builder-row,
.weightage-row,
.status-card,
.notification-stack div,
.integration-list div,
.risk-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 11px;
}

.template-list button span,
.rating {
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.range-track,
.risk-list span {
    height: 8px;
    flex: 1;
    border-radius: 999px;
    background: #e7eef7;
    overflow: hidden;
}

.range-track i,
.risk-list span {
    display: block;
    background: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-card {
    background: #f8fbff;
}

.phone-frame {
    max-width: 310px;
    margin: 0 auto;
    border: 10px solid #172033;
    border-radius: 28px;
    background: #fff;
    padding: 16px;
}

.phone-top,
.score-footer {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.question-block {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    margin: 14px 0;
}

.answer-buttons button {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 9px;
}

.answer-buttons .yes {
    background: #dff6ec;
    border-color: #9ad8bd;
    color: var(--green);
}

.upload-zone {
    min-height: 130px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    border: 2px dashed #a8bfd8;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--muted);
    text-align: center;
}

.upload-zone.compact {
    min-height: 72px;
    margin-top: 12px;
}

.thumb-row {
    margin: 12px 0;
}

.status-card.critical {
    background: #fff0f0;
    border-color: #ffc7c7;
    color: var(--red);
}

.detail-list {
    display: grid;
    gap: 9px;
    margin: 12px 0 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
}

.workflow .done {
    background: #dff6ec;
    color: var(--green);
}

.report-preview {
    grid-template-columns: 1fr 170px;
}

.export-actions {
    display: grid;
    gap: 10px;
    align-content: start;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

.search-row button {
    border: 0;
    border-radius: 8px;
    background: var(--primary-dark);
    color: #fff;
    padding: 0 14px;
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(4, minmax(38px, 1fr));
    gap: 8px;
}

.heatmap span {
    aspect-ratio: 1;
    border-radius: 8px;
}

.heatmap .low { background: #b8e8cc; }
.heatmap .med { background: #ffe0a3; }
.heatmap .high { background: #ffaaa5; }

.analytics-layout {
    grid-template-columns: 1fr 1.3fr;
}

.integration-list span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
}

.integration-list em {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}

.risk-list {
    display: grid;
    gap: 12px;
}

.risk-list div {
    display: grid;
    grid-template-columns: 70px 1fr 70px;
}

.notification-stack div.danger { border-color: #ffc7c7; background: #fff7f7; }
.notification-stack div.warning { border-color: #ffd991; background: #fff9ed; }

.admin-layout {
    grid-template-columns: 1.4fr .8fr;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
}

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

th {
    background: #eaf2ff;
    color: var(--primary-dark);
}

.config-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

@media (max-width: 1180px) {
    .screen-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-layout,
    .form-grid,
    .metric-row,
    .management-grid,
    .executive-kpis,
    .dashboard-board,
    .page-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 16px;
    }

    .sidebar-card {
        position: static;
        margin-top: 16px;
    }

    .nav-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .topbar,
    .hero-panel {
        align-items: stretch;
        flex-direction: column;
        display: flex;
    }

    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .global-search {
        width: 100%;
    }

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

    .screen-grid,
    .screen-card.wide,
    .dashboard-layout,
    .analytics-layout,
    .report-preview,
    .admin-layout,
    .dashboard-board,
    .page-layout,
    .page-layout.two-column,
    .large-panel {
        display: grid;
        grid-template-columns: 1fr;
        grid-column: auto;
    }
}

@media (max-width: 560px) {
    .main-content {
        padding: 14px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .nav-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-metrics,
    .metric-row,
    .management-grid,
    .form-grid,
    .executive-kpis,
    .role-grid {
        grid-template-columns: 1fr;
    }

    .screen-card {
        padding: 14px;
    }

    .builder-row,
    .weightage-row,
    .status-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-list div,
    .risk-list div {
        grid-template-columns: 1fr;
    }
}

/* Standard admin navigation refresh */
:root {
    --menu-bg: #ffffff;
    --menu-ink: #172033;
    --menu-muted: #6b778c;
    --menu-line: #d8e0ec;
    --menu-active: #155eef;
    --menu-active-soft: #eef4ff;
}

.app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
    background: #f5f7fb;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 14px;
    overflow: hidden;
    background: var(--menu-bg);
    color: var(--menu-ink);
    border-right: 1px solid var(--menu-line);
    box-shadow: 8px 0 24px rgba(23, 32, 51, .04);
}

.brand {
    min-height: 58px;
    margin: 0;
    padding: 8px 10px 14px;
    border-bottom: 1px solid var(--menu-line);
    color: var(--menu-ink);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #155eef;
    color: #fff;
    box-shadow: 0 10px 20px rgba(21, 94, 239, .18);
}

.brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.brand small,
.sidebar-card small {
    color: var(--menu-muted);
}

.nav-list {
    flex: 1;
    display: block;
    overflow-y: auto;
    padding: 2px 4px 8px 0;
    scrollbar-width: thin;
}

.nav-section {
    display: block;
    margin: 16px 10px 7px;
    color: #8a94a6;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.nav-list a {
    min-height: 42px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 3px 0;
    padding: 7px 10px;
    border-radius: 8px;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-list a span {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #667085;
    font-size: 11px;
    font-weight: 900;
}

.nav-list a:hover {
    background: #f8fafc;
    color: var(--menu-active);
}

.nav-list a:hover span {
    background: var(--menu-active-soft);
    color: var(--menu-active);
}

.nav-list a.active {
    background: var(--menu-active-soft);
    color: var(--menu-active);
    border-color: #c7d7fe;
}

.nav-list a.active span {
    background: var(--menu-active);
    color: #fff;
}

.sidebar-card {
    position: static;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: 0;
    padding: 12px;
    border: 1px solid #c7d7fe;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--menu-ink);
}

.sidebar-card strong {
    display: block;
    color: #172033;
    font-size: 13px;
}

.status-dot {
    width: 9px;
    height: 9px;
    background: #12b76a;
}

.main-content {
    padding: 22px 26px 34px;
}

.topbar {
    min-height: 68px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(23, 32, 51, .05);
}

.topbar-link {
    background: #eef4ff;
    color: #155eef;
}

.logout-link {
    background: #fff1f3;
    color: #c01048;
}

.sidebar-logout {
    display: inline-flex;
    margin-top: 8px;
    color: #c01048;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.sidebar-logout:hover {
    text-decoration: underline;
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .nav-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .nav-section {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .nav-list {
        grid-template-columns: 1fr;
    }
}

.master-template-form {
    align-items: end;
}

.action-table th:last-child,
.action-table td:last-child {
    width: 96px;
    text-align: right;
}

.edit-button {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid #bcd0ff;
    border-radius: 8px;
    background: #eef4ff;
    color: #155eef;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.edit-button:hover {
    background: #155eef;
    color: #fff;
}

.editing-row td {
    background: #f4f8ff;
}

.editing-row td:first-child {
    border-left: 3px solid #155eef;
}

/* Full screen login */
.login-screen {
    height: 100vh;
    display: grid;
    grid-template-columns: minmax(440px, .95fr) minmax(500px, 1.05fr);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(9, 41, 84, .96), rgba(21, 94, 239, .88)),
        #0b2550;
    color: #fff;
}

.login-brand-panel {
    height: 100vh;
    min-height: 0;
    display: grid;
    align-content: space-between;
    gap: 20px;
    padding: 30px 42px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, .32), transparent 34%);
}

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: #155eef;
    font-size: 22px;
    font-weight: 900;
}

.login-brand-top strong {
    display: block;
    font-size: 22px;
}

.login-brand-top small,
.login-hero-copy p {
    color: rgba(255, 255, 255, .78);
}

.login-hero-copy {
    max-width: 690px;
}

.login-hero-copy .eyebrow {
    color: #9ff7df;
}

.login-hero-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 3.4vw, 52px);
    line-height: 1.04;
    letter-spacing: 0;
}

.login-hero-copy p {
    margin: 0;
    max-width: 620px;
    font-size: 16px;
    line-height: 1.55;
}

.login-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.login-stat-grid div {
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
}

.login-stat-grid strong {
    display: block;
    font-size: 25px;
}

.login-stat-grid span {
    color: rgba(255, 255, 255, .76);
    font-size: 13px;
}

.login-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.login-feature-list span {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 800;
}

.login-form-panel {
    height: 100vh;
    min-height: 0;
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 24px 42px;
    overflow: hidden;
    background: #f5f7fb;
    color: var(--ink);
}

.login-card {
    width: min(100%, 560px);
    justify-self: center;
    padding: 24px 28px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(23, 32, 51, .14);
}

.login-card-head {
    margin-bottom: 18px;
}

.secure-badge {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #067647;
    font-size: 12px;
    font-weight: 900;
}

.login-card h2 {
    margin: 0 0 6px;
    font-size: 30px;
}

.login-card p {
    margin: 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.login-submit {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: #155eef;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(21, 94, 239, .22);
}

.login-submit:hover {
    background: #0f49bd;
}

.login-support-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.login-support-row a {
    color: #155eef;
    text-decoration: none;
}

.login-role-strip {
    width: min(100%, 560px);
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.login-role-strip div {
    padding: 10px 13px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
}

.login-role-strip strong,
.login-role-strip span {
    display: block;
}

.login-role-strip span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.login-card input,
.login-card select {
    min-height: 46px;
    padding: 9px 12px;
}

.login-card label {
    gap: 5px;
}

@media (max-height: 820px) and (min-width: 981px) {
    .login-brand-panel {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .login-hero-copy h1 {
        font-size: clamp(31px, 3vw, 46px);
    }

    .login-hero-copy p {
        font-size: 15px;
        line-height: 1.45;
    }

    .login-stat-grid div {
        padding: 11px 13px;
    }

    .login-feature-list span {
        padding: 7px 10px;
        font-size: 12px;
    }

    .login-card {
        padding: 22px 26px;
    }

    .login-card h2 {
        font-size: 28px;
    }

    .login-role-strip div {
        padding: 9px 12px;
    }
}

@media (max-width: 980px) {
    .login-screen {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .login-brand-panel {
        height: auto;
        min-height: auto;
        padding: 28px;
    }

    .login-form-panel {
        height: auto;
        padding: 28px;
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .login-stat-grid,
    .login-two-col,
    .login-role-strip {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 22px;
    }
}

/* Modern dashboard */
.modern-dashboard {
    display: grid;
    gap: 18px;
}

.dashboard-command {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border: 1px solid #cfe0f7;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(21, 94, 239, .96), rgba(13, 148, 136, .88)),
        #155eef;
    color: #fff;
    box-shadow: 0 18px 40px rgba(21, 94, 239, .18);
}

.dashboard-command .eyebrow {
    color: #c9fff2;
}

.dashboard-command h2 {
    margin: 0 0 7px;
    font-size: 30px;
}

.dashboard-command p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
}

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

.dashboard-command .primary-button {
    background: #fff;
    color: #155eef;
}

.dashboard-command .secondary-button {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .28);
}

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

.kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    padding: 18px;
    border: 1px solid #d8e3f3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(23, 32, 51, .06);
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #155eef;
}

.kpi-card span,
.kpi-card small {
    display: block;
    color: #66758a;
    font-weight: 700;
}

.kpi-card strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 34px;
    line-height: 1;
}

.kpi-card.accent-cyan::before { background: #0891b2; }
.kpi-card.accent-green::before { background: #12b76a; }
.kpi-card.accent-red::before { background: #d92d20; }

.dashboard-analytics-grid {
    display: grid;
    grid-template-columns: 1.08fr 1fr .86fr;
    gap: 18px;
}

.analytics-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid #d8e3f3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(23, 32, 51, .07);
}

.analytics-card h3 {
    margin: 0;
    font-size: 23px;
}

.score-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #155eef;
    font-size: 12px;
    font-weight: 900;
}

.score-chip.positive {
    background: #ecfdf3;
    color: #067647;
}

.score-chip.danger {
    background: #fff1f3;
    color: #c01048;
}

.compliance-visual {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.compliance-ring {
    width: 178px;
    height: 178px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff 58%, transparent 59%),
        conic-gradient(#155eef calc(var(--score) * 1%), #e7edf7 0);
}

.compliance-ring strong {
    font-size: 34px;
}

.compliance-ring span {
    color: var(--muted);
    font-weight: 800;
}

.compliance-list {
    display: grid;
    gap: 10px;
}

.compliance-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e1e8f2;
    border-radius: 8px;
    background: #f8fbff;
}

.modern-bars {
    height: 224px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 13px;
    align-items: end;
    padding-top: 10px;
}

.modern-bars div {
    height: 100%;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 8px;
    align-items: end;
    text-align: center;
}

.modern-bars span {
    display: block;
    width: 100%;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #14b8a6, #155eef);
}

.modern-bars small {
    color: var(--muted);
    font-weight: 800;
}

.risk-stack {
    display: grid;
    gap: 18px;
    padding-top: 12px;
}

.risk-stack div {
    display: grid;
    grid-template-columns: 68px 1fr 28px;
    gap: 10px;
    align-items: center;
}

.risk-stack label {
    display: block;
    color: var(--ink);
    font-size: 13px;
}

.risk-stack span {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
}

.risk-stack i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f79009, #d92d20);
}

.risk-stack div:nth-child(2) i {
    background: linear-gradient(90deg, #fdb022, #f79009);
}

.risk-stack div:nth-child(3) i {
    background: linear-gradient(90deg, #32d583, #12b76a);
}

.dashboard-work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(340px, .72fr);
    gap: 18px;
}

.modern-table td strong,
.modern-table td small {
    display: block;
}

.modern-table td small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.modern-table tbody tr:hover td {
    background: #f8fbff;
}

.dashboard-side-stack {
    display: grid;
    gap: 18px;
}

.action-health {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.action-health div {
    padding: 14px;
    border: 1px solid #d8e3f3;
    border-radius: 8px;
    background: #f8fbff;
}

.action-health strong,
.action-health span {
    display: block;
}

.action-health strong {
    font-size: 30px;
}

.supplier-score-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg, #0f766e, #155eef);
    color: #fff;
}

.supplier-score-card .eyebrow,
.supplier-score-card span {
    color: rgba(255, 255, 255, .78);
}

.supplier-score-card h3 {
    font-size: 38px;
}

.supplier-score-card a {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

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

.modern-activity li {
    display: grid;
    gap: 3px;
    padding: 11px;
    border: 1px solid #e1e8f2;
    border-radius: 8px;
    background: #f8fbff;
}

.modern-activity span,
.modern-activity small {
    color: var(--muted);
}

.modern-activity span {
    font-size: 13px;
}

.modern-activity small {
    font-size: 12px;
}

@media (max-width: 1280px) {
    .dashboard-analytics-grid,
    .dashboard-work-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .dashboard-command {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-kpis,
    .compliance-visual,
    .action-health {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .dashboard-kpis,
    .compliance-visual,
    .action-health {
        grid-template-columns: 1fr;
    }

    .compliance-ring {
        margin: 0 auto;
    }
}
