/* ============================================================
   KUMSAL ÖZEL EĞİTİM - ADMIN PANEL CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
    --sidebar-w: 256px;
    --sidebar-bg: #1D3557;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(230, 57, 70, 0.18);
    --accent: #E63946;
    --accent-hover: #D62839;
    --teal: #2A9D8F;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --body-bg: #F1F5F9;
    --card-bg: #FFFFFF;
    --border: #E2E8F0;
    --text: #0F172A;
    --text-muted: #64748B;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
}

html, body { height: 100%; }

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--body-bg);
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────── */
.admin-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 38px; height: 38px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px; font-weight: 800;
    flex-shrink: 0;
}
.sidebar-brand-text { color: #FFFFFF; }
.sidebar-brand-text strong { display: block; font-size: 0.88rem; font-weight: 700; line-height: 1.2; }
.sidebar-brand-text span { font-size: 0.72rem; color: rgba(255,255,255,0.5); }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 12px 8px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.18s ease;
}
.nav-item:hover { background: var(--sidebar-hover); color: #FFFFFF; }
.nav-item.active { background: var(--sidebar-active); color: #FFFFFF; border-left: 3px solid var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.18s ease;
}
.sidebar-footer a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}
.sidebar-footer a:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #FCA5A5;
}
.sidebar-footer a:hover svg {
    opacity: 1;
}

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

.admin-topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
}
.topbar-avatar {
    width: 32px; height: 32px;
    background: var(--sidebar-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.8rem; font-weight: 700;
}

.admin-content {
    padding: 28px;
    flex: 1;
}

/* ── Cards ─────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.card-body { padding: 22px; }

/* ── Stats Grid ─────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon.blue { background: #EFF6FF; color: #3B82F6; }
.stat-icon.red { background: #FEF2F2; color: var(--accent); }
.stat-icon.green { background: #F0FDF4; color: var(--success); }
.stat-icon.orange { background: #FFFBEB; color: var(--warning); }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ── Table ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
    background: #F8FAFC;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F8FAFC; }

/* ── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--sidebar-bg); color: #FFFFFF; }
.btn-primary:hover { background: #162C47; color: #fff; }

.btn-accent { background: var(--accent); color: #FFFFFF; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

.btn-success { background: var(--success); color: #FFFFFF; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-danger:hover { background: #DC2626; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: #F8FAFC; color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-sm svg { width: 13px; height: 13px; }

/* ── Forms ──────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: #FFFFFF;
    transition: border-color 0.18s;
    outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--sidebar-bg); box-shadow: 0 0 0 3px rgba(29,53,87,0.08); }
textarea { resize: vertical; min-height: 120px; }

.form-actions { display: flex; align-items: center; gap: 10px; padding-top: 10px; }

/* ── Badge ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }

/* ── Flash Alert ────────────────────────────────── */
.flash-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 22px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid;
}
.flash-alert.success { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }
.flash-alert.error   { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.flash-alert.info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }

/* ── Login Page ─────────────────────────────────── */
.login-page {
    min-height: 100vh;
    width: 100%;
    flex: 1;
    background: linear-gradient(135deg, #1D3557, #457B9D);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}
.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}
.login-logo-icon {
    width: 44px; height: 44px;
    background: var(--accent);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px; font-weight: 800;
}
.login-logo-text strong { display: block; font-size: 1rem; font-weight: 700; color: var(--text); }
.login-logo-text span { font-size: 0.78rem; color: var(--text-muted); }
.login-card h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.login-card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 28px; }
.login-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    font-weight: 500;
}
.login-card .form-group { margin-bottom: 16px; }
.login-card input { background: #F8FAFC; }
.login-submit { width: 100%; padding: 12px; font-size: 0.95rem; margin-top: 8px; }
.login-back { text-align: center; margin-top: 20px; font-size: 0.83rem; color: var(--text-muted); }
.login-back a { color: var(--sidebar-bg); font-weight: 600; text-decoration: none; }

/* ── Smart Bot Verification Widget (Turnstile Style) ────────────── */
.smart-bot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.smart-bot-card:hover {
    border-color: #94A3B8;
    background: #F1F5F9;
}
.bot-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bot-checkbox {
    width: 26px;
    height: 26px;
    border: 2px solid #94A3B8;
    border-radius: 6px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.smart-bot-card:hover .bot-checkbox {
    border-color: #0284C7;
}
.bot-checkbox.verifying {
    border-color: #0284C7;
}
.bot-checkbox.checked {
    background: #16A34A;
    border-color: #16A34A;
}
.bot-check-icon {
    width: 16px;
    height: 16px;
    stroke: #FFFFFF;
    display: none;
}
.bot-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid #E2E8F0;
    border-top-color: #0284C7;
    border-radius: 50%;
    animation: botSpin 0.7s linear infinite;
    display: none;
}
@keyframes botSpin {
    to { transform: rotate(360deg); }
}
.bot-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: #1E293B;
    transition: color 0.2s;
}
.bot-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.75;
}
.bot-shield-icon {
    width: 24px;
    height: 24px;
    stroke: #0284C7;
}
.bot-branding {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.15;
}
.bot-branding strong {
    font-size: 0.68rem;
    color: #0F172A;
    font-weight: 700;
}
.bot-branding span {
    font-size: 0.6rem;
    color: #64748B;
}

/* ── Image Upload ───────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    background: #F8FAFC;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--sidebar-bg); background: #EFF6FF; }
.upload-zone p { font-size: 0.875rem; color: var(--text-muted); margin-top: 8px; }

/* ── Topbar Menu Button (Mobile) ───────────────── */
.topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.topbar-menu-btn:hover {
    background: #F1F5F9;
}

/* ── Sidebar Backdrop (Mobile) ─────────────────── */
.admin-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-sidebar-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 900px) {
    .topbar-menu-btn {
        display: inline-flex;
    }
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
        width: 100%;
    }
    .admin-topbar {
        padding: 0 16px;
        height: 56px;
    }
    .topbar-title {
        font-size: 0.95rem;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .admin-content {
        padding: 16px 14px;
    }
    .form-grid, .form-row {
        grid-template-columns: 1fr !important;
    }
    .admin-two-cols, .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
    .table-wrap, .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrap table, .table-responsive table, table {
        min-width: 560px;
    }
}

@media (max-width: 540px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .card-header .btn {
        width: 100%;
        justify-content: center;
    }
}
