
/*
 * FITCORE GYM — ROYAL BLACK & CHAMPAGNE GOLD THEME
 * Presentation layer only.
 * Existing PHP, database logic, roles and permissions remain unchanged.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --ink: #191919;
    --ink-2: #232323;
    --ink-3: #303030;
    --gold: #c5a46d;
    --gold-deep: #a8874d;
    --gold-soft: #f4ead7;
    --bg: #f6f4ef;
    --paper: #fffefa;
    --text: #292824;
    --muted: #858176;
    --line: #e8e2d7;
    --green: #2e7856;
    --red: #a9443c;
    --blue: #496d8a;
    --shadow: 0 8px 28px rgba(35, 29, 18, .055);
    --radius: 14px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    min-height: 100vh;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 258px;
    background: linear-gradient(180deg, #191919 0%, #20201e 100%);
    color: #f9f5ed;
    display: flex;
    flex-direction: column;
    z-index: 30;
    padding: 23px 15px 16px;
    overflow-y: auto;
    border-right: 1px solid rgba(197, 164, 109, .22);
    box-shadow: 8px 0 28px rgba(20, 18, 13, .08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 24px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: .2px;
    min-width: 0;
}

.brand > span:last-child {
    overflow-wrap: anywhere;
}

.brand-mark,
.login-logo {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 41px;
    height: 41px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 12px;
    background: linear-gradient(145deg, #dfc58f, #b38d4d);
    color: #211d15;
    font-family: Georgia, serif;
    font-weight: 900;
    font-size: 24px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .22);
}

.sidebar nav {
    display: grid;
    gap: 5px;
}

.sidebar nav a {
    position: relative;
    color: #c7c3ba;
    text-decoration: none;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 15px;
    font-weight: 550;
    transition: background .18s ease, color .18s ease,
                border-color .18s ease;
}

.sidebar nav a:hover {
    background: rgba(239, 174, 9, 0.055);
    color: #ed6d6d;
    border-color: rgba(255, 255, 255, .06);
}

.sidebar nav a.active {
    background: linear-gradient(
        90deg,
        rgba(197, 164, 109, .19),
        rgba(197, 164, 109, .06)
    );
    border-color: rgba(197, 164, 109, .28);
    color: #f0d9ad;
}

.sidebar nav a.active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}

.sidebar-bottom {
    margin-top: auto;
    color: #a6a095;
    padding: 20px 10px 4px;
    font-size: 11px;
    letter-spacing: .4px;
}

.sidebar-bottom small {
    display: block;
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-top: 15px;
}

/* =========================================================
   MAIN AREA AND TOPBAR
   ========================================================= */

.main-area {
    margin-left: 258px;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    height: 72px;
    background: rgba(255, 254, 250, .96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 31px;
    gap: 17px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-title {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .2px;
    color: #5c564b;
}

.topbar-title::before {
    content: "/";
    color: var(--gold-deep);
    margin-right: 9px;
}

.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #39372f;
    font-weight: 600;
}

.avatar {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-soft);
    border: 1px solid #e5d5b8;
    color: #71582d;
    font-weight: 800;
}

.logout-link {
    margin-left: 8px;
    text-decoration: none;
    color: #736b5e;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 650;
    transition: color .15s ease, border-color .15s ease;
}

.logout-link:hover {
    color: #191919;
    border-color: var(--gold);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fffefa;
    color: var(--ink);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 20px;
    cursor: pointer;
}

/* =========================================================
   PAGE CONTENT AND HEADINGS
   ========================================================= */

.content {
    padding: 30px 32px 40px;
    max-width: 1680px;
    margin: auto;
}

.welcome,
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.welcome h1,
.page-heading h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31px;
    font-weight: 600;
    letter-spacing: -.55px;
    line-height: 1.2;
    margin: 4px 0 8px;
    color: #24221d;
}

.eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--gold-deep);
    margin: 0;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
    margin: 0;
}

/* =========================================================
   DASHBOARD STATISTICS
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 23px;
}

.stat-card,
.panel {
    background: var(--gold-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card {
    position: relative;
    padding: 21px 21px 19px;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -26px;
    top: -35px;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    border: 1px solid rgba(197, 164, 109, .22);
    box-shadow:
        0 0 0 12px rgba(197, 164, 109, .045),
        0 0 0 25px rgba(197, 164, 109, .025);
    pointer-events: none;
}

.stat-card span {
    display: block;
    color: #777164;
    font-weight: 650;
    font-size: 12px;
    letter-spacing: .15px;
}

.stat-card strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31px;
    line-height: 1.2;
    font-weight: 600;
    margin: 13px 0 8px;
    color: #2708f0;
    overflow-wrap: anywhere;
}

.stat-card small {
    display: block;
    color: #999285;
    font-size: 11px;
}

/* =========================================================
   PANELS AND TABLES
   ========================================================= */

.panel {
    padding: 22px 23px;
    margin-bottom: 22px;
    min-width: 0;
}

.panel h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    font-weight: 600;
    color: #2c2922;
    margin: 0 0 18px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.panel-heading h2 {
    margin: 0;
}

.panel-heading a {
    color: #96743d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 750;
}

.panel-heading a:hover {
    text-decoration: underline;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #eee8dd;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}

th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #837a69;
    background: #f4f0e8;
    font-weight: 800;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #eee9e0;
}

td {
    font-size: 12.5px;
    color: #403d36;
}

tbody tr {
    transition: background .12s ease;
}

tbody tr:hover td {
    background: #fcfaf5;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td small {
    color: #969082;
}

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

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 750;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.35;
    transition: transform .12s ease, background .12s ease,
                border-color .12s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible,
.menu-toggle:focus-visible,
.logout-link:focus-visible {
    outline: 3px solid rgba(197, 164, 109, .5);
    outline-offset: 2px;
}

.btn.primary {
    background: linear-gradient(135deg, #d7bd88, #b89559);
    color: #211d15;
    border-color: #b89559;
    box-shadow: 0 4px 10px rgba(168, 135, 77, .13);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #e2cca0, #c2a168);
}

.btn.secondary {
    background: #f6f3ec;
    color: #514b40;
    border-color: #e7dfd1;
}

.btn.secondary:hover {
    background: #eee7da;
    border-color: #d8c6a7;
}

.full {
    width: 100%;
}

/* =========================================================
   TOOLBARS AND FORMS
   ========================================================= */

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.toolbar input {
    max-width: 360px;
}

.form-panel {
    max-width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.wide {
    grid-column: 1 / -1;
}

label {
    font-weight: 750;
    color: #5b5549;
    font-size: 11px;
    letter-spacing: .2px;
}

input,
select,
textarea {
    width: 100%;
    font: inherit;
    font-size: 13px;
    padding: 11px 12px;
    border: 1px solid #ded7ca;
    border-radius: 8px;
    background: #fffefa;
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder,
textarea::placeholder {
    color: #aaa294;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #c3a36d;
    box-shadow: 0 0 0 3px rgba(197, 164, 109, .16);
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.two-column {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
    gap: 20px;
    align-items: start;
}

.two-column .panel {
    min-width: 0;
}

.two-column .field {
    margin-bottom: 16px;
}

/* =========================================================
   STATUS BADGES
   ========================================================= */

.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border: 1px solid #d4e6d8;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2px;
    background: #edf6ee;
    color: #32724c;
}

.status.expired,
.status.inactive {
    background: #fbefeb;
    color: #a34439;
    border-color: #efd5ce;
}

.status.pending {
    background: #faf2df;
    color: #916b23;
    border-color: #ead9b4;
}

.status.completed {
    background: #eaf1f6;
    color: #496d8a;
    border-color: #d4e0e8;
}

/* =========================================================
   ALERT MESSAGES
   ========================================================= */

.alert {
    padding: 12px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    margin-bottom: 18px;
    font-size: 13px;
}

.alert.success {
    background: #edf6ee;
    color: #286844;
    border-color: #d5e8d8;
}

.alert.error {
    background: #fbefeb;
    color: #963e35;
    border-color: #eed5cf;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            ellipse at 15% 20%,
            rgba(197, 164, 109, .18),
            transparent 32%
        ),
        linear-gradient(135deg, #151515, #292722 70%, #171715);
}

.login-card {
    width: min(100%, 430px);
    background: #fffefa;
    border: 1px solid rgba(197, 164, 109, .4);
    border-radius: 18px;
    padding: 36px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.login-logo {
    width: 54px;
    height: 54px;
    font-size: 29px;
}

.login-card h1 {
    font-family: Georgia, "Times New Roman", serif;
    margin: 7px 0 0;
    font-size: 28px;
    font-weight: 600;
    color: #25221c;
}

.login-card .muted {
    margin-bottom: 12px;
}

.login-card small {
    color: #898274;
    line-height: 1.6;
    margin-top: 5px;
}

.login-card label {
    margin-top: 3px;
}

.login-card .btn {
    min-height: 43px;
}

/* =========================================================
   DASHBOARD INTRODUCTION
   ========================================================= */

.dashboard-intro {
    padding: 25px 27px;
    border: 1px solid #3c3830;
    border-radius: 16px;
    background:
        radial-gradient(
            circle at 90% 0%,
            rgba(197, 164, 109, .18),
            transparent 32%
        ),
        linear-gradient(120deg, #22221f, #171716);
    color: #f8f4eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
    box-shadow: 0 12px 30px rgba(25, 23, 18, .12);
}

.dashboard-intro h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -.5px;
    margin: 4px 0 8px;
    color: #fffaf0;
}

.dashboard-intro .muted {
    color: #c2bcae;
}

.dashboard-intro .eyebrow {
    color: #d9bd86;
}

.dashboard-intro .btn.secondary {
    background: rgba(255, 255, 255, .08);
    color: #f4e8cf;
    border-color: rgba(255, 255, 255, .18);
}

.dashboard-date {
    font-size: 11px;
    color: #c7bda9;
    letter-spacing: .5px;
    margin-top: 14px;
}

/* =========================================================
   DASHBOARD ALERT SUMMARY
   ========================================================= */

.alert-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.alert-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f3d598;
    font-size: 14px;
    color: #655e51;
}

.alert-pill strong {
    color: #2b2924;
}

.section-kicker {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a38a5c;
    font-weight: 800;
    margin: 0 0 8px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.inline-actions .btn {
    padding: 7px 10px;
}

/* =========================================================
   REPORT CARDS
   ========================================================= */

.report-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.report-card {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fcfaf5;
}

.report-card strong {
    font-size: 20px;
    font-family: Georgia, "Times New Roman", serif;
    display: block;
    margin: 4px 0;
}

.report-card small {
    color: var(--muted);
}

/* =========================================================
   RESPONSIVE — TABLETS AND SMALL DESKTOPS
   ========================================================= */

@media (max-width: 1250px) {
    .content {
        padding: 25px 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        width: 240px;
    }

    .main-area {
        margin-left: 240px;
    }

    .topbar {
        padding: 0 23px;
    }
}

/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .22s ease;
        width: 270px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 12px 0 35px rgba(0, 0, 0, .28);
    }

    .main-area {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        height: 62px;
        padding: 0 13px;
        gap: 10px;
    }

    .topbar-title {
        font-size: 13px;
    }

    .user-menu {
        gap: 6px;
    }

    .user-menu > span:not(.avatar) {
        display: none;
    }

    .logout-link {
        margin-left: 2px;
        padding: 7px 8px;
    }

    .content {
        padding: 19px 13px 30px;
    }

    .welcome,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .welcome h1,
    .page-heading h1 {
        font-size: 25px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card strong {
        font-size: 25px;
        margin: 10px 0 6px;
    }

    .stat-card span {
        font-size: 11px;
    }

    .stat-card small {
        font-size: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field.wide {
        grid-column: auto;
    }

    .panel {
        padding: 15px;
        margin-bottom: 16px;
    }

    .panel h2 {
        font-size: 18px;
    }

    .toolbar {
        flex-wrap: wrap;
    }

    .toolbar input {
        max-width: none;
        flex: 1 1 100%;
    }

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

    .dashboard-intro {
        align-items: flex-start;
        flex-direction: column;
        padding: 21px;
    }

    .dashboard-intro h1 {
        font-size: 25px;
    }

    .report-cards {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        border-radius: 8px;
    }

    th,
    td {
        padding: 11px 10px;
    }

    .btn {
        padding: 9px 11px;
    }

    .two-column {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   ACCESSIBILITY — REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* =========================================================
   FITCORE DASHBOARD — CLICKABLE CARDS AND RECEIPTS
   ========================================================= */

a.stat-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

a.stat-card-link:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 12px 30px rgba(35, 29, 18, .10);
}

a.stat-card-link:focus-visible,
a.alert-pill-link:focus-visible,
.receipt-link:focus-visible {
    outline: 3px solid rgba(197, 164, 109, .65);
    outline-offset: 3px;
}

a.alert-pill-link {
    color: inherit;
    text-decoration: none;
    transition:
        background .15s ease,
        border-color .15s ease;
}

a.alert-pill-link:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.receipt-link {
    color: #96743d;
    text-decoration: none;
}

.receipt-link:hover {
    color: #715326;
    text-decoration: underline;
}

.receipt-link span {
    font-size: 11px;
}
