/* Light-only, deliberately — there is no dark theme anywhere in this app (dashboard or
   marketing) by product decision, so these tokens are the only palette that exists. */
:root {
    --pos-bg: #f4f5f7;
    --pos-surface: #ffffff;
    --pos-border: #e2e4e9;
    --pos-text: #1c1f26;
    --pos-text-muted: #6b7280;
    --pos-accent: #3b5bfd;
    --pos-accent-hover: #2f49d1;
    --pos-danger: #d1293d;
    --pos-disabled: #b6bdd6;
    --pos-radius: 10px;
    --pos-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: var(--pos-text);
    background: var(--pos-bg);
}

a {
    color: var(--pos-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.25;
}

h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

h2 {
    font-size: 1.15rem;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2rem;
}

/* The uppercase/bordered treatment below is dashboard-only, scoped under .dash-shell —
   marketing pages use raw <h2> too (Terms/Privacy/Cookies section headings, Home/Product
   section titles) with their own, different h2 styling in MarketingLayout.razor.css, and would
   otherwise inherit an unwanted left border and lose their intended alignment/size. */
.dash-shell h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pos-text);
    letter-spacing: 0.05em;
    margin: 2.5rem 0 1rem;
    padding-left: 12px;
    border-left: 3px solid var(--pos-accent);
}

/* Dashboard-only shell: every page (@Body in MainLayout) renders its own uniquely-named wrapper
   (.dashboard, .products, .customers, …) with no class in common between them, so this is the
   single place that gives all of them the same outer breathing room and a readable max width on
   a wide monitor — see MainLayout.razor. Deliberately not touching --pos-bg/--pos-radius/
   --pos-shadow themselves: those are shared with the marketing site's already-tuned layout. */
.dash-shell {
    /* Slightly deeper than the shared --pos-bg (also used by the marketing site, unchanged
       there) so cards get real lift against the page instead of nearly matching it. Full-bleed;
       .dash-shell-inner is the actual centered/max-width content column. */
    --pos-bg: #e9ebf0;
    background: var(--pos-bg);
    min-height: 100vh;
}

.dash-shell-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 28px 32px 8px;
}

/* Shared surfaces */
.pos-card {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 20px -4px rgba(16, 24, 40, 0.10);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}

/* The From/To/Apply-style filter row every report page opens with (<div class="pos-card
   filters">) — never had its own layout rule, so it fell back to plain stacked block children. */
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
}

.filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pos-text-muted);
}

.filters button, .filters .pos-button {
    height: 42px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--pos-accent);
}

.subtitle {
    margin: 4px 0 0;
    color: var(--pos-text-muted);
    font-size: 0.9rem;
}

/* Buttons */
button, .pos-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--pos-accent);
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 0 0 1px color-mix(in srgb, var(--pos-accent) 12%, transparent);
    transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

button:hover:not(:disabled), .pos-button:hover {
    background: var(--pos-accent-hover);
}

button:active:not(:disabled), .pos-button:active {
    transform: translateY(1px);
}

button:disabled {
    background: var(--pos-disabled);
    box-shadow: none;
    cursor: not-allowed;
}

button.pos-secondary, a.pos-secondary {
    color: var(--pos-text);
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    box-shadow: none;
}

button.pos-secondary:hover:not(:disabled), a.pos-secondary:hover {
    background: var(--pos-bg);
}

/* Inputs */
input, select {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--pos-text);
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--pos-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos-accent) 15%, transparent);
}

input[type="checkbox"] {
    width: auto;
    padding: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius);
    overflow: hidden;
}

th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pos-text-muted);
    background: color-mix(in srgb, var(--pos-bg) 60%, var(--pos-surface));
    border-bottom: 1px solid var(--pos-border);
    padding: 13px 16px;
}

td {
    padding: 13px 16px;
    border-top: 1px solid var(--pos-border);
}

tbody tr {
    transition: background-color 100ms ease;
}

tbody tr:hover {
    background: color-mix(in srgb, var(--pos-accent) 4%, transparent);
}

tr.pos-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--pos-text);
}

tr.pos-total-row:hover {
    background: transparent;
}

.pos-error {
    color: var(--pos-danger);
    font-weight: 500;
}

/* /home — the light post-login landing page (DashboardHome.razor). */
.home-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.home-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.home-stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--pos-text);
}

.home-stat-link {
    color: inherit;
    text-decoration: none;
    transition: transform 120ms ease;
}

.home-stat-link:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.home-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    color: var(--pos-text);
    text-decoration: none;
    padding: 1.5rem 1rem;
    transition: transform 120ms ease, border-color 120ms ease;
}

.home-link:hover {
    text-decoration: none;
    border-color: var(--pos-accent);
    transform: translateY(-2px);
}

/* Legacy nav container class — the dashboard nav now lives in DashboardNav.razor (.dash-nav)
   with its own scoped styles. Kept as a harmless fallback for any page still using it. */
.header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}

.app-version-footer {
    text-align: center;
    color: var(--pos-text-muted);
    font-size: 0.8rem;
    padding: 32px 0 40px;
}

h1:focus {
    outline: none;
}

/* The dashboard nav (DashboardNav.razor) sits beside the page title in each page's flex
   header (.page-header, .dashboard-header, .products-header, …). Give it a wide gap from the
   title, let it wrap to its own row on narrow screens, and keep the title on one line.
   `gap` isn't set by any of the per-page scoped rules, so this applies everywhere. */
[class$="-header"] {
    gap: 56px;
    row-gap: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--pos-border);
}

[class$="-header"] h1 {
    white-space: nowrap;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPS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0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}
