/* ==========================================================================
   Newave — Tasarım Sistemi
   Tek dosya, derleme adımı gerektirmez.
   ========================================================================== */

/* --- 1. Belirteçler (design tokens) -------------------------------------- */
:root {
    /* Yüzeyler — koyu, derinlikli finans teması */
    --bg:          #07090e;
    --bg-soft:     #0b0e15;
    --surface:     #11151f;
    --surface-2:   #171c28;
    --surface-3:   #1f2634;
    --border:      #1e2534;
    --border-soft: #171d29;
    --border-strong: #2b3446;

    /* Metin */
    --text:       #eef2f8;
    --text-muted: #99a5bb;
    --text-dim:   #66738c;

    /* Marka */
    --primary:       #16c47f;
    --primary-hover: #12ab6c;
    --primary-ink:   #03150c;
    --primary-soft:  rgba(22, 196, 127, .12);
    --primary-glow:  rgba(22, 196, 127, .28);
    --secondary:     #38bdf8;
    --accent:        #fbbf24;

    /* Durum */
    --success: #16c47f;
    --warning: #f59e0b;
    --danger:  #f2545b;
    --info:    #38bdf8;

    /* Ölçü */
    --radius-sm: 10px;
    --radius:    14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 8px 24px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 28px 70px -24px rgba(0,0,0,.8);
    --shadow-glow: 0 0 0 1px var(--primary), 0 12px 40px -12px var(--primary-glow);

    --container: 1180px;
    --header-h: 74px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --ease: cubic-bezier(.22,.61,.36,1);
    --dur: .22s;
}

/* Aydınlık tema */
[data-theme="light"] {
    --bg:          #f7f9fc;
    --bg-soft:     #eef2f8;
    --surface:     #ffffff;
    --surface-2:   #f5f8fb;
    --surface-3:   #e9eff6;
    --border:      #e3e9f1;
    --border-soft: #eef2f7;
    --border-strong: #cbd5e2;
    --text:       #0d1526;
    --text-muted: #4d5f7a;
    --text-dim:   #7787a0;
    --primary-ink: #ffffff;
    --primary-soft: rgba(22, 196, 127, .10);
    --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
    --shadow:    0 8px 24px -10px rgba(16,24,40,.14);
    --shadow-lg: 0 28px 70px -28px rgba(16,24,40,.22);
}

/* --- 2. Sıfırlama -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.025em;
    text-wrap: balance;
}
h1 { font-size: clamp(2.15rem, 1.4rem + 3.1vw, 3.9rem); letter-spacing: -.038em; }
h2 { font-size: clamp(1.65rem, 1.2rem + 1.9vw, 2.6rem); letter-spacing: -.03em; }
h3 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); }
h4 { font-size: 1.075rem; }

p { margin: 0 0 1rem; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--primary-hover); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

code, pre, .mono { font-family: var(--font-mono); font-size: .92em; font-variant-numeric: tabular-nums; }
code { background: var(--surface-2); padding: .15em .42em; border-radius: 5px; border: 1px solid var(--border); }

::selection { background: var(--primary-soft); color: var(--text); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* İnce kaydırma çubuğu */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* --- 3. Yerleşim --------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(18px, 4vw, 28px); }
.container-narrow { max-width: 760px; }
.container-wide { max-width: 1400px; }

.section { padding: clamp(52px, 8vw, 108px) 0; }
.section-sm { padding: clamp(32px, 5vw, 60px) 0; }

.row { display: flex; flex-wrap: wrap; gap: var(--row-gap, 1rem); }
.row-between { justify-content: space-between; }
.row-center { justify-content: center; }
.row-middle { align-items: center; }
.row-end { justify-content: flex-end; }
.col { flex: 1 1 0; min-width: 0; }

.grid { display: grid; gap: var(--grid-gap, 24px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }

@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px)  { .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Yan panelli düzen */
.split { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* --- 4. Tipografi yardımcıları ------------------------------------------- */
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-xs { font-size: .78rem; }
.text-sm { font-size: .885rem; }
.text-lg { font-size: 1.1rem; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lead { font-size: clamp(1.05rem, .98rem + .4vw, 1.235rem); line-height: 1.6; color: var(--text-muted); }

.eyebrow {
    display: inline-flex; align-items: center; gap: .55rem;
    font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--primary); margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--primary)); }
.text-center .eyebrow::after { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, var(--primary), transparent); }

.text-gradient {
    background: linear-gradient(135deg, var(--text) 25%, var(--primary) 125%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}.mt-5{margin-top:3rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.mb-4{margin-bottom:2rem}.mb-5{margin-bottom:3rem}

.section-head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head.text-center { margin-inline: auto; }
.section-head h2 { margin-bottom: .65rem; }

/* --- 5. Butonlar --------------------------------------------------------- */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .72rem 1.35rem;
    font-family: inherit; font-size: .935rem; font-weight: 600; line-height: 1.2;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
                color var(--dur) var(--ease), transform .08s var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn-primary {
    background: linear-gradient(180deg, var(--primary), var(--primary-hover));
    color: var(--primary-ink);
    box-shadow: 0 1px 0 rgba(255,255,255,.16) inset, 0 8px 22px -10px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(180deg, #19d489, var(--primary)); color: var(--primary-ink);
    box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 12px 30px -10px var(--primary-glow);
}

.btn-secondary { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-dim); color: var(--text); }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e03b43; color: #fff; }

.btn-sm { padding: .46rem .85rem; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: .92rem 1.85rem; font-size: 1.02rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 38px; height: 38px; }

/* --- 6. Kartlar ---------------------------------------------------------- */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.15rem, 2.2vw, 1.65rem);
}
.card-hover { transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }

.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin: calc(-1 * clamp(1.15rem, 2.2vw, 1.65rem)) calc(-1 * clamp(1.15rem, 2.2vw, 1.65rem)) 1.25rem;
    padding: 1.05rem clamp(1.15rem, 2.2vw, 1.65rem);
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; font-size: 1.02rem; }
.card-footer {
    margin: 1.25rem calc(-1 * clamp(1.15rem, 2.2vw, 1.65rem)) calc(-1 * clamp(1.15rem, 2.2vw, 1.65rem));
    padding: 1.05rem clamp(1.15rem, 2.2vw, 1.65rem);
    border-top: 1px solid var(--border);
}
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { margin: 0; }

.card-featured { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.card-featured::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* --- 7. Formlar ---------------------------------------------------------- */
.field { margin-bottom: 1.2rem; }
.label { display: block; margin-bottom: .45rem; font-size: .875rem; font-weight: 600; color: var(--text); }
.label .req { color: var(--danger); margin-left: .15rem; }
.hint { margin-top: .4rem; font-size: .8rem; color: var(--text-dim); line-height: 1.5; }

.input, .select, .textarea {
    display: block; width: 100%;
    padding: .72rem .9rem;
    font-family: inherit; font-size: .95rem; line-height: 1.5;
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
    -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-dim); }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--primary); background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.input:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(242,84,91,.14); }
.textarea { min-height: 128px; resize: vertical; }

.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2399a5bb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .75rem center;
    padding-right: 2.35rem; cursor: pointer;
}
.error { margin-top: .4rem; font-size: .82rem; color: var(--danger); }

.check { display: flex; align-items: flex-start; gap: .65rem; cursor: pointer; font-size: .9rem; line-height: 1.5; }
.check input[type="checkbox"], .check input[type="radio"] {
    width: 18px; height: 18px; margin: .18rem 0 0; accent-color: var(--primary); flex: 0 0 auto; cursor: pointer;
}
.check.card { transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.check.card:hover { border-color: var(--border-strong); }

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }

/* --- 8. Rozet, uyarı ----------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: .32rem;
    padding: .24rem .62rem; font-size: .755rem; font-weight: 600;
    border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text-muted);
    white-space: nowrap; border: 1px solid transparent;
}
.badge-success { background: rgba(22,196,127,.13); color: #4ade9b; border-color: rgba(22,196,127,.22); }
.badge-warning { background: rgba(245,158,11,.13); color: #fbbf24; border-color: rgba(245,158,11,.22); }
.badge-danger  { background: rgba(242,84,91,.13);  color: #fb8f95; border-color: rgba(242,84,91,.22); }
.badge-info    { background: rgba(56,189,248,.13); color: #7dd3fc; border-color: rgba(56,189,248,.22); }
.badge-primary { background: var(--primary-soft);  color: var(--primary); border-color: rgba(22,196,127,.25); }

.alert {
    padding: 1rem 1.15rem; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface-2);
    display: flex; gap: .85rem; align-items: flex-start;
    font-size: .92rem; line-height: 1.6;
}
.alert-success { border-color: rgba(22,196,127,.3);  background: rgba(22,196,127,.07); }
.alert-warning { border-color: rgba(245,158,11,.3);  background: rgba(245,158,11,.07); }
.alert-danger  { border-color: rgba(242,84,91,.3);   background: rgba(242,84,91,.07); }
.alert-info    { border-color: rgba(56,189,248,.3);  background: rgba(56,189,248,.07); }

/* --- 9. Tablolar --------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    text-align: left; padding: .78rem .9rem;
    font-size: .715rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap;
    background: var(--surface-2);
}
.table td { padding: .85rem .9rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table-actions { display: flex; gap: .35rem; justify-content: flex-end; }

.empty { padding: 3.5rem 1.5rem; text-align: center; color: var(--text-dim); }

/* --- 10. Sayfalama ------------------------------------------------------- */
.pagination { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 .65rem;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    color: var(--text-muted); font-size: .885rem; font-weight: 600;
    transition: all var(--dur) var(--ease);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pagination .disabled { opacity: .35; pointer-events: none; }

/* --- 11. Bileşenler ------------------------------------------------------ */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-soft), transparent);
    border: 1px solid rgba(22,196,127,.24);
    color: var(--primary); font-weight: 700; font-size: .85rem; flex: 0 0 auto;
}

.divider { height: 1px; background: var(--border); margin: 1.75rem 0; }

.icon-box {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: var(--radius);
    background: linear-gradient(140deg, var(--primary-soft), transparent 70%);
    border: 1px solid rgba(22,196,127,.2);
    color: var(--primary);
}

.stat-value { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .865rem; color: var(--text-muted); }

.lock-note {
    display: flex; align-items: center; gap: .55rem;
    padding: .6rem .85rem; border-radius: var(--radius-sm);
    background: rgba(245,158,11,.09); border: 1px solid rgba(245,158,11,.2);
    color: #fbbf24; font-size: .855rem; font-weight: 600;
}

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: no-preference) {
    .reveal   { animation: reveal .55s var(--ease) both; }
    .reveal-2 { animation: reveal .55s .07s var(--ease) both; }
    .reveal-3 { animation: reveal .55s .14s var(--ease) both; }
    @keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* --- 12. Erişilebilirlik ------------------------------------------------- */
.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;
}
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--primary); color: var(--primary-ink); padding: .8rem 1.3rem; font-weight: 700;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

@media (pointer: coarse) {
    .btn, .pagination a, .side-link, .main-nav a { min-height: 44px; }
    .btn-sm { min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important; scroll-behavior: auto !important;
    }
}

/* --- 13. Yazdırma -------------------------------------------------------- */
@media print {
    .site-header, .site-footer, .admin-sidebar, .panel-sidebar, .cookie-bar, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ddd; box-shadow: none; }
}
