/* kiramaortak.com yönetim paneli */
:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f0f3f8;
    --border: #e2e7ef;
    --text: #1b2333;
    --muted: #677389;
    --primary: #2f6fed;
    --primary-hover: #2459c9;
    --primary-soft: #e8f0ff;
    --side-bg: #141b2d;
    --side-text: #c3cbdc;
    --side-muted: #7f8aa3;
    --side-hover: #1f2840;
    --side-active: #2f6fed;
    --ok-bg: #e7f6ee; --ok-text: #136c3c; --ok-border: #b7e3c9;
    --warn-bg: #fff5e0; --warn-text: #8a5a00; --warn-border: #f3d79a;
    --err-bg: #fdecec; --err-text: #a52222; --err-border: #f3bcbc;
    --info-bg: #e8f0ff; --info-text: #1f4fb5; --info-border: #c3d5fb;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1320;
        --surface: #161d2e;
        --surface-2: #1c2438;
        --border: #263049;
        --text: #e5e9f2;
        --muted: #8e99b3;
        --primary: #4d86ff;
        --primary-hover: #6a9bff;
        --primary-soft: #1b2a4d;
        --side-bg: #0a0f1a;
        --side-hover: #151d30;
        --ok-bg: #0f2a1d; --ok-text: #7fdca8; --ok-border: #1d4d33;
        --warn-bg: #2d2209; --warn-text: #f1c66b; --warn-border: #574215;
        --err-bg: #2f1214; --err-text: #ff9b9b; --err-border: #5c2226;
        --info-bg: #14223f; --info-text: #9bbcff; --info-border: #26406f;
        --shadow: none;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; word-break: break-all; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 36px; height: 36px; }

/* ───── Yerleşim: içerik solda, menü sağda ───── */
.shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 264px;
    min-height: 100vh;
}
.main { padding: 36px 40px 56px; max-width: 1200px; width: 100%; }
.page-head { margin-bottom: 24px; }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 24px;
    background: var(--side-bg); color: var(--side-text);
    padding: 24px 16px;
    border-left: 1px solid rgba(255, 255, 255, .04);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #4d86ff, #2f5fd6); color: #fff; font-weight: 800; font-size: 1.1rem;
}
.brand-text { display: flex; flex-direction: column; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { font-weight: 500; font-size: .78rem; color: var(--side-muted); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 12px; border-radius: 9px;
    color: var(--side-text); font: inherit; font-weight: 550; text-align: left;
    background: none; border: 0; cursor: pointer;
}
.nav-link:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--side-active); color: #fff; }
.nav-link:focus-visible, .btn:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot form { margin: 0; }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 12px 8px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--side-hover); color: #fff; font-weight: 700; font-size: .9rem; }
.user-name { color: #fff; font-weight: 600; }

/* ───── Kartlar ───── */
.lead { margin: 0 0 24px; font-size: 1.02rem; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.lead .muted { font-size: .88rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 24px;
}
.cards .card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card > p:first-of-type { margin-top: 0; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-note { color: var(--muted); font-size: .84rem; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* ───── Tablo ───── */
.table-wrap { overflow-x: auto; margin: 0 -24px -22px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 11px 24px; text-align: left; border-top: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-2); }
.empty { color: var(--muted); margin: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }

/* ───── Uyarılar ───── */
.alert { padding: 12px 16px; border-radius: 10px; border: 1px solid; margin-bottom: 12px; font-size: .93rem; }
.alert-success { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.alert-warning { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.alert-error { background: var(--err-bg); color: var(--err-text); border-color: var(--err-border); }
.alert-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); }

/* ───── Formlar ───── */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.field small { font-weight: 400; }
input[type=text], input[type=password] {
    width: 100%; padding: 11px 13px; font: inherit; font-weight: 400; font-size: .95rem;
    color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
}
input[type=text]:focus, input[type=password]:focus { border-color: var(--primary); outline: 3px solid var(--primary-soft); outline-offset: 0; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border); border-right: 0; border-radius: 9px 0 0 9px; color: var(--muted); font-family: var(--mono); }
.input-prefix input { border-radius: 0 9px 9px 0; font-family: var(--mono); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: .93rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 36px 20px; border: 2px dashed var(--border); border-radius: var(--radius);
    background: var(--surface-2); text-align: center; cursor: pointer; color: var(--muted);
    transition: border-color .15s, background .15s;
}
.dropzone strong { color: var(--text); }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: .9rem; border-top: 1px solid var(--border); }
.file-list li:first-child { border-top: 0; }
.file-list li.is-bad { color: var(--err-text); background: var(--err-bg); }
.file-list .name { font-family: var(--mono); word-break: break-all; }
.file-list .size { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-foot p { margin: 0; flex: 1 1 320px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 9px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 14px; font-size: .88rem; }
.btn-block { width: 100%; }

/* ───── Giriş sayfası ───── */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
    background: radial-gradient(1200px 600px at 80% -10%, var(--primary-soft), transparent 60%), var(--bg);
}
.login-card {
    width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 12px 40px rgba(16, 24, 40, .10); padding: 36px 32px;
}
.brand-center { justify-content: center; margin-bottom: 28px; }
.login-card .brand-text { color: var(--text); font-size: 1.15rem; }
.login-card .brand-sub { color: var(--muted); }

/* ───── Mobil: menü üste ───── */
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { order: -1; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-left: 0; }
    .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 auto; }
    .nav-link { width: auto; padding: 8px 10px; }
    .sidebar-foot { margin: 0; border: 0; padding: 0; flex-direction: row; align-items: center; }
    .user { padding: 0; }
    .user-name, .brand-sub { display: none; }
    .main { padding: 24px 16px 40px; }
    .table-wrap { margin: 0 -16px -18px; }
    .card { padding: 18px 16px; }
    .table th, .table td { padding: 10px 16px; }
}

/* ───── Metin editörü ───── */
.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; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: 8px; margin: 0; }
select {
    max-width: 320px; padding: 7px 10px; font: inherit; font-size: .88rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
}
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.editor:focus-within { border-color: var(--primary); outline: 3px solid var(--primary-soft); }
.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.badge-type { background: var(--primary-soft); color: var(--primary); border-color: transparent; text-transform: uppercase; letter-spacing: .04em; }
.badge-type.is-bad { background: var(--err-bg); color: var(--err-text); }
textarea.code {
    display: block; width: 100%; min-height: 460px; resize: vertical; margin: 0; padding: 14px 16px;
    font: 13.5px/1.6 var(--mono); tab-size: 4; color: var(--text); background: var(--surface);
    border: 0; outline: none; white-space: pre; overflow: auto;
}
kbd { font-family: var(--mono); font-size: .8em; padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); }
@media (max-width: 860px) {
    .form-row { grid-template-columns: 1fr; }
    select { max-width: 100%; flex: 1; }
    .inline-form { flex: 1 1 100%; }
    textarea.code { min-height: 320px; }
}
