/* =========================================
   1. DEĞİŞKENLER VE TEMEL AYARLAR
========================================= */
:root {
    /* Renk Paleti */
    --primary: #2c3e50;
    /* Ana Lacivert */
    --primary-dark: #1a252f;
    /* Header/Sidebar */
    --accent: #3498db;
    /* Vurgu Mavisi */
    --accent-hover: #2980b9;

    /* Arka Plan ve Metin */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #374151;
    --text-muted: #9ca3af;
    --border: #e5e7eb;

    /* Durum Renkleri */
    --warning-bg: #fff7ed;
    --warning-text: #c2410c;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --success-bg: #f0fdf4;
    --success-text: #15803d;
    --info-bg: #eff6ff;
    --info-text: #1d4ed8;

    /* Yeni Etiket Renkleri */
    --purple-bg: #f3e8ff;
    --purple-text: #7e22ce;
    --teal-bg: #ccfbf1;
    --teal-text: #0f766e;
    --gray-bg: #e5e7eb;
    --gray-text: #4b5563;

    /* Ölçüler */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    /* Masaüstünde taşmayı engelle */
    font-size: 14px;
}

/* =========================================
   2. ANA YERLEŞİM (LAYOUT)
========================================= */
.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 50;
    transition: width 0.3s;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: var(--primary-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent);
}

.brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text span {
    font-size: 10px;
    opacity: 0.6;
    letter-spacing: 1px;
}

.menu-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.menu-label {
    padding: 15px 25px 5px;
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background-color: rgba(52, 152, 219, 0.1);
    color: white;
    border-left-color: var(--accent);
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    background-color: var(--primary-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-mini-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-mini-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .name {
    font-weight: 600;
    font-size: 13px;
}

.user-details .role {
    font-size: 11px;
    opacity: 0.5;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-body);
}

.top-bar {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.page-header small {
    color: var(--text-muted);
    font-size: 12px;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.content-section {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    padding-bottom: 80px;
    /* Mobilde alttan kesilmeyi önler */
}

.hidden {
    display: none !important;
}

/* =========================================
   3. DASHBOARD VE KARTLAR
========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-info h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.value-box {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: 5px 0;
}

.value-box .number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.value-box .unit {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Renk Varyasyonları */
.warning-card .stat-icon {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.danger-card .stat-icon {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.success-card .stat-icon {
    background: var(--success-bg);
    color: var(--success-text);
}

.info-card .stat-icon {
    background: var(--info-bg);
    color: var(--info-text);
}

/* İçerik Kartları */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.card-body {
    padding: 25px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Dashboard Uyarısı */
.alert-box {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    padding: 15px 20px;
    border-radius: var(--radius);
    border: 1px solid #fecaca;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.alert-box i {
    font-size: 20px;
}

/* =========================================
   4. FORMLAR VE GİRİŞLER
========================================= */
.row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.align-end {
    align-items: flex-end;
}

.align-center {
    align-items: center;
}

.col {
    flex: 1;
}

.col-8 {
    flex: 2;
}

.col-4 {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.required {
    color: var(--danger-text);
}

.hint-text {
    font-size: 11px;
    margin-top: 5px;
    display: block;
}

.text-danger {
    color: var(--danger-text) !important;
}

.text-success {
    color: var(--success-text) !important;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.big-input {
    padding: 12px 15px;
    font-size: 16px;
}

.form-section-head {
    margin: 25px 0 15px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

/* Checkbox Grid */
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-body);
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}

.checkbox-container:hover {
    border-color: var(--accent);
}

.checkbox-container input {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

/* Butonlar */
.form-footer {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-body);
}

.btn-text {
    background: none;
    color: var(--accent);
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.full-width {
    width: 100%;
}

/* =========================================
   5. TABLOLAR VE ETİKETLER
========================================= */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    text-align: left;
    padding: 15px 20px;
    background-color: #f9fafb;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.modern-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.striped tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.modern-table tbody tr:hover {
    background-color: #f3f4f6;
}

/* Tag / Badge Stilleri */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tag.silahli {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.tag.silahsiz {
    background-color: var(--info-bg);
    color: var(--info-text);
}

.tag.borclu {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.tag.tamam {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.tag.silahfarki {
    background-color: var(--purple-bg);
    color: var(--purple-text);
}

.tag.xray {
    background-color: var(--teal-bg);
    color: var(--teal-text);
}

/* Öğrenci Durum Tagları (Madde 11) */
.tag.aktif {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.tag.mezun {
    background-color: var(--info-bg);
    color: var(--info-text);
}

.tag.dondurdu {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.tag.silindi {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    text-decoration: line-through;
}

/* Arama */
.search-wrapper {
    position: relative;
    width: 300px;
}

.search-wrapper input {
    padding-left: 35px;
    border-radius: 20px;
    background-color: var(--bg-body);
    border: none;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* =========================================
   6. YENİ MODÜL STİLLERİ
========================================= */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.schedule-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.schedule-header {
    background-color: #f9fafb;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--primary);
}

.lesson-card {
    background-color: var(--info-bg);
    color: var(--info-text);
    padding: 5px;
    border-radius: 4px;
    font-size: 11px;
    border-left: 3px solid var(--accent);
    cursor: pointer;
    margin-bottom: 2px;
}

.lesson-card:hover {
    opacity: 0.8;
}

/* Modal (Popup) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    width: 500px;
    max-width: 90%;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    /* Mobilde taşmayı önle */
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
}

.close-modal:hover {
    color: var(--danger-text);
}

/* =========================================
   7. GİRİŞ EKRANI
========================================= */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    color: #3498db;
    font-size: 48px;
    margin-bottom: 10px;
}

.login-title {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-subtitle {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 30px;
}

.login-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.3s;
}

.login-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-login:hover {
    background-color: #2980b9;
}

.error-msg {
    color: #b91c1c;
    font-size: 13px;
    margin-top: 15px;
    display: none;
}

/* =========================================
   8. MOBİL UYUMLULUK (RESPONSIVE)
========================================= */
@media screen and (max-width: 768px) {

    /* Genel Yerleşim */
    .app-container {
        flex-direction: column;
    }

    body {
        overflow: auto;
        height: auto;
    }

    /* Sidebar (Menü) */
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 10px;
        background-color: var(--primary-dark);
        position: sticky;
        top: 0;
        overflow-x: auto;
        white-space: nowrap;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-header {
        border: none;
        padding: 0 10px;
        width: auto;
    }

    .brand-text h2 {
        font-size: 14px;
    }

    .brand-text span {
        display: none;
    }

    .sidebar-footer,
    .menu-label {
        display: none;
    }

    .menu-items {
        display: flex;
        flex-direction: row;
        padding: 0;
        gap: 15px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .menu-items::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 8px;
        border: none;
        border-radius: 6px;
        flex-direction: column;
        font-size: 10px;
        min-width: 60px;
        justify-content: center;
        text-align: center;
    }

    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.1);
        border-left: none;
    }

    .nav-link i {
        margin: 0 0 4px 0;
        font-size: 18px;
    }

    .nav-link span {
        display: block;
        font-size: 9px;
    }

    /* Ana İçerik */
    .main-content {
        height: auto;
        overflow: visible;
    }

    .top-bar {
        padding: 15px;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .content-section {
        padding: 15px;
        overflow: visible;
    }

    /* Gridler ve Formlar */
    .row {
        flex-direction: column;
        gap: 15px;
    }

    .col,
    .col-8,
    .col-4 {
        width: 100%;
        flex: none;
    }

    .stats-grid,
    .checklist-grid {
        grid-template-columns: 1fr;
    }

    /* Tablolar (Yatay Kaydırma) */
    .card-body {
        padding: 15px;
        overflow-x: auto;
    }

    /* Butonlar ve Inputlar */
    .search-wrapper {
        width: 100%;
        margin-bottom: 10px;
    }

    .btn {
        width: 100%;
    }

    /* Takvim ve Modal */
    .schedule-grid {
        display: flex;
        flex-direction: column;
        border: none;
        background: transparent;
        gap: 10px;
    }

    .schedule-header {
        display: none;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 20px;
    }
}

/* =========================================
   9. YENİ EKLENEN MODAL VE DETAY STİLLERİ
========================================= */
/* Düzenleme Modalı için daha geniş alan */
.modal-content-lg {
    width: 700px;
    max-width: 95%;
}

/* Ödeme Geçmişi Özeti */
.payment-summary {
    display: flex;
    justify-content: space-between;
    background-color: var(--success-bg);
    padding: 15px;
    border-radius: var(--radius);
    margin: 20px 0;
    border: 1px solid #bbf7d0;
}

.payment-stat {
    text-align: center;
}

.payment-stat strong {
    display: block;
    font-size: 16px;
    margin-top: 5px;
}

.payment-stat small {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
}

/* Scroll Alanları */
.scroll-box {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* Belge Durum İşaretçileri (Madde 2 ve 3) */
.doc-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.doc-missing {
    background-color: var(--danger-text);
}

/* Kırmızı */
.doc-ok {
    background-color: var(--success-text);
}

/* Yeşil */
.doc-none {
    background-color: var(--border);
}

/* Gri - Gerekmiyor */

/* YENİ EKLENEN ÖZET BİLGİ ŞERİDİ */
.summary-bar {
    display: flex;
    gap: 15px;
    margin: 15px 15px 0 15px;
    /* HTML'deki inline stili buraya taşıdık */
    padding: 12px 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    align-items: center;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-main);
}

.summary-item strong {
    font-size: 15px;
    color: var(--primary);
}