/* =========================================================
   AIGS NBA REPORTER
   Main Application Styles
   ========================================================= */

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e2e8f0;
    --text: #172033;
    --muted: #64748b;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;

    --success: #16a34a;
    --success-soft: #f0fdf4;

    --warning: #d97706;
    --warning-soft: #fffbeb;

    --danger: #dc2626;
    --danger-soft: #fef2f2;

    --sidebar: #111827;
    --sidebar-hover: #1f2937;

    --radius: 14px;
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================================
   TOP HEADER
   ========================================================= */

.top {
    height: 68px;
    background: var(--surface);

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    position: sticky;
    top: 0;
    z-index: 100;

    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;

    display: flex;
    align-items: center;
    gap: 6px;
}

.brand::before {
    content: "A";
    width: 34px;
    height: 34px;

    border-radius: 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: white;

    font-size: 16px;
    font-weight: 800;
}

.brand span {
    color: var(--primary);
}

.top > div:last-child {
    color: var(--muted);
    font-size: 13px;
}

.top > div:last-child a {
    margin-left: 10px;
    color: var(--danger);
    font-weight: 600;
}

.top > div:last-child a:hover {
    text-decoration: underline;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.layout {
    display: flex;
    min-height: calc(100vh - 68px);
}

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

aside {
    width: 245px;
    min-width: 245px;

    background: var(--sidebar);
    color: #cbd5e1;

    padding: 22px 14px;

    position: sticky;
    top: 68px;

    height: calc(100vh - 68px);

    overflow-y: auto;
}

aside > a {
    display: flex;
    align-items: center;

    min-height: 44px;

    padding: 0 14px;
    margin-bottom: 4px;

    border-radius: 9px;

    color: #cbd5e1;

    font-size: 13px;
    font-weight: 500;

    transition: 0.2s ease;
}

aside > a:hover {
    background: var(--sidebar-hover);
    color: white;
    transform: translateX(2px);
}

aside > a:first-child {
    background: rgba(37, 99, 235, 0.18);
    color: white;
}

.side-title {
    margin: 25px 12px 10px;

    padding-bottom: 9px;

    border-bottom: 1px solid rgba(255,255,255,0.08);

    color: white;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1px;
    text-transform: uppercase;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

main {
    flex: 1;
    min-width: 0;

    padding: 32px;
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8fbff 100%
        );

    border: 1px solid var(--border);

    border-radius: 18px;

    padding: 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;

    margin-bottom: 24px;

    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 5px 0 8px;

    font-size: 28px;
    line-height: 1.2;

    letter-spacing: -0.8px;
}

.hero p {
    margin: 0;

    color: var(--muted);

    font-size: 14px;
}

.eyebrow {
    color: var(--primary);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1.3px;

    text-transform: uppercase;
}

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

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 17px;

    border-radius: 9px;

    border: 1px solid var(--primary);

    background: var(--primary);
    color: white;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);

    transform: translateY(-1px);

    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.18);
}

.btn.small {
    min-height: 34px;
    padding: 0 12px;

    font-size: 12px;
}

/* =========================================================
   STAT CARDS
   ========================================================= */

.cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;
}

.cards > div {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 22px;

    min-height: 115px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    box-shadow: var(--shadow);

    position: relative;
    overflow: hidden;
}

.cards > div::after {
    content: "";

    position: absolute;

    width: 70px;
    height: 70px;

    right: -20px;
    top: -20px;

    border-radius: 50%;

    background: var(--primary-soft);
}

.cards b {
    position: relative;
    z-index: 1;

    font-size: 30px;
    line-height: 1;

    margin-bottom: 8px;

    color: var(--text);
}

.cards span {
    position: relative;
    z-index: 1;

    color: var(--muted);

    font-size: 12px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================================
   PANELS
   ========================================================= */

.panel {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;

    margin-bottom: 24px;
}

.panel-head {
    min-height: 70px;

    padding: 15px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-bottom: 1px solid var(--border);
}

.panel-head h2 {
    margin: 0;

    font-size: 17px;
    font-weight: 750;
}

.panel-head input {
    width: 260px;
}

/* =========================================================
   FORMS
   ========================================================= */

label {
    display: flex;
    flex-direction: column;

    gap: 7px;

    color: #334155;

    font-size: 12px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;

    border: 1px solid #d5dce7;

    background: white;

    color: var(--text);

    border-radius: 8px;

    padding: 10px 12px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* =========================================================
   TABLE
   ========================================================= */

table {
    width: 100%;

    border-collapse: collapse;

    font-size: 13px;
}

thead {
    background: var(--surface-soft);
}

th {
    color: #475569;

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.4px;

    white-space: nowrap;
}

th,
td {
    padding: 14px 16px;

    border-bottom: 1px solid var(--border);

    text-align: left;

    vertical-align: middle;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f8fbff;
}

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

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

.status {
    display: inline-flex;

    align-items: center;

    min-height: 27px;

    padding: 0 10px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 750;

    white-space: nowrap;

    background: #f1f5f9;
    color: #475569;
}

.status.completed {
    background: var(--success-soft);
    color: var(--success);
}

.status.verified {
    background: var(--primary-soft);
    color: var(--primary);
}

.status.in_progress {
    background: var(--warning-soft);
    color: var(--warning);
}

.status.draft {
    background: #f1f5f9;
    color: #64748b;
}

/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    padding: 11px 14px;

    margin-bottom: 16px;

    border-radius: 9px;

    background: var(--danger-soft);

    border: 1px solid #fecaca;

    color: var(--danger);

    font-size: 13px;
    font-weight: 600;
}

.success {
    padding: 11px 14px;

    border-radius: 9px;

    background: var(--success-soft);

    border: 1px solid #bbf7d0;

    color: var(--success);
}

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

body.login {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    background:
        radial-gradient(
            circle at top left,
            #dbeafe,
            transparent 35%
        ),
        radial-gradient(
            circle at bottom right,
            #e0e7ff,
            transparent 35%
        ),
        #f1f5f9;
}

.login-card {
    width: 100%;
    max-width: 430px;

    padding: 38px;

    background: rgba(255,255,255,0.96);

    border: 1px solid var(--border);

    border-radius: 20px;

    box-shadow:
        0 25px 70px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
    margin: 0 0 8px;

    font-size: 28px;

    letter-spacing: -0.7px;
}

.login-card p {
    margin: 0 0 25px;

    color: var(--muted);

    font-size: 13px;
}

.login-card label {
    margin-bottom: 16px;
}

.login-card button {
    width: 100%;

    min-height: 46px;

    border: 0;

    border-radius: 9px;

    background: var(--primary);
    color: white;

    font-weight: 750;

    cursor: pointer;

    transition: 0.2s ease;
}

.login-card button:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);
}

.login-card small {
    display: block;

    margin-top: 18px;

    text-align: center;

    color: #94a3b8;

    font-size: 11px;
}

/* =========================================================
   FORM GRID
   ========================================================= */

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;

    padding: 22px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    padding: 18px 22px;

    border-top: 1px solid var(--border);

    background: var(--surface-soft);
}

/* =========================================================
   TOOLBAR
   ========================================================= */

.toolbar {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;
}

.toolbar-left,
.toolbar-right {
    display: flex;

    align-items: center;

    gap: 10px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

    aside {
        width: 210px;
        min-width: 210px;
    }

    main {
        padding: 24px;
    }

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

    .hero h1 {
        font-size: 24px;
    }
}

@media (max-width: 800px) {

    .top {
        padding: 0 18px;
    }

    .layout {
        display: block;
    }

    aside {
        position: relative;

        top: 0;

        width: 100%;
        min-width: 100%;

        height: auto;

        display: flex;

        gap: 5px;

        padding: 10px;

        overflow-x: auto;
    }

    aside > a {
        flex: 0 0 auto;

        margin: 0;
    }

    .side-title {
        display: none;
    }

    main {
        padding: 18px;
    }

    .hero {
        align-items: flex-start;

        flex-direction: column;
    }

    .hero .btn {
        width: 100%;
    }

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

    .panel {
        overflow-x: auto;
    }

    .panel-head {
        min-width: 600px;
    }

    table {
        min-width: 750px;
    }

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

    .form-grid .full {
        grid-column: auto;
    }
}

@media (max-width: 550px) {

    .top {
        height: auto;

        min-height: 64px;

        gap: 10px;

        padding: 12px 15px;
    }

    .brand {
        font-size: 17px;
    }

    .brand::before {
        width: 30px;
        height: 30px;
    }

    .top > div:last-child {
        font-size: 11px;
    }

    main {
        padding: 14px;
    }

    .hero {
        padding: 22px;
    }

    .hero h1 {
        font-size: 22px;
    }

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

/* =========================================================
   PRINT
   ========================================================= */

@media print {

    body {
        background: white;
    }

    .top,
    aside,
    .btn,
    .toolbar,
    .panel-head input {
        display: none !important;
    }

    .layout {
        display: block;
    }

    main {
        padding: 0;
    }

    .panel {
        border: none;
        box-shadow: none;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    @page {
        size: A4;
        margin: 12mm;
    }
}