/* ==========================================================================
   Karaman İl Millî Eğitim Müdürlüğü MEBBİS Şubesi - Kurumsal Tema
   ========================================================================== */

:root {
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    /* MEB Kurumsal Kırmızı */
    --meb-red: #c81e1e;
    --meb-red-hover: #a51818;
    --meb-red-light: rgba(200, 30, 30, 0.12);
    --meb-red-glow: rgba(200, 30, 30, 0.25);
}

/* ☀️ GÜNDÜZ MODU (Açık Tema) */
[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #f8fafc;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #c81e1e;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --chat-bot-bg: #ffffff;
    --chat-bot-text: #0f172a;
    --chat-bot-border: #e2e8f0;
    --chat-user-bg: #c81e1e;
    --chat-user-text: #ffffff;

    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-border: #e2e8f0;
    --nav-active: #c81e1e;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* 🌙 GECE MODU (Koyu Tema) */
[data-theme="dark"] {
    --bg-body: #0b1120;
    --bg-surface: #131c31;
    --bg-surface-secondary: #1a253f;
    --bg-input: #0f172a;
    --border-color: #24304f;
    --border-focus: #ef4444;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --chat-bot-bg: #1a253f;
    --chat-bot-text: #f8fafc;
    --chat-bot-border: #24304f;
    --chat-user-bg: #b91c1c;
    --chat-user-text: #ffffff;

    --nav-bg: rgba(19, 28, 49, 0.95);
    --nav-border: #24304f;
    --nav-active: #f87171;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== KURUMSAL ÜST BAŞLIK (HEADER) ==================== */
.public-header {
    background-color: var(--bg-surface);
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left .portal-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--meb-red);
    background-color: var(--meb-red-light);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
    display: inline-block;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.meb-header-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(200, 30, 30, 0.25));
    transition: transform 0.3s ease;
}

.brand-link:hover .meb-header-logo {
    transform: scale(1.05);
}

.header-gov-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.header-sub-dept {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--meb-red);
    display: block;
    margin-top: 2px;
}

/* Gece/Gündüz Modu Butonu ve Üst Menü Aksiyonları */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: var(--transition);
}

.login-header-btn {
    background-color: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.login-header-btn:hover {
    border-color: var(--meb-red);
    color: var(--meb-red);
}

.register-header-btn {
    background-color: var(--meb-red);
    border: 1px solid var(--meb-red);
    color: #ffffff;
}

.register-header-btn:hover {
    background-color: var(--meb-red-hover);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(200, 30, 30, 0.35);
}

.logout-header-btn {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.logout-header-btn:hover {
    background-color: #ef4444;
    color: #ffffff;
}

.admin-badge-btn {
    background-color: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.admin-badge-btn:hover {
    background-color: #10b981;
    color: #ffffff;
}

/* Kullanıcı Başlık Rozeti */
.user-header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    max-width: 250px;
}

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

.user-badge-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
}

.user-badge-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge-inst {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.theme-toggle-btn {
    background-color: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    border-color: var(--meb-red);
    color: var(--meb-red);
}

[data-theme="light"] .theme-toggle-btn .icon-light { display: none; }
[data-theme="light"] .theme-toggle-btn .icon-dark { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle-btn .icon-light { display: inline-block; color: #fbbf24; }

/* ==================== SOHBET / CHAT ALANI ==================== */
.public-main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px 85px 16px; /* Alt bar için boşluk */
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100vh - 165px);
}

.chat-messages-stream {
    flex: 1;
    overflow-y: auto;
    padding: 24px 8px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

/* Karşılama Kartı */
.chat-welcome-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 8px;
    animation: fadeIn 0.4s ease;
}

.welcome-emblem {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 10px rgba(200, 30, 30, 0.3));
}

.chat-welcome-card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.chat-welcome-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 20px auto;
    line-height: 1.6;
}

/* Hızlı Soru Çipleri */
.prompt-chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    max-width: 750px;
    margin: 0 auto;
}

.prompt-chip {
    background-color: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.prompt-chip i {
    color: var(--meb-red);
    font-size: 16px;
    flex-shrink: 0;
}

.prompt-chip:hover {
    border-color: var(--meb-red);
    background-color: var(--meb-red-light);
    transform: translateY(-2px);
}

/* Mesaj Balonları */
.chat-message-row {
    display: flex;
    gap: 12px;
    max-width: 82%;
    animation: fadeIn 0.3s ease;
}

.chat-message-row.user-row {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-row.bot-row {
    align-self: flex-start;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.msg-avatar img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.msg-avatar.user-avatar {
    background-color: #475569;
    color: #fff;
    font-size: 14px;
}

.msg-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.94rem;
    line-height: 1.6;
    word-break: break-word;
    box-shadow: var(--shadow-sm);
}

.user-row .msg-bubble {
    background-color: var(--chat-user-bg);
    color: var(--chat-user-text);
    border-bottom-right-radius: 4px;
}

.bot-row .msg-bubble {
    background-color: var(--chat-bot-bg);
    color: var(--chat-bot-text);
    border: 1px solid var(--chat-bot-border);
    border-bottom-left-radius: 4px;
}

.msg-meta-source {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed rgba(150, 150, 150, 0.2);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Yazıyor Animasyonu */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 12px;
}

.chat-typing-indicator.hidden {
    display: none;
}

.typing-avatar img {
    width: 28px;
    height: 28px;
}

.typing-bubble {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-full);
    display: flex;
    gap: 6px;
}

.typing-bubble .dot {
    width: 8px;
    height: 8px;
    background-color: var(--meb-red);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-bubble .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-bubble .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Mesaj Giriş Alanı */
.chat-input-area {
    padding: 10px 0 6px 0;
    position: sticky;
    bottom: 0;
    background-color: var(--bg-body);
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 8px 6px 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--meb-red-glow);
}

.chat-input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    padding: 6px 0;
}

.btn-chat-send {
    width: 44px;
    height: 44px;
    background-color: var(--meb-red);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: var(--transition);
}

.btn-chat-send:hover {
    background-color: var(--meb-red-hover);
    transform: scale(1.05);
}

.chat-input-footer-hint {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ==================== SABİT ALT MENÜ ÇUBUĞU ==================== */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--nav-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex: 1;
    max-width: 120px;
}

.bottom-nav-item i {
    font-size: 19px;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--nav-active);
}

.bottom-nav-item.active .nav-icon-box {
    transform: translateY(-2px);
}

/* ==================== DOSYALAR & FORMLAR SAYFASI ==================== */
.public-files-container {
    padding-top: 20px;
}

.files-header-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 20px;
}

.banner-icon {
    width: 52px;
    height: 52px;
    background-color: var(--meb-red-light);
    color: var(--meb-red);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.banner-text h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.banner-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.files-search-bar {
    position: relative;
    margin-bottom: 20px;
}

.files-search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.files-search-bar input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    transition: var(--transition);
}

.files-search-bar input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--meb-red-glow);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.file-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--meb-red);
}

.file-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.file-type-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-surface-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.file-type-pdf  { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.file-type-docx, .file-type-doc { color: #3b82f6; border-color: rgba(59, 130, 246, 0.3); }
.file-type-xlsx, .file-type-xls { color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.file-type-zip,  .file-type-rar { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }

.file-meta-stats {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.file-description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.file-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.file-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-download-file {
    background-color: var(--meb-red);
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-download-file:hover {
    background-color: var(--meb-red-hover);
}

.empty-files-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-files-box i {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--meb-red);
}

/* ==================== GİRİŞ SAYFASI (LOGIN) ==================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.login-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-icon {
    width: 60px;
    height: 60px;
    background-color: var(--meb-red-light);
    color: var(--meb-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 16px auto;
}

.login-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-form {
    text-align: left;
}

.login-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--meb-red);
}

/* ==================== KAYIT SAYFASI (REGISTER) ==================== */
.register-wrapper {
    padding: 30px 16px;
}

.register-card {
    max-width: 580px;
    padding: 36px 36px;
}

.register-icon {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

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

@media (max-width: 600px) {
    .form-row-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .register-card {
        padding: 26px 18px;
    }
}

.required-star {
    color: var(--meb-red);
    font-weight: bold;
}

.form-hint {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.3;
}

.select-with-icon select.custom-select {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: var(--transition);
}

.select-with-icon select.custom-select:focus {
    outline: none;
    border-color: var(--meb-red);
    box-shadow: 0 0 0 3px rgba(200, 30, 30, 0.12);
}

.custom-select optgroup {
    font-weight: 700;
    color: var(--meb-red);
    font-size: 0.85rem;
    background-color: var(--bg-surface);
    padding: 6px 0;
}

.custom-select option {
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    padding: 6px 10px;
}

.auth-switch-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-link {
    color: var(--meb-red);
    text-decoration: none;
    transition: var(--transition);
}

.auth-link:hover {
    text-decoration: underline;
}

/* ==================== YÖNETİCİ PANELİ (ADMIN) DÜZENİ ==================== */
.admin-body {
    background-color: var(--bg-body);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    flex-shrink: 0;
}

.admin-brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 18px;
}

.brand-text h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.brand-text span {
    font-size: 0.72rem;
    color: var(--meb-red);
    font-weight: 600;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-item:hover {
    background-color: var(--bg-surface-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--meb-red);
    color: #fff;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.sidebar-site-link, .sidebar-logout-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-site-link {
    background-color: var(--bg-surface-secondary);
    color: var(--text-primary);
}

.sidebar-logout-link {
    color: #ef4444;
}

.sidebar-logout-link:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

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

/* ==================== FORM VE BUTON ELEMANLARI ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: var(--transition);
}

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

.btn-primary {
    background-color: var(--meb-red);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--meb-red-hover);
}

.btn-secondary {
    background-color: var(--bg-surface-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--meb-red);
    color: var(--meb-red);
}

.btn-block {
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--meb-red-glow);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 40px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ==================== KARTLAR & TABLOLAR ==================== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title i {
    color: var(--meb-red);
    font-size: 18px;
}

.header-title h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

.card-body.p-0 {
    padding: 0;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    background-color: var(--bg-surface-secondary);
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: var(--bg-surface-secondary);
}

/* Rozetler */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-primary { background: var(--meb-red-light); color: var(--meb-red); }
.badge-neutral { background: var(--bg-surface-secondary); color: var(--text-muted); border: 1px solid var(--border-color); }

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-secondary);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.action-btn.edit-btn:hover { background-color: #3b82f6; color: #fff; border-color: #3b82f6; }
.action-btn.delete-btn:hover { background-color: #ef4444; color: #fff; border-color: #ef4444; }

.inline-form { display: inline; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: monospace; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* Bildirimler */
.flash-toast-container, .flash-container {
    max-width: 900px;
    margin: 12px auto 0 auto;
    padding: 0 16px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.alert-success { background: rgba(16, 185, 129, 0.15); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-danger  { background: rgba(239, 68, 68, 0.15);  color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-warning { background: rgba(245, 158, 11, 0.15); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }
.alert-info    { background: rgba(59, 130, 246, 0.15); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.3); }

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.stat-content h3 {
    font-size: 1.35rem;
    font-weight: 800;
}

.stat-content p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stat-link {
    position: absolute;
    right: 16px;
    top: 18px;
    font-size: 0.75rem;
    color: var(--meb-red);
    text-decoration: none;
    font-weight: 700;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Animasyon */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
    .header-gov-title { font-size: 0.88rem; }
    .header-sub-dept { font-size: 0.72rem; }
    .meb-header-logo { width: 42px; height: 42px; }
    .header-left { display: none; }
    .prompt-chips-grid { grid-template-columns: 1fr; }
    .chat-message-row { max-width: 92%; }
    .grid-2-cols { grid-template-columns: 1fr; }
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .header-action-btn .btn-text { display: none; }
    .header-action-btn { padding: 6px 10px; font-size: 0.9rem; }
    .theme-toggle-btn .theme-btn-text { display: none; }
    .theme-toggle-btn { padding: 6px 10px; }
}
