:root {
    --ink: #10232b;
    --muted: #5d7380;
    --line: #d9e4ea;
    --paper: #fffdf8;
    --panel: #ffffff;
    --ocean: #0b3d4a;
    --ocean-deep: #06262f;
    --aqua: #14b8a6;
    --aqua-soft: #d7f6f1;
    --gold: #e8b86d;
    --sand: #f4efe4;
    --shadow: 0 18px 40px rgba(6, 38, 47, 0.08);
    --radius: 22px;
}

html, body {
    font-family: Manrope, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 12% -10%, #d8f4ef 0, transparent 28%),
        radial-gradient(circle at 90% 0%, #f8e7c6 0, transparent 24%),
        linear-gradient(180deg, #f7f4ee 0%, #eef3f4 100%);
    color: var(--ink);
}

h1, h2, .display {
    font-family: Fraunces, Georgia, serif;
    letter-spacing: -0.03em;
}

.page-hero,
.dash-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
}

.page-hero h1,
.dash-head h1 {
    margin: 0;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.dash-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 11px;
    font-weight: 800;
    color: var(--aqua);
}

.hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ocean);
}

.kpi-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.kpi-secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi {
    position: relative;
    min-width: 0;
    background: #f3f8f6;
    border: 1px solid #d7e6e1;
    border-radius: 16px;
    padding: 16px 16px 14px 18px;
    box-shadow: 0 8px 20px rgba(11, 61, 74, 0.04);
}

.kpi::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 99px;
    background: #7aa8a0;
}

.kpi.sale {
    background: linear-gradient(180deg, #e8f7f2 0%, #f4fbf8 100%);
    border-color: #c6e6dc;
}
.kpi.sale::before { background: #0f766e; }

.kpi.recovery {
    background: linear-gradient(180deg, #fbf0e4 0%, #fdf7ef 100%);
    border-color: #ecd7be;
}
.kpi.recovery::before { background: #c2782a; }

.kpi.current {
    background: linear-gradient(180deg, #e9f3fb 0%, #f4f9fd 100%);
    border-color: #c9dceb;
}
.kpi.current::before { background: #3b82a8; }

.kpi.collection {
    background: linear-gradient(180deg, #eef6ea 0%, #f6faf3 100%);
    border-color: #cfe0c6;
}
.kpi.collection::before { background: #5b8a3c; }

.kpi.ship {
    background: linear-gradient(180deg, #eef2f8 0%, #f6f8fb 100%);
    border-color: #d0d8e4;
}
.kpi.ship::before { background: #5b6d86; }

.kpi.commission {
    background: linear-gradient(180deg, #f8f1dc 0%, #fbf7ec 100%);
    border-color: #e6d7b0;
}
.kpi.commission::before { background: #b0892e; }

.kpi-label {
    display: block;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

a.kpi-label:hover {
    color: var(--ocean);
}

.kpi-value {
    display: block;
    margin-top: 8px;
    color: var(--ocean-deep);
    font-size: clamp(1.05rem, 2.6vw, 1.55rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.kpi-primary .kpi {
    padding: 18px 18px 16px 20px;
    min-height: 96px;
}

.kpi-secondary .kpi {
    padding: 14px 14px 12px 16px;
}

.kpi-secondary .kpi-value {
    font-size: clamp(0.98rem, 2vw, 1.2rem);
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(11, 61, 74, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(6, 38, 47, 0.05);
    overflow: hidden;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    font-size: 1.45rem;
}

.panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.table-wrap,
.table-responsive {
    overflow: auto;
}

.rich-table {
    width: 100%;
    border-collapse: collapse;
}

.rich-table th,
.rich-table td,
.table th,
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid #e4eee9;
    text-align: left;
}

.rich-table thead th,
.table thead th {
    background: #dceee9;
    color: #3e5a66;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    --bs-table-bg: #dceee9;
}

.rich-table tbody tr:nth-child(3n + 1) > *,
.table tbody tr:nth-child(3n + 1) > * {
    background-color: #e8f7f2;
    --bs-table-bg: #e8f7f2;
}

.rich-table tbody tr:nth-child(3n + 2) > *,
.table tbody tr:nth-child(3n + 2) > * {
    background-color: #fbf3e8;
    --bs-table-bg: #fbf3e8;
}

.rich-table tbody tr:nth-child(3n + 3) > *,
.table tbody tr:nth-child(3n + 3) > * {
    background-color: #eef4fb;
    --bs-table-bg: #eef4fb;
}

.rich-table tbody tr:hover > *,
.table tbody tr:hover > * {
    background-color: #dff3ec;
    --bs-table-bg: #dff3ec;
}

.rich-table tbody tr.empty-row > *,
.table tbody tr.empty-row > * {
    background-color: #f7faf8;
    --bs-table-bg: #f7faf8;
}

.rich-table tfoot td,
.table tfoot td {
    background: #0b3d4a;
    color: #fff;
    font-weight: 800;
    --bs-table-bg: #0b3d4a;
}

.num, .text-end {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.marathi {
    font-weight: 800;
}

.banner,
.alert {
    border-radius: 16px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(6, 38, 47, 0.72), rgba(11, 61, 74, 0.55)),
        url("data:image/svg+xml,%3Csvg width='160' height='160' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 80h160M80 0v160' stroke='%23ffffff14' stroke-width='1'/%3E%3C/svg%3E"),
        linear-gradient(160deg, #06262f, #0b3d4a 55%, #11706a);
}

.gate-card {
    width: min(520px, 100%);
    background: rgba(255, 253, 248, 0.96);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 32px;
    padding: 36px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.28);
}

.gate-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.brand-mark,
.gate-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #1ad1bc, #0f766e);
    color: #fff;
    font-weight: 800;
}

.gate-card h1 {
    margin: 0 0 10px;
    font-size: 2.3rem;
}

.gate-card p {
    color: var(--muted);
}

.gate-card .form-control {
    border-radius: 14px;
    padding: 14px 16px;
    border-color: var(--line);
}

.btn-primary,
.btn-aqua {
    background: linear-gradient(180deg, #17c3b0, #0f766e);
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 800;
}

.btn-primary:hover,
.btn-aqua:hover {
    background: #0d6a62;
}

.suggest-list {
    list-style: none;
    padding: 8px;
    margin: 8px 0 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    max-height: 240px;
    overflow: auto;
}

.vendor-code {
    color: #b45309;
    font-weight: 800;
    margin-top: 10px;
}

.metric-box {
    background: #f7fbfb;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 800;
}

.company-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--aqua-soft);
    color: var(--ocean);
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
}

.content {
    padding-top: 1.2rem;
    padding-bottom: 2rem;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.install-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #0b3d4a;
    color: #fff;
}

.install-banner p {
    margin: 4px 0 0;
    color: #c9ebe6;
    font-size: 13px;
}

.install-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.empty-row td {
    color: var(--muted);
    padding: 28px 18px;
}

@media (max-width: 960px) {
    .kpi-secondary {
        grid-template-columns: 1fr 1fr;
    }

    .page-hero,
    .dash-head {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 16px;
        gap: 8px;
    }

    .page-hero h1,
    .dash-head h1 {
        font-size: 1.35rem;
    }

    .gate-card {
        width: 100%;
        padding: 24px;
        border-radius: 24px;
    }

    .company-label {
        max-width: 34vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .install-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .kpi-row,
    .kpi-secondary {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .kpi,
    .kpi-primary .kpi,
    .kpi-secondary .kpi {
        padding: 14px 12px 12px 14px;
        min-height: 0;
    }

    .kpi-label {
        font-size: 12px;
    }

    .kpi-value,
    .kpi-primary .kpi-value,
    .kpi-secondary .kpi-value {
        font-size: 1.05rem;
    }

    .rich-table th,
    .rich-table td,
    .table th,
    .table td {
        padding: 12px 12px;
        font-size: 14px;
    }
}
