/* =========================================================================
   main.css — Kuzey Panel
   Değişkenler, sıfırlama, tipografi ve temel layout (sidebar/topbar/shell)
   ========================================================================= */

:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --border: #e7eaf0;
    --border-strong: #d9dee8;
    --text: #172033;
    --text-muted: #697386;
    --text-faint: #96a0b3;

    --primary: #635bff;
    --primary-dark: #4f46e5;
    --primary-soft: #f0efff;

    --success: #0e9f6e;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fff7ed;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --danger-strong: #991b1b;
    --info: #2563eb;
    --info-soft: #eff6ff;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-xs: 0 1px 2px rgba(23, 32, 51, 0.04);
    --shadow-sm: 0 2px 6px rgba(23, 32, 51, 0.06);
    --shadow-md: 0 8px 24px rgba(23, 32, 51, 0.08);
    --shadow-lg: 0 16px 48px rgba(23, 32, 51, 0.12);

    --sidebar-w: 268px;
    --topbar-h: 72px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
h1, h2, h3, h4, h5, p { margin: 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-primary { color: var(--primary); }

/* =========================================================================
   APP SHELL
   ========================================================================= */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-w);
}

.app-content {
    flex: 1;
    padding: 28px 32px 40px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    padding: 18px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-faint);
    font-size: 12.5px;
}
.app-footer-links { display: flex; gap: 16px; }
.app-footer-links a:hover { color: var(--text-muted); }

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
}
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-name {
    font-weight: 700; font-size: 15px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-plan {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; color: var(--primary);
    background: var(--primary-soft);
    padding: 2px 8px; border-radius: 20px; margin-top: 4px;
}
.brand-logo {
    max-height: 38px;
    max-width: calc(var(--sidebar-w) - 40px);
    width: auto;
    object-fit: contain;
}
.sidebar-close { display: none; margin-left: auto; }

.branch-select {
    padding: 0 20px 16px;
}
.branch-select label {
    display: block; font-size: 11px; font-weight: 600; color: var(--text-faint);
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.select-wrap {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; background: var(--surface-soft);
}
.select-wrap i { color: var(--text-faint); font-size: 12px; }
.select-wrap select {
    border: none; background: transparent; outline: none; width: 100%;
    font-size: 13px; font-weight: 500; color: var(--text);
}

.sidebar-nav { flex: 1; padding: 4px 12px 12px; }
.nav-group { margin-bottom: 6px; }
.nav-group-label {
    font-size: 10.5px; font-weight: 700; color: var(--text-faint);
    text-transform: uppercase; letter-spacing: .06em;
    padding: 14px 10px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; color: var(--text-muted);
    margin-bottom: 2px;
    transition: background .12s ease, color .12s ease;
}
.nav-item i { width: 16px; text-align: center; font-size: 14px; color: var(--text-faint); }
.nav-item:hover { background: var(--surface-soft); color: var(--text); }
.nav-item.active {
    background: var(--primary-soft); color: var(--primary-dark); font-weight: 600;
}
.nav-item.active i { color: var(--primary); }
.nav-item-muted { color: var(--text-faint); }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 12px;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px; margin-top: 4px; border-radius: var(--radius-sm);
}
.sidebar-user:hover { background: var(--surface-soft); }
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name {
    font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 11.5px; color: var(--text-faint); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(23,32,51,.45);
    z-index: 39;
}

/* =========================================================================
   TOPBAR
   ========================================================================= */
.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 20px;
    padding: 0 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.sidebar-toggle { display: none; }
.topbar-title { font-size: 18px; font-weight: 700; }
.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-faint); margin-top: 2px;
}
.breadcrumb a:hover { color: var(--text-muted); }
.breadcrumb i { font-size: 9px; }

.topbar-search {
    position: relative;
    flex: 1; max-width: 440px;
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
}
.topbar-search i { color: var(--text-faint); font-size: 13px; }
.topbar-search input {
    border: none; background: transparent; outline: none; flex: 1;
    font-size: 13px; color: var(--text);
}
.topbar-search input::placeholder { color: var(--text-faint); }
.search-results {
    display: none;
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    max-height: 360px; overflow-y: auto; z-index: 50;
    padding: 6px;
}
.search-results.show { display: block; }
.search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-sm);
}
.search-result-item:hover { background: var(--surface-soft); }
.search-result-tag {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: var(--primary); background: var(--primary-soft);
    padding: 2px 7px; border-radius: 20px; flex-shrink: 0;
}
.search-result-title { font-size: 13px; font-weight: 600; }
.search-result-sub { font-size: 11.5px; color: var(--text-faint); }
.search-empty { padding: 16px; text-align: center; color: var(--text-faint); font-size: 12.5px; }

.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-shrink: 0; }

.rate-strip {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-soft); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 7px 12px;
}
.rate-chip { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.rate-code { font-weight: 700; color: var(--text-faint); }
.rate-val { font-weight: 600; color: var(--text); }
.icon-btn-xs { width: 22px; height: 22px; font-size: 11px; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    position: relative;
    flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-soft); color: var(--text); }

.notif-dot {
    position: absolute; top: -5px; right: -5px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; border: 2px solid var(--surface);
}

.user-chip {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: var(--radius-sm); padding: 5px 10px 5px 5px;
}
.user-chip:hover { background: var(--surface-soft); }
.user-chip-info { text-align: left; }
.user-chip-name { display: block; font-size: 12.5px; font-weight: 600; }
.user-chip-role { display: block; font-size: 10.5px; color: var(--text-faint); }
.user-chip i { font-size: 10px; color: var(--text-faint); margin-left: 2px; }

.btn-topbar { flex-shrink: 0; }

.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* =========================================================================
   DROPDOWN
   ========================================================================= */
[data-dropdown] { position: relative; }
.dropdown-panel {
    display: none;
    position: absolute; top: calc(100% + 10px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    min-width: 220px; z-index: 60; padding: 6px;
}
.dropdown-panel-wide { min-width: 340px; padding: 0; }
[data-dropdown].open .dropdown-panel { display: block; }

.dropdown-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 13.5px;
}
.dropdown-header a { color: var(--primary); font-size: 12px; font-weight: 600; }

.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-muted); font-weight: 500;
}
.dropdown-item i { width: 16px; text-align: center; color: var(--text-faint); }
.dropdown-item:hover { background: var(--surface-soft); color: var(--text); }

.notif-row {
    display: flex; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: var(--surface-soft); }
.notif-icon {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.notif-icon-danger { background: var(--danger-soft); color: var(--danger); }
.notif-icon-success { background: var(--success-soft); color: var(--success); }
.notif-icon-warning { background: var(--warning-soft); color: var(--warning); }
.notif-icon-info { background: var(--info-soft); color: var(--info); }
.notif-title { font-size: 12.5px; font-weight: 700; }
.notif-text { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
