/* ============================================================
   LAYOUT — Navbar, Main Content Area, Page Headers,
            Sidebar, Panel Layout, Mobile Nav, FAB
   ============================================================ */

/* ═══════════════════════════════════════════════════════════════
   NAVBAR — Premium Glassmorphism Design
═══════════════════════════════════════════════════════════════ */
nav {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: saturate(180%) blur(24px) brightness(1.02);
    -webkit-backdrop-filter: saturate(180%) blur(24px) brightness(1.02);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
nav.scrolled {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
[data-theme="dark"] nav {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom-color: color-mix(in srgb, var(--border) 50%, transparent);
}
[data-theme="dark"] nav.scrolled {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    box-shadow: 0 1px 12px rgba(0,0,0,0.2);
}
.nav-inner {
    max-width: 1600px; margin: 0 auto;
    padding: 0 2rem; height: 58px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.25rem;
}

/* ── Brand ── */
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}
.nav-brand:hover { opacity: 0.85; }
.nav-brand:focus-visible {
    outline: 2px solid var(--teal); outline-offset: 4px;
    border-radius: 8px;
}
.nav-logo {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--teal) 0%, color-mix(in srgb, var(--teal) 70%, #fff) 100%);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-radius 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,147,158,0.2);
}
.nav-brand:hover .nav-logo {
    border-radius: 10px; transform: scale(1.08) rotate(-2deg);
}
.nav-logo svg { width: 16px; height: 16px; fill: #fff; }
.nav-title {
    font-size: 0.96rem; font-weight: 650; color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* ── Actions ── */
.nav-actions {
    display: flex; gap: 5px; align-items: center;
    justify-content: flex-end;
}

/* ── MAIN CONTENT AREA ── */
main { max-width: 1600px; margin: 0 auto; padding: 2rem 2.5rem 4.5rem; }

/* ============================================================
   HEADER
============================================================ */
.page-header { margin-bottom: 1.5rem !important; }
.page-header-eyebrow { font-size: 0.82rem; color: var(--text-tertiary); margin-bottom: 0.15rem !important; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.page-header h1 { font-family: 'DM Sans', sans-serif; font-size: 2.4rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.03em; line-height: 1.15 !important; margin: 4px 0; }
.page-header h1 em { font-family: 'DM Sans', sans-serif; font-style: italic; font-weight: 700; }
.page-header-sub { font-size: 0.95rem; color: var(--text-secondary); margin-top: 0.2rem !important; font-weight: 400; line-height: 1.5; }

/* ============================================================
   CONTENT GRID & SIDEBAR
============================================================ */
.content-grid { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; align-items: start; }

.sidebar { display: flex; flex-direction: column; gap: 0.875rem; }

/* ============================================================
   PANEL — MODERN
============================================================ */
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); display:flex; flex-direction: column; position: relative; transition: all 0.25s ease; }
.panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--teal), var(--green), var(--gold)); opacity: 0.5; z-index: 1; }
.panel:hover { box-shadow: var(--shadow-md); }

.panel-top { padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 0.9rem; font-weight: 650; letter-spacing: -0.02em; color: var(--text-primary); display:flex; align-items:center; gap:8px; }
.record-count { font-size: 0.68rem; font-weight: 700; color: var(--teal); background: var(--teal-light); border-radius: 100px; padding: 3px 10px; }
.panel-top .input-field { border-radius: 100px; font-size: 0.78rem; padding: 7px 16px; height: 34px; }

/* ============================================================
   MOBİL BOTTOM NAVIGATION — Premium Design
============================================================ */
.mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: saturate(180%) blur(24px) brightness(1.02);
    -webkit-backdrop-filter: saturate(180%) blur(24px) brightness(1.02);
    border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    display: none;
    box-shadow: 0 -1px 12px rgba(0,0,0,0.04);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
[data-theme="dark"] .mobile-bottom-nav {
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    box-shadow: 0 -1px 12px rgba(0,0,0,0.15);
}

.mobile-bottom-nav-inner {
    display: flex; justify-content: space-around; align-items: center;
    gap: 2px; padding: 0 12px; max-width: 480px; margin: 0 auto;
}

.mobile-nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 6px 12px; border-radius: 12px;
    background: transparent; border: none; cursor: pointer;
    transition: all 0.22s ease; position: relative;
    text-decoration: none; color: var(--text-tertiary);
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item:focus-visible {
    outline: 2px solid var(--teal); outline-offset: 2px;
}
.mobile-nav-item:active { transform: scale(0.92); }

.mobile-nav-item.active {
    color: var(--teal);
}
.mobile-nav-item.active::before {
    content: ''; position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 24px; height: 2.5px; border-radius: 0 0 3px 3px;
    background: var(--teal);
    animation: navIndicatorIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mobile-nav-icon {
    width: 26px; height: 26px; display: flex;
    align-items: center; justify-content: center;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mobile-nav-item.active .mobile-nav-icon { transform: scale(1.15); }
.mobile-nav-icon svg { width: 21px; height: 21px; }

.mobile-nav-label {
    font-size: 0.62rem; font-weight: 600;
    letter-spacing: -0.01em; line-height: 1;
    transition: color 0.2s ease;
}

/* ============================================================
   MOBİL PULL TO REFRESH İNDİKATÖRÜ
============================================================ */
.pull-to-refresh-indicator {
    position: fixed; top: 56px; left: 50%;
    transform: translateX(-50%) translateY(-60px);
    background: var(--bg-card); border-radius: 100px;
    padding: 8px 20px; box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--teal); z-index: 98;
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}
.pull-to-refresh-indicator.visible {
    transform: translateX(-50%) translateY(12px);
}
.pull-to-refresh-indicator svg {
    width: 16px; height: 16px;
    animation: spin 1s linear infinite;
}

/* ============================================================
   BODY DECORATION
============================================================ */
body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background-image: radial-gradient(circle at 20% 50%, var(--teal-glow) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(168, 123, 0, 0.03) 0%, transparent 50%);
    opacity: 0.6;
}
[data-theme="dark"] body::before {
    background-image: radial-gradient(circle at 20% 50%, rgba(46, 203, 214, 0.06) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(212, 160, 23, 0.04) 0%, transparent 50%);
}

/* ============================================================
   MOBILE BOTTOM NAV GLASS (Legacy class support)
============================================================ */
.mobile-nav {
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    background: color-mix(in srgb, var(--bg) 75%, transparent) !important;
    border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent) !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}
[data-theme="dark"] .mobile-nav {
    background: color-mix(in srgb, var(--bg) 82%, transparent) !important;
    border-top-color: color-mix(in srgb, var(--border) 40%, transparent) !important;
}
.mobile-nav-item {
    position: relative; transition: all 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item::after {
    content: ''; position: absolute; top: 3px; left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px; height: 2.5px; border-radius: 3px;
    background: var(--teal);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mobile-nav-item.active::after { transform: translateX(-50%) scaleX(1); }
.mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.12); color: var(--teal) !important;
}
.mobile-nav-item.active .mobile-nav-label {
    color: var(--teal) !important; font-weight: 600;
}
.mobile-nav-icon { transition: transform 0.22s ease; }
.mobile-nav-label { transition: color 0.2s ease; }

/* ============================================================
   DEEPER CARDS / SMOOTH SCROLL
============================================================ */
.page-content { -webkit-overflow-scrolling: touch; }

/* ============================================================
   SIDEBAR BACKDROP
============================================================ */
.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 109;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    display: none;
    animation: backdropFadeIn 0.22s ease;
}
[data-theme="dark"] .sidebar-backdrop {
    background: rgba(0,0,0,0.55);
}
.sidebar-backdrop.open { display: block; }

/* ============================================================
   FLOATING ACTION BUTTON — Mobile
============================================================ */
.mobile-fab {
    position: fixed; bottom: calc(6rem + env(safe-area-inset-bottom));
    right: max(14px, env(safe-area-inset-right));
    z-index: 50; display: none;
}
.mobile-fab-btn {
    width: 50px; height: 50px; border-radius: 14px; border: none;
    background: linear-gradient(135deg, var(--teal) 0%, color-mix(in srgb, var(--teal) 80%, #fff) 100%);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,147,158,0.3), 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}
.mobile-fab-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 24px rgba(0,147,158,0.4), 0 2px 8px rgba(0,0,0,0.08);
}
.mobile-fab-btn:active { transform: scale(0.92); }
.mobile-fab-btn svg { width: 20px; height: 20px; }
.mobile-fab-btn.is-open svg { transform: rotate(45deg); transition: transform 0.22s ease; }
.mobile-fab-menu {
    position: absolute; bottom: 58px; right: 0;
    display: none; flex-direction: column; gap: 7px;
    min-width: 190px;
    animation: fabMenuIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.mobile-fab-menu.is-open { display: flex; }
.mobile-fab-menu-item {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-primary);
    font-family: inherit; font-size: 0.8rem; font-weight: 500;
    cursor: pointer; box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.mobile-fab-menu-item:hover {
    background: var(--hover-bg); border-color: var(--border-strong);
}
.mobile-fab-menu-item:active { transform: scale(0.96); }
.mobile-fab-menu-item svg { width: 17px; height: 17px; color: var(--teal); flex-shrink: 0; }