:root {
    --bg: #f4efe6;
    --panel: #fffaf2;
    --panel-strong: #fff4de;
    --text: #1b1a17;
    --muted: #5f5a52;
    --accent: #116466;
    --accent-dark: #083c3d;
    --line: #ded2bd;
    --error: #b42318;
    --success: #0f766e;
    --shadow: 0 18px 50px rgba(22, 20, 15, 0.08);
    --report-orange: #ef7e2f;
    --report-yellow: #ffc928;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(17, 100, 102, 0.12), transparent 28%),
        linear-gradient(135deg, #f4efe6 0%, #efe4cf 100%);
}

.page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 40px 20px 56px;
}

.top-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
}

.nav-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.hero {
    padding: 12px 0 28px;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--accent-dark);
}

h1,
h2,
h3 {
    margin: 0 0 12px;
    line-height: 1.1;
}

h1 {
    max-width: 12ch;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
}

h3 {
    margin-bottom: 6px;
}

.lead {
    max-width: 56rem;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.panel {
    margin-top: 22px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.file-form {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.field span {
    color: var(--text);
    font-weight: 700;
}

select,
button,
.secondary,
.nav-link {
    font: inherit;
}

select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
}

small {
    color: var(--muted);
}

.actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

button,
.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

button {
    border: 0;
    background: var(--accent);
    color: white;
    cursor: pointer;
    gap: 8px;
}

button:disabled {
    cursor: wait;
    opacity: 0.9;
}

.button-working {
    display: none;
}

button.is-loading .button-label {
    display: none;
}

button.is-loading .button-working {
    display: inline;
}

.secondary {
    border: 1px solid var(--line);
    color: var(--text);
    background: transparent;
}

button:hover,
.secondary:hover,
.nav-link:hover {
    transform: translateY(-1px);
}

.success {
    background: linear-gradient(145deg, #f6fff9 0%, #eefbf6 100%);
}

.error {
    background: linear-gradient(145deg, #fff5f4 0%, #fdeeed 100%);
    color: var(--error);
}

.output-list {
    display: grid;
    gap: 14px;
}

.output-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.75);
}

.output-item p {
    margin: 0;
    color: var(--muted);
}

.output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form {
    margin: 0;
}

.report-output-list .output-item {
    align-items: flex-start;
}

.report-button {
    min-width: 160px;
}

.report-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px;
    margin-bottom: 12px;
}

.report-filter-field {
    flex: 1 1 220px;
    margin: 0;
}

.report-filter-actions {
    display: flex;
    align-items: end;
    gap: 10px;
}

.report-apply-button {
    min-width: 140px;
}

.report-filter-note {
    margin: 0 0 16px;
    color: var(--muted);
}

.report-share-actions {
    align-items: center;
    margin: 0 0 18px;
}

.whatsapp-share-panel {
    margin-top: 30px;
}

.client-share-status {
    margin-top: 18px;
}

.share-help {
    margin: 0;
}

.report-summary-grid {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.report-summary-grid p,
.report-panel p {
    margin: 0;
}

.update-report-panel {
    overflow: hidden;
}

.update-title-bar {
    margin-bottom: 10px;
    padding: 10px 16px;
    border: 1px solid #5d5d5d;
    background: var(--report-orange);
    color: white;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.04em;
}

.share-title {
    margin-top: 14px;
}

.asp-date-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    margin: 12px 0 16px;
    padding: 10px 18px;
    border: 2px solid #202020;
    background: var(--report-yellow);
    font-size: 1.1rem;
    font-weight: 700;
}

.asp-share-wrap {
    margin-top: 28px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 18px;
}

.compact-wrap {
    margin-top: 28px;
}

.day-wise-report-grid {
    display: grid;
    gap: 28px;
}

.day-wise-metric-wrap {
    margin-top: 0;
}

.day-wise-metric-title {
    margin-bottom: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(60, 60, 60, 0.45);
    background: #f5b325;
    font-weight: 700;
    text-align: center;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.update-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1220px;
    background: white;
}

.day-wise-table {
    min-width: 760px;
}

.share-table {
    min-width: 420px;
}

.report-table th,
.report-table td,
.update-table th,
.update-table td {
    padding: 8px 10px;
    border: 1px solid rgba(60, 60, 60, 0.4);
    text-align: center;
    white-space: nowrap;
    font-size: 0.82rem;
}

.report-table th,
.update-table thead th {
    background: var(--report-yellow);
    font-weight: 700;
}

.report-table thead th {
    position: sticky;
    top: 0;
}

.report-table td:nth-child(2),
.update-table td:nth-child(2),
.update-table th:nth-child(2) {
    text-align: left;
}

.report-table .total-row td,
.update-total-row td {
    font-weight: 700;
    background: #fff35a;
}

.day-wise-table th.day-wise-ftd-header {
    background: #fff200;
}

.day-wise-table th.day-wise-mtd-header {
    background: #92d050;
}

.day-wise-negative {
    background: #f7c7cf;
    color: #b22020;
}

.margin-report-table {
    min-width: 1180px;
}

.margin-report-table th:first-child,
.margin-report-table td:first-child {
    text-align: left;
}

.margin-report-table .margin-net-header {
    background: #548235;
    color: #ffffff;
}

.margin-report-table .margin-net-cell {
    background: #c6e0b4;
}

.margin-summary-wrap {
    max-width: 420px;
    margin-left: auto;
}

.margin-summary-table {
    min-width: 360px;
}

.margin-summary-table td:first-child {
    text-align: left;
}

.margin-profit-row td {
    background: #00b050;
    color: #ffffff;
    font-weight: 700;
}

.margin-sales-row td {
    background: #fff200;
    font-weight: 700;
}

.state-subtotal-row td {
    font-weight: 700;
    background: var(--report-orange);
    color: white;
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 28px;
}

.loading-shell {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(27, 26, 23, 0.36);
    backdrop-filter: blur(5px);
    z-index: 999;
}

.loading-shell.active {
    display: flex;
}

.loading-card {
    width: min(100%, 420px);
    padding: 28px;
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    text-align: center;
}

.loading-card p {
    margin: 0;
    color: var(--muted);
}

.spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    border: 4px solid rgba(17, 100, 102, 0.18);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

.warnings ul,
.notes ol {
    margin: 12px 0 0;
    padding-left: 20px;
}

.notes li,
.warnings li {
    margin-bottom: 8px;
    line-height: 1.5;
}

code {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(17, 100, 102, 0.08);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 960px) {
    .share-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 28px 14px 40px;
    }

    .panel {
        padding: 18px;
        border-radius: 18px;
    }

    .actions,
    .top-nav,
    .report-filter-row,
    .report-filter-actions {
        flex-direction: column;
    }

    .output-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-filter-field,
    .report-filter-actions,
    .report-button,
    .inline-form,
    .inline-form button {
        width: 100%;
    }
}







.danger-button {
    background: var(--error);
    color: white;
}


.manage-files-actions {
    margin-bottom: 14px;
}

.selectable-output-item {
    align-items: center;
    cursor: pointer;
}

.file-select-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
}

.file-select-box input {
    width: 18px;
    height: 18px;
}


.login-panel {
    max-width: 560px;
}

.login-form {
    grid-template-columns: 1fr;
}

input[type='text'],
input[type='password'],
input[type='file'] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
}

