:root {
    /* Renk Paleti - Medikal, Güven Verici ve Modern */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --secondary: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;

    --success: #10b981;
    --success-light: #d1fae5;

    --warning: #f59e0b;
    --warning-light: #fef3c7;

    --danger: #ef4444;
    --danger-light: #fee2e2;

    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    /* Glassmorphism arka planı */

    --border-color: rgba(226, 232, 240, 0.8);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    /* Hafif bir arkaplan gradyan detayı modern his katar */
    background-image:
        radial-gradient(at 0% 0%, hsla(217, 100%, 94%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(217, 100%, 94%, 1) 0, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Glassmorphism Yardımcı Sınıf */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-xl);
}

/* Tipografi */
h1,
h2,
h3,
h4 {
    color: var(--secondary);
    font-weight: 600;
}

p {
    color: var(--text-muted);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Butonlar */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-main);
    border-color: var(--text-muted);
}

/* Form Elemanları */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: white;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-main);
    transition: var(--transition);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Toast Bildirimleri */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    min-width: 300px;
    max-width: 400px;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ═══════════════════════════════════════════
   APP LAYOUT — Header + Collapsible Sidebar
   ═══════════════════════════════════════════ */

:root {
    --header-height: 64px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
}

/* ── Genel Sarmalayıcı ── */
.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-left: var(--sidebar-width);
    transition: padding-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.sidebar-collapsed {
    padding-left: var(--sidebar-collapsed-width);
}

/* ── Header ── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 200;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ── Header Logo ── */
.header-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.header-logo i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.header-logo:hover {
    opacity: 0.85;
}

/* ── Sidebar Toggle Butonu ── */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* ── Kullanıcı Dropdown ── */
.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.user-dropdown-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.user-dropdown-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.user-dropdown-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-arrow {
    font-size: 1rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.user-dropdown.open .user-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown menü */
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

.user-dropdown.open .user-dropdown-menu {
    display: block;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-dropdown-fullname {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
}

.user-dropdown-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.user-dropdown-item--danger {
    color: var(--danger);
}

.user-dropdown-item--danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border-color);
    z-index: 150;
    overflow: hidden;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.app-layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

/* ── Nav Linkleri ── */
.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    font-size: 1.3rem;
    flex-shrink: 0;
    min-width: 1.3rem;
    text-align: center;
}

/* Etiket: açıkken görünür, kapalıyken gizli */
.nav-label {
    opacity: 1;
    transition: opacity 0.18s ease;
}

.app-layout.sidebar-collapsed .nav-label {
    opacity: 0;
    pointer-events: none;
}

/* Kapalıyken nav-item'ı ortalı göster */
.app-layout.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
}

/* ── Ana İçerik Alanı ── */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    min-width: 0;
}

/* ── Mobil Overlay (Sidebar arkası karartma) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 140;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    /* Kapalıyken tıklamaları engelleme! */
    transition: opacity 0.28s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    /* Açıkken tıklamaları yakala */
}

/* ════════════════════════════════════════
   MOBİL RESPONSIVE  (≤ 768px)
   ════════════════════════════════════════ */
@media (max-width: 768px) {

    /* İçerik alanı sidebar padding'i taşımaz */
    .app-layout,
    .app-layout.sidebar-collapsed {
        padding-left: 0;
    }

    /* İçerik daha az boşluk */
    .main-content {
        padding: 1.25rem 1rem;
    }

    /* Sidebar: varsayılanda gizli, sola gömülü */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        width: var(--sidebar-width) !important;
        /* Collapsed override'ı iptal */
        box-shadow: var(--shadow-lg);
        z-index: 160;
    }

    /* Açık sidebar: slayt içeri */
    .app-layout.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    /* Nav label'lar mobilde her zaman görünür */
    .app-layout .nav-label {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Nav item'lar soldan hizalı */
    .app-layout .nav-item {
        justify-content: flex-start !important;
        padding: 0.875rem 1.25rem !important;
    }

    /* Overlay mobilde aktif */
    .sidebar-overlay {
        display: block;
    }

    /* Header logo metni kısalt */
    .logo-text {
        display: none;
    }

    /* Header sağ: kullanıcı rolü gizle */
    .user-role {
        display: none;
    }

    /* Logout metni kısalt */
    .logout-text {
        display: none;
    }
}

/* Header/Sayfa Başlığı */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    letter-spacing: -0.025em;
}

/* Utility Classes */
.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.text-center {
    text-align: center;
}

/* Ekran Ortası Auth Kartı */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}