/* ============================================================
   Duxton Pubs - Financial | Site-wide stylesheet
   Light theme (white background)

   STRUCTURE
   1. Theme tokens (:root)        - change colours here for rebrand
   2. Base / typography
   3. Layout helpers
   4. Cards (login box, section cards)
   5. Form controls
   6. Buttons
   7. Links, notes, helper text
   8. Tables - admin grids (dark style)
   9. Tables - dashboard grids (light style)
   10. KPI / card text overrides (light theme)
   11. Footer
   12. Status / messages
   13. Spinner (login page only - Site.Master overlay is separate)
   14. Responsive tweaks
   ============================================================ */


/* ---------- 1. Theme tokens ---------- */
:root {
    /* page */
    --bg-page: #ffffff;
    --text-primary: #000000;
    --text-secondary: #1a1a1a;
    --text-muted: #5a7a9a;
    /* navy cards (kept dark — sharp contrast on white page) */
    --bg-card: #0f2745;
    --bg-card-alt: #1a3a61;
    --text-on-card: #ffffff;
    --text-on-card-soft: #cfe6ff;
    --text-on-card-dim: #94a3b8;
    --heading-on-card: #e2e8f0;
    --title-on-card: #dbeafe;
    /* form inputs (light theme) */
    --bg-input: #ffffff;
    --border-input: #c5d0dc;
    --placeholder: #94a3b8;
    /* brand */
    --brand-navy: #1a3a61;
    --brand-blue: #1e40af;
    --brand-blue-hover: #244fd1;
    --brand-accent: #00b894; /* toned down from #00ffcc for white bg */
    --brand-accent-hover: #019170;
    --brand-gold: #ffd700;
    /* admin tables (kept dark — look sharp as dark panels on white) */
    --tbl-bg: #1b2b3b;
    --tbl-bg-alt: #223344;
    --tbl-header-bg: #2f4f6f;
    --tbl-border: #2a3b4e;
    --tbl-header-border: #415a76;
    --tbl-text: #ffffff;
    /* dashboard tables (light) */
    --dash-bg: #ffffff;
    --dash-bg-alt: #f9f9f9;
    --dash-bg-hover: #eef;
    --dash-header-bg: #f2f2f2;
    --dash-border: #dddddd;
    --dash-highlight: #c0ffc0;
    /* feedback */
    --danger: #c0392b;
    /* shape */
    --radius-card: 12px;
    --radius-control: 8px;
    --radius-control-sm: 6px;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.08);
}


/* ---------- 2. Base / typography ---------- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background-color: var(--bg-page);
    font-family: Arial, sans-serif;
    color: var(--text-primary);
}

h1, h3, h4 {
    color: var(--text-secondary);
}

/* h2 is used as page heading on white — must be dark, not white */
h2 {
    text-align: center;
    font-size: 32px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* GamingIQ navy banners (.head) and modal headers (.mhead) sit on dark, so their
   heading must stay light. The global h1..h4 / h2 rules above target the heading
   element directly and would otherwise override the banner's inherited white.
   These classes are used only on the gaming (navy) frames. */
.head h1, .head h2, .head h3, .head h4,
.mhead h1, .mhead h2, .mhead h3, .mhead h4 {
    color: var(--text-on-card);
}

a {
    color: var(--brand-navy);
}


/* ---------- 3. Layout helpers ---------- */
.body-content {
    padding: 20px 20px 40px 20px;
}

.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}


/* ---------- 4. Cards ---------- */

/* Login card (centered, fixed width) */
.login-box {
    background-color: var(--bg-card-alt);
    padding: 30px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    color: var(--text-on-card);
    width: 350px;
    margin: 100px auto 0 auto;
    text-align: center;
}

    .login-box h2 {
        /* heading inside the navy login card stays white */
        color: var(--text-on-card);
        margin-top: 0;
        margin-bottom: 16px;
        font-size: 24px;
    }

/* Section card (admin pages, etc.) */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--shadow-card);
    color: var(--text-on-card);
}

    .section-card h3 {
        color: var(--heading-on-card);
        font-size: 1.05rem;
        margin: 0 0 12px 0;
    }

.page-title {
    color: var(--text-secondary); /* sits on white page */
    font-size: 1.25rem;
    font-weight: 700;
    margin: 16px 0 8px 0;
}


/* ---------- 5. Form controls ---------- */

/* Default constrained width */
input,
select,
textarea {
    max-width: 280px;
}

    /* Login-style inputs (white inputs on navy card) */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"] {
        padding: 10px;
        margin: 10px;
        width: 250px;
        border-radius: var(--radius-control-sm);
        border: 1px solid var(--border-input);
        background-color: var(--bg-input);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 14px;
    }

        input[type="text"]:focus,
        input[type="password"]:focus,
        input[type="email"]:focus,
        input[type="number"]:focus,
        .form-control:focus {
            outline: none;
            border-color: var(--brand-accent);
            box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.15);
        }

/* Admin-style inputs (inside dark section-card / admin pages) */
.form-control {
    background: #0b1e36;
    border: 1px solid #244a7c;
    color: var(--text-on-card);
    border-radius: var(--radius-control);
    padding: 8px 10px;
    min-width: 220px;
}

    .form-control::placeholder {
        color: #64748b;
    }

/* Checkbox alignment helper */
.chk {
    transform: translateY(1px);
}


/* ---------- 6. Buttons ---------- */

/* Primary accent button (login, key calls-to-action) */
input[type="submit"],
.aspNetButton {
    padding: 10px 30px;
    background-color: var(--brand-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-control-sm);
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

    input[type="submit"]:hover,
    .aspNetButton:hover {
        background-color: var(--brand-accent-hover);
    }

.login-button {
    margin-top: 15px;
}

/* Generic .btn (admin pages) */
.btn {
    background: var(--brand-blue);
    color: #fff;
    border: 0;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .06s ease, background .15s ease;
    font-family: inherit;
}

    .btn:hover {
        transform: translateY(-1px);
        background: var(--brand-blue-hover);
    }

    .btn.secondary {
        background: #0b2547;
    }

    .btn.small {
        padding: 6px 10px;
        border-radius: var(--radius-control);
        font-size: .9rem;
    }
/* ===== Date-picker proxy alignment ===== */
/* The global input[type=text] rule gives every text input margin:10px + padding:10px.
   The date picker's text proxy (id ends "_au") inherits it, making the date field
   taller than the adjacent <select>. Reset the proxy to the standard 38px box. */
input[id$="_au"] {
    margin: 0 !important;
    height: 38px !important;
    padding: 0 11px !important;
    line-height: 36px;
    box-sizing: border-box;
}

span:has(> input[id$="_au"]) {
    height: 38px;
    box-sizing: border-box;
}

/* TAB Reads' toolbar controls have no fixed height — pin its select to match. */
.tr-page .toolbar .field select {
    height: 38px;
    box-sizing: border-box;
}

/* ---------- 7. Links, notes, helper text ---------- */
.reset-link-wrap {
    margin-top: 8px;
    margin-bottom: 10px;
}

.reset-link {
    color: var(--text-on-card-soft);
    text-decoration: underline;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
}

    .reset-link:hover {
        color: #ffffff;
    }

.reset-note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-on-card-soft);
}

.row-note {
    color: var(--text-on-card-dim);
    font-size: .85rem;
    margin-top: 8px;
}

.legal-notice {
    margin-top: 30px;
    font-size: 12px;
    color: var(--text-muted);
    opacity: .85;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}


/* ---------- 8. Tables - admin grids (dark style) ---------- */
.admin-grid {
    width: 100%;
    border-collapse: collapse;
    background: var(--tbl-bg);
    color: var(--tbl-text);
}

    .admin-grid th {
        background: var(--tbl-header-bg);
        color: var(--tbl-text);
        text-align: left;
        padding: 8px 10px;
        border-bottom: 2px solid var(--tbl-header-border);
    }

    .admin-grid td {
        padding: 6px 10px;
        border-bottom: 1px solid var(--tbl-border);
    }

    .admin-grid .grid-row-alt {
        background: var(--tbl-bg-alt);
    }

    .admin-grid .col-actions {
        white-space: nowrap;
    }

    .admin-grid td.num,
    .admin-grid th.num {
        text-align: right;
    }

    /* Action links inside grids */
    .admin-grid a,
    .grid-action {
        color: #fff !important;
        text-decoration: underline;
        margin-left: 6px;
    }

        .admin-grid a:hover,
        .grid-action:hover {
            color: var(--brand-gold) !important;
        }


/* ---------- 9. Tables - dashboard grids (light style) ---------- */
.master-dashboard-grid,
table.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 14px;
    background: var(--dash-bg);
    color: var(--text-primary);
}

    .master-dashboard-grid th,
    .master-dashboard-grid td,
    table.dashboard-table th,
    table.dashboard-table td {
        border: 1px solid var(--dash-border);
        padding: 10px;
        text-align: center;
        color: var(--text-primary);
    }

    .master-dashboard-grid th,
    table.dashboard-table th {
        background: var(--dash-header-bg);
        font-weight: bold;
    }

    .master-dashboard-grid tr:nth-child(even),
    table.dashboard-table tr:nth-child(even) {
        background: var(--dash-bg-alt);
    }

    .master-dashboard-grid tr:hover,
    table.dashboard-table tr:hover {
        background: var(--dash-bg-hover);
    }

    .master-dashboard-grid .highlight,
    table.dashboard-table .highlight {
        background: var(--dash-highlight);
        font-weight: bold;
    }


/* ---------- 10. KPI / card text (light theme) ----------
   These elements were styled for the old dark theme.
   On a white page they need dark text. Using normal specificity
   (no !important) so individual pages can still override if needed. */
.kpi-box,
.kpi-box .kpi-label,
.kpi-box .kpi-value,
.kpi-box .kpi-sub,
.card,
.card h3 {
    color: var(--text-primary);
}


/* ---------- 11. Footer ---------- */
footer {
    color: var(--text-muted);
    font-size: 12px;
    opacity: .9;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: center;
}

.footer-divider {
    opacity: .55;
}


/* ---------- 12. Status / messages ---------- */
.status-error,
.status-message {
    color: var(--danger);
    font-weight: bold;
}


/* ---------- 13. Spinner (login page) ---------- */
#spinner {
    display: none;
    margin-top: 30px;
    text-align: center;
    color: var(--text-primary);
    font-size: 14px;
}

    #spinner img {
        animation: spin 1s linear infinite;
        display: block;
        margin: 0 auto 10px auto;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/* ===== AU date-picker alignment ===== */
/* The picker hides <input type="date"> and shows a text proxy (id ends "_au")
   inside an inline-flex <span>, which renders taller than the sibling <select>
   and pushes the date field's label up. Pin the proxy + its wrapper to the
   app's standard 38px control height so every date field lines up. */
span:has(> input[id$="_au"]) {
    height: 38px;
    box-sizing: border-box;
}

input[id$="_au"] {
    height: 38px !important;
    box-sizing: border-box;
    padding: 0 11px;
    line-height: 36px;
    margin: 0;
}

/* TAB Reads' toolbar controls have no fixed height — pin its select to 38px too. */
.tr-page .toolbar .field select {
    height: 38px;
    box-sizing: border-box;
}

/* ---------- 14. Responsive tweaks ---------- */
@media screen and (min-width: 768px) {
    /* (intentionally minimal — admin styles now apply on all sizes) */
}
