/* Merkez paneli (Origela). Açık tema varsayılan; koyu tema sistem tercihiyle veya Tema düğmesiyle (html[data-theme]).
   Renkler marka kitinden: Mercan #F35438 vurgu, Eylem #C83F28 düğme/açık zeminde küçük metin, Mürekkep #202326, Krem #FAF9F5. */
:root {
    --bg: #faf9f5; --card: #fff; --side: #fff; --text: #202326; --muted: #5d6166; --line: #e7e4dc; --line-strong: #d6d2c7;
    --field: #fff; --hover: #f3f1ea; --primary: #c83f28; --primary-hover: #ae3420; --primary-text: #fff; --accent: #f35438;
    --accent-soft: #fdeae5; --danger: #b42318; --ok: #067647; --warn: #9a4a05;
    --ok-bg: #ecfdf3; --warn-bg: #fff6e8; --danger-bg: #fef3f2; --focus: #c83f28;
    --r: 10px; --r-sm: 7px; --shadow: 0 1px 2px rgba(32, 35, 38, .05);
    --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --side-w: 236px; --gut: 28px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #17191b; --card: #202326; --side: #1c1e21; --text: #ecebe6; --muted: #a6a9ad; --line: #32363b; --line-strong: #41464c;
        --field: #1a1c1f; --hover: #2a2e32; --primary: #f35438; --primary-hover: #ff6a4f; --primary-text: #1a0904; --accent: #f35438;
        --accent-soft: #3a211b; --danger: #ff8a80; --ok: #5dd39e; --warn: #fdb022;
        --ok-bg: #12261d; --warn-bg: #2a2113; --danger-bg: #2c1716; --focus: #f35438;
        --shadow: none; color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #17191b; --card: #202326; --side: #1c1e21; --text: #ecebe6; --muted: #a6a9ad; --line: #32363b; --line-strong: #41464c;
    --field: #1a1c1f; --hover: #2a2e32; --primary: #f35438; --primary-hover: #ff6a4f; --primary-text: #1a0904; --accent: #f35438;
    --accent-soft: #3a211b; --danger: #ff8a80; --ok: #5dd39e; --warn: #fdb022;
    --ok-bg: #12261d; --warn-bg: #2a2113; --danger-bg: #2c1716; --focus: #f35438;
    --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--bg); color: var(--text); overflow-wrap: break-word; }
a { color: var(--primary); text-underline-offset: 2px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 60; }
.skip:focus { left: 8px; }

/* iskelet: geniş ekranda sol kenar menü + içerik */
.shell { min-height: 100vh; }
header.top { background: var(--side); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 28px; height: 28px; flex: none; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.navwrap { display: flex; flex-direction: column; gap: 12px; padding: 4px 12px 16px; }
header.top nav { display: flex; flex-direction: column; gap: 2px; }
header.top nav a, .user > a { display: block; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
header.top nav a:hover, .user > a:hover { background: var(--hover); }
header.top a.on { background: var(--accent-soft); color: var(--primary); font-weight: 600; }
.user { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.logout { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 0 4px 0 12px; min-width: 0; }
.logout .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.btn.navtoggle { display: none; }
.user .themetoggle { align-self: flex-start; margin-left: 12px; }

main { padding: 20px 16px 48px; min-width: 0; }
.page-head { margin: 4px 0 20px; }
h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 6px; }
.lead { margin: 0; color: var(--muted); max-width: 760px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 6px; }

@media (min-width: 1024px) {
    .shell:not(.auth) { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
    .shell:not(.auth) header.top { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
    .shell:not(.auth) .topbar { padding: 16px 16px 14px; }
    .shell:not(.auth) .navwrap { flex: 1; justify-content: space-between; }
    .shell:not(.auth) main { padding: 28px var(--gut) 56px; max-width: 1360px; width: 100%; }
}
@media (max-width: 1023.98px) {
    .js .btn.navtoggle { display: inline-flex; }
    .js .navwrap { display: none; }
    .js .navwrap.open { display: flex; }
    .shell:not(.auth) header.top { position: sticky; top: 0; z-index: 30; }
}

/* girişsiz sayfalar ve tek kartlı sayfalar: ortalanmış dar sütun (başlık kartla aynı hizada) */
.auth header.top { background: transparent; border-bottom: 0; }
.auth .topbar { max-width: 480px; margin: 0 auto; padding: 28px 16px 4px; }
.auth main { max-width: 480px; margin: 0 auto; padding-top: 12px; }
.auth .page-head { text-align: center; }
.auth .lead { margin: 0 auto; }
main:has(> .card.narrow) { max-width: 640px; }
.shell:not(.auth) main:has(> .card.narrow) { margin: 0; }

/* kartlar, ızgaralar */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; min-width: 0; box-shadow: var(--shadow); }
.narrow { max-width: 640px; }
.card.narrow { margin-left: 0; margin-right: 0; }
.auth .card.narrow { max-width: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat b { display: block; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.empty { text-align: center; padding: 40px 16px; }
.empty p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }

/* tablolar: geniş tablo sarmalayıcı içinde kayar, sayfa kaymaz */
.tablewrap { position: relative; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; max-width: 100%; box-shadow: var(--shadow); }
.card .tablewrap { border: 0; box-shadow: none; margin-left: -20px; margin-right: -20px; max-width: none; border-radius: 0; }
.card .tablewrap:last-child { margin-bottom: -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tablewrap > table { min-width: 640px; }
td:first-child { min-width: 11em; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child > td { border-bottom: 0; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; background: var(--hover); white-space: nowrap; }
tbody tr:hover > td { background: color-mix(in srgb, var(--hover) 55%, transparent); }
td.warn, .warn-text { color: var(--warn); font-weight: 600; }
tr.notes td { padding-top: 0; }
tr.notes pre { margin: 0; white-space: pre-wrap; color: var(--muted); }
ul.kv { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.muted { color: var(--muted); }
.mono, code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.small, small { font-size: 13px; }
pre { background: var(--hover); padding: 12px; border-radius: var(--r-sm); overflow-x: auto; font-size: 12px; max-width: 100%; }

/* rozetler, uyarılar */
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; border: 1px solid transparent; color: var(--muted); background: var(--hover); }
.b-active { color: var(--ok); background: var(--ok-bg); }
.b-grace { color: var(--warn); background: var(--warn-bg); }
.b-suspended { color: var(--danger); background: var(--danger-bg); }
.b-cancelled { color: var(--muted); background: var(--hover); }
.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; border: 1px solid var(--line); border-left-width: 4px; background: var(--card); }
.flash.ok { border-color: var(--ok); background: var(--ok-bg); }
.flash.error { border-color: var(--danger); background: var(--danger-bg); }
.flash.warn { border-color: var(--warn); background: var(--warn-bg); }
.card > .flash:last-child { margin-bottom: 0; }

/* formlar */
.form label, .card > label, .field > label, form > label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.field { margin: 0 0 16px; min-width: 0; border: 0; padding: 0; }
fieldset.field legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 8px 10px; max-width: 100%; min-height: 38px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 0; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, form > input:not([type="hidden"]), .card > form > input:not([type="hidden"]) { display: block; width: 100%; }
form > input:not([type="hidden"]), form > textarea { margin-bottom: 14px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
textarea { resize: vertical; width: 100%; }
.help { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; margin: 4px 0 0; }
.field-error:empty { display: none; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 30px; }
label.check input { width: auto; margin: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 0 16px; }
.timepair { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.timepair label { font-weight: 400; margin: 0; }
.field .timepair input { display: inline-block; width: auto; }
details.advanced, details.manual { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; margin: 0 0 16px; }
details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 10px; }
details.card > summary { font-size: 15px; }

/* alan adı çipleri */
.chipbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 5px; background: var(--field); cursor: text; }
.chipbox:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.chipbox:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.chiplist { display: contents; list-style: none; margin: 0; padding: 0; }
.chipitem { display: inline-flex; align-items: center; gap: 4px; background: var(--hover); border: 1px solid var(--line); border-radius: 999px; padding: 1px 4px 1px 10px; max-width: 100%; overflow-wrap: anywhere; }
.chipx { border: 0; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 999px; }
.chipx:hover { color: var(--danger); }
.field .chipbox input.chipinput { border: 0; flex: 1 1 140px; min-width: 0; width: auto; padding: 4px; min-height: 0; outline: none; background: transparent; }

/* düğmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; min-height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.25; text-align: center; max-width: 100%; }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn.danger.solid { color: #1b0b0a; }
.btn.small { padding: 4px 10px; font-size: 13px; min-height: 30px; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 6px 6px 0; max-width: 100%; vertical-align: top; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mt { margin-top: 16px; }
input.tiny { width: 76px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters > input:not([type="hidden"]), .filters > select { display: inline-block; width: auto; flex: 0 1 240px; min-width: 0; margin: 0; }
.filters a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 14px; background: var(--card); }
.filters a.on, .filters a[aria-current] { background: var(--accent-soft); color: var(--primary); border-color: transparent; font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 16px; }
dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0 0 14px; }
dt { color: var(--muted); }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.confirm-extra { margin: 6px 0; flex-basis: 100%; }
.js .confirm-extra { display: none; }
.js .modal .confirm-extra { display: block; }

/* bağlantı kodu, 2FA */
.secret { border-color: var(--warn); border-left-width: 4px; }
.codeline { display: block; width: 100%; margin: 6px 0 8px; font-size: 13px; }
.secret textarea { margin-bottom: 8px; }
ol.steps { padding-left: 22px; margin-top: 0; }
ol.steps li { margin-bottom: 4px; }
.qr { display: flex; justify-content: center; margin: 8px 0 16px; }
.qr svg { max-width: 100%; height: auto; border-radius: 6px; background: #fff; padding: 8px; }
.secretkey { font-size: 17px; letter-spacing: 1px; background: var(--hover); padding: 8px 10px; border-radius: var(--r-sm); overflow-wrap: anywhere; }
ol.codes { columns: 2; font-size: 17px; padding-left: 26px; margin: 12px 0 16px; }
ol.codes li { margin-bottom: 6px; }

/* onay penceresi */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 17, 19, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--card); color: var(--text); border-radius: 12px; border: 1px solid var(--line); width: 100%; max-width: 460px; padding: 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.modal h2 { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.modal-extra label { display: block; font-weight: 600; margin-bottom: 4px; }
body.modal-open { overflow: hidden; }

@media (max-width: 760px) {
    main { padding: 16px 16px 40px; }
    h1 { font-size: 21px; }
    .card { padding: 16px; }
    .card .tablewrap { margin-left: -16px; margin-right: -16px; }
    th:first-child, td:first-child { padding-left: 16px; }
    th:last-child, td:last-child { padding-right: 16px; }
    ol.codes { columns: 1; }
    dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
    dt { margin-top: 8px; }
    label.check { margin-top: 0; margin-bottom: 16px; }
}
@media print {
    header.top, .actions, form, .flash { display: none !important; }
    .shell { display: block !important; }
    body { background: #fff; color: #000; }
    .card { border: 0; }
}
details.tech { margin-top: 2px; }
details.tech > summary { font-weight: 400; font-size: 12px; color: var(--muted); }
details.tech code { font-size: 12px; overflow-wrap: anywhere; }
tr.errors td { color: var(--danger); border-top: 0; }
tr.errors a { color: inherit; font-weight: 600; }
.flash.integrity h2 { color: var(--danger); margin-bottom: 6px; }
.flash.integrity h3 { margin: 10px 0 4px; font-size: 14px; }
ul.paths { margin: 0 0 6px; padding-left: 20px; font-size: 13px; overflow-wrap: anywhere; }
