/* =============================================
   Mus Royale — Minimalist Light Theme 2026
   ============================================= */

/* ---------- Tokens ---------- */
:root {
    --white: #ffffff;
    --bg: #fafafa;
    --surface: #ffffff;
    --border: #e8e8ec;
    --border-hover: #d0d0d8;

    --text: #111111;
    --text-secondary: #6b6b76;
    --text-muted: #9b9ba8;

    --accent: #111111;
    --accent-soft: #f3f3f5;
    --gold: #c8a035;
    --silver: #8a8a8a;
    --bronze: #a06830;
    --green: #22a06b;
    --red: #e5483e;
    --blue: #3b82f6;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-full: 999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --transition: 0.15s ease;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}

main {
    flex: 1;
}

.container {
    width: 96%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}


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

/* ---------- Navbar ---------- */
.nav-bar {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    width: 96%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.03em;
}

.brand-mark {
    font-size: 20px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.nav-link.active {
    color: var(--text);
    background: var(--accent-soft);
}

/* ---------- Page ---------- */
.page-header {
    padding: 32px 0 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

/* KPI */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}

.kpi:hover {
    box-shadow: var(--shadow-sm);
}

.kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-top: 4px;
    line-height: 1;
}

/* ---------- Podium ---------- */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    padding: 40px 0 32px;
}

.podium-item {
    text-align: center;
    transition: transform 0.2s ease;
}

.podium-item:hover {
    transform: translateY(-4px);
}

.podium-item:nth-child(1) {
    order: 2;
    margin-bottom: 20px;
}

.podium-item:nth-child(2) {
    order: 1;
}

.podium-item:nth-child(3) {
    order: 3;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    margin: 0 auto 10px;
    background: var(--accent-soft);
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.podium-item:nth-child(1) .avatar {
    width: 72px;
    height: 72px;
    font-size: 26px;
    border-color: var(--gold);
    color: var(--gold);
    background: #fdf8ec;
}

.podium-item:nth-child(2) .avatar {
    border-color: var(--silver);
    color: var(--silver);
}

.podium-item:nth-child(3) .avatar {
    border-color: var(--bronze);
    color: var(--bronze);
    background: #fdf5ec;
}

.podium-name {
    font-weight: 600;
    font-size: 14px;
}

.podium-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.podium-rank {
    font-size: 18px;
    margin-bottom: 4px;
}

/* ---------- Table ---------- */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

tr:hover td {
    background: var(--accent-soft);
}

.position {
    font-weight: 700;
    color: var(--text-muted);
    width: 40px;
}

.position.p1 {
    color: var(--gold);
}

.position.p2 {
    color: var(--silver);
}

.position.p3 {
    color: var(--bronze);
}

.avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--text-secondary);
    margin-right: 10px;
    vertical-align: middle;
}

.player-name {
    font-weight: 600;
    font-size: 14px;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.badge-up {
    color: var(--green);
    background: rgba(34, 160, 107, 0.08);
}

.badge-down {
    color: var(--red);
    background: rgba(229, 72, 62, 0.08);
}

.badge-active {
    color: var(--green);
    background: rgba(34, 160, 107, 0.08);
    font-size: 12px;
    padding: 3px 10px;
}

.badge-inactive {
    color: var(--red);
    background: rgba(229, 72, 62, 0.08);
    font-size: 12px;
    padding: 3px 10px;
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* ---------- Match Feed ---------- */
.feed-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-item:hover {
    background: var(--accent-soft);
}

.feed-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 65px;
    font-variant-numeric: tabular-nums;
}

.feed-teams {
    flex: 1;
    font-size: 14px;
}

.feed-winner {
    font-weight: 600;
}

.feed-vs {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0 6px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--accent-soft);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--white);
    color: var(--red);
    border: 1px solid rgba(229, 72, 62, 0.2);
}

.btn-danger:hover {
    background: rgba(229, 72, 62, 0.05);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
}

.alert-success {
    background: rgba(34, 160, 107, 0.06);
    color: var(--green);
    border: 1px solid rgba(34, 160, 107, 0.15);
}

.alert-error {
    background: rgba(229, 72, 62, 0.06);
    color: var(--red);
    border: 1px solid rgba(229, 72, 62, 0.15);
}

.alert-info {
    background: rgba(59, 130, 246, 0.06);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* ---------- Empty State ---------- */
.empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty p {
    font-size: 14px;
    max-width: 300px;
    margin: 0 auto;
}

/* ---------- Section ---------- */
.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .icon {
    color: var(--text-muted);
}

/* ---------- Footer ---------- */
footer {
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.footer-inner {
    padding: 20px 24px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---------- Utilities ---------- */
.text-gold {
    color: var(--gold) !important;
}

.text-silver {
    color: var(--silver) !important;
}

.text-bronze {
    color: var(--bronze) !important;
}

.text-green {
    color: var(--green) !important;
}

.text-red {
    color: var(--red) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.mt-4 {
    margin-top: 16px;
}

.mt-8 {
    margin-top: 32px;
}

.mb-4 {
    margin-bottom: 16px;
}

.gap-3 {
    gap: 12px;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

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

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}


/* ---------- Responsive ---------- */

/* Tablet landscape */
@media (max-width: 1100px) {
    .grid-dashboard {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .nav-inner {
        padding: 0 20px;
    }

    .nav-links {
        gap: 0;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 13px;
    }

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

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

    .podium {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .podium-item:nth-child(1),
    .podium-item:nth-child(2),
    .podium-item:nth-child(3) {
        order: unset;
        margin-bottom: 0;
    }

    .kpi-value {
        font-size: 22px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav-inner {
        padding: 0 16px;
    }

    .nav-links .nav-link:not(:last-child):not(:nth-last-child(2)) {
        display: none;
    }

    .feed-item {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .kpi-card {
        padding: 16px;
    }
}