/* ==========================================================================
   Hockey Belgaum — admin panel
   Quiet, dense and legible. Same palette as the public site so the two
   never feel like different products, but with none of the pitch geometry.
   ========================================================================== */

:root {
    /* Same crest palette as the public site, lighter chrome for long edits. */
    --navy: #02214D;
    --navy-deep: #011738;
    --navy-ink: #000C22;
    --gold: #C8911C;
    --crimson: #B3241C;
    --green: #1B7A47;

    --pitch: var(--navy-deep);
    --pitch-deep: var(--navy-ink);
    --turf: var(--navy);
    --turf-dark: #011738;
    --marigold: var(--gold);
    --clay: var(--crimson);

    --chalk: #F3F5F9;
    --paper: #FFFFFF;
    --slate: #5A6478;
    --line: #DCE0EA;

    --display: "Barlow Condensed", sans-serif;
    --body: "Barlow", system-ui, sans-serif;
    --mono: "IBM Plex Mono", monospace;
    --radius: 4px;
}

* { box-sizing: border-box; }

body.admin {
    margin: 0;
    font-family: var(--body);
    font-size: .97rem;
    color: var(--pitch);
    background: var(--chalk);
    -webkit-font-smoothing: antialiased;
}

.admin a { color: var(--turf); }
.admin h1, .admin h2, .admin h3 {
    font-family: var(--display);
    text-transform: uppercase;
    letter-spacing: .01em;
    margin: 0 0 .4em;
}
.admin h1 { font-size: 2rem; }
.admin h2 { font-size: 1.5rem; }
.admin h3 { font-size: 1.2rem; }

:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* --- shell --------------------------------------------------------------- */

.a-wrap { display: flex; min-height: 100vh; }

.a-side {
    width: 250px;
    flex-shrink: 0;
    background: var(--pitch);
    color: rgba(243, 245, 242, .82);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.a-brand {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(243, 245, 242, .12);
    display: flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
    color: #fff;
}
.a-brand span:first-child {
    width: 36px; height: 36px;
    background: var(--marigold);
    color: var(--pitch);
    border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--display);
    font-weight: 700;
}
.a-brand strong { font-family: var(--display); font-size: 1.2rem; text-transform: uppercase; display: block; line-height: 1; }
.a-brand small { font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; color: rgba(243, 245, 242, .55); }

.a-nav { padding: .75rem 0 2rem; flex: 1; }
.a-nav__group {
    font-family: var(--mono);
    font-size: .63rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(243, 245, 242, .4);
    padding: 1.15rem 1.25rem .4rem;
}
.a-nav a {
    display: block;
    padding: .55rem 1.25rem;
    color: rgba(243, 245, 242, .82);
    text-decoration: none;
    font-size: .95rem;
    border-left: 3px solid transparent;
}
.a-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.a-nav a.is-active {
    background: rgba(242, 160, 7, .12);
    border-left-color: var(--marigold);
    color: #fff;
    font-weight: 600;
}
.a-nav .badge-count {
    float: right;
    background: var(--clay);
    color: #fff;
    font-family: var(--mono);
    font-size: .68rem;
    padding: 0 .4rem;
    border-radius: 10px;
}

.a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.a-top {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: .85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 20;
}
.a-top__user { font-family: var(--mono); font-size: .78rem; color: var(--slate); }
.a-body { padding: 1.75rem; flex: 1; }

.a-side-toggle {
    display: none;
    background: var(--pitch);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    padding: .45rem .8rem;
    font-family: var(--display);
    text-transform: uppercase;
}

/* --- page head ----------------------------------------------------------- */

.a-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.a-head p { margin: .2rem 0 0; color: var(--slate); font-size: .92rem; }

/* --- buttons ------------------------------------------------------------- */

.a-btn, .a-btn-ghost, .a-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: .5rem 1.1rem;
    border-radius: var(--radius);
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    background: var(--turf);
    color: #fff;
}
.a-btn:hover { background: var(--turf-dark); color: #fff; }
.a-btn-ghost { background: transparent; border-color: var(--line); color: var(--pitch); }
.a-btn-ghost:hover { border-color: var(--turf); color: var(--turf); }
.a-btn-danger { background: transparent; border-color: rgba(181, 69, 30, .4); color: var(--clay); }
.a-btn-danger:hover { background: var(--clay); color: #fff; }
.a-btn-sm { padding: .3rem .7rem; font-size: .88rem; }

/* --- panels & tables ----------------------------------------------------- */

.a-panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
}
.a-panel__title {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--slate);
    margin-bottom: 1rem;
}

.a-table { width: 100%; border-collapse: collapse; background: var(--paper); }
.a-table th {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--slate);
    text-align: left;
    padding: .7rem .9rem;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}
.a-table td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.a-table tbody tr:hover { background: #FAFBFF; }
.a-table__actions { text-align: right; white-space: nowrap; }
.a-table a { text-decoration: none; }
.a-table a:hover { text-decoration: underline; }

.a-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

.chip {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .15rem .55rem;
    border-radius: 100px;
    display: inline-block;
}
.chip--live { background: rgba(18, 105, 91, .14); color: var(--turf); }
.chip--draft { background: rgba(90, 107, 102, .16); color: var(--slate); }
.chip--new { background: rgba(181, 69, 30, .14); color: var(--clay); }

/* --- forms --------------------------------------------------------------- */

.a-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

.a-field { margin-bottom: 1.1rem; }
.a-field > label, .a-form .form-group > label {
    display: block;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--slate);
    margin-bottom: .35rem;
}
.a-form input[type="text"], .a-form input[type="email"], .a-form input[type="tel"],
.a-form input[type="number"], .a-form input[type="date"], .a-form input[type="datetime-local"],
.a-form input[type="password"], .a-form input[type="search"], .a-form input[type="file"],
.a-form textarea, .a-form select, .form-control, .form-select {
    width: 100%;
    font-family: var(--body);
    font-size: .97rem;
    padding: .55rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--pitch);
}
.a-form textarea { min-height: 120px; resize: vertical; }
.a-form .editor { min-height: 340px; font-family: var(--mono); font-size: .88rem; line-height: 1.6; }
.a-form input:focus, .a-form textarea:focus, .a-form select:focus {
    outline: none;
    border-color: var(--turf);
    box-shadow: 0 0 0 3px rgba(18, 105, 91, .14);
}
.a-hint { font-size: .82rem; color: var(--slate); margin-top: .3rem; }
.a-check { display: flex; align-items: center; gap: .55rem; }
.a-check input { width: 18px; height: 18px; accent-color: var(--turf); }
.a-check label { margin: 0; text-transform: none; font-family: var(--body); font-size: .95rem; letter-spacing: 0; color: var(--pitch); }

.help-block, .invalid-feedback { color: var(--clay); font-size: .84rem; display: block; margin-top: .25rem; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--clay); }

.a-thumb {
    display: block;
    max-width: 220px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: .5rem;
}
.a-filecard {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: .5rem;
    font-size: .9rem;
}

.a-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--line);
}

/* --- flash & empty ------------------------------------------------------- */

.a-flash {
    padding: .85rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--turf);
    background: rgba(18, 105, 91, .09);
}
.a-flash--error { border-color: var(--clay); background: rgba(181, 69, 30, .09); }

.a-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--paper);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}
.a-empty p { color: var(--slate); max-width: 44ch; margin: .5rem auto 1.25rem; }

/* --- dashboard ----------------------------------------------------------- */

.a-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.a-stat {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    text-decoration: none;
    color: inherit;
    display: block;
    border-bottom: 3px solid var(--marigold);
}
.a-stat:hover { border-color: var(--turf); border-bottom-color: var(--turf); }
.a-stat b {
    display: block;
    font-family: var(--display);
    font-size: 2.4rem;
    line-height: 1;
    color: var(--pitch);
}
.a-stat span {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--slate);
}

.a-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }

/* --- photo manager ------------------------------------------------------- */

.a-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.a-photo {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.a-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.a-photo__body { padding: .7rem; display: grid; gap: .45rem; }
.a-photo input { font-size: .85rem; padding: .35rem .5rem; }

.a-drop {
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    background: var(--paper);
    margin-bottom: 1.25rem;
}

/* --- login --------------------------------------------------------------- */

.a-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--pitch);
    padding: 2rem 1rem;
}
.a-login__card {
    background: var(--paper);
    border-radius: var(--radius);
    padding: 2.25rem;
    width: min(420px, 100%);
    border-top: 4px solid var(--marigold);
}
.a-login__card h1 { font-size: 1.7rem; margin-bottom: .2rem; }
.a-login__card p.sub { color: var(--slate); font-size: .9rem; margin: 0 0 1.5rem; }

/* --- pagination ---------------------------------------------------------- */

.pagination { display: flex; gap: .3rem; list-style: none; padding: 0; margin: 1.25rem 0 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: block; font-family: var(--mono); font-size: .82rem;
    padding: .4rem .75rem; border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none; color: var(--pitch); background: var(--paper);
}
.pagination .active a, .pagination .active span { background: var(--pitch); color: var(--marigold); border-color: var(--pitch); }

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
    .a-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .a-side-toggle { display: inline-block; }
    .a-wrap { flex-direction: column; }
    .a-side {
        width: 100%;
        height: auto;
        position: static;
        display: none;
    }
    .a-side.is-open { display: flex; }
    .a-body { padding: 1.15rem; }
    .a-top { padding: .7rem 1.15rem; }
    .a-table thead { display: none; }
    .a-table, .a-table tbody, .a-table tr, .a-table td { display: block; width: 100%; }
    .a-table tr { border-bottom: 2px solid var(--line); padding: .5rem 0; }
    .a-table td { border: 0; padding: .3rem .9rem; }
    .a-table td::before {
        content: attr(data-label) " ";
        font-family: var(--mono);
        font-size: .64rem;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: var(--slate);
        display: block;
    }
    .a-table__actions { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Crest above the sign-in card */
.a-login__logo {
    display: block;
    width: 96px;
    height: auto;
    margin: 0 auto 1.25rem;
}
.a-brand img {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--paper);
    padding: 2px;
    object-fit: contain;
    flex: none;
}
