/* =============================================================
   NurseFlow — Ana Stil Dosyası
   Renk Paleti: Lacivert + Turkuaz/Cyan + Sıcak Uyarı Renkleri
   Yaklaşım: Mobile-first, refined-medical aesthetic
   ============================================================= */

/* ---------- CSS Değişkenleri ---------- */
:root {
    /* Ana Renkler - Lacivert ailesi */
    --nf-navy-950: #061224;
    --nf-navy-900: #0a1f3a;
    --nf-navy-800: #0e2a50;
    --nf-navy-700: #13386b;
    --nf-navy-600: #1a4787;
    --nf-navy-500: #2563a8;
    
    /* Vurgu - Turkuaz/Cyan ailesi */
    --nf-cyan-700: #0e7490;
    --nf-cyan-600: #0891b2;
    --nf-cyan-500: #06b6d4;
    --nf-cyan-400: #22d3ee;
    --nf-cyan-300: #67e8f9;
    --nf-cyan-50: #ecfeff;
    
    /* Durum Renkleri */
    --nf-success: #059669;
    --nf-success-light: #d1fae5;
    --nf-success-bg: #ecfdf5;
    
    --nf-danger: #dc2626;
    --nf-danger-light: #fee2e2;
    --nf-danger-bg: #fef2f2;
    
    --nf-warning: #d97706;
    --nf-warning-light: #fed7aa;
    --nf-warning-bg: #fffbeb;
    
    --nf-info: #2563eb;
    --nf-info-light: #dbeafe;
    --nf-info-bg: #eff6ff;
    
    /* Nötr Renkler */
    --nf-bg: #f1f5f9;
    --nf-surface: #ffffff;
    --nf-surface-2: #f8fafc;
    --nf-border: #e2e8f0;
    --nf-border-strong: #cbd5e1;
    
    --nf-text: #0f172a;
    --nf-text-2: #334155;
    --nf-text-muted: #64748b;
    --nf-text-light: #94a3b8;
    
    /* Tipografi */
    --nf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --nf-font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    
    /* Spacing */
    --nf-radius-sm: 6px;
    --nf-radius: 10px;
    --nf-radius-lg: 14px;
    --nf-radius-xl: 20px;
    
    /* Gölgeler */
    --nf-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --nf-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --nf-shadow-md: 0 4px 8px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --nf-shadow-lg: 0 12px 24px -8px rgba(15, 23, 42, 0.12), 0 6px 12px -6px rgba(15, 23, 42, 0.06);
    --nf-shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.18);
    
    /* Transitions */
    --nf-transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout - sidebar genişliği */
    --nf-sidebar-w: 260px;
    --nf-header-h: 64px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--nf-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--nf-text);
    background: var(--nf-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }
a { color: var(--nf-cyan-600); text-decoration: none; transition: var(--nf-transition); }
a:hover { color: var(--nf-cyan-700); }

/* ---------- Tipografi ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.01em; color: var(--nf-text); }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.35; }
h4 { font-size: 16px; line-height: 1.4; }

/* ---------- Butonlar ---------- */
.nf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--nf-radius);
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    transition: var(--nf-transition);
    user-select: none;
    white-space: nowrap;
}

.nf-btn:active { transform: translateY(1px); }

.nf-btn-primary {
    background: linear-gradient(135deg, var(--nf-navy-700), var(--nf-navy-600));
    color: white;
    box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, var(--nf-shadow);
}
.nf-btn-primary:hover {
    background: linear-gradient(135deg, var(--nf-navy-800), var(--nf-navy-700));
    box-shadow: var(--nf-shadow-md);
    color: white;
}

.nf-btn-accent {
    background: var(--nf-cyan-600);
    color: white;
}
.nf-btn-accent:hover { background: var(--nf-cyan-700); color: white; }

.nf-btn-ghost {
    background: transparent;
    color: var(--nf-text-2);
    border: 1px solid var(--nf-border-strong);
}
.nf-btn-ghost:hover { background: var(--nf-surface-2); color: var(--nf-text); }

.nf-btn-danger {
    background: var(--nf-danger);
    color: white;
}
.nf-btn-danger:hover { background: #b91c1c; color: white; }

.nf-btn-block { width: 100%; }
.nf-btn-sm { padding: 8px 12px; font-size: 13px; }
.nf-btn-lg { padding: 14px 22px; font-size: 15px; }

/* ---------- Form Elemanları ---------- */
.nf-form-group { margin-bottom: 16px; }

.nf-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--nf-text-2);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.nf-input,
.nf-textarea,
.nf-select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--nf-border);
    border-radius: var(--nf-radius);
    background: var(--nf-surface);
    color: var(--nf-text);
    transition: var(--nf-transition);
    font-size: 15px;
}

.nf-input:focus,
.nf-textarea:focus,
.nf-select:focus {
    outline: none;
    border-color: var(--nf-cyan-500);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.nf-input::placeholder { color: var(--nf-text-light); }
.nf-input[disabled], .nf-textarea[disabled] {
    background: var(--nf-surface-2);
    color: var(--nf-text-muted);
    cursor: not-allowed;
}

.nf-input-with-icon { position: relative; }
.nf-input-with-icon .nf-input { padding-left: 42px; }
.nf-input-with-icon .nf-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nf-text-muted);
    pointer-events: none;
}

/* ---------- Alert / Flash mesajları ---------- */
.nf-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--nf-radius);
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.nf-alert-success {
    background: var(--nf-success-bg);
    border-color: var(--nf-success);
    color: #065f46;
}
.nf-alert-error,
.nf-alert-danger {
    background: var(--nf-danger-bg);
    border-color: var(--nf-danger);
    color: #991b1b;
}
.nf-alert-warning {
    background: var(--nf-warning-bg);
    border-color: var(--nf-warning);
    color: #92400e;
}
.nf-alert-info {
    background: var(--nf-info-bg);
    border-color: var(--nf-info);
    color: #1e40af;
}

.nf-alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ---------- Kart (Card) ---------- */
.nf-card {
    background: var(--nf-surface);
    border-radius: var(--nf-radius-lg);
    box-shadow: var(--nf-shadow);
    border: 1px solid var(--nf-border);
    overflow: hidden;
}

.nf-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--nf-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nf-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--nf-text);
    margin: 0;
}

.nf-card-body { padding: 20px; }
.nf-card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--nf-border);
    background: var(--nf-surface-2);
}

/* ---------- Logo ---------- */
.nf-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--nf-navy-900);
    text-decoration: none;
}

.nf-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--nf-navy-800), var(--nf-cyan-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px -2px rgba(8, 145, 178, 0.4);
}

.nf-logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--nf-navy-900);
}

.nf-logo-text span {
    font-weight: 400;
    color: var(--nf-cyan-600);
}

/* ---------- Toast (Sayfa içi bildirim - sağ üst) ---------- */
.nf-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100% - 32px);
    width: 360px;
    pointer-events: none;
}

.nf-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--nf-surface);
    border-radius: var(--nf-radius);
    box-shadow: var(--nf-shadow-lg);
    border-left: 4px solid var(--nf-cyan-500);
    pointer-events: auto;
    animation: nfToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 14px;
    line-height: 1.4;
}

.nf-toast.nf-toast-success { border-left-color: var(--nf-success); }
.nf-toast.nf-toast-error { border-left-color: var(--nf-danger); }
.nf-toast.nf-toast-warning { border-left-color: var(--nf-warning); }
.nf-toast.nf-toast-info { border-left-color: var(--nf-info); }

.nf-toast.removing {
    animation: nfToastOut 0.25s ease-out forwards;
}

@keyframes nfToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes nfToastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

.nf-toast-body { flex: 1; min-width: 0; }
.nf-toast-title { font-weight: 600; color: var(--nf-text); margin-bottom: 2px; }
.nf-toast-message { color: var(--nf-text-2); }
.nf-toast-close {
    color: var(--nf-text-muted);
    padding: 2px;
    border-radius: 4px;
}
.nf-toast-close:hover { color: var(--nf-text); background: var(--nf-bg); }

/* ---------- Yardımcı sınıflar ---------- */
.nf-text-center { text-align: center; }
.nf-text-muted { color: var(--nf-text-muted); }
.nf-mt-2 { margin-top: 8px; }
.nf-mt-3 { margin-top: 12px; }
.nf-mt-4 { margin-top: 16px; }
.nf-mb-2 { margin-bottom: 8px; }
.nf-mb-3 { margin-bottom: 12px; }
.nf-mb-4 { margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    body { font-size: 14px; }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    
    .nf-card-body { padding: 16px; }
    .nf-card-header { padding: 14px 16px; }
}

/* =============================================================
   PAYLAŞILAN MODAL VE FORM STILLERI
   (Önceden patients.css'teydi; tüm sayfalarda kullanılır)
   ============================================================= */

/* ---------- Modal ---------- */
.nf-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    overscroll-behavior: contain;
}

.nf-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 640px) {
    .nf-modal-backdrop {
        align-items: center;
        padding: 24px;
    }
}

.nf-modal {
    background: var(--nf-surface);
    border-radius: var(--nf-radius-xl) var(--nf-radius-xl) 0 0;
    width: 100%;
    max-width: 560px;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

@media (min-width: 640px) {
    .nf-modal {
        height: auto;
        max-height: calc(100vh - 48px);
        border-radius: var(--nf-radius-xl);
        box-shadow: var(--nf-shadow-xl);
    }
}

.nf-modal.lg { max-width: 720px; }

.nf-modal-backdrop.show .nf-modal {
    transform: translateY(0);
}

.nf-modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--nf-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.nf-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--nf-text);
}

.nf-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--nf-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.nf-modal-close:hover { background: var(--nf-surface-2); color: var(--nf-text); }

.nf-modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.nf-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.nf-modal-footer {
    padding: 14px 22px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--nf-border);
    background: var(--nf-surface);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04);
}

/* ---------- Form Grid (2 sütun) ---------- */
.nf-form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .nf-form-grid.cols-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Checkbox grid ---------- */
.nf-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 480px) {
    .nf-checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.nf-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1.5px solid var(--nf-border);
    border-radius: var(--nf-radius);
    cursor: pointer;
    transition: var(--nf-transition);
    user-select: none;
    background: var(--nf-surface);
}

.nf-checkbox-item:hover {
    background: var(--nf-surface-2);
}

.nf-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--nf-cyan-600);
    cursor: pointer;
}

.nf-checkbox-item span {
    font-size: 13px;
    font-weight: 500;
    color: var(--nf-text-2);
}

.nf-checkbox-item:has(input:checked) {
    border-color: var(--nf-cyan-500);
    background: var(--nf-cyan-50);
}

.nf-checkbox-item:has(input:checked) span {
    color: var(--nf-cyan-700);
    font-weight: 600;
}

/* ---------- Form errors ---------- */
.nf-error-msg {
    color: var(--nf-danger);
    font-size: 12px;
    margin-top: 4px;
}

.nf-input.is-invalid,
.nf-textarea.is-invalid,
.nf-select.is-invalid {
    border-color: var(--nf-danger);
}

/* ---------- Boş durum kutusu ---------- */
.nf-empty-state {
    padding: 36px 20px;
    text-align: center;
    color: var(--nf-text-muted);
}

.nf-empty-state svg {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    opacity: 0.4;
}

/* ---------- Sayfa başlığı (her sayfada kullanılır) ---------- */
.nf-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nf-page-header h1 {
    font-size: 24px;
    margin-bottom: 4px;
    color: var(--nf-text);
}

.nf-page-subtitle {
    color: var(--nf-text-muted);
    font-size: 14px;
}

.nf-page-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
