/* ============================================================
   SdnNET CORPORATE DESIGN SYSTEM
   Turuncu + Lacivert tema — tüm projelerde paylaşılır
   ============================================================ */

:root {
    /* --- Brand Colors --- */
    --brand-orange: #F97316;
    --brand-orange-dark: #EA580C;
    --brand-orange-soft: #FFF7ED;
    --brand-navy: #0B3C6E;
    --brand-blue: #0F6FDE;
    --brand-blue-soft: #EFF6FF;
    --brand-sky: #0EA5E9;

    /* --- Semantic Colors --- */
    --success: #047857;
    --success-soft: #ECFDF5;
    --warning: #B45309;
    --warning-soft: #FEF3C7;
    --error: #B91C1C;
    --error-soft: #FEF2F2;
    --info: #0F6FDE;
    --info-soft: #EFF6FF;

    /* --- Neutral --- */
    --bg-light: #FFFFFF;
    --bg-gray: #F4F6FA;
    --bg-dark: #0B3C6E;
    --surface: #FFFFFF;
    --surface-hover: #F8FAFC;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-on-brand: #FFFFFF;

    /* --- Typography --- */
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* --- Spacing & Sizing --- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 3px rgba(11, 60, 110, 0.08);
    --shadow-md: 0 4px 12px rgba(11, 60, 110, 0.10);
    --shadow-lg: 0 12px 28px rgba(11, 60, 110, 0.12);
    --shadow-xl: 0 20px 48px rgba(11, 60, 110, 0.15);

    --shadow-brand: 0 8px 24px rgba(234, 88, 12, 0.35);
    --shadow-brand-hover: 0 12px 32px rgba(234, 88, 12, 0.45);

    /* --- Transitions --- */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;

    /* --- Z-index --- */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
    --z-toast: 2000;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-body);
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

@supports (overflow: clip) { html, body { overflow-x: clip; } }

a { color: var(--brand-blue); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-navy); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--brand-navy);
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

p { color: var(--text-secondary); font-size: 1rem; line-height: 1.7; }

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-base);
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* Primary - Turuncu */
.btn-primary {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    color: var(--text-on-brand);
    box-shadow: var(--shadow-brand);
}
.btn-primary:hover:not(:disabled) {
    background: #C2410C;
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand-hover);
}
.btn-primary:active { transform: translateY(0); }

/* Secondary - Beyaz + Lacivert çerçeve */
.btn-secondary {
    background: var(--surface);
    color: var(--brand-navy);
    border: 2px solid var(--brand-blue);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: var(--text-on-brand);
}

/* Outline - Açık mavi */
.btn-outline {
    background: transparent;
    color: var(--brand-blue);
    border: 2px solid var(--brand-blue);
}
.btn-outline:hover { background: var(--brand-blue-soft); }

/* Ghost - Metin butonu */
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; padding: 8px 12px; }
.btn-ghost:hover { color: var(--brand-orange); background: var(--brand-orange-soft); }

/* Danger */
.btn-danger { background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); color: white; }
.btn-danger:hover { background: #B91C1C; }

/* Sizes */
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

/* Full width */
.btn-block { width: 100%; }

/* ============================================================
   INPUTS & FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--brand-navy);
    margin-bottom: 6px;
}

.form-label .required::after { content: ' *'; color: var(--error); }

.input-wrapper { position: relative; }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}
.form-input::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px var(--brand-blue-soft);
    background: var(--surface);
}

.form-input:disabled { background: var(--bg-gray); color: var(--text-muted); cursor: not-allowed; }

.form-textarea { min-height: 100px; resize: vertical; }

.form-help { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--text-muted); }
.form-error { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--error); }

/* Checkbox / Radio */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-orange);
    flex-shrink: 0;
}
.form-check-label { font-size: 0.88rem; color: var(--text-secondary); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}
.card:hover {
    border-color: var(--brand-orange);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-gray);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-gray); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.card-title { font-family: var(--font-heading); color: var(--brand-navy); font-size: 1.1rem; font-weight: 700; }

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}
.badge-primary { background: var(--brand-orange-soft); color: var(--brand-orange-dark); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--bg-gray); color: var(--text-secondary); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 0.9rem;
}
.alert-success { background: var(--success-soft); border-color: #A7F3D0; color: var(--success); }
.alert-error { background: var(--error-soft); border-color: #FCA5A5; color: var(--error); }
.alert-warning { background: var(--warning-soft); border-color: #FDE68A; color: var(--warning); }
.alert-info { background: var(--info-soft); border-color: #BFDBFE; color: var(--info); }
.alert-icon { flex-shrink: 0; margin-top: 2px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { background: var(--brand-navy); color: var(--text-on-brand); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.75rem; padding: 12px 15px; text-align: left; }
.table td { padding: 12px 15px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.table tbody tr:nth-child(even) { background: var(--bg-gray); }
.table tbody tr:hover { background: var(--brand-blue-soft); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.tab-btn:hover { color: var(--brand-navy); }
.tab-btn.active { color: var(--brand-orange); border-bottom-color: var(--brand-orange); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 60, 110, 0.45);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-base);
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-heading); color: var(--brand-navy); font-size: 1.15rem; font-weight: 700; }
.modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--brand-navy); }
.modal-body { padding: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* ============================================================
   DROPDOWN / SELECT
   ============================================================ */
.select-wrapper { position: relative; }
.select-wrapper::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-muted);
    pointer-events: none;
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
.tooltip-trigger { position: relative; cursor: help; }
.tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-navy);
    color: var(--text-on-brand);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-lg);
}
.tooltip-trigger::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--brand-navy);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}
.tooltip-trigger:hover::after,
.tooltip-trigger:hover::before { opacity: 1; visibility: visible; }

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--brand-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-fade-in { animation: fadeIn var(--transition-base) ease forwards; }
.animate-slide-up { animation: slideUp var(--transition-slow) ease forwards; }
.animate-slide-down { animation: slideDown var(--transition-slow) ease forwards; }

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .no-print { display: none !important; }
    .btn { display: none !important; }
    body { background: white !important; color: black !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    :root { --radius-lg: 12px; --radius-xl: 16px; }
    .btn { padding: 12px 20px; font-size: 0.9rem; }
    .btn-lg { padding: 14px 28px; font-size: 1rem; }
    .card { border-radius: var(--radius-md); }
    .modal { margin: 16px; max-height: calc(100vh - 32px); }
    .table-wrapper { margin: 0 -16px; width: calc(100% + 32px); border-radius: 0; }
}