/* ============================================================
   Klinik Yönetim Sistemi — Ana CSS
   Referans: Ekran görüntüsündeki mor/mor sidebar tasarımı
============================================================ */

:root {
    --sidebar-width:    240px;
    --topbar-height:    54px;
    --color-primary:    #6c5ce7;
    --color-primary-d:  #5a4bd1;
    --color-sidebar-bg: #2d2d6b;
    --color-sidebar-dk: #1e1e4f;
    --color-text:       #2d3748;
    --color-muted:      #718096;
    --color-border:     #e2e8f0;
    --color-bg:         #f7f8fc;
    --color-white:      #ffffff;
    --color-success:    #00b894;
    --color-warning:    #fdcb6e;
    --color-danger:     #e17055;
    --color-info:       #0984e3;
    --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
    --shadow-md:        0 4px 12px rgba(0,0,0,.10);
    --radius-sm:        6px;
    --radius-md:        10px;
    --radius-lg:        14px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    margin: 0;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: linear-gradient(135deg, var(--color-sidebar-dk) 0%, var(--color-primary) 100%);
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.user-avatar-sm {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge {
    position: absolute;
    top: 0; right: 0;
    width: 16px; height: 16px;
    background: var(--color-danger);
    border-radius: 50%;
    font-size: 9px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-dropdown { min-width: 300px; max-height: 360px; overflow-y: auto; }
.notif-item { white-space: normal !important; padding: .5rem 1rem; }

/* ── Wrapper / Sidebar / Main ─────────────────────────────── */
.wrapper {
    display: flex;
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .25s ease, transform .25s ease;
    z-index: 1030;
}

.sidebar::-webkit-scrollbar        { width: 4px; }
.sidebar::-webkit-scrollbar-track  { background: transparent; }
.sidebar::-webkit-scrollbar-thumb  { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-nav { padding: .75rem 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .55rem 1.25rem;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 13.5px;
    transition: background .15s, color .15s, padding-left .15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link i { font-size: 16px; flex-shrink: 0; }

.sidebar-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    padding-left: 1.5rem;
}

.sidebar-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-left-color: #a29bfe;
    font-weight: 500;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    transition: margin-left .25s ease;
}

/* Sidebar collapsed */
body.sidebar-collapsed .sidebar { width: 0; transform: translateX(-100%); }
body.sidebar-collapsed .main-content { margin-left: 0; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    padding: 1.5rem 1.75rem 1rem;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 .2rem;
}

.page-header .breadcrumb { font-size: 12px; margin: 0; }
.page-header .subtitle   { color: var(--color-muted); font-size: 13px; margin: 0; }

/* ── Content padding ─────────────────────────────────────── */
.page-body { padding: 0 1.75rem 2rem; }

/* ── Stat kartları ────────────────────────────────────────── */
.stat-card {
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-label  { font-size: 12px; opacity: .85; margin-bottom: .25rem; }
.stat-card .stat-value  { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-icon   {
    position: absolute; right: 1rem; top: 50%;
    transform: translateY(-50%);
    font-size: 2.4rem; opacity: .2;
}

.stat-purple  { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.stat-teal    { background: linear-gradient(135deg, #00b894, #00cec9); }
.stat-blue    { background: linear-gradient(135deg, #0984e3, #74b9ff); }
.stat-orange  { background: linear-gradient(135deg, #e17055, #fab1a0); }

/* ── Card ─────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    padding: .85rem 1.25rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

/* ── Tablo ────────────────────────────────────────────────── */
.table thead th {
    background: #f8f9fc;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.table td { vertical-align: middle; font-size: 13.5px; }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ── Formlar ─────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: 13px; margin-bottom: .35rem; }

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--color-border);
    font-size: 13.5px;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,.15);
}

.form-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── Butonlar ─────────────────────────────────────────────── */
.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-d); border-color: var(--color-primary-d); }

.btn-icon {
    width: 30px; height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* ── Hasta dosya görünümü tabları ─────────────────────────── */
.patient-tab-nav .nav-link {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: .6rem 1rem;
}
.patient-tab-nav .nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: transparent;
}

/* ── Hasta avatar ─────────────────────────────────────────── */
.patient-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
}

.patient-avatar-placeholder {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #a29bfe);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Badge override ───────────────────────────────────────── */
.badge { font-weight: 500; font-size: 11px; }

/* ── Borç özeti (hasta dosyası) ───────────────────────────── */
.balance-bar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}
.balance-bar .balance-item {
    padding: .35rem .85rem;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Randevu takvimi ──────────────────────────────────────── */
#calendar { font-size: 13px; }
.fc-event  { cursor: pointer; font-size: 12px; }
.fc-toolbar-title { font-size: 1rem !important; font-weight: 600; }

/* ── Hatırlatmalar ────────────────────────────────────────── */
.reminder-stat-card {
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

/* ── Login sayfası ────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-sidebar-dk) 0%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--color-white);
    padding: 2.5rem 2rem;
}

.login-logo { font-size: 2rem; margin-bottom: .5rem; }

/* ── DataTables override ─────────────────────────────────── */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    padding: .25rem .5rem;
    font-size: 13px;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination { margin: 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar            { transform: translateX(-100%); }
    .sidebar.open       { transform: translateX(0); }
    .main-content       { margin-left: 0; }
    .page-header        { padding: 1rem; }
    .page-body          { padding: 0 1rem 2rem; }
}

/* ── Utilities ────────────────────────────────────────────── */
.rounded-4 { border-radius: 1rem !important; }
.rounded-5 { border-radius: 1.5rem !important; }

.ls-1 { letter-spacing: 0.1em !important; }
.ls-2 { letter-spacing: 0.2em !important; }

.text-gray-100 { color: #f8f9fc !important; }
.text-gray-200 { color: #eaecf4 !important; }
.text-gray-300 { color: #dddfeb !important; }
.text-gray-400 { color: #d1d3e2 !important; }
.text-gray-500 { color: #b7b9cc !important; }
.text-gray-600 { color: #858796 !important; }
.text-gray-700 { color: #6e707e !important; }
.text-gray-800 { color: #5a5c69 !important; }
.text-gray-900 { color: #3a3b45 !important; }

.bg-gradient-light { background: linear-gradient(180deg, #f8f9fc 0%, #eaecf4 100%) !important; }
.bg-gradient-primary { background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-d) 100%) !important; }
.bg-gradient-info { background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%) !important; }

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md) !important;
}

.transition-all { transition: all 0.2s ease-in-out; }

.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.user-avatar-md { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.user-avatar-lg { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.user-avatar-xl { width: 100px; height: 100px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }

.bg-indigo { background-color: #6366f1 !important; }
.text-indigo { color: #6366f1 !important; }
.bg-indigo-subtle { background-color: rgba(99, 102, 241, 0.1) !important; }

/* ── Scroll ───────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
