/* ============================================================
   AtmoSpace Admin Panel — Tema
   Mobil uygulamanın renk paletinden türetildi:
   koyu navy zemin + teal/emerald accent
   ============================================================ */

:root {
    /* Zemin */
    --bg-deep:        #0a1420;
    --bg-base:        #0e1a28;
    --bg-surface:     #142436;
    --bg-surface-2:   #18293d;
    --bg-elevated:    #1d3044;

    /* Accent — mobildeki yeşil/teal */
    --accent:         #2dd4a7;
    --accent-bright:  #34e0b0;
    --accent-dim:     #1f9d7c;
    --accent-soft:    rgba(45, 212, 167, 0.12);
    --accent-glow:    rgba(45, 212, 167, 0.35);

    /* Metin */
    --text-primary:   #eef4f2;
    --text-secondary: #9fb2c0;
    --text-muted:     #61788a;

    /* Çizgi/kenar */
    --border:         rgba(255, 255, 255, 0.06);
    --border-strong:  rgba(255, 255, 255, 0.12);

    /* Durum */
    --danger:         #f0556d;
    --warning:        #f0b429;
    --info:           #4aa8ff;

    /* Ölçü */
    --sidebar-w:      264px;
    --radius:         16px;
    --radius-sm:      10px;
    --shadow:         0 12px 32px rgba(0, 0, 0, 0.35);

    --font-display: "Sora", -apple-system, sans-serif;
    --font-body:    "Plus Jakarta Sans", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 8px; border: 2px solid var(--bg-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 80% -10%, rgba(45, 212, 167, 0.08), transparent 60%),
        var(--bg-deep);
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: linear-gradient(180deg, var(--bg-base), var(--bg-deep));
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 22px;
}
.brand-mark {
    width: 40px; height: 40px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-elevated);
    box-shadow: 0 6px 18px var(--accent-glow);
    display: block;
    /* metin fallback (görsel yüklenmezse) */
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    color: var(--accent-bright);
    text-align: center;
    line-height: 40px;
}
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.3px; }
.brand-text span { color: var(--accent); }

.nav-group { margin-top: 10px; }
.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-muted);
    padding: 14px 12px 8px;
    font-weight: 600;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14.5px;
    transition: all .18s ease;
    position: relative;
}
.nav-item svg { width: 19px; height: 19px; stroke-width: 2; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-surface); color: var(--text-primary); }
.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-bright);
}
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -16px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 22px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background .18s ease;
}
.user-card:hover { background: var(--bg-surface); }
.user-avatar {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    display: grid; place-items: center;
    color: #07221b; font-weight: 700;
}
.user-meta { line-height: 1.3; overflow: hidden; }
.user-meta .name { font-weight: 600; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-meta .role { font-size: 12px; color: var(--text-muted); }

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

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(14, 26, 40, 0.7);
    backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 20;
}
.search-bar {
    flex: 1;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .18s ease;
}
.search-bar:focus-within { border-color: var(--accent-dim); }
.search-bar svg { width: 18px; height: 18px; color: var(--text-muted); }
.search-bar input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 14px;
}
.search-bar input::placeholder { color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: grid; place-items: center;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all .18s ease;
    position: relative;
}
.icon-btn:hover { color: var(--accent-bright); border-color: var(--accent-dim); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot {
    position: absolute; top: 9px; right: 10px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 2px var(--bg-surface);
}

.content { padding: 32px; flex: 1; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 28px; }
.greeting { font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.page-title {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: 4px;
    display: flex; align-items: center; gap: 10px;
}

/* ============================================================
   COMPONENTS
   ============================================================ */
.section { margin-bottom: 36px; }
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-family: var(--font-display);
    font-size: 17px; font-weight: 650;
    display: flex; align-items: center; gap: 9px;
}
.section-title svg { width: 18px; height: 18px; color: var(--accent); }
.section-link { font-size: 13px; color: var(--accent); font-weight: 600; }
.section-link:hover { color: var(--accent-bright); }

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--accent-dim); }
.stat-card .ic {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: var(--accent-bright);
    margin-bottom: 16px;
}
.stat-card .ic svg { width: 22px; height: 22px; }
.stat-card .val { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; }
.stat-card .lbl { color: var(--text-secondary); font-size: 13.5px; margin-top: 6px; }
.stat-card .trend { position: absolute; top: 22px; right: 22px; font-size: 12px; color: var(--accent); font-weight: 600; }

/* Quick actions */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.qa-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 16px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    text-align: center;
    transition: all .18s ease;
}
.qa-card:hover { background: var(--bg-surface-2); border-color: var(--accent-dim); transform: translateY(-3px); }
.qa-card .ic {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent-soft), transparent);
    border: 1px solid var(--border-strong);
    color: var(--accent-bright);
}
.qa-card .ic svg { width: 24px; height: 24px; }
.qa-card .t { font-size: 13px; font-weight: 600; letter-spacing: .3px; }

/* Workspace cards */
.ws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.ws-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all .18s ease;
}
.ws-card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }
.ws-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ws-folder {
    width: 42px; height: 42px;
    border-radius: 11px;
    background: var(--accent-soft);
    display: grid; place-items: center;
    color: var(--accent-bright);
}
.ws-folder svg { width: 22px; height: 22px; }
.ws-star { color: var(--accent); }
.ws-star svg { width: 18px; height: 18px; fill: var(--accent); }
.ws-card .name { font-weight: 650; font-size: 15px; }
.ws-card .cat { font-size: 11px; letter-spacing: 1px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }

/* Recent list */
.recent-list { display: flex; flex-direction: column; gap: 12px; }
.recent-row {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: all .18s ease;
}
.recent-row:hover { border-color: var(--accent-dim); background: var(--bg-surface-2); }
.recent-row .ws-folder { width: 46px; height: 46px; }
.recent-row .info { flex: 1; }
.recent-row .info .name { font-weight: 650; font-size: 15px; }
.recent-row .info .meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; letter-spacing: .4px; }
.recent-row .chev { color: var(--text-muted); }
.recent-row .chev svg { width: 20px; height: 20px; }

/* ============================================================
   LOGIN
   ============================================================ */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--bg-deep);
}
.auth-hero {
    background:
        radial-gradient(700px 500px at 30% 20%, rgba(45, 212, 167, 0.14), transparent 60%),
        linear-gradient(160deg, var(--bg-base), var(--bg-deep));
    border-right: 1px solid var(--border);
    padding: 56px;
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.auth-hero::after {
    content: "";
    position: absolute; bottom: -120px; right: -120px;
    width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    filter: blur(40px);
}
.auth-hero .brand { padding: 0; }
.auth-hero .pitch { position: relative; z-index: 1; }
.auth-hero .pitch h1 {
    font-family: var(--font-display);
    font-size: 44px; font-weight: 700;
    line-height: 1.1; letter-spacing: -1px;
    margin-bottom: 18px;
}
.auth-hero .pitch h1 span { color: var(--accent); }
.auth-hero .pitch p { color: var(--text-secondary); font-size: 16px; max-width: 420px; line-height: 1.6; }
.auth-feats { display: flex; gap: 28px; margin-top: 32px; position: relative; z-index: 1; }
.auth-feat { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 14px; }
.auth-feat svg { width: 18px; height: 18px; color: var(--accent); }
.auth-foot { color: var(--text-muted); font-size: 13px; position: relative; z-index: 1; }

.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-secondary); margin-bottom: 32px; font-size: 14.5px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.field input {
    width: 100%;
    padding: 13px 15px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    color: var(--text-primary);
    font-size: 14.5px;
    transition: border-color .18s ease;
    outline: none;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--text-muted); }
.field-validation-error, .text-danger { color: var(--danger); font-size: 12.5px; margin-top: 6px; display: block; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-secondary); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.link-accent { color: var(--accent); font-size: 13.5px; font-weight: 600; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 20px;
    border-radius: 11px;
    font-weight: 650; font-size: 15px;
    transition: all .18s ease;
}
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #07221b;
    box-shadow: 0 8px 22px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--accent-glow); }
.auth-alt { text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 13.5px; }

/* 409 — başka cihazda aktif oturum onayı */
.auth-notice {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 20px;
    background: rgba(240, 180, 41, 0.10);
    border: 1px solid rgba(240, 180, 41, 0.35);
    border-radius: 11px;
    color: var(--warning);
    font-size: 13px; line-height: 1.5;
}
.auth-notice i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   PLACEHOLDER PAGES
   ============================================================ */
.placeholder {
    display: grid; place-items: center;
    min-height: 60vh; text-align: center;
}
.placeholder .ic {
    width: 88px; height: 88px; border-radius: 24px;
    background: var(--accent-soft); color: var(--accent-bright);
    display: grid; place-items: center; margin: 0 auto 24px;
}
.placeholder .ic svg { width: 40px; height: 40px; }
.placeholder h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 10px; }
.placeholder p { color: var(--text-secondary); max-width: 380px; }

/* ---------- Animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .5s ease both; }
.rise-1 { animation-delay: .05s; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .19s; }
.rise-4 { animation-delay: .26s; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .qa-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -280px; z-index: 100; transition: left .25s ease; }
    .sidebar.open { left: 0; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
}
@media (max-width: 560px) {
    .stat-grid, .qa-grid { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 20px; }
}

/* ============================================================
   WORKSPACES / TABLES — entegrasyon bileşenleri
   ============================================================ */

/* Flash mesajları */
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; margin-bottom: 22px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    animation: rise .35s ease both;
}
.flash svg { width: 18px; height: 18px; flex-shrink: 0; }
.flash span { flex: 1; }
.flash-ok  { background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-bright); }
.flash-err { background: rgba(240, 85, 109, 0.12); border: 1px solid rgba(240, 85, 109, 0.4); color: var(--danger); }
.flash-x { color: inherit; opacity: .6; }
.flash-x:hover { opacity: 1; }
.flash-x svg { width: 16px; height: 16px; }

/* Başlık satırı + inline buton */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn-inline { width: auto; padding: 11px 18px; font-size: 14px; }
.page-title svg { width: 28px; height: 28px; vertical-align: -5px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 16px; height: 16px; }

/* Sekmeler */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.tab {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 16px; color: var(--text-secondary);
    font-size: 14px; font-weight: 600;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-bright); border-bottom-color: var(--accent); }
.tab-count { font-size: 12px; color: var(--text-muted); background: var(--bg-surface); padding: 1px 8px; border-radius: 20px; }
.tab.active .tab-count { color: var(--accent); background: var(--accent-soft); }
.tab-badge { font-size: 11px; font-weight: 700; color: #07221b; background: var(--warning); padding: 1px 7px; border-radius: 20px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Workspace kart eklentileri */
.ws-card .ws-link { display: block; }
.ws-menu { display: flex; gap: 4px; }
.ws-card.archived { opacity: .85; }
.icon-mini {
    width: 30px; height: 30px; border-radius: 8px;
    display: inline-grid; place-items: center;
    color: var(--text-muted); border: 1px solid transparent;
}
.icon-mini:hover { color: var(--accent-bright); background: var(--bg-surface-2); }
.icon-mini.danger:hover { color: var(--danger); }
.icon-mini svg { width: 16px; height: 16px; }

.pill { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); background: var(--bg-surface-2); padding: 3px 10px; border-radius: 20px; }
.pill-warn { color: #07221b; background: var(--warning); }

.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.btn-sm {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 9px 12px; border-radius: 9px;
    font-size: 13px; font-weight: 600; transition: all .15s ease;
}
.btn-sm svg { width: 15px; height: 15px; }
.btn-sm-ok { background: var(--accent-soft); color: var(--accent-bright); border: 1px solid var(--accent-dim); }
.btn-sm-ok:hover { background: var(--accent-dim); color: #07221b; }
.btn-sm-ghost { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-strong); }
.btn-sm-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn-sm-ghost.danger:hover { color: var(--danger); border-color: var(--danger); }

/* Detay düzeni */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.ws-head { display: flex; align-items: center; gap: 14px; }
.ws-folder.lg { width: 56px; height: 56px; border-radius: 14px; }
.ws-folder.lg svg { width: 28px; height: 28px; }
.ws-folder.sm { width: 38px; height: 38px; border-radius: 9px; }
.ws-folder.sm svg { width: 18px; height: 18px; }
.ws-desc { color: var(--text-secondary); margin-top: 14px; max-width: 700px; font-size: 14px; }
.grid-hint { color: var(--text-muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.grid-hint svg { width: 16px; height: 16px; }
.grid-hint code { background: var(--bg-surface); padding: 2px 7px; border-radius: 6px; color: var(--accent-bright); font-size: 12px; }

/* Tablo listesi */
.table-list { display: flex; flex-direction: column; gap: 8px; }
.table-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px; transition: all .15s ease;
}
.table-row:hover { border-color: var(--accent-dim); }
.table-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.table-row .name { font-weight: 600; font-size: 14.5px; }
.table-row .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.row-actions { display: flex; gap: 4px; }
.chev { color: var(--text-muted); }

.placeholder.sm { min-height: 220px; }
.placeholder.sm .ic { width: 60px; height: 60px; }

/* Paylaşım kutusu */
.share-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.share-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.share-form input, .share-form select { padding: 11px 13px; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; outline: none; }
.share-form input:focus, .share-form select:focus { border-color: var(--accent); }
.muted-note { color: var(--text-muted); font-size: 13px; text-align: center; padding: 10px 0; }
.collab-list { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.collab-row { display: flex; align-items: center; gap: 11px; }
.collab-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-bright); font-weight: 700; font-size: 14px; }
.collab-meta { flex: 1; }
.collab-meta .name { font-weight: 600; font-size: 14px; }
.collab-meta .meta { font-size: 12px; color: var(--text-muted); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(7, 14, 22, 0.66); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    width: 100%; max-width: 440px;
    background: var(--bg-elevated); border: 1px solid var(--border-strong);
    border-radius: var(--radius); padding: 22px;
    animation: rise .3s ease both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 18px; }
.modal-head h3 svg { width: 20px; height: 20px; color: var(--accent); }
.modal .field { margin-bottom: 14px; }
.modal .field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.modal .field input, .modal .field select, .modal .field textarea {
    width: 100%; padding: 11px 13px; background: var(--bg-base);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px; outline: none; font-family: inherit;
}
.modal .field input:focus, .modal .field select:focus, .modal .field textarea:focus { border-color: var(--accent); }
.modal .field textarea { resize: vertical; }
.color-input { height: 44px; padding: 4px; cursor: pointer; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.modal-foot .btn-sm { width: auto; padding: 10px 16px; }

/* ============================================================
   TABLO EDİTÖRÜ (Excel benzeri spreadsheet)
   ============================================================ */
.sheet-head { margin-bottom: 12px; }

#sheetApp {
    --cellw: 116px; --cellh: 28px; --rowhdr: 50px;
    --smono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
    display: flex; flex-direction: column;
    height: calc(100vh - 150px); min-height: 440px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius); overflow: hidden;
}

/* Araç çubuğu */
.s-toolbar {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px; background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}
.s-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 14px; white-space: nowrap; }
.s-title svg { width: 18px; height: 18px; color: var(--accent); }
.s-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
.s-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-surface-2); border: 1px solid var(--border-strong);
    color: var(--text-secondary); padding: 7px 12px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; transition: all .15s ease;
}
.s-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.s-btn svg { width: 14px; height: 14px; }
.s-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #07221b; border: none; }
.s-btn.primary:hover { filter: brightness(1.08); }
.s-btn.blue { background: var(--accent-soft); color: var(--accent-bright); border-color: var(--accent-dim); }
.s-grp { display: flex; gap: 2px; background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px; }
.s-grp button { padding: 5px 11px; border-radius: 6px; color: var(--text-secondary); font-size: 13px; }
.s-grp button:hover { background: var(--bg-base); color: var(--text-primary); }
.s-grp button.on { background: var(--accent); color: #07221b; }
.s-hint { color: var(--text-muted); font-size: 11.5px; }
.s-hint b { color: var(--accent-bright); font-weight: 600; }

/* Formül çubuğu */
.s-fbar { display: flex; align-items: center; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.s-namebox { width: 80px; text-align: center; font-family: var(--smono); font-weight: 700; padding: 8px; border-right: 1px solid var(--border); color: var(--accent-bright); }
.s-fx {
    padding: 0 14px; min-width: 56px; height: 100%; align-self: stretch;
    color: var(--text-muted); font-style: italic; font-family: var(--smono); font-size: 13px;
    border: none; border-right: 1px solid var(--border); background: transparent;
    cursor: pointer; transition: all .15s ease; display: inline-flex; align-items: center; gap: 5px;
}
.s-fx:hover { color: var(--text-primary); background: var(--bg-surface-2); }
.s-fx.ai {
    color: #07221b; font-style: normal; font-weight: 700;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent2, #1f9d7c));
}
#formulaInput { flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); padding: 8px 12px; font-family: var(--smono); font-size: 13px; }
#formulaInput.ai { font-family: var(--sans, "Plus Jakarta Sans", sans-serif); font-style: normal; color: var(--accent-bright); }
#formulaInput:disabled { opacity: .6; }
.s-ai-go {
    display: inline-grid; place-items: center; width: 38px; align-self: stretch;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #07221b;
    border: none; border-left: 1px solid var(--border); cursor: pointer;
}
.s-ai-go:hover { filter: brightness(1.1); }
.s-ai-go svg { width: 16px; height: 16px; }

/* Izgara */
.s-gridwrap { flex: 1; overflow: auto; background: var(--bg-base); position: relative; }
#grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
#grid th, #grid td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); height: var(--cellh); overflow: hidden; white-space: nowrap; }
#grid thead th { position: sticky; top: 0; z-index: 3; background: var(--bg-surface-2); color: var(--text-muted); font-weight: 600; text-align: center; width: var(--cellw); user-select: none; }
#grid thead th.corner { left: 0; z-index: 5; width: var(--rowhdr); }
#grid th.rowhdr { position: sticky; left: 0; z-index: 2; background: var(--bg-surface-2); color: var(--text-muted); font-weight: 600; text-align: center; width: var(--rowhdr); user-select: none; }
#grid th.colhdr.sel, #grid th.rowhdr.sel { background: var(--accent-soft); color: var(--accent-bright); }
#grid td { width: var(--cellw); padding: 0; cursor: cell; position: relative; }
#grid td .cv { padding: 4px 7px; height: 100%; overflow: hidden; text-overflow: ellipsis; font-family: var(--smono); font-size: 12.5px; line-height: 20px; }
#grid td.num .cv { text-align: right; }
#grid td.err .cv { color: var(--danger); }
#grid td.bold .cv { font-weight: 700; }
#grid td.italic .cv { font-style: italic; }
#grid td.sel { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); z-index: 1; }
#grid td.inrange { background: var(--accent-soft); }
#grid td input { width: 100%; height: 100%; border: none; outline: none; background: var(--bg-elevated); color: var(--text-primary); font-family: var(--smono); font-size: 12.5px; padding: 4px 7px; }

/* Durum çubuğu */
.s-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: var(--bg-elevated); border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.s-stats { display: flex; gap: 18px; font-family: var(--smono); }

/* Toast */
.s-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--accent-dim); color: #07221b; padding: 10px 18px; border-radius: 9px; opacity: 0; transition: .28s ease; pointer-events: none; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 80%; z-index: 300; font-size: 13px; }
.s-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.s-toast.err { background: var(--danger); color: #fff; }

@media (max-width: 860px) {
    .detail-grid { grid-template-columns: 1fr; }
    .s-hint { display: none; }
}
