/* MatCraft — Design System (LevelTel-inspired) */
:root {
    --navy:       #1c3054;
    --navy-dark:  #0f1e3a;
    --navy-light: #2a4575;
    --green:      #4ecca3;
    --green-dark: #3ba88a;
    --orange:     #f07d00;
    --orange-l:   #ff9a2e;
    --red:        #e74c3c;
    --red-dark:   #c0392b;
    --gray-bg:    #f4f7fb;
    --gray-light: #e8edf5;
    --gray-mid:   #8fa0b8;
    --text:       #1c2d45;
    --text-light: #5a7090;
    --white:      #ffffff;
    --border:     #d5dce8;
    --success:    #28a745;
    --radius:     8px;
    --shadow:     0 2px 16px rgba(28,48,84,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--gray-bg);
    min-height: 100vh;
    line-height: 1.5;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--navy-dark);
    border-bottom: 3px solid var(--green);
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 24px;
}
.navbar-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.logo-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #fff;
    letter-spacing: 1px;
}
.logo-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    margin-left: 2px;
    vertical-align: super;
}
.navbar-spacer { flex: 1; }
.navbar-user {
    color: var(--gray-mid);
    font-size: 13px;
    margin-right: 16px;
}

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    min-height: calc(100vh - 67px);
}

/* ===== SIDEBAR ===== */
.sidebar-nav {
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    flex-shrink: 0;
}
.snav-section {
    margin-bottom: 24px;
}
.snav-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-mid);
    padding: 0 12px;
    margin-bottom: 6px;
}
.snav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
}
.snav-item:hover {
    background: var(--gray-bg);
    color: var(--navy);
}
.snav-item.active {
    background: rgba(28,48,84,.08);
    color: var(--navy);
    font-weight: 700;
}
.snav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.snav-badge {
    margin-left: auto;
    background: var(--orange);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.snav-badge.green {
    background: var(--success);
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    padding: 28px;
    max-width: 960px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.page-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
}
.page-sub {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    border-top: 3px solid var(--border);
}
.stat-val {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 38px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    background: var(--navy);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.card-header .header-badge {
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
}
.card-body {
    padding: 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--navy);
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.btn:hover { background: var(--navy-light); }
.btn.green { background: var(--success); }
.btn.green:hover { background: #219a52; }
.btn.orange { background: var(--orange); }
.btn.orange:hover { background: var(--orange-l); }
.btn.red { background: var(--red); }
.btn.red:hover { background: var(--red-dark); }
.btn.gray { background: #666; }
.btn.gray:hover { background: #555; }
.btn.sm { padding: 5px 12px; font-size: 11px; }
.btn.full { width: 100%; }

/* ===== FORMS ===== */
.form-field {
    margin-bottom: 14px;
}
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 5px;
}
.form-label .req { color: var(--orange); }
.form-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: border-color .15s;
}
.form-input:focus {
    outline: none;
    border-color: var(--navy);
}
.form-input::placeholder { color: var(--gray-mid); }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ===== TABLES ===== */
.tbl-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th {
    background: var(--gray-bg);
    padding: 9px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
td {
    padding: 11px 14px;
    border-bottom: 1px solid #eef1f7;
    vertical-align: middle;
}
tr:hover td { background: #fafbfd; }
.td-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert.success { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.alert.error { background: #fff0f0; border-color: #fca5a5; color: #b91c1c; }
.alert.warn { background: #fff8e8; border-color: #f5d78a; color: #7a5200; }
.alert.info { background: #e3f2fd; border-color: #90caf9; color: #0d47a1; }

/* ===== STATUS DOT ===== */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-dot.on { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.off { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ===== STATUS BADGES ===== */
.badge-status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}
.badge-status.pending { background: #fff8e8; color: #7a5200; }
.badge-status.accepted { background: #e8f5e9; color: #1b5e20; }
.badge-status.rejected { background: #fff0f0; color: #b91c1c; }

/* ===== SERVER CONTROL ===== */
.server-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.server-status-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
}
.server-actions {
    display: flex;
    gap: 10px;
}

/* ===== PLAYER LIST ===== */
.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #eef1f7;
}
.player-row:last-child { border-bottom: none; }
.player-name {
    font-weight: 600;
    font-size: 14px;
}

/* ===== OVERLAY ===== */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15,30,58,0.85);
    z-index: 200;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.overlay.active { display: flex; }
.overlay-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 24px;
    color: #fff;
    margin-bottom: 16px;
}
.overlay-timer {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 52px;
    color: var(--orange);
    font-weight: 700;
}
.overlay-sub {
    font-size: 13px;
    color: var(--gray-mid);
    margin-top: 12px;
}
.spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(255,255,255,.15);
    border-top: 4px solid var(--green);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin { 0%{transform:rotate(0)} 100%{transform:rotate(360deg)} }

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--navy-dark);
    padding: 20px;
}
.login-container {
    width: 100%;
    max-width: 420px;
}
.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.login-header {
    background: var(--navy);
    padding: 32px;
    text-align: center;
}
.login-header .logo-text {
    font-size: 32px;
    margin-bottom: 6px;
    display: block;
}
.login-header p {
    color: var(--gray-mid);
    font-size: 13px;
}
.login-body {
    padding: 28px;
}
.login-body .form-input {
    margin-bottom: 12px;
}

/* Access request card */
.access-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.access-header {
    background: var(--navy-light);
    padding: 16px 24px;
    text-align: center;
}
.access-header h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.access-header p {
    font-size: 12px;
    color: var(--gray-mid);
    margin-top: 4px;
}
.access-body {
    padding: 24px;
}
.access-body .form-input {
    margin-bottom: 10px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray-mid);
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; }
    .snav-section { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
    .snav-title { display: none; }
    .snav-item { padding: 8px 14px; font-size: 13px; }
    .content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 12px; }
}
