/* ============================================================
   ADMIN PANEL CSS — KKTC Okul Sporları
   ============================================================ */

:root {
    --sidebar-w:     260px;
    --topbar-h:      64px;
    --primary:       #0057B8;
    --primary-dark:  #003f87;
    --primary-light: #EFF6FF;
    --sidebar-bg:    #0F172A;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active:#1E40AF;
    --text:          #1D2939;
    --text-light:    #667085;
    --border:        #E4E7EC;
    --bg:            #F8FAFC;
    --card:          #ffffff;
    --success:       #12B76A;
    --danger:        #D92D20;
    --warning:       #F79009;
    --shadow:        0 1px 4px rgba(0,0,0,.08);
    --shadow-md:     0 4px 20px rgba(0,0,0,.1);
    --radius:        12px;
    --radius-sm:     8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; }

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.sidebar-brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar-brand-sub  { color: #64748B; font-size: 11px; font-weight: 500; }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 14px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: #94A3B8;
    font-size: 14px;
    font-weight: 600;
    transition: all .15s;
    cursor: pointer;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item i { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 14px 14px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.user-info { overflow: hidden; }
.user-name { color: #E2E8F0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: #64748B; font-size: 11px; }

.logout-btn {
    background: rgba(255,255,255,.06);
    border: none;
    color: #94A3B8;
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; cursor: pointer;
    transition: all .2s; flex-shrink: 0;
}
.logout-btn:hover { background: var(--danger); color: #fff; }

/* ── MAIN ── */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ── TOPBAR ── */
.admin-topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
    background: none; border: none;
    font-size: 22px; cursor: pointer; color: var(--text);
    display: none;
    width: 38px; height: 38px;
    border-radius: 8px;
    align-items: center; justify-content: center;
    transition: background .2s;
}
.sidebar-toggle:hover { background: var(--bg); }

.admin-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    list-style: none; padding: 0; margin: 0;
    font-size: 13px; color: var(--text-light);
}
.admin-breadcrumb li { display: flex; align-items: center; gap: 6px; }
.admin-breadcrumb li:not(:last-child)::after { content: '/'; color: var(--border); }
.admin-breadcrumb a { color: var(--text-light); }
.admin-breadcrumb a:hover { color: var(--primary); }
.admin-breadcrumb .active { color: var(--text); font-weight: 600; }

.topbar-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: none; background: none;
    color: var(--text-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; cursor: pointer;
    transition: all .2s;
}
.topbar-btn:hover { background: var(--bg); color: var(--primary); }

/* ── CONTENT ── */
.admin-content { padding: 24px; flex: 1; }

/* ── PAGE HEADER ── */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-page-header h1 {
    font-size: 22px; font-weight: 800;
    display: flex; align-items: center; gap: 10px;
}
.admin-page-header h1 i { color: var(--primary); }
.admin-page-header p { color: var(--text-light); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── CARDS ── */
.admin-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.admin-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-card-header h5 {
    font-size: 15px; font-weight: 700; margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.admin-card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card-admin {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.stat-icon.blue   { background: #EFF6FF; color: #1D4ED8; }
.stat-icon.green  { background: #ECFDF3; color: #065F46; }
.stat-icon.orange { background: #FFF7ED; color: #9A3412; }
.stat-icon.purple { background: #F5F3FF; color: #5B21B6; }
.stat-icon.red    { background: #FEF2F2; color: #991B1B; }
.stat-icon.teal   { background: #F0FDFA; color: #0F766E; }
.stat-icon.yellow { background: #FEFCE8; color: #854D0E; }
.stat-icon.indigo { background: #EEF2FF; color: #3730A3; }
.stat-info h3 { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-info p  { font-size: 12px; color: var(--text-light); font-weight: 600; margin-top: 3px; }

/* ── TABLE ── */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #FAFBFC; }

/* ── BUTTONS ── */
.btn-admin {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    border: none; cursor: pointer; transition: all .2s;
    white-space: nowrap;
}
.btn-primary-admin { background: var(--primary); color: #fff; }
.btn-primary-admin:hover { background: var(--primary-dark); color: #fff; }
.btn-success-admin { background: var(--success); color: #fff; }
.btn-success-admin:hover { background: #0e9458; color: #fff; }
.btn-danger-admin  { background: var(--danger);  color: #fff; }
.btn-danger-admin:hover  { background: #b91c1c; color: #fff; }
.btn-warning-admin { background: var(--warning); color: #fff; }
.btn-outline-admin {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline-admin:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
    width: 32px; height: 32px; padding: 0;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px;
}

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--text); margin-bottom: 6px;
}
.form-label span.req { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text);
    background: var(--card);
    outline: none; transition: border-color .2s, box-shadow .2s;
    font-family: 'Inter', sans-serif;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,87,184,.1);
}
.form-control.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-hint  { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.form-row { display: grid; gap: 16px; }
.form-row.col-2 { grid-template-columns: 1fr 1fr; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.form-check label { font-size: 14px; cursor: pointer; }

/* ── BADGES ── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #ECFDF3; color: #065F46; }
.badge-danger  { background: #FEF2F2; color: #991B1B; }
.badge-warning { background: #FFFBEB; color: #92400E; }
.badge-gray    { background: #F1F5F9; color: #475569; }

/* ── TOAST ── */
.admin-toast {
    position: fixed; top: 80px; right: 20px; z-index: 9999;
    padding: 14px 18px; border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 600;
    transition: opacity .4s;
    animation: toastIn .3s ease;
    max-width: 380px;
}
.admin-toast.success { background: #ECFDF3; color: #065F46; border: 1px solid #A7F3D0; }
.admin-toast.error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: .6; margin-left: auto; font-size: 16px;
}
.toast-close:hover { opacity: 1; }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } }

/* ── DASHBOARD ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    margin-top: 0;
}
.dashboard-main { display: flex; flex-direction: column; gap: 20px; }
.dashboard-side { display: flex; flex-direction: column; gap: 20px; }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; opacity: .4; }
.empty-state h5 { font-size: 16px; margin-bottom: 6px; }
.empty-state p  { font-size: 14px; }

/* ── OVERLAY (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* ── FILTER BAR ── */
.filter-bar {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: flex-end;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; font-weight: 700; color: var(--text-light); }
.filter-control {
    padding: 7px 10px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    color: var(--text); background: var(--card);
    outline: none; cursor: pointer;
}
.filter-control:focus { border-color: var(--primary); }

/* ── LOGIN PAGE ── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0F172A 0%, #0057B8 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
    width: 60px; height: 60px;
    background: var(--primary); color: #fff;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin: 0 auto 20px;
}
.login-title { text-align: center; margin-bottom: 6px; font-size: 22px; font-weight: 800; }
.login-sub   { text-align: center; color: var(--text-light); font-size: 14px; margin-bottom: 28px; }
.login-footer { text-align: center; margin-top: 20px; color: var(--text-light); font-size: 12px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .admin-content { padding: 16px; }
    .form-row.col-2,
    .form-row.col-3 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .admin-page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* Util */
.d-none { display: none !important; }
.d-md-block { display: none; }
@media (min-width: 768px) { .d-md-block { display: block; } }
.text-muted { color: var(--text-light); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
