/* ==========================================================================
   FyBlue tasarım sistemi
   Token'lar :root'ta; koyu tema hem sistem tercihiyle hem manuel seçimle çalışır.
   ========================================================================== */

:root {
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #f0f2f7;
    --surface-3: #e8ebf3;
    --border: #e3e6ee;
    --border-strong: #cfd4e0;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;

    --accent: #4353ff;
    --accent-hover: #3242ec;
    --accent-soft: rgba(67, 83, 255, .10);
    --accent-text: #ffffff;
    --ring: rgba(67, 83, 255, .35);

    --osos: #7c3aed;
    --osos-soft: rgba(124, 58, 237, .10);
    --epias: #0d9488;
    --epias-soft: rgba(13, 148, 136, .11);

    --ok: #15803d;
    --ok-soft: rgba(22, 163, 74, .11);
    --error: #dc2626;
    --error-soft: rgba(220, 38, 38, .09);
    --warn: #b45309;
    --warn-soft: rgba(217, 119, 6, .12);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, .10);

    --sidebar-bg: #ffffff;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px -4px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 40px -12px rgba(15, 23, 42, .25);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-w: 252px;
    --sidebar-w-collapsed: 72px;
    --topbar-h: 60px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0c12;
        --surface: #11141d;
        --surface-2: #171b27;
        --surface-3: #1f2433;
        --border: #232838;
        --border-strong: #323a50;
        --text: #e7eaf3;
        --text-2: #c3c9d8;
        --muted: #8990a6;
        --accent: #6f7dff;
        --accent-hover: #8390ff;
        --accent-soft: rgba(111, 125, 255, .14);
        --ring: rgba(111, 125, 255, .45);
        --osos: #a78bfa;
        --osos-soft: rgba(167, 139, 250, .14);
        --epias: #2dd4bf;
        --epias-soft: rgba(45, 212, 191, .12);
        --ok: #4ade80;
        --ok-soft: rgba(74, 222, 128, .12);
        --error: #f87171;
        --error-soft: rgba(248, 113, 113, .12);
        --warn: #fbbf24;
        --warn-soft: rgba(251, 191, 36, .12);
        --info: #60a5fa;
        --info-soft: rgba(96, 165, 250, .12);
        --sidebar-bg: #0d1018;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px -6px rgba(0, 0, 0, .5);
        --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, .7);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0a0c12;
    --surface: #11141d;
    --surface-2: #171b27;
    --surface-3: #1f2433;
    --border: #232838;
    --border-strong: #323a50;
    --text: #e7eaf3;
    --text-2: #c3c9d8;
    --muted: #8990a6;
    --accent: #6f7dff;
    --accent-hover: #8390ff;
    --accent-soft: rgba(111, 125, 255, .14);
    --ring: rgba(111, 125, 255, .45);
    --osos: #a78bfa;
    --osos-soft: rgba(167, 139, 250, .14);
    --epias: #2dd4bf;
    --epias-soft: rgba(45, 212, 191, .12);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, .12);
    --error: #f87171;
    --error-soft: rgba(248, 113, 113, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, .12);
    --sidebar-bg: #0d1018;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
}

/* ---------- Temel ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

h1, h2, h3 { margin: 0; color: var(--text); letter-spacing: -.015em; }
h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: .82em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: .08em .4em; border-radius: 6px; color: var(--text-2); }
h1:focus { outline: none; }

.icon { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.text-ok { color: var(--ok); }
.text-error { color: var(--error); }
.hint { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: .35rem; margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Açılış ---------- */

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1.25rem; }
.boot-mark { width: 48px; height: 48px; border-radius: 14px; }
.boot-bar { width: 140px; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.boot-progress { display: block; height: 100%; width: var(--blazor-load-percentage, 10%); background: var(--accent); border-radius: 99px; transition: width .2s; }

/* ---------- Kabuk: sidebar + içerik ---------- */

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; transition: grid-template-columns .2s ease; }
.shell.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 0 .75rem .75rem;
    overflow: hidden;
    z-index: 30;
}

.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 .4rem; flex-shrink: 0; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0;
    color: #fff; background: linear-gradient(135deg, #4f6bff 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px -4px rgba(79, 107, 255, .6);
}

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: .15rem; padding-top: .5rem; scrollbar-width: thin; }

.nav-group { display: flex; flex-direction: column; gap: .15rem; margin-top: 1.1rem; }
.nav-group-title {
    display: flex; align-items: center; gap: .5rem;
    padding: 0 .75rem .3rem; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
    white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-osos { background: var(--osos); }
.dot-epias { background: var(--epias); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; }
.status-dot.is-on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status-dot.is-off { background: var(--border-strong); }

.nav-item {
    display: flex; align-items: center; gap: .75rem;
    height: 38px; padding: 0 .75rem; border-radius: 9px;
    color: var(--text-2); font-weight: 500; white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active .icon { color: var(--accent); }
.nav-item .icon { color: var(--muted); }

.sidebar-collapse {
    display: flex; align-items: center; gap: .75rem; height: 36px; padding: 0 .85rem; margin-top: .5rem;
    border: 0; background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer; font: inherit; font-size: .85rem; white-space: nowrap;
}
.sidebar-collapse:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sidebar-close { display: none; }

.shell.is-collapsed .brand-name,
.shell.is-collapsed .nav-item span,
.shell.is-collapsed .nav-group-label,
.shell.is-collapsed .sidebar-collapse span { display: none; }
.shell.is-collapsed .nav-item { justify-content: center; padding: 0; }
.shell.is-collapsed .nav-group-title { justify-content: center; padding: 0 0 .3rem; }
.shell.is-collapsed .status-dot { margin-left: 0; }
.shell.is-collapsed .sidebar-brand { justify-content: center; }
.shell.is-collapsed .sidebar-collapse { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    height: var(--topbar-h); display: flex; align-items: center; gap: .5rem;
    padding: 0 1.5rem;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar-spacer { flex: 1; }
.icon-btn.menu-btn { display: none; }

.user-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .7rem .25rem .25rem; border-radius: 99px; color: var(--text); font-weight: 500; border: 1px solid var(--border); background: var(--surface); }
.user-chip:hover { text-decoration: none; border-color: var(--border-strong); }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
    font-size: .8rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #4f6bff, #7c3aed);
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }

.content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }

.scrim { display: none; }

@media (max-width: 960px) {
    .shell, .shell.is-collapsed { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar-w), 86vw);
        transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
    }
    .shell.drawer-open .sidebar { transform: none; }
    .shell.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 10, 18, .45); z-index: 25; }
    .icon-btn.sidebar-close { display: inline-grid; }
    .sidebar-collapse { display: none; }
    .shell.is-collapsed .brand-name, .shell.is-collapsed .nav-item span, .shell.is-collapsed .nav-group-label { display: initial; }
    .shell.is-collapsed .nav-item { justify-content: flex-start; padding: 0 .75rem; }
    .shell.is-collapsed .nav-group-title { justify-content: flex-start; padding: 0 .75rem .3rem; }
    .shell.is-collapsed .status-dot { margin-left: auto; }
    .icon-btn.menu-btn { display: inline-grid; }
    .topbar { padding: 0 1rem; }
    .content { padding: 1.25rem 1rem 2.5rem; }
    .user-name { display: none; }
    .user-chip { padding: .2rem; }
}

/* ---------- Sayfa başlığı ---------- */

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-header-text { display: flex; flex-direction: column; gap: .35rem; min-width: 0; max-width: 820px; }
.page-subtitle { color: var(--muted); margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.module-tag {
    align-self: flex-start; display: inline-flex; align-items: center; gap: .4rem;
    font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: .2rem .55rem; border-radius: 99px;
}
.module-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.module-osos { color: var(--osos); background: var(--osos-soft); }
.module-epias { color: var(--epias); background: var(--epias-soft); }

.meta-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: var(--muted); margin-top: -.5rem; }
.description { color: var(--text-2); max-width: 900px; margin: 0; }

/* ---------- Kartlar ve ızgaralar ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.35rem 1.4rem;
    display: flex; flex-direction: column; gap: 1rem;
    min-width: 0;
}
.card-flush { padding: 0; gap: 0; overflow: hidden; }
.card > .btn, .card > a.btn { align-self: flex-start; }
.card-pad { padding: 1.1rem 1.4rem; }
.card-flush > .card-pad + .table-wrap,
.card-flush > .toolbar + .table-wrap { border-top: 1px solid var(--border); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-align-start { align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: .9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; }
.stat-tile {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem;
}
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: .5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* Modül kartları (genel bakış) */
.module-card { position: relative; overflow: hidden; }
.module-card::before, .connection-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--module-color); }
.module-accent-osos { --module-color: var(--osos); --module-soft: var(--osos-soft); }
.module-accent-epias { --module-color: var(--epias); --module-soft: var(--epias-soft); }
.module-card-head, .connection-head { display: flex; align-items: center; gap: .85rem; }
.module-icon, .connection-logo {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    color: var(--module-color); background: var(--module-soft);
}
.push-right { margin-left: auto; }
.section-title { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: .25rem; }

.module-links { display: flex; gap: .4rem; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: auto; }
.module-links a {
    display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border-radius: 9px;
    color: var(--text-2); background: var(--surface-2); font-weight: 500; font-size: .87rem;
}
.module-links a:hover { text-decoration: none; color: var(--module-color); background: var(--module-soft); }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.activity li:last-child { border-bottom: 0; }
.activity-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--module-color, var(--accent)); background: var(--module-soft, var(--accent-soft)); }
.activity-text { flex: 1; display: flex; gap: .5rem; align-items: baseline; min-width: 0; }
.activity-time { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .75rem; }
.mini-stats > div { background: var(--surface-2); border-radius: var(--radius); padding: .8rem .95rem; display: flex; flex-direction: column; }
.mini-stats strong { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-stats span { color: var(--muted); font-size: .8rem; }

/* Bağlı hesaplar */
.connection-card { position: relative; overflow: hidden; }
.connection-title { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; padding: .9rem 1rem; background: var(--surface-2); border-radius: var(--radius); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.profile-head { display: flex; align-items: center; gap: 1rem; }

/* ---------- Formlar ---------- */

.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 500; color: var(--text-2); }
.field .req { color: var(--error); font-style: normal; }
.field-action { justify-content: flex-end; }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: .55rem .75rem; min-height: 40px;
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
textarea { resize: vertical; min-height: 96px; }
.code-input { font-family: var(--mono); font-size: .85rem; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem 1rem; align-items: end; }
.span-all { grid-column: 1 / -1; margin: 0; }

.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--text-2); }

.filter-bar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.filter-bar select { width: auto; min-width: 200px; }
.search-input { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.search-input .icon { position: absolute; left: .75rem; color: var(--muted); pointer-events: none; }
.search-input > input[type="search"] { padding-left: 2.4rem; }

.picker summary { cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; color: var(--text-2); font-weight: 500; list-style: none; }
.picker summary::-webkit-details-marker { display: none; }
.picker-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .35rem .75rem;
    margin-top: .75rem; max-height: 260px; overflow-y: auto; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}

/* ---------- Butonlar ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    height: 40px; padding: 0 1rem; border-radius: 10px;
    font: inherit; font-weight: 600; font-size: .9rem; white-space: nowrap;
    color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
    cursor: pointer; box-shadow: var(--shadow-sm);
    transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 4px 14px -6px var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; color: var(--error); border-color: color-mix(in srgb, var(--error) 35%, transparent); box-shadow: none; }
.btn-danger-ghost:hover { background: var(--error-soft); }
.btn-sm { height: 32px; padding: 0 .7rem; font-size: .83rem; border-radius: 8px; }
.btn-lg { height: 46px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
    background: transparent; border: 0; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn-danger:hover { background: var(--error-soft); color: var(--error); }

.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; flex-wrap: wrap; align-self: flex-start; }
.segmented button {
    display: inline-flex; align-items: center; gap: .4rem;
    border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; font-size: .87rem;
    padding: .4rem .85rem; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.segmented-sm button { padding: .3rem .7rem; font-size: .82rem; }

.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }

/* ---------- Rozet / uyarı ---------- */

.badge {
    display: inline-flex; align-items: center; gap: .3rem; height: 22px; padding: 0 .55rem; border-radius: 99px;
    font-size: .74rem; font-weight: 600; white-space: nowrap;
    background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
a.badge:hover { text-decoration: none; }
.badge code { background: none; border: 0; padding: 0; color: inherit; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-error { background: var(--error-soft); color: var(--error); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-muted { color: var(--muted); }

.alert {
    display: flex; align-items: flex-start; gap: .65rem;
    padding: .8rem 1rem; border-radius: var(--radius); border: 1px solid transparent;
    font-size: .9rem;
}
.alert > .icon { margin-top: .1rem; }
.alert-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert-close { width: 26px; height: 26px; margin: -.2rem -.3rem -.2rem 0; color: inherit; opacity: .7; }
.alert-error { background: var(--error-soft); color: var(--error); border-color: color-mix(in srgb, var(--error) 22%, transparent); }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }

/* ---------- Tablolar ---------- */

.table-wrap { overflow: auto; max-width: 100%; }
.table-wrap-tall { max-height: 560px; }
.table-wrap-short { max-height: 320px; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .87rem; }
.table th, .table td { padding: .7rem 1rem; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--surface-2); color: var(--muted);
    font-size: .78rem; font-weight: 600; letter-spacing: .01em;
}
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-selected { background: var(--accent-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; width: 1%; }
.table .actions .btn + .btn { margin-left: .35rem; }
.table-compact th, .table-compact td { padding: .45rem .8rem; }
.table code { font-size: .78rem; }
.cell-title { font-weight: 600; color: var(--text); display: block; white-space: normal; min-width: 220px; }
.cell-sub { color: var(--muted); font-size: .8rem; white-space: normal; }
.cell-sub code { white-space: nowrap; }
.table-caption { padding: .8rem 1.4rem; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--border); }

.card:not(.card-flush) > .table-wrap { border: 1px solid var(--border); border-radius: var(--radius); }

.pager { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .85rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .87rem; }
.card:not(.card-flush) .pager { border-top: 0; padding-bottom: 0; }

/* ---------- Boş durum / yükleniyor ---------- */

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 2.75rem 1.5rem; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: .5rem; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 0; }
.empty-actions { margin-top: .75rem; display: flex; gap: .5rem; }

.skeleton-list { display: flex; flex-direction: column; gap: .7rem; }
.skeleton {
    height: 14px; border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
    background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner {
    width: 18px; height: 18px; border-radius: 50%; display: inline-block; flex-shrink: 0;
    border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .85;
}
.spinner-sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-indeterminate { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.progress-indeterminate::after {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 99px; background: var(--accent);
    animation: indeterminate 1.2s ease-in-out infinite;
}
@keyframes indeterminate { from { left: -35%; } to { left: 100%; } }

/* ---------- Grafik ---------- */

.chart { width: 100%; height: auto; display: block; }
.chart-bar { fill: var(--accent); opacity: .9; }
.chart-bar:hover { opacity: 1; fill: var(--accent-hover); }
.chart-axis-line { stroke: var(--border-strong); }
.chart-zero { stroke: var(--border); stroke-dasharray: 3 3; }
.chart-axis { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart-label { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.chart-controls { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.chart-controls label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--muted); }
.chart-controls select { width: auto; min-width: 180px; }

/* ---------- Formüller ---------- */

.formula-list { list-style: none; margin: 0; padding: 0; }
.formula-list li { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.4rem; border-top: 1px solid var(--border); }
.formula-list li.is-selected { background: var(--accent-soft); }
.formula-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.formula-expr { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding: .55rem .7rem; }

/* ---------- Formül oluşturucu (sürükle-bırak) ---------- */

.fb { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: stretch; }
@media (max-width: 900px) { .fb { grid-template-columns: 1fr; } }

.fb-palette {
    display: flex; flex-direction: column; min-height: 0; max-height: 520px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
    overflow: hidden; position: relative; transition: border-color .15s, background .15s;
}
.fb-palette.is-trash { border-color: var(--error); border-style: dashed; background: var(--error-soft); }
.fb-palette-head { display: flex; flex-direction: column; gap: .5rem; padding: .7rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.fb-palette-head .search-input { min-width: 0; }
.fb-only-data { font-size: .8rem; }
.fb-source-list { overflow-y: auto; padding: .35rem .45rem .6rem; flex: 1; }
.fb-pad { padding: .6rem; margin: 0; }
.fb-tag { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .7rem .4rem .3rem; }

.fb-source-head {
    display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: .35rem; width: 100%;
    background: transparent; border: 0; padding: .4rem; border-radius: 8px; text-align: left;
    font: inherit; color: var(--text); cursor: pointer;
}
.fb-source-head:hover { background: var(--surface-3); }
.fb-caret { color: var(--muted); margin-top: 3px; transition: transform .15s; }
.fb-source.is-open .fb-caret { transform: rotate(90deg); }
.fb-source-title { font-size: .86rem; font-weight: 500; line-height: 1.3; }
.fb-source-meta { grid-column: 2; font-size: .74rem; color: var(--muted); }
.fb-fields { display: flex; flex-wrap: wrap; gap: .35rem; padding: .25rem .4rem .6rem 1.55rem; }

/* sürüklenebilir kaynak parçaları */
.fb-chip {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 30px; padding: .25rem .6rem;
    border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
    font-size: .82rem; font-weight: 500; color: var(--text-2); cursor: grab; user-select: none;
    box-shadow: var(--shadow-sm); transition: border-color .12s, background .12s, transform .05s;
}
.fb-chip:hover { border-color: var(--accent); color: var(--text); }
.fb-chip:active { cursor: grabbing; transform: translateY(1px); }
.fb-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.fb-chip-field { border-color: color-mix(in srgb, var(--epias) 40%, var(--border-strong)); }
.fb-chip-field .icon { color: var(--epias); flex-shrink: 0; }
.fb-chip-field:hover { background: var(--epias-soft); border-color: var(--epias); }
.fb-chip-op { min-width: 34px; justify-content: center; font-family: var(--mono); font-size: .92rem; font-weight: 600; }
.fb-chip-num { color: var(--warn); }
.fb-chip-fn { color: var(--osos); }

.fb-trash-hint {
    position: absolute; inset: auto .6rem .6rem; display: flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem; border-radius: 8px; background: var(--error); color: #fff; font-size: .82rem; font-weight: 600; pointer-events: none;
}

.fb-main { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.fb-tools { display: flex; flex-direction: column; gap: .5rem; }
.fb-tool-group { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.fb-tool-label { width: 52px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* formül alanı */
.fb-canvas {
    display: flex; flex-wrap: wrap; align-items: center; row-gap: .5rem; align-content: flex-start;
    min-height: 150px; padding: .9rem .75rem; border-radius: var(--radius);
    border: 2px dashed var(--border-strong); background: var(--surface);
    transition: border-color .15s, background .15s;
}
.fb-canvas:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.fb-canvas.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.fb-canvas.is-empty { justify-content: center; align-content: center; }
.fb-empty { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; color: var(--muted); max-width: 420px; pointer-events: none; }
.fb-empty .icon { color: var(--accent); margin-bottom: .25rem; }
.fb-empty strong { color: var(--text-2); font-weight: 600; }
.fb-empty span { font-size: .85rem; }

.fb-gap { align-self: stretch; width: 10px; min-height: 38px; position: relative; cursor: text; flex-shrink: 0; }
.fb-gap::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px; background: transparent; }
.fb-canvas:focus-within .fb-gap.is-cursor::after { background: var(--accent); animation: fb-blink 1s steps(1) infinite; }
.fb-gap.is-hover::after { background: var(--accent); width: 4px; margin-left: -2px; animation: none; }
.fb-canvas.is-dragging .fb-gap { width: 16px; }
@keyframes fb-blink { 50% { opacity: 0; } }

.fb-tok {
    position: relative; display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: .3rem .55rem;
    border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2);
    font-weight: 600; font-size: .9rem; color: var(--text); cursor: grab; user-select: none; max-width: 100%;
}
.fb-tok.is-moving { opacity: .4; }
.fb-tok-op { font-family: var(--mono); font-size: 1.05rem; min-width: 34px; justify-content: center; background: var(--surface); }
.fb-tok-paren { font-family: var(--mono); font-size: 1.1rem; color: var(--muted); background: transparent; border-color: transparent; padding: .3rem .25rem; }
.fb-tok-fn { color: var(--osos); background: var(--osos-soft); border-color: transparent; }
.fb-tok-num { background: var(--warn-soft); border-color: transparent; }
.fb-tok-field { background: var(--epias-soft); border-color: color-mix(in srgb, var(--epias) 35%, transparent); padding-left: .7rem; }
.fb-tok-field.is-unknown { background: var(--error-soft); border-color: var(--error); }
.fb-tok-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.fb-tok-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.fb-tok-text small { font-size: .7rem; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

.fb-agg {
    width: auto !important; min-height: 0 !important; height: 26px; padding: 0 .4rem !important; font-size: .75rem; font-weight: 600;
    border-radius: 6px !important; background: var(--surface); color: var(--text-2); cursor: pointer;
}
.fb-num {
    min-height: 0 !important; height: 26px; padding: 0 .3rem !important; min-width: 3ch; text-align: center;
    font-family: var(--mono); font-weight: 600; background: var(--surface) !important; border-radius: 6px !important;
}

.fb-tok-x {
    position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
    cursor: pointer; opacity: 0; transition: opacity .12s; z-index: 4; padding: 0;
}
.fb-tok:hover .fb-tok-x, .fb-tok:focus-within .fb-tok-x { opacity: 1; }
.fb-tok-x:hover { color: var(--error); border-color: var(--error); }
@media (hover: none) { .fb-tok-x { opacity: 1; } }

.fb-half { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 3; }
.fb-half-l { left: 0; }
.fb-half-r { right: 0; }

.fb-footer { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fb-help { font-size: .8rem; }
.fb-text summary { font-size: .85rem; }
.fb-text textarea { margin-top: .5rem; min-height: 70px; }

.fb-status { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-height: 24px; font-size: .88rem; }
.fb-status .spinner { width: 12px; height: 12px; }
.fb-status-error { color: var(--error); }

.fb-settings { display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(150px, 1fr)); gap: .9rem 1rem; align-items: start; }
.fb-settings small { font-size: .78rem; line-height: 1.4; }
@media (max-width: 1100px) { .fb-settings { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.fb-sql { flex-basis: 100%; }

.fb-readout { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.fb-tok-static { cursor: default; min-height: 30px; font-size: .82rem; padding: .2rem .5rem; }
.fb-tok-static.fb-tok-field { padding-left: .55rem; }

.disclosure summary { cursor: pointer; color: var(--text-2); font-weight: 500; }
.code-block {
    margin: .6rem 0 0; padding: 1rem; border-radius: var(--radius); overflow: auto; max-height: 320px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: pre;
}

/* ---------- Giriş / kayıt ---------- */

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero {
    position: relative; overflow: hidden; color: #eef1ff;
    background:
        radial-gradient(900px 500px at 10% 0%, rgba(124, 58, 237, .55), transparent 60%),
        radial-gradient(700px 500px at 100% 100%, rgba(13, 148, 136, .45), transparent 60%),
        linear-gradient(160deg, #1b2240 0%, #0e1226 100%);
    display: flex; align-items: flex-end; padding: 3.5rem;
}
.auth-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 480px; display: flex; flex-direction: column; gap: 1.1rem; }
.auth-hero h2 { color: #fff; font-size: 2.4rem; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; margin-top: 2.5rem; }
.auth-hero p { color: rgba(238, 241, 255, .75); font-size: 1.02rem; margin: 0; }
.brand-light { color: #fff; }
.auth-points { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-direction: column; gap: .7rem; color: rgba(238, 241, 255, .85); }
.auth-points li { display: flex; align-items: center; gap: .7rem; }
.auth-points .icon { color: #a5b4ff; }

.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 1.1rem; }
.auth-card-head { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .5rem; }
.auth-card-head p { color: var(--muted); margin: 0; }
.auth-switch { text-align: center; color: var(--muted); margin: .25rem 0 0; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { padding: 1.5rem 1.25rem; }
    .auth-hero h2, .auth-hero p, .auth-points { display: none; }
}

/* ---------- Blazor hata çubuğu ---------- */

#blazor-error-ui {
    display: none; position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 1000;
    padding: .75rem 1.1rem; border-radius: var(--radius); box-shadow: var(--shadow-lg);
    background: var(--error); color: #fff; font-weight: 500; gap: .75rem; align-items: center;
}
#blazor-error-ui a { color: #fff; text-decoration: underline; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: .5rem; }

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