/* Dosya: /assets/css/cockpit.css */
/* Sıddık Naci Eren (ks) Web Sistemi ve Yönetim Kokpiti - 100vw x 100dvh Sıfır-Scroll Bento Grid CSS Katmanı */

:root {
    --bg-main: #f3f0e8;
    --bg-surface: #ffffff;
    --bg-elevated: #f9f7f2;
    --bg-sidebar: #0b291e;
    --text-main: #0f1d17;
    --text-muted: #354c42;
    --text-sidebar: #f4f9f6;
    --accent-emerald: #0f3d2e;
    --accent-emerald-hover: #175943;
    --accent-gold: #9e7005;
    --accent-gold-soft: rgba(184, 134, 11, 0.16);
    --border-color: rgba(15, 61, 46, 0.24);
    --border-strong: rgba(184, 134, 11, 0.52);
    --status-ok: #15803d;
    --status-ok-bg: rgba(21, 128, 61, 0.11);
    --status-warn: #b45309;
    --status-warn-bg: rgba(180, 83, 9, 0.12);
    --status-err: #b91c1c;
    --status-err-bg: rgba(185, 28, 28, 0.11);
    --shadow-card: 0 8px 26px rgba(13, 46, 34, 0.06);
    --radius-lg: 16px;
    --radius-md: 11px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    --bg-main: #070f0c;
    --bg-surface: #10201a;
    --bg-elevated: #172d25;
    --bg-sidebar: #050b09;
    --text-main: #f4faf7;
    --text-muted: #bdd1c8;
    --text-sidebar: #f4faf7;
    --accent-emerald: #1f7a5c;
    --accent-emerald-hover: #289471;
    --accent-gold: #e5c148;
    --accent-gold-soft: rgba(229, 193, 72, 0.20);
    --border-color: rgba(229, 193, 72, 0.28);
    --border-strong: rgba(229, 193, 72, 0.55);
    --status-ok: #22c55e;
    --status-ok-bg: rgba(34, 197, 94, 0.14);
    --status-warn: #f59e0b;
    --status-warn-bg: rgba(245, 158, 11, 0.15);
    --status-err: #ef4444;
    --status-err-bg: rgba(239, 68, 68, 0.15);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

[hidden] {
    display: none !important;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) transparent;
}

*::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(184, 134, 11, 0.45);
    border-radius: 999px;
}

html, body.cockpit-body {
    width: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ANA KOKPİT KABUĞU (TAM AÇIKLIK - SOL MENÜSÜZ ÜST HEADER MİMARİSİ) */
.cockpit-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100dvh;
}

.topbar-brand-box {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
}

.topbar-center-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex: 1;
    padding: 0.25rem 0.5rem;
}

/* SOL NAVİGASYON SÜTUNU */
.cockpit-sidebar {
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100dvh;
    padding: 1.1rem 0.9rem;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-emblem {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-emerald), #082219);
    border: 1px solid var(--accent-gold);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-text strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    margin: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-tab-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.52rem 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sidebar-tab-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.sidebar-tab-btn.is-active {
    background: linear-gradient(90deg, rgba(184, 134, 11, 0.24), rgba(15, 61, 46, 0.55));
    border-color: var(--accent-gold);
    color: #ffffff;
    font-weight: 600;
}

.sidebar-tab-btn .tab-icon {
    flex-shrink: 0;
    color: var(--accent-gold);
}

.nav-badge-counter {
    margin-left: auto;
    background: var(--status-err);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.48rem;
    border-radius: 999px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.user-mini-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-gold);
    color: #09120f;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-meta strong {
    font-size: 0.83rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.sidebar-footer-actions {
    display: flex;
    gap: 0.45rem;
}

.btn-ghost-sm, .btn-danger-sm {
    flex: 1;
    text-align: center;
    padding: 0.48rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
}

.btn-ghost-sm {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-ghost-sm:hover {
    border-color: var(--accent-gold);
}

.btn-danger-sm {
    background: rgba(185, 28, 28, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ÜST HEADER ÇUBUĞU (1 VEYA 2 SATIR ORTALI ESNEK YAPI) */
.cockpit-topbar {
    position: sticky;
    top: 0;
    z-index: 800;
    background: var(--bg-sidebar);
    color: #ffffff;
    border-bottom: 2px solid var(--accent-gold);
    padding: 0.6rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.topbar-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-main);
}

.topbar-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.cockpit-select-sm {
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-main);
    font-size: 0.8rem;
    outline: none;
}

.btn-smart-patch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-gold);
    background: linear-gradient(135deg, var(--accent-emerald), #0b291f);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-smart-patch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(184, 134, 11, 0.25);
}

.icon-only-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.18s ease;
}

.icon-only-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* SIFIR CONTAINER TAM AÇIKLIKTA (FULL-BLEED) ÇALIŞMA ALANI */
.cockpit-workspace {
    width: 100%;
    max-width: none;
    padding: 1rem 1.25rem 2rem;
    flex: 1;
}

.cockpit-tab-pane {
    display: none;
    width: 100%;
}

.cockpit-tab-pane.is-active {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    width: 100%;
}

.bento-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
    width: 100%;
    align-items: start;
}

.bento-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
    width: 100%;
    align-items: start;
}

.bento-column {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    width: 100%;
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.35rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: visible;
}

.bento-card.flex-1 {
    flex: 1;
}

.bento-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.7rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.bento-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

#activeTabSubheading,
.topbar-subtitle,
.bento-card-subtitle {
    display: none !important;
}

.bento-card-body {
    width: 100%;
    overflow: visible;
}

/* FORM VE EDİTÖR BİLEŞENLERİ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.65rem;
}

.form-field label {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-field small {
    font-size: 0.79rem;
    color: var(--text-muted);
}

.cockpit-input, .cockpit-textarea, .cockpit-select {
    width: 100%;
    padding: 0.62rem 0.82rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s ease;
}

.cockpit-textarea.code-editor {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    resize: none;
}

.cockpit-input:focus, .cockpit-textarea:focus, .cockpit-select:focus {
    border-color: var(--accent-gold);
}

[data-rbac-locked="1"] {
    opacity: 0.65;
    cursor: not-allowed !important;
}

/* BUTON SETLERİ */
.btn-group-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary, .btn-gold, .btn-secondary, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.54rem 0.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.81rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.btn-primary {
    background: var(--accent-emerald);
    color: #ffffff;
    border-color: var(--accent-gold);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-emerald-hover);
}

.btn-gold {
    background: var(--accent-gold);
    color: #0b1411;
    border-color: var(--accent-gold);
}

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

.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent-gold);
}

.btn-danger {
    background: var(--status-err-bg);
    color: var(--status-err);
    border-color: var(--status-err);
}

.btn-sm {
    padding: 0.34rem 0.65rem;
    font-size: 0.75rem;
}

button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

/* VERİ LİSTELEME TABLOLARI VE ROZETLER */
.cockpit-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.cockpit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.89rem;
}

.cockpit-table th, .cockpit-table td {
    padding: 0.68rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cockpit-table th {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-main);
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
    z-index: 1;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-ok { background: var(--status-ok-bg); color: var(--status-ok); }
.badge-warn { background: var(--status-warn-bg); color: var(--status-warn); }
.badge-err { background: var(--status-err-bg); color: var(--status-err); }
.badge-gold { background: var(--accent-gold-soft); color: var(--accent-gold); }

/* SAĞDAN AÇILAN ÇEKMECE (OFFCANVAS DRAWER) */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 13, 10, 0.58);
    backdrop-filter: blur(2px);
    z-index: 900;
}

.offcanvas-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(640px, 94vw);
    height: 100dvh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-strong);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    z-index: 950;
    transform: translateX(102%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.offcanvas-drawer.is-open {
    transform: translateX(0);
}

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

.drawer-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem 1.25rem;
}

/* ANLIK BİLDİRİM BALONLARI (TOAST) */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-width: 390px;
}

.cockpit-toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--accent-gold);
    color: var(--text-main);
    padding: 0.78rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    font-size: 0.83rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    animation: toastSlideIn 0.22s ease forwards;
}

.cockpit-toast.toast-ok { border-left-color: var(--status-ok); }
.cockpit-toast.toast-err { border-left-color: var(--status-err); }
.cockpit-toast.toast-warn { border-left-color: var(--status-warn); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* MOBİL VE TABLET RESPONSIVE UYUMU */
@media (max-width: 1024px) {
    html, body.cockpit-body, .cockpit-shell, .cockpit-main, .cockpit-workspace {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
    }
    .cockpit-shell {
        grid-template-columns: 1fr;
    }
    .cockpit-sidebar {
        height: auto;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-tab-btn {
        width: auto;
        flex: 1 1 140px;
    }
    .bento-grid-2col, .bento-grid-3col {
        grid-template-columns: 1fr;
        height: auto;
    }
}
```