/* ============================================
   FORMAKTUEL — MATERIAL DESIGN SYSTEM v2
   Font: Inter | Primary: #1a73e8
   ============================================ */

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

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

:root {
    /* Renkler */
    --primary:        #1a73e8;
    --primary-dark:   #1557b0;
    --primary-light:  #e8f0fe;
    --primary-hover:  #1669d3;

    --success:        #1e8e3e;
    --success-light:  #e6f4ea;
    --success-border: #b7dfc4;

    --warning:        #f9ab00;
    --warning-dark:   #b06000;
    --warning-light:  #fef7e0;
    --warning-border: #f5d98a;

    --error:          #d93025;
    --error-light:    #fce8e6;
    --error-border:   #f5c0bc;

    --info:           #1a73e8;
    --info-light:     #e8f0fe;
    --info-border:    #c5d9f5;

    /* Nötr */
    --surface:        #ffffff;
    --bg:             #f8f9fa;
    --bg2:            #f1f3f4;
    --bg3:            #e8eaed;

    --text1:          #202124;
    --text2:          #5f6368;
    --text3:          #80868b;
    --text4:          #bdc1c6;

    --border:         #dadce0;
    --border2:        #bdc1c6;

    /* Gölgeler */
    --shadow-sm:  0 1px 2px rgba(60,64,67,.10);
    --shadow:     0 1px 3px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.10);
    --shadow-md:  0 2px 6px rgba(60,64,67,.20), 0 1px 2px rgba(60,64,67,.12);
    --shadow-lg:  0 4px 12px rgba(60,64,67,.20), 0 2px 4px rgba(60,64,67,.12);

    /* Radius */
    --r-sm:   4px;
    --r:      8px;
    --r-md:   12px;
    --r-lg:   16px;
    --r-pill: 24px;

    /* Spacing (8px grid) */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-5:  20px;
    --sp-6:  24px;
    --sp-8:  32px;
    --sp-10: 40px;

    /* Layout */
    --container: 800px;
    --sidebar-w: 240px;
    --sidebar-collapsed-w: 64px;
    --topbar-h:  64px;

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    font-size: 16px;
    scrollbar-gutter: stable;
}
body { font-family: var(--font); color: var(--text1); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* Öğrenci sayfalarında normal scroll */
body { overflow-y: auto; }

 

/* ============================================
   LAYOUT
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--sp-6);
}

/* ============================================
   TİPOGRAFİ
   ============================================ */

h1, h2, h3, h4 { font-weight: 600; color: var(--text1); line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p  { color: var(--text2); font-size: 14px; line-height: 1.6; }

.text-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text2);
}
.text-caption { font-size: 12px; color: var(--text3); }
.text-primary  { color: var(--primary); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning-dark); }
.text-error    { color: var(--error); }
.text-muted    { color: var(--text3); }

/* ============================================
   HEADER — Öğrenci & Admin paylaşımlı
   ============================================ */

.app-header {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.app-header-inner {
    height: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--sp-6);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    flex-shrink: 0;
}

.app-logo-mark {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.app-logo-text { font-size: 15px; font-weight: 600; color: var(--text1); }
.app-logo-sub  { font-size: 12px; color: var(--text3); margin-top: 1px; }

.header-spacer { flex: 1; }

.header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-countdown {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: 12px;
    font-weight: 500;
    color: var(--warning-dark);
    background: var(--warning-light);
    border: 1px solid var(--warning-border);
    padding: 4px 10px;
    border-radius: var(--r-pill);
}

/* Mobil hamburger */
.header-toggle {
    display: none; /* masaüstünde gizli */
    width: 36px;
    height: 36px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
}

/* Öğrenci header nav — masaüstünde görünür */
.student-header-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

/* Anket seçenek (şık) stili */
.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--surface);
    -webkit-tap-highlight-color: transparent; /* mobilde native highlight kaldır */
}
/* Hover sadece gerçek mouse'da çalışsın, dokunmatik ekranda değil */
@media (hover: hover) {
    .option-label:hover {
        border-color: var(--primary);
        background: var(--primary-light);
    }
}
.option-label.option-selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.option-label.option-selected .option-letter {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.option-letter {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text2);
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}

/* Skala butonu */
.scale-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.scale-num {
    width: 100%;
    min-width: 32px;
    height: 44px;
    border-radius: var(--r);
    border: 2px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text2);
    transition: all .15s;
}
@media (hover: hover) {
    .scale-btn:hover .scale-num {
        border-color: var(--scale-color, var(--primary));
        color: var(--scale-color, var(--primary));
    }
}
.scale-btn.scale-selected .scale-num {
    background: var(--scale-color, var(--primary));
    border-color: var(--scale-color, var(--primary));
    color: #fff;
}

/* #19 — Mobil scale: dar ekranda wrap yap */
@media (max-width: 480px) {
    .scale-wrap {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .scale-btn {
        flex: 0 0 calc(20% - 5px);
        min-width: 44px;
    }
    .scale-num {
        height: 48px; /* Daha büyük touch target */
        font-size: 15px;
    }
    /* option-label daha büyük touch target */
    .option-label {
        padding: 14px 16px;
        min-height: 52px;
    }
    .option-letter {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    /* yesno butonları büyük */
    .yesno-btn {
        padding: 16px 12px;
        min-height: 80px;
    }
}

/* Evet/Hayır butonu */
.yesno-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text2);
    background: var(--bg);
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    .yesno-btn:hover { border-color: var(--primary); }
}
.yesno-btn.yesno-yes { border-color:#1e8e3e; background:#e6f4ea; color:#1e8e3e; }
.yesno-btn.yesno-no  { border-color:#d93025; background:#fce8e6; color:#d93025; }

@media (max-width: 640px) {
    .student-breadcrumb { display: block; }
}
.header-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text2);
    border-radius: 2px;
    transition: all .2s;
}

/* ============================================
   BUTONLAR
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    height: 36px;
    padding: 0 var(--sp-4);
    border-radius: var(--r);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, box-shadow .15s, opacity .15s;
    flex-shrink: 0;
    letter-spacing: .01em;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-full { width: 100%; }

/* Primary — Google mavi */
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(26,115,232,.4), 0 1px 3px rgba(26,115,232,.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 4px rgba(26,115,232,.4), 0 1px 6px rgba(26,115,232,.2);
}

/* Success — yeşil */
.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 1px 2px rgba(30,142,62,.4);
}
.btn-success:hover { background: #137333; box-shadow: 0 2px 4px rgba(30,142,62,.4); }

/* Danger — kırmızı */
.btn-danger {
    background: var(--error);
    color: #fff;
    box-shadow: 0 1px 2px rgba(217,48,37,.3);
}
.btn-danger:hover { background: #c5221f; }

/* Outlined */
.btn-outlined {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid #dadce0;
    box-shadow: 0 1px 2px rgba(60,64,67,.1);
}
.btn-outlined:hover { background: var(--primary-light); border-color: var(--primary); box-shadow: 0 1px 3px rgba(60,64,67,.15); }

/* Neutral outlined */
.btn-neutral {
    background: var(--surface);
    color: var(--text2);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(60,64,67,.1);
}
.btn-neutral:hover { background: var(--bg2); box-shadow: 0 1px 3px rgba(60,64,67,.15); }

/* Text */
.btn-text { background: transparent; color: var(--primary); padding: 0 var(--sp-3); box-shadow: none; }
.btn-text:hover { background: var(--primary-light); }

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error-border);
    font-size: 13px;
    height: 32px;
    padding: 0 var(--sp-4);
    box-shadow: none;
}
.btn-ghost:hover { background: var(--error-light); }

/* Sm */
.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: 13px; }

/* ============================================
   CHIPS / BADGES
   ============================================ */

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    height: 24px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.chip-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chip-info    { background: var(--info-light);    color: var(--primary);      }
.chip-success { background: var(--success-light); color: var(--success);      }
.chip-warning { background: var(--warning-light); color: var(--warning-dark); }
.chip-error   { background: var(--error-light);   color: var(--error);        }
.chip-neutral { background: var(--bg2);           color: var(--text2);        }

/* ============================================
   KARTLAR
   ============================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
}

.card-header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.card-body { padding: var(--sp-5); }
.card-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--r-md) var(--r-md);
}

/* ============================================
   METRİK KARTLAR
   ============================================ */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--sp-4);
}

@media (max-width: 400px) {
    .metric-grid { grid-template-columns: 1fr 1fr; }
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-5) var(--sp-6);
}

.metric-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: var(--sp-2);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text1);
    line-height: 1;
}

.metric-sub {
    font-size: 12px;
    color: var(--text3);
    margin-top: var(--sp-1);
}

/* ============================================
   FORM ELEMANLARI
   ============================================ */

.form-group { margin-bottom: var(--sp-5); }

/* İki sütunlu form satırı */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: var(--sp-2);
}

.form-label .required { color: var(--error); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text1);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-input   { height: 40px; padding: 0 var(--sp-3); }
.form-select  { height: 40px; padding: 0 var(--sp-3); cursor: pointer; }
.form-textarea { padding: var(--sp-3); resize: vertical; min-height: 96px; line-height: 1.6; }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text4); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}

.form-input.error { border-color: var(--error); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(217,48,37,.12); }
.form-hint { font-size: 12px; color: var(--text3); margin-top: var(--sp-1); }
.form-error { font-size: 12px; color: var(--error); margin-top: var(--sp-1); }

/* ---- Custom file input ---- */
.file-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 6px 6px 6px var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--bg);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    overflow: hidden;
    min-height: 42px;
}
.file-input-wrap:hover { border-color: var(--primary); background: var(--surface); }
.file-input-wrap input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1;
}
.file-input-btn {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text1);
    white-space: nowrap;
    pointer-events: none;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(60,64,67,.08);
}
.file-input-name {
    flex: 1;
    font-size: 13px;
    color: var(--text3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ---- Bulk action bar ---- */
.bulk-bar {
    display: none;
    align-items: center;
    gap: var(--sp-3);
    padding: 10px var(--sp-5);
    background: var(--primary-light);
    border-bottom: 1px solid #c5d9f5;
    flex-wrap: wrap;
}
.bulk-bar.visible { display: flex; }
.bulk-bar-label { font-size: 13px; font-weight: 600; color: var(--primary); flex-shrink: 0; }
.bulk-bar-divider { width: 1px; height: 18px; background: #c5d9f5; flex-shrink: 0; }

/* Toggle */
.toggle-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
    user-select: none;
}
.toggle-track {
    width: 40px; height: 22px;
    border-radius: 11px;
    background: var(--border2);
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.toggle-track.on { background: var(--primary); }
.toggle-track::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    top: 3px; left: 3px;
    transition: transform .2s;
    box-shadow: var(--shadow-sm);
}
.toggle-track.on::after { transform: translateX(18px); }
.toggle-label { font-size: 14px; color: var(--text1); }

/* Checkbox */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    cursor: pointer;
}
.checkbox-box {
    width: 18px; height: 18px;
    border: 2px solid var(--border2);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
    margin-top: 1px;
}
.checkbox-box.checked {
    background: var(--primary);
    border-color: var(--primary);
}
.checkbox-text { font-size: 14px; color: var(--text1); line-height: 1.4; }

/* ============================================
   TABLOLAR
   ============================================ */

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

/* Sağa/sola kaydırma */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Tablo scroll olduğunda card kenarını aşmasın */
.table-scroll::-webkit-scrollbar { height: 4px; }
.table-scroll::-webkit-scrollbar-track { background: var(--bg); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.data-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    text-align: left;
}

/* Çizgiyi tr'ye ver — tüm genişlikte tek çizgi */
.data-table tbody tr {
    border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child {
    border-bottom: none;
}
@media (hover: hover) {
    .data-table tbody tr:hover { background: var(--primary-light); }
}

/* Mobilde bazı sütunları gizle */
@media (max-width: 640px) {
    .data-table .hide-mobile { display: none; }
}

.data-table th {
    padding: 10px var(--sp-4);
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text2);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0 var(--sp-4);
    height: 52px;
    font-size: 14px;
    color: var(--text1);
    vertical-align: middle;
    line-height: 1.4;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--primary-light); }

.td-name { font-weight: 500; }
.td-mono { font-size: 13px; color: var(--text2); font-family: monospace; }
.td-muted { color: var(--text3); font-size: 13px; }
.td-actions { display: flex; gap: var(--sp-2); align-items: center; white-space: nowrap; justify-content: flex-end; }
.td-actions .btn { white-space: nowrap; flex-shrink: 0; }
.data-table th:last-child, .data-table td:last-child { text-align: right; }

/* ============================================
   ALERT / BİLDİRİM
   ============================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--r);
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid;
}

.alert-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content { flex: 1; }
.alert-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }

.alert-info    { background: var(--info-light);    border-color: var(--info-border);    }
.alert-success { background: var(--success-light); border-color: var(--success-border); }
.alert-warning { background: var(--warning-light); border-color: var(--warning-border); }
.alert-error   { background: var(--error-light);   border-color: var(--error-border);   }

.alert-info    .alert-icon { background: var(--primary);      }
.alert-success .alert-icon { background: var(--success);      }
.alert-warning .alert-icon { background: var(--warning);      }
.alert-error   .alert-icon { background: var(--error);        }

.alert-info    .alert-title { color: var(--primary-dark);  }
.alert-success .alert-title { color: #137333;              }
.alert-warning .alert-title { color: var(--warning-dark);  }
.alert-error   .alert-title { color: #c5221f;              }

.alert-info    p { color: #1557b0; }
.alert-success p { color: #137333; }
.alert-warning p { color: var(--warning-dark); }
.alert-error   p { color: #c5221f; }

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-wrap {
    height: 4px;
    background: var(--bg3);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: var(--r-pill);
    background: var(--primary);
    transition: width .4s ease;
}
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }

/* ============================================
   MODAl / DİALOG
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(32,33,36,.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .15s ease;
}
.modal-sm { max-width: 380px; }
.modal-lg { max-width: 680px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    font-size: 18px;
    line-height: 1;
    transition: background .15s;
}
.modal-close:hover { background: var(--bg2); }

.modal-body   { padding: var(--sp-6); }
.modal-footer {
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */

/* Masaüstü: fixed height layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

 
/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    height: 100dvh; /* mobil adres çubuğunu hesaba katar */
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition);
    overflow: hidden; /* footer hiç kaymasın */
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-4) var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-footer {
    flex-shrink: 0;
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: auto;
}

.sidebar-brand {
    height: var(--topbar-h);
    min-height: var(--topbar-h); /* sıkışmasın */
    padding: 0 var(--sp-5);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    flex-shrink: 0; /* brand asla küçülmesin */
}

.sidebar-brand-mark {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand-text { font-size: 15px; font-weight: 600; color: var(--text1); }
.sidebar-brand-sub  { font-size: 11px; color: var(--text3); }

/* sidebar-nav yukarıda tanımlandı, burada sadece override */

.nav-section-label {
    padding: var(--sp-3) var(--sp-5) var(--sp-1);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 9px var(--sp-5);
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    text-decoration: none;
    cursor: pointer;
    transition: background .12s, color .12s;
    position: relative;
    border-radius: 0;
    height: 38px; /* sabit yükseklik — collapsed geçişte zıplamayı önler */
    box-sizing: border-box;
}

.nav-item:hover { background: var(--bg); color: var(--text1); }

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
}

.nav-icon {
    width: 20px; height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-divider { height: 1px; background: var(--border); margin: var(--sp-2) var(--sp-5); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
}

.sidebar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-name  { font-size: 13px; font-weight: 600; color: var(--text1); }
.sidebar-user-role  { font-size: 11px; color: var(--text3); }

/* Admin main */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left .25s ease;
}

/* ---- Collapsed sidebar (masaüstü — sadece ikon) ---- */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-w);
}

/* Collapsed geçici genişleme — layout ETKİLENMEZ */
.sidebar.collapsed.peek {
    width: var(--sidebar-w);
    box-shadow: var(--shadow-lg);
}

/* Peek modunda label'lar görünür */
.sidebar.collapsed.peek .nav-label         { display: inline; }
.sidebar.collapsed.peek .nav-section-label { display: block; }
.sidebar.collapsed.peek .nav-item          { justify-content: flex-start; padding: 9px var(--sp-5); gap: var(--sp-3); }
.sidebar.collapsed.peek .sidebar-brand-info { display: block; }
.sidebar.collapsed.peek .sidebar-brand     { justify-content: flex-start; padding: 0 var(--sp-5); }
.sidebar.collapsed.peek .sidebar-user-info { display: block; }
.sidebar.collapsed.peek .sidebar-user      { justify-content: flex-start; margin-bottom: var(--sp-3); }
.sidebar.collapsed.peek .sidebar-footer    { padding: var(--sp-4) var(--sp-5); }
.sidebar.collapsed.peek .sidebar-logout    { width: 100%; height: 32px; border-radius: var(--r-pill); padding: 0 var(--sp-4); }
.sidebar.collapsed.peek .sidebar-logout .nav-label { display: inline; }

/* Brand: sadece logo mark kalır */
.sidebar.collapsed .sidebar-brand-info { display: none; }
.sidebar.collapsed .sidebar-brand      { justify-content: center; padding: 0; }

/* Nav: label'lar kaybolur — padding AYNI KALIR */
.sidebar.collapsed .nav-label          { display: none; }
.sidebar.collapsed .nav-section-label  { display: none; }
.sidebar.collapsed .nav-divider        { margin: var(--sp-2) var(--sp-3); }
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 9px 0; /* yükseklik normal modla aynı */
    gap: 0;
}

/* Footer: user info kaybolur */
.sidebar.collapsed .sidebar-user-info  { display: none; }
.sidebar.collapsed .sidebar-user       { justify-content: center; margin-bottom: var(--sp-2); }
.sidebar.collapsed .sidebar-footer     { padding: var(--sp-3) var(--sp-2); }
.sidebar.collapsed .sidebar-logout .nav-label { display: none; }
.sidebar.collapsed .sidebar-logout {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* Collapsed: admin-main margin DEĞİŞMEZ — peek'te de 64px kalır */
.sidebar.collapsed ~ .admin-main,
.admin-main.collapsed {
    margin-left: var(--sidebar-collapsed-w);
}


/* Admin topbar */
.admin-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: 0 var(--sp-6);
    flex-shrink: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    overflow: hidden; /* scrollbar topbar'a yansımasın */
}


.topbar-toggle {
    display: flex;
    width: 36px; height: 36px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
}
.topbar-toggle span { display: block; width: 18px; height: 2px; background: var(--text2); border-radius: 2px; }

.topbar-title { font-size: 16px; font-weight: 600; color: var(--text1); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-3); }

.active-pill {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
    background: var(--success-light);
    border: 1px solid var(--success-border);
    padding: 4px 10px;
    border-radius: var(--r-pill);
}
.active-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.warn-pill {
    font-size: 12px;
    font-weight: 500;
    color: var(--warning-dark);
    background: var(--warning-light);
    border: 1px solid var(--warning-border);
    padding: 4px 10px;
    border-radius: var(--r-pill);
}

/* Admin content */
.admin-content {
    padding: var(--sp-6);
    flex: 1;
}




/* Toolbar */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
}
.toolbar-left  { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

/* ============================================
   GLOBAL TOAST/ALERT
   ============================================ */

.toast {
    position: fixed;
    top: 80px;
    right: var(--sp-5);
    z-index: 9999;
    padding: var(--sp-3) var(--sp-5);
    border-radius: var(--r);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transition: opacity .4s;
    max-width: 360px;
    border: 1px solid;
}
.toast-success { background: var(--success-light); border-color: var(--success-border); color: #137333; }
.toast-error   { background: var(--error-light);   border-color: var(--error-border);   color: #c5221f; }

/* ============================================
   FADE GEÇİŞ — sadece içerik alanı
   ============================================ */

/* Sayfa geçişi: tüm body DEĞİL, sadece admin-content */
.admin-content { animation: contentFade .18s ease; }
@keyframes contentFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Öğrenci sayfaları için de sadece main etkilensin */
.student-main  { animation: contentFade .18s ease; }
.form-page-main { animation: contentFade .18s ease; }
.login-box      { animation: contentFade .2s ease; }
.center-card    { animation: contentFade .2s ease; }

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--sp-10) var(--sp-8);
}
.empty-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--bg2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-4);
}
.empty-icon svg { width: 24px; height: 24px; stroke: var(--text3); }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text1); margin-bottom: var(--sp-2); }
.empty-state p  { font-size: 14px; color: var(--text2); margin-bottom: var(--sp-5); }

/* ============================================
   PAGİNATİON
   ============================================ */

.pagination { display: flex; gap: var(--sp-1); align-items: center; justify-content: center; padding: var(--sp-4); flex-wrap: wrap; }
.page-btn {
    width: 32px; height: 32px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all .15s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================
   DASHBOARD GRID
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
}
@media (max-width: 640px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
.dash-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Dışarı taşmayı ana çerçevede engeller */
}
.dash-card-wide { grid-column: 1 / -1; }
.dash-card-header { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.dash-card-header h3 { font-size: 14px; font-weight: 600; }
.dash-card-body {
    padding: var(--sp-5);
    flex: 1;
    overflow-x: auto; /* İçerik genişse yatay scroll ekler */
    -webkit-overflow-scrolling: touch;
}

/* Progress sınıf istatistikleri */
.class-stat-row {
        min-width: 350px; /* Sınıf oranları barının çok daralmasını önler */
        display: flex;
        align-items: center;
        gap: var(--sp-3);
    }
.class-stat-name { font-size: 14px; font-weight: 500; white-space: nowrap; }
.class-stat-bar-wrap { flex: 1; }
.class-stat-pct { font-size: 13px; color: var(--text2); min-width: 60px; text-align: right; }

/* Active sessions */
.session-list { list-style: none; }
.session-item { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: none; }
.session-info strong { display: block; font-size: 13px; font-weight: 500; }
.session-info span { font-size: 12px; color: var(--text3); }

/* Log badges */
.log-login   { color: var(--success); background: var(--success-light); }
.log-logout  { color: var(--text2);   background: var(--bg2);           }
.log-failed  { color: var(--error);   background: var(--error-light);   }
.log-locked  { color: var(--warning-dark); background: var(--warning-light); }

/* ============================================
   ÖĞRENCİ — GİRİŞ SAYFASI
   ============================================ */

.login-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-10) var(--sp-8);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: var(--sp-6);
}
.login-logo-mark {
    width: 48px; height: 48px;
    background: var(--primary);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-4);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}
.login-title { font-size: 20px; font-weight: 600; color: var(--text1); margin-bottom: var(--sp-1); text-align: center; }
.login-sub   { font-size: 14px; color: var(--text2); text-align: center; }

.login-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin: var(--sp-5) 0;
    font-size: 12px;
    color: var(--text3);
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Admin login — aynı yapı, farklı renk yok. Sadece başlık farklı */

/* ============================================
   ÖĞRENCİ — FORM LİSTESİ
   ============================================ */

.student-page {
    background: var(--bg);
    min-height: 100vh;
    padding-top: var(--topbar-h);
}

.student-main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-6) var(--sp-10);
}

.page-welcome {
    margin-bottom: var(--sp-6);
}
.page-welcome h2 { font-size: 20px; font-weight: 600; margin-bottom: var(--sp-1); }
.page-welcome p  { font-size: 14px; color: var(--text2); }

.formcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sp-5);
}

/* Form kartları */
.fcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.fcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Sol renk çizgisi duruma göre */
.fcard-accent {
    height: 3px;
}
.fcard-pending   .fcard-accent { background: var(--primary); }
.fcard-draft     .fcard-accent { background: var(--warning); }
.fcard-submitted .fcard-accent { background: var(--success); }
.fcard-closed    .fcard-accent { background: var(--border2); }

.fcard-body { padding: var(--sp-5); flex: 1; }

.fcard-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.fcard-title { font-size: 15px; font-weight: 600; color: var(--text1); line-height: 1.4; }
.fcard-desc  { font-size: 13px; color: var(--text2); margin-bottom: var(--sp-4); line-height: 1.5; }

.fcard-meta { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.fcard-meta-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 12px;
    color: var(--text3);
}
.fcard-meta-row svg { width: 14px; height: 14px; stroke: var(--text3); flex-shrink: 0; }
.fcard-meta-row.submitted { color: var(--success); }
.fcard-meta-row.submitted svg { stroke: var(--success); }
.fcard-meta-row.expired { color: var(--error); }
.fcard-meta-row.expired svg { stroke: var(--error); }

.fcard-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.fcard-closed { opacity: .7; }
.fcard-closed:hover { transform: none; box-shadow: var(--shadow); }
.fcard-done-text {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text3);
    padding: var(--sp-1) 0;
}

/* ============================================
   ÖĞRENCİ — FORM DOLDURMNA
   ============================================ */

.form-page-main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-6) var(--sp-10);
}

.autosave-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 12px;
    color: var(--text3);
    padding: var(--sp-2) var(--sp-4);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: var(--sp-5);
}

.question-card { margin-bottom: var(--sp-4); }

.question-card .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
}

.question-num {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary);
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text1);
    line-height: 1.5;
}

.question-text strong { font-weight: 600; }
.question-text em     { font-style: italic; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
    margin-top: var(--sp-6);
    flex-wrap: wrap;
}

/* ============================================
   GÜVENLİK ŞİFRE KARTI
   ============================================ */

.pw-card-display {
    background: var(--success-light);
    border: 1px solid var(--success-border);
    border-radius: var(--r);
    padding: var(--sp-4) var(--sp-5);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .12em;
    color: #137333;
    font-family: monospace;
    text-align: center;
    margin: var(--sp-4) 0;
}

/* ============================================
   BAKIM / 404
   ============================================ */

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: var(--sp-6);
}
.center-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-10) var(--sp-8);
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-md);
}
.center-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-5);
}
.center-icon svg { width: 32px; height: 32px; stroke: var(--primary); }
.center-card h1 { margin-bottom: var(--sp-3); }
.center-card p  { margin-bottom: var(--sp-6); }

/* ============================================
   AYARLAR / SETTINGS
   ============================================ */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
}

@media (max-width: 700px) {
    .settings-grid { grid-template-columns: 1fr; }
}

/* ============================================
   EXPORT
   ============================================ */

.export-btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--sp-4);
    margin-top: var(--sp-5);
}
.export-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all .15s;
    text-align: left;
}
.export-btn:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.export-btn-icon { font-size: 24px; flex-shrink: 0; }
.export-btn strong { display: block; font-size: 14px; font-weight: 600; color: var(--text1); }
.export-btn span   { font-size: 12px; color: var(--text3); }

/* ============================================
   İSTATİSTİK
   ============================================ */

.stat-chart-wrap {
    display: flex;
    justify-content: center;
    padding: var(--sp-4);
}

/* ============================================
   PRINT — Öğrenci şifre kartları
   ============================================ */

@media print {
    body * { visibility: hidden !important; }
    #printArea, #printArea * { visibility: visible !important; }
    #printArea { position: fixed !important; left: 0; top: 0; width: 100%; z-index: 99999; background: white; }
    .no-print { display: none !important; }
}

.print-grid { display: flex; flex-wrap: wrap; }
.student-card-print {
    width: 9cm; min-height: 4.5cm;
    border: 1px dashed #bdc1c6;
    padding: 12px 16px;
    margin: 4px;
    font-family: Arial, sans-serif;
    page-break-inside: avoid;
    box-sizing: border-box;
}
.scp-site  { font-size: 9px; color: #5f6368; margin-bottom: 6px; font-weight: 500; }
.scp-name  { font-size: 14px; font-weight: 700; color: #202124; margin-bottom: 8px; }
.scp-row   { font-size: 12px; margin-bottom: 4px; display: flex; gap: 4px; align-items: center; }
.scp-label { color: #5f6368; font-size: 11px; min-width: 72px; }
.scp-val   { font-weight: 700; font-family: monospace; font-size: 14px; letter-spacing: .5px; color: #202124; }

/* Sınıf accordion başlık butonları */
/* Sınıf accordion başlık */
.cls-header-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.cls-count-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text2);
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}
/* 900px altında label'ları gizle — sadece ikon+kısa etiket */
@media (max-width: 900px) {
    .cls-btn-label { display: none; }
    .cls-header-btns .btn {
        padding: 0 10px;
        min-width: 34px;
        justify-content: center;
    }
}
/* 540px altında öğrenci sayısı metnini de gizle */
@media (max-width: 540px) {
    .cls-count-text { display: none; }
    .cls-header-btns .btn {
        padding: 0 8px;
        min-width: 32px;
    }
}

/* ============================================
   INVITATION LIST / ADMIN FORMS
   ============================================ */

.admin-fcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-5);
}

.afc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.afc:hover { box-shadow: var(--shadow-md); }
.afc-top-bar { height: 4px; }
.afc-body { padding: var(--sp-5); }
.afc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.afc-title { font-size: 15px; font-weight: 600; color: var(--text1); }
.afc-desc  { font-size: 13px; color: var(--text2); margin-bottom: var(--sp-4); line-height: 1.5; min-height: 36px; }
.afc-meta  { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.afc-meta-item { font-size: 12px; color: var(--text3); }
.afc-meta-item.expired { color: var(--error); }
.afc-progress-label { font-size: 12px; color: var(--text2); margin-bottom: var(--sp-2); display: flex; justify-content: space-between; }
.afc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-wrap: wrap;
}

/* Form card önizleme */
.fc-preview { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-top: var(--sp-3); }
.fc-preview-top { height: 3px; background: linear-gradient(90deg, var(--primary), #4285f4); }
.fc-preview-body { padding: var(--sp-3) var(--sp-4); }
.fc-preview-title { font-weight: 600; font-size: 13px; color: var(--text1); }
.fc-preview-desc  { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ============================================
   CHECKBOX LİST (sınıf atama)
   ============================================ */

.checkbox-list { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 250px; overflow-y: auto; }
.checkbox-list-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: 14px;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r);
    cursor: pointer;
    transition: background .12s;
}
.checkbox-list-item:hover { background: var(--bg); }

/* INVITE LINK */
.invite-link-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: var(--sp-3) var(--sp-4);
    font-size: 13px;
    word-break: break-all;
    font-family: monospace;
    margin: var(--sp-3) 0;
    color: var(--text2);
}

/* ============================================
   MOBİL RESPONSIVE
   ============================================ */

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(32,33,36,.5);
    z-index: 199;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.open { display: block; }


@media (max-width: 640px) {
    :root { --container: 100%; }
    .admin-topbar { padding: 0 var(--sp-4); } /* content ile aynı */
    .admin-content { padding: var(--sp-4); }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .export-btns { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .page-toolbar { flex-direction: column; align-items: flex-start; }
    .toolbar-right { width: 100%; }
    .toolbar-right .btn { flex: 1; justify-content: center; }
    .login-box { padding: var(--sp-8) var(--sp-6); }
    .formcard-grid { grid-template-columns: 1fr; }
    .modal { max-height: 95vh; }
    .modal-body { padding: var(--sp-4); }
    .data-table th,
    .data-table td { 
        padding: 10px var(--sp-2); 
        font-size: 13px; /* Mobilde metinleri biraz küçültür */
    }
    .admin-fcard-grid { grid-template-columns: 1fr; }

    /* Mobil header */
    .header-right { display: none; flex-direction: column; align-items: stretch; gap: var(--sp-3); }
    .header-right.open {
        display: flex;
        position: fixed;
        top: var(--topbar-h);
        left: 0; right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: var(--sp-4) var(--sp-5);
        box-shadow: var(--shadow-md);
        z-index: 99;
    }
    .header-toggle { display: flex; }
    .student-header-nav { display: none; }
    .header-user { justify-content: flex-start; }
    .header-countdown { justify-content: center; }
    .btn-ghost { text-align: center; }
}
/* ============================================
   FIX: MOBİL SCROLL & LAYOUT OPTIMIZATION
   ============================================ */

/* Tüm ekranlarda body'i sabitle, kaydırmayı içeriğe devret */
body.admin-body {
    overflow: hidden !important;
    height: 100vh;
    height: 100dvh; /* Modern tarayıcılar için dinamik height */
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Admin ana taşıyıcıyı ekran yüksekliğine sabitle */
.admin-layout {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
}

/* Header her zaman sabit kalsın, içerik alanı kaysın */
.admin-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    min-width: 0;
}

.admin-topbar {
    flex-shrink: 0; /* Header'ın yukarı kaçmasını engeller */
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: var(--sp-6);
    min-height: 0;
    scrollbar-gutter: stable; /* scrollbar çıkınca içerik kaymaz */
}

/* --- MASAÜSTÜ (961px+) --- */
@media (min-width: 961px) {
    
    .sidebar { transform: none !important; }
}

/* --- MOBİL (960px ve Altı) --- */
@media (max-width: 960px) {
    .admin-topbar {
        padding: 0 var(--sp-4); /* content ile aynı: 16px */
    }
    .admin-content {
        padding: var(--sp-4);
        /* Adres çubuğu + safe area için ekstra boşluk */
        padding-bottom: max(80px, calc(var(--sp-4) + env(safe-area-inset-bottom, 20px)));
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: auto !important; /* bottom:0 ile çakışmaması için */
        width: var(--sidebar-w);
        transform: translateX(-100%);
        z-index: 1100;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .topbar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg2);
        border: none;
        border-radius: var(--r);
        cursor: pointer;
        margin-right: var(--sp-2);
    }

    .admin-main {
        margin-left: 0 !important;
    }
}