:root {
    --bg: #f5f7fb;
    --ink: #172033;
    --muted: #647087;
    --line: #dfe5ee;
    --panel: #ffffff;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b42318;
    --warn: #9a6700;
}

* {
    box-sizing: border-box;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 58px;
    padding: 0 28px;
    background: #14213d;
    color: #fff;
    box-shadow: 0 2px 10px rgba(20, 33, 61, .18);
}

.brand {
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 58px;
}

.nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    font-size: 14px;
}

.user-menu span {
    color: rgba(255, 255, 255, .82);
}

.user-menu a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.user-menu a:hover {
    text-decoration: underline;
}

.dropdown {
    position: relative;
    height: 58px;
    display: flex;
    align-items: center;
}

.dropbtn {
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.dropbtn::after {
    content: "";
    display: inline-block;
    margin-left: 8px;
    border: 5px solid transparent;
    border-top-color: currentColor;
    transform: translateY(3px);
}

.dropdown:hover .dropbtn,
.dropbtn:focus {
    background: rgba(255, 255, 255, .12);
}

.dropdown-menu {
    position: absolute;
    top: 58px;
    left: 0;
    display: none;
    min-width: 210px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(20, 33, 61, .18);
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: #e8f3f1;
    color: var(--accent-dark);
}

.wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 32px;
}

h2 {
    margin-bottom: 14px;
    font-size: 18px;
}

.filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

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

.filters input,
.filters select {
    height: 40px;
    min-width: 160px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

.filters button {
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stats div,
.panel,
.alert,
.notice {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stats div {
    padding: 16px;
}

.stats .stat-card-1,
.quick-links .quick-link-1 {
    background: #ecfdf3;
}

.stats .stat-card-2,
.quick-links .quick-link-2 {
    background: #eff6ff;
}

.stats .stat-card-3,
.quick-links .quick-link-3 {
    background: #fff7ed;
}

.stats .stat-card-4,
.quick-links .quick-link-4 {
    background: #f5f3ff;
}

.stats .stat-card-5,
.quick-links .quick-link-5 {
    background: #fef2f2;
}

.stats .stat-card-6,
.quick-links .quick-link-6 {
    background: #f0fdfa;
}

.stats .stat-card-7,
.quick-links .quick-link-7 {
    background: #fefce8;
}

.stats .stat-card-8,
.quick-links .quick-link-8 {
    background: #eef2ff;
}

.stats span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stats strong {
    font-size: 22px;
}

.panel {
    margin-bottom: 20px;
    padding: 18px;
}

.report-panel {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.vertical-title {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    margin: 0;
    padding: 14px 8px;
    border-radius: 6px;
    background: #e8f3f1;
    color: #4f6f75;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.chart-panel {
    display: flex;
    flex-direction: column;
    height: 340px;
}

.chart-panel h2 {
    flex: 0 0 auto;
    margin-bottom: 12px;
}

.chart-panel canvas {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.inline-filter {
    margin-bottom: 20px;
}

.chart-type-filter {
    margin-bottom: 12px;
}

.product-search {
    align-items: end;
}

.product-search .search-field {
    flex: 1 1 360px;
}

.product-search input[type="search"] {
    height: 40px;
    width: 100%;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

.table-wrap,
.data-grid-wrap {
    overflow-x: auto;
}

.data-grid {
    display: grid;
    min-width: 860px;
    border-bottom: 1px solid var(--line);
}

.grid-cols-4 {
    grid-template-columns: minmax(90px, .5fr) minmax(260px, 1.6fr) repeat(2, minmax(140px, .8fr));
}

.grid-cols-quotation {
    grid-template-columns: minmax(120px, .7fr) minmax(180px, 1fr) minmax(360px, 1.8fr) minmax(140px, .7fr);
}

.grid-cols-client-sales {
    grid-template-columns: minmax(100px, .5fr) minmax(280px, 1.8fr) minmax(160px, .8fr);
}

.grid-cols-client-profit {
    grid-template-columns: minmax(100px, .5fr) minmax(260px, 1.5fr) repeat(3, minmax(150px, .8fr));
}

.grid-cols-5 {
    grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(130px, .8fr));
}

.grid-cols-6 {
    grid-template-columns: minmax(90px, .5fr) minmax(240px, 1.5fr) repeat(4, minmax(130px, .8fr));
}

.grid-cols-7 {
    grid-template-columns: minmax(120px, .8fr) minmax(150px, 1fr) minmax(220px, 1.4fr) repeat(4, minmax(120px, .8fr));
}

.grid-cols-8 {
    grid-template-columns: minmax(120px, .8fr) minmax(150px, 1fr) minmax(220px, 1.4fr) repeat(3, minmax(140px, .9fr)) minmax(130px, .8fr) minmax(180px, 1.1fr);
}

.grid-cols-9 {
    grid-template-columns: minmax(130px, .8fr) minmax(130px, .8fr) minmax(220px, 1.4fr) minmax(130px, .8fr) minmax(110px, .7fr) repeat(4, minmax(130px, .8fr));
}

.grid-cols-10 {
    grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .8fr) minmax(140px, .8fr) minmax(140px, .8fr) minmax(110px, .7fr) minmax(110px, .7fr) minmax(90px, .6fr) repeat(3, minmax(130px, .8fr));
}

.grid-cols-delivery-status {
    grid-template-columns: minmax(110px, .7fr) minmax(130px, .8fr) minmax(220px, 1.3fr) minmax(240px, 1.5fr) minmax(120px, .7fr) repeat(3, minmax(110px, .6fr)) minmax(140px, .8fr) minmax(120px, .7fr);
}

.grid-head,
.grid-cell {
    min-width: 0;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.grid-head {
    background: #14213d;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.report-grid .grid-head {
    background: #e8f3f1;
    color: #4f6f75;
}

.grid-empty {
    grid-column: 1 / -1;
    padding: 28px 10px;
    color: var(--muted);
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.client-sales-table th:first-child,
.client-sales-table td:first-child {
    width: 120px;
}

.client-sales-table th:last-child,
.client-sales-table td:last-child {
    width: 220px;
}

.client-profit-table th:first-child,
.client-profit-table td:first-child {
    width: 120px;
}

.client-profit-table th:nth-child(3),
.client-profit-table td:nth-child(3),
.client-profit-table th:nth-child(4),
.client-profit-table td:nth-child(4),
.client-profit-table th:nth-child(5),
.client-profit-table td:nth-child(5) {
    width: 190px;
}

.delivery-status-table {
    min-width: 1180px;
}

.delivery-status-table th:first-child,
.delivery-status-table td:first-child,
.delivery-status-table th:nth-child(2),
.delivery-status-table td:nth-child(2),
.delivery-status-table th:nth-child(5),
.delivery-status-table td:nth-child(5),
.delivery-status-table th:nth-child(9),
.delivery-status-table td:nth-child(9),
.delivery-status-table th:nth-child(10),
.delivery-status-table td:nth-child(10) {
    width: 120px;
}

.delivery-status-table th:nth-child(3),
.delivery-status-table td:nth-child(3) {
    width: 220px;
}

.delivery-status-table th:nth-child(6),
.delivery-status-table td:nth-child(6),
.delivery-status-table th:nth-child(7),
.delivery-status-table td:nth-child(7),
.delivery-status-table th:nth-child(8),
.delivery-status-table td:nth-child(8) {
    width: 105px;
}

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

th {
    background: #14213d;
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
}

td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.cell-color-1 {
    background: #ecfdf3;
}

.cell-color-2 {
    background: #eff6ff;
}

.cell-color-3 {
    background: #fff7ed;
}

.cell-color-4 {
    background: #f5f3ff;
}

.cell-color-5 {
    background: #fef2f2;
}

.cell-color-6 {
    background: #f0fdf4;
}

.cell-color-7 {
    background: #fefce8;
}

.cell-color-8 {
    background: #eef2ff;
}

.cell-color-9 {
    background: #f0fdfa;
}

.cell-color-10 {
    background: #faf5ff;
}

.cell-color-11 {
    background: #fff1f2;
}

.cell-color-12 {
    background: #f8fafc;
}

.num {
    text-align: right;
    white-space: nowrap;
}

.pending {
    color: var(--warn);
    font-weight: 700;
}

.loss {
    color: var(--danger);
    font-weight: 700;
}

.gain {
    color: var(--accent-dark);
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--muted);
    text-transform: capitalize;
}

.pending-badge {
    background: #fffbeb;
    color: var(--warn);
}

.delivered-badge {
    background: #ecfdf3;
    color: var(--accent-dark);
}

.alert,
.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
}

.alert {
    border-color: #fecdca;
    background: #fff4f2;
    color: var(--danger);
}

.notice {
    border-color: #fedf89;
    background: #fffbeb;
    color: #7a5600;
}

.empty {
    padding: 28px 10px;
    color: var(--muted);
    text-align: center;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.quick-links a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.quick-links a:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}


.login-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(12, 18, 34, .84), rgba(12, 86, 81, .7)),
        url("assets/india-flag.jpg") center / cover no-repeat fixed,
        #14213d;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px;
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 28px;
    width: min(100%, 980px);
    padding: 22px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(6, 16, 32, .34);
    backdrop-filter: blur(14px);
}

.login-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 430px;
    padding: 34px;
    color: #fff;
}

.login-brand img {
    width: min(280px, 100%);
    height: auto;
    margin-bottom: 34px;
    object-fit: contain;
}

.login-brand .eyebrow {
    color: rgba(255, 255, 255, .76);
}

.login-brand h1 {
    max-width: 460px;
    margin-bottom: 12px;
    color: #fff;
    font-size: 42px;
    line-height: 1.08;
}

.login-brand p:last-child {
    max-width: 430px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 16px;
    line-height: 1.6;
}

.login-card {
    align-self: center;
    padding: 30px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(6, 16, 32, .22);
}

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

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

.login-form input {
    height: 46px;
    width: 100%;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    outline: none;
}

.login-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

.login-form button {
    height: 46px;
    margin-top: 4px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.login-form button:hover {
    background: var(--accent-dark);
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 0 16px;
        padding-bottom: 12px;
    }

    .nav {
        align-items: stretch;
        flex-wrap: wrap;
        min-height: 0;
        width: 100%;
    }

    .nav a {
        min-height: 34px;
        padding: 0 9px;
    }

    .user-menu {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .wrap {
        padding: 20px 14px;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .report-panel {
        display: block;
    }

    .vertical-title {
        min-height: 0;
        margin-bottom: 14px;
        writing-mode: horizontal-tb;
        transform: none;
    }

    .filters,
    .filters label,
    .filters input,
    .filters button {
        width: 100%;
    }

    h1 {
        font-size: 26px;
    }

    .login-shell {
        padding: 18px;
    }

    .login-panel {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 14px;
    }

    .login-brand {
        min-height: 0;
        padding: 22px 18px 24px;
    }

    .login-brand img {
        width: min(220px, 100%);
        margin-bottom: 22px;
    }

    .login-brand h1 {
        font-size: 30px;
    }

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