/* ==========================================================
   Yönetim paneli + kurulum sihirbazı
   Marka rengi --brand ayarlardan gelir; panel her zaman açık temadır.
   ========================================================== */
:root {
    --brand: #0f766e;
    --brand-contrast: #fff;
    --brand-soft: color-mix(in oklab, var(--brand) 9%, #fff);
    --brand-soft-2: color-mix(in oklab, var(--brand) 16%, #fff);
    --brand-ink: color-mix(in oklab, var(--brand) 80%, #000);
    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --text: #18181b;
    --text-2: #3f3f46;
    --muted: #71717a;
    --line: #ececef;
    --line-strong: #dcdce1;
    --success: #16a34a;
    --success-ink: #15803d;
    --danger: #dc2626;
    --warning: #d97706;
    --warning-ink: #b45309;
    --info: #0284c7;
    --radius: 18px;
    --radius-sm: 10px;
    --shadow-xs: 0 1px 2px rgba(24, 24, 27, .04);
    --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 4px 16px -6px rgba(24, 24, 27, .06);
    --shadow-lg: 0 20px 50px -12px rgba(24, 24, 27, .22);
    --ring: 0 0 0 4px color-mix(in oklab, var(--brand) 16%, transparent);
    --sidebar: 264px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--font-body); background: var(--bg); color: var(--text);
    font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 24px; margin: 0 0 6px; font-weight: 750; }
h2 { font-size: 16px; margin: 0 0 14px; font-weight: 650; }
.h3, h3 { font-size: 14.5px; margin: 0 0 10px; font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.big-emoji { font-size: 48px; line-height: 1; margin-bottom: 8px; }

/* ---------- Kenar çubuğu ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar);
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--line);
    transition: transform .3s var(--ease), width .2s var(--ease);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px;
    color: var(--text); text-decoration: none !important;
}
.sidebar-brand img, .sidebar-logo {
    width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none;
}
.sidebar-logo {
    display: grid; place-items: center; font-weight: 800; font-size: 17px;
    background: var(--brand); color: var(--brand-contrast);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.sidebar-brand-text { min-width: 0; display: grid; line-height: 1.25; }
.sidebar-brand-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand-text small { color: var(--muted); font-size: 12px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-section {
    margin: 18px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: #a1a1aa;
}
.nav-link {
    position: relative; display: flex; align-items: center; gap: 11px;
    height: 40px; padding: 0 12px; margin: 1px 0; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 550; text-decoration: none !important;
    transition: background .15s, color .15s;
}
.nav-link .icon { color: #a1a1aa; transition: color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link:hover .icon { color: var(--text-2); }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.nav-link.is-active .icon { color: var(--brand); }
.nav-link.is-active::before {
    content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--brand);
}
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.sidebar-cta {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
    background: var(--surface-2); color: var(--text); text-decoration: none !important;
    transition: background .15s;
}
.sidebar-cta:hover { background: var(--brand-soft); }
.sidebar-cta-icon {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
    background: var(--surface); color: var(--brand); box-shadow: var(--shadow-xs);
}
.sidebar-cta > span:nth-child(2) { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.sidebar-cta strong { font-size: 13px; }
.sidebar-cta small { color: var(--muted); font-size: 11.5px; }
.sidebar-cta-arrow { width: 15px; height: 15px; color: var(--muted); }
.sidebar-version { margin: 10px 4px 0; font-size: 11px; color: #a1a1aa; }
.sidebar-backdrop { display: none; }

/* ---------- Ana alan ---------- */
.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s var(--ease); }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 17px; font-weight: 650; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.content { padding: 28px; max-width: 1240px; width: 100%; }

.icon-btn {
    width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
    background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--text-2);
}

.dropdown { position: relative; }
.dropdown summary {
    list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
    height: 40px; padding: 0 10px 0 4px; border-radius: 999px; color: var(--text-2);
    border: 1px solid var(--line-strong); background: var(--surface); transition: box-shadow .15s;
}
.dropdown summary:hover { box-shadow: var(--shadow); }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary .icon { width: 15px; height: 15px; color: var(--muted); }
.dropdown-name { font-weight: 600; font-size: 13.5px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--brand); color: var(--brand-contrast); font-weight: 700; font-size: 13px;
}
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
    padding: 6px; animation: pop .16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dropdown-head { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-head small { color: var(--muted); }
.dropdown-head .badge { justify-self: start; margin-top: 6px; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 9px; background: none; border: 0;
    font: inherit; color: var(--text-2); text-decoration: none !important; cursor: pointer;
}
.dropdown-menu .icon { width: 16px; height: 16px; color: var(--muted); }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 35;
        background: rgba(24, 24, 27, .35); backdrop-filter: blur(2px);
    }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-grid; }
    .content { padding: 18px 16px 40px; }
    .topbar { padding: 0 16px; }
    .hide-sm { display: none !important; }
}

/* ---------- Kartlar ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-xs); padding: 22px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 18px 22px 0; }
.card-flush > .table-wrap .table th:first-child, .card-flush > .table-wrap .table td:first-child { padding-left: 22px; }
.card-flush > .table-wrap .table th:last-child, .card-flush > .table-wrap .table td:last-child { padding-right: 22px; }
.card-title-icon {
    width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); flex: none;
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; max-width: 640px; }

.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .layout-2 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { gap: 10px; } }

.stat { padding: 18px 20px; display: grid; gap: 4px; position: relative; }
.stat-icon {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px;
    background: var(--brand-soft); color: var(--brand);
}
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat.is-warning .stat-icon { background: #fef3c7; color: var(--warning-ink); }
.stat.is-warning { border-color: #fde68a; }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 14px; text-decoration: none !important; cursor: pointer; white-space: nowrap;
    transition: background .15s, box-shadow .15s, transform .1s, filter .15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: var(--brand); color: var(--brand-contrast);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(24, 24, 27, .12);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #27272a; }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.otp-input {
    text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 26px !important; font-weight: 700; letter-spacing: .4em; height: 56px !important;
}
.alert code { font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: #fef2f2; }
.choice-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.choice-row input { accent-color: var(--brand); margin-top: 3px; }
.choice-row > span { display: grid; gap: 2px; }
.choice-row small { color: var(--muted); font-size: 12.5px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: 0; color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; padding: 0;
}
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-link.danger { color: var(--danger); }
.btn-link .icon { width: 15px; height: 15px; }
form.inline { display: inline; }

/* ---------- Formlar ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.field > span small { font-weight: 400; color: var(--muted); }
.field small, .help { color: var(--muted); font-size: 12.5px; }
.help { margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=time], input[type=url], input[type=tel], input:not([type]), select, textarea {
    width: 100%; height: 42px; padding: 0 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
    font: inherit; outline: none; box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .15s;
}
select {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
textarea { height: auto; min-height: 88px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #a1a1aa; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
input[type=file] { font: inherit; font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button {
    font: inherit; font-weight: 600; font-size: 13px; margin-right: 10px; cursor: pointer;
    height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--text-2);
}
.field-error { color: var(--danger); font-size: 12.5px; margin: 0; font-weight: 500; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon {
    display: grid; place-items: center; padding: 0 13px; flex: none;
    border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--surface-2); color: var(--muted); font-weight: 600;
}
/* Önek olarak (ör. site adresi + panel adresi) */
.input-group .addon:first-child {
    border-left: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 42px; font-weight: 500;
}
.input-group .addon:first-child + input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; min-width: 0; }

.check {
    display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    transition: border-color .15s, background .15s;
}
.check:hover { border-color: var(--line-strong); }
.check:has(input:checked) { border-color: color-mix(in oklab, var(--brand) 40%, transparent); background: var(--brand-soft); }
.check input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.check-inline { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.check-inline input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }

.switch {
    appearance: none; -webkit-appearance: none; flex: none; margin: 0;
    width: 40px; height: 24px; border-radius: 12px; background: #d4d4d8;
    position: relative; cursor: pointer; transition: background .2s; vertical-align: middle;
}
.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease);
}
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { box-shadow: var(--ring); outline: 0; }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.switch-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; color: var(--text-2); }

.image-field { display: flex; gap: 16px; align-items: center; }
.image-preview {
    width: 96px; height: 96px; border-radius: 16px; flex: none;
    border: 1px dashed var(--line-strong); background: var(--surface-2) center / cover no-repeat;
    display: grid; place-items: center; color: #a1a1aa;
}
.image-preview .icon { width: 28px; height: 28px; }
.image-preview.wide { width: 100%; height: 120px; }
.image-preview[style] { border-style: solid; border-color: var(--line); }

/* Alerjen seçimi: Yok / Eser / İçerir */
.allergen-matrix { display: grid; gap: 6px; }
.allergen-item {
    display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 12px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    transition: border-color .15s, background .15s;
}
.allergen-item .ai-icon { font-size: 18px; width: 24px; text-align: center; }
.allergen-item .ai-name { flex: 1; min-width: 0; font-weight: 550; font-size: 14px; }
.allergen-item .ai-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.allergen-item.is-contains { border-color: #fecaca; background: #fef7f7; }
.allergen-item.is-may { border-color: #fde68a; background: #fffcf0; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); flex: none; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: block; padding: 5px 11px; border-radius: 7px;
    font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); transition: all .15s;
}
.segmented span:hover { color: var(--text); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--line); }
.segmented input[value=may_contain]:checked + span { background: var(--warning); color: #fff; box-shadow: none; }
.segmented input[value=contains]:checked + span { background: var(--danger); color: #fff; box-shadow: none; }
.segmented input:focus-visible + span { box-shadow: var(--ring); }
.allergen-matrix.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .allergen-matrix.compact { grid-template-columns: 1fr; } }

.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-select label { position: relative; }
.chip-select input { position: absolute; opacity: 0; pointer-events: none; }
.chip-select span {
    display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 999px;
    border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; cursor: pointer;
    background: var(--surface); color: var(--text-2); transition: all .15s;
}
.chip-select input:checked + span { background: var(--chip, var(--brand)); border-color: var(--chip, var(--brand)); color: #fff; }
.chip-select input:focus-visible + span { box-shadow: var(--ring); }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody:last-child tr:last-child td, .table tr:last-child td { border-bottom: 0; }
.table tbody tr:not(.group-row):hover td { background: #fafafb; }
.table-compact td { padding: 9px 4px; }
.table .thumb {
    width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
    background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center;
    font-weight: 750; font-size: 16px;
}
.table .thumb-empty { background: var(--surface-2); color: var(--muted); }
.table .thumb-empty .icon { width: 20px; height: 20px; stroke-width: 1.5; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: 14px; }
.table tr.is-muted td > * { opacity: .55; }
.group-row td {
    background: var(--surface-2) !important; font-weight: 650; font-size: 12.5px; color: var(--text-2);
    padding-top: 9px !important; padding-bottom: 9px !important;
}
.drag-handle { cursor: grab; color: #c4c4cc; user-select: none; width: 32px; }
.drag-handle .icon { width: 16px; height: 16px; display: block; }
.drag-handle:hover { color: var(--muted); }
tr.is-dragging, .option-row.is-dragging { opacity: .4; }
.row-title { font-weight: 600; color: var(--text); }
.row-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ---------- Rozet, uyarı ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge-success { background: #dcfce7; color: var(--success-ink); }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: var(--warning-ink); }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-brand { background: var(--brand-soft-2); color: var(--brand-ink); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.icons { letter-spacing: 1px; font-size: 15px; }
.icons .trace { opacity: .38; filter: grayscale(.6); }

.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 13px 15px; border-radius: 14px; margin-bottom: 18px; border: 1px solid; font-weight: 500;
    animation: pop .2s var(--ease);
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert p { margin: 4px 0 0; font-weight: 400; }
.alert a { color: inherit; text-decoration: underline; font-weight: 650; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); }
.checklist .tick {
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
    border: 2px solid var(--line-strong); color: transparent;
}
.checklist .tick .icon { width: 13px; height: 13px; }
.checklist .is-done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.checklist .is-done span:last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: #d4d4d8; }
.checklist a { font-weight: 600; color: var(--text); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 16px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .empty-icon {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand);
}
.empty-state .empty-icon .icon { width: 26px; height: 26px; }
.empty-state h2 { margin-bottom: 4px; }
.empty-state p { margin: 0 0 16px; }

/* ---------- Modül kartları ---------- */
.module-card { display: flex; gap: 16px; align-items: flex-start; }
.module-icon {
    font-size: 24px; width: 48px; height: 48px; display: grid; place-items: center; flex: none;
    background: var(--brand-soft); border-radius: 14px;
}
.module-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; }
.module-card p { margin: 0; color: var(--muted); }
.module-card .switch { margin-left: auto; margin-top: 4px; }
.perm-row {
    display: flex; align-items: center; gap: 16px; padding: 13px 22px;
    border-top: 1px solid var(--line); cursor: pointer;
}
.perm-row > span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.perm-row strong { font-weight: 600; }
.perm-row small { color: var(--muted); font-size: 12.5px; }
.perm-row:hover { background: var(--surface-2); }


/* ---------- Seçenek satırları ---------- */
.option-rows { display: grid; gap: 10px; }
.option-row { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 12px; }
.option-row-main { display: grid; grid-template-columns: 24px minmax(0, 1fr) 130px auto auto auto; gap: 10px; align-items: center; }
.option-row details { margin-top: 10px; }
.option-row summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.option-row summary .icons { margin-left: 6px; }
.option-row .allergen-matrix { margin-top: 10px; }
@media (max-width: 700px) {
    .option-row-main { grid-template-columns: 1fr 1fr; }
    .option-row-main .drag-handle { display: none; }
}

/* ---------- QR ---------- */
.qr-frame {
    padding: 16px; border-radius: 18px; background: var(--surface-2);
    display: grid; place-items: center;
}
.qr-preview { width: 168px; height: 168px; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #fff; }
.qr-preview svg { width: 100%; height: 100%; display: block; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text-2); }

dialog.modal {
    border: 0; border-radius: 22px; padding: 26px; width: min(440px, calc(100vw - 32px));
    box-shadow: var(--shadow-lg);
}
dialog.modal[open] { animation: pop .2s var(--ease); }
dialog.modal::backdrop { background: rgba(24, 24, 27, .4); backdrop-filter: blur(3px); }
dialog.modal h2 { margin-bottom: 4px; font-size: 19px; }
dialog.modal-wide { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }

/* Hazır ürün görselleri */
.search-field {
    display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.search-field .icon { color: var(--muted); width: 17px; height: 17px; }
.search-field input { border: 0 !important; box-shadow: none !important; padding: 0; height: 100%; background: transparent; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery-item {
    display: grid; gap: 6px; padding: 6px; border-radius: 14px; cursor: pointer; text-align: left;
    border: 1.5px solid var(--line); background: var(--surface); font: inherit; color: var(--text);
    transition: border-color .15s, transform .15s;
}
.gallery-item:hover { border-color: var(--line-strong); }
.gallery-item:active { transform: scale(.98); }
.gallery-item.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.gallery-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.gallery-item span { display: grid; font-size: 12.5px; font-weight: 600; line-height: 1.3; padding: 0 2px 2px; }
.gallery-item small { color: var(--muted); font-weight: 500; font-size: 11.5px; }

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 100;
    transform: translate(-50%, 140px); transition: transform .35s var(--ease);
    background: var(--text); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 550;
    box-shadow: var(--shadow-lg);
}
.toast.is-visible { transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

/* ---------- Görünüm (tema) ayarları ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 10px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span {
    display: block; aspect-ratio: 1; border-radius: 14px; cursor: pointer; background: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .15s var(--ease);
}
.swatch span:hover { transform: scale(1.06); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch input:checked + span::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 8px;
    border: solid var(--ck, #fff); border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg);
}
.swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }
.custom-color { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.custom-color input[type=color] {
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; cursor: pointer; background: none;
}
.custom-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .1); border-radius: 14px; }
.custom-color input[type=text] { width: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
    display: grid; gap: 4px; height: 100%; padding: 14px; border-radius: 14px; cursor: pointer;
    border: 1.5px solid var(--line); background: var(--surface); transition: border-color .15s, background .15s;
}
.choice > span:hover { border-color: var(--line-strong); }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.choice input:focus-visible + span { box-shadow: var(--ring); }
.choice .choice-sample { font-size: 26px; line-height: 1.1; font-weight: 700; color: var(--text); }
.choice strong { font-size: 13.5px; }
.choice small { color: var(--muted); font-size: 12px; }
.choice .icon { width: 22px; height: 22px; color: var(--brand); }
.cover-choices .choice > span { padding: 8px 8px 12px; }
.cover-thumb {
    display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 6px;
    border-radius: 10px; background: var(--surface-2) center / cover no-repeat;
}
.cover-thumb.is-empty { border: 1.5px dashed var(--line-strong); }
.cover-thumb.is-empty .icon { color: var(--muted); }
.cover-choices strong, .cover-choices small { padding: 0 4px; }
.cover-upload { display: grid; gap: 6px; margin-top: 12px; }

/* Canlı önizleme (telefon) */
.settings-layout { grid-template-columns: minmax(0, 1fr) 320px; }
.settings-aside { position: sticky; top: 84px; }
@media (max-width: 1100px) { .settings-layout { grid-template-columns: 1fr; } .settings-aside { position: static; } }
.phone {
    width: 300px; max-width: 100%; margin: 0 auto; padding: 10px; border-radius: 44px;
    background: #18181b; box-shadow: var(--shadow-lg), inset 0 0 0 2px #3f3f46;
}
.phone-screen { height: 560px; border-radius: 34px; overflow: hidden; position: relative; }
.phone iframe { width: 390px; height: 746px; border: 0; transform: scale(.7333); transform-origin: 0 0; display: block; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 90px; height: 24px; border-radius: 14px; background: #18181b; z-index: 2; }
.preview-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }

/* ---------- Kurulum & giriş ---------- */
.auth-body { min-height: 100vh; background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.auth-aside {
    position: relative; overflow: hidden; isolation: isolate;
    color: var(--brand-contrast);
    background:
        radial-gradient(80% 60% at 0% 0%, color-mix(in oklab, var(--brand) 55%, #fff), transparent 70%),
        radial-gradient(80% 80% at 100% 100%, color-mix(in oklab, var(--brand) 50%, #000), transparent 70%),
        var(--brand);
}
.auth-aside::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, var(--brand-contrast) 14%, transparent) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent);
    -webkit-mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent);
}
.auth-aside-inner { height: 100%; display: flex; flex-direction: column; padding: 44px 48px; }
.auth-mark { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.auth-mark img, .auth-mark span {
    width: 44px; height: 44px; border-radius: 14px; object-fit: cover; display: grid; place-items: center;
    background: color-mix(in srgb, var(--brand-contrast) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-contrast) 24%, transparent);
}
.auth-pitch { margin: auto 0; max-width: 420px; }
.auth-pitch h2 { color: inherit; font-size: 40px; line-height: 1.08; letter-spacing: -.035em; font-weight: 800; margin: 0 0 16px; }
.auth-pitch p { opacity: .85; font-size: 16px; margin: 0 0 24px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-pitch li { display: flex; gap: 10px; align-items: center; font-weight: 550; }
.auth-pitch li .icon {
    width: 22px; height: 22px; padding: 4px; border-radius: 50%;
    background: color-mix(in srgb, var(--brand-contrast) 18%, transparent);
}
.auth-aside-foot { margin: 0; opacity: .6; font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-shell { width: 100%; max-width: 460px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 6px; font-size: 26px; letter-spacing: -.025em; }
.auth-card > p.muted { margin-top: 0; margin-bottom: 22px; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 550; min-width: 0; }
.steps li em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li span {
    width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--surface); border: 1.5px solid var(--line-strong); font-weight: 700; font-size: 11.5px;
}
.steps li span .icon { width: 13px; height: 13px; }
.steps li.current { color: var(--text); }
.steps li.current span { border-color: var(--brand); color: var(--brand); box-shadow: var(--ring); }
.steps li.done span { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.req-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 6px; }
.req-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.done-icon {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand);
}
.done-icon .icon { width: 30px; height: 30px; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-grid .choice > span { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; padding: 12px; }
.type-grid .choice .emoji { font-size: 22px; grid-row: span 2; }

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { padding: 24px 16px; align-items: start; }
    .auth-card { padding: 24px; }
    .steps li em { display: none; }
    .steps li { flex: none; }
}

/* Izgara ve yığın içindeki kartlar arasına ekstra üst boşluk ekleme */
.grid > .card, .grid-2 > .card, .grid-3 > .card, .grid-4 > .card, .stack > .card, .layout-2 > .card, .layout-2 > form.card { margin-top: 0; }

/* Daraltılmış kenar çubuğu (masaüstü): yalnızca ikonlar, adlar üzerine gelince ipucu olarak görünür */
@media (min-width: 961px) {
    body.sidebar-collapsed { --sidebar: 76px; }
    body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .nav-link span,
    body.sidebar-collapsed .sidebar-cta > span:nth-child(2),
    body.sidebar-collapsed .sidebar-cta-arrow,
    body.sidebar-collapsed .sidebar-version { display: none; }
    body.sidebar-collapsed .nav-section { margin: 12px 8px 6px; height: 1px; background: var(--line); font-size: 0; }
    body.sidebar-collapsed .sidebar-nav { scrollbar-width: none; }
    body.sidebar-collapsed .sidebar-nav::-webkit-scrollbar { display: none; }
    body.sidebar-collapsed .nav-link { justify-content: center; padding: 0; }
    body.sidebar-collapsed .sidebar-cta { justify-content: center; padding: 8px; }
}
.image-field { flex-wrap: wrap; align-items: flex-start; }
.image-field > .stack { min-width: 0; flex: 1 1 160px; }
input[type=file] { max-width: 100%; }
.swatches { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
.switch:checked { background: var(--success); }
.table .actions a:not(.btn) { color: var(--text-2); font-weight: 600; }
.table .actions a:not(.btn):hover { color: var(--text); }
@media (max-width: 1100px) {
    .layout-2, .settings-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .allergen-item { flex-wrap: wrap; }
    .allergen-item .segmented { margin-left: auto; }
    .page-head .row input, .page-head .row select { width: 100% !important; }
    .page-head .row { width: 100%; }
}
.stack, .form, .field { grid-template-columns: minmax(0, 1fr); }
.allergen-matrix:not(.compact) { grid-template-columns: minmax(0, 1fr); }
.allergen-item .ai-name { flex: 1 1 140px; }
.field { align-content: start; }

/* ---------- Kasa ---------- */
.kasa { max-width: 720px; margin: 0 auto; display: grid; gap: 16px; }
.kasa-camera {
    position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden;
    background: #0b0b0d; margin-bottom: 18px;
}
.kasa-camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.kasa-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.kasa-frame span {
    width: 58%; aspect-ratio: 1; border-radius: 22px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); border: 3px solid rgba(255, 255, 255, .9);
}
.kasa-camera-off {
    position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
    padding: 24px; text-align: center; background: var(--surface-2); color: var(--text);
}
.kasa-camera-off small { max-width: 360px; color: var(--muted); }
.kasa-camera-off .btn { margin-top: 6px; }
.kasa-manual input { font-size: 15px; }
.kasa-cust-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kasa-cust-head > div { flex: 1; min-width: 160px; }
.kasa-avatar { width: 48px; height: 48px; font-size: 20px; }
.kasa-progress { margin: 20px 0 6px; }
.kasa-stamps { display: flex; flex-wrap: wrap; gap: 8px; }
.kasa-stamp {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
    border: 2px dashed var(--line-strong); background: var(--surface);
}
.kasa-stamp.is-on { background: var(--brand); border: 2px solid var(--brand); }
.kasa-stamp.is-gift { border-style: solid; }
.kasa-stamp.is-gift.is-on { background: #fbbf24; border-color: #fbbf24; }
.kasa-progress-text { margin: 10px 0 0; font-weight: 650; font-size: 15px; }
.kasa-reward {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 4px;
    padding: 14px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a;
}
.kasa-reward > div { flex: 1; min-width: 160px; }
.kasa-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.stepper .btn { border: 0; border-radius: 0; height: 52px; width: 52px; font-size: 22px; box-shadow: none; }
.stepper output { min-width: 44px; text-align: center; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.kasa-stamp-btn { flex: 1; height: 54px; font-size: 16px; min-width: 200px; }
.kasa-history { list-style: none; margin: 0; padding: 0; display: grid; }
.kasa-history li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.kasa-history li:last-child { border-bottom: 0; }
.kasa-history li.is-voided { opacity: .5; text-decoration: line-through; }
.kh-label { font-weight: 650; }
.kh-meta { color: var(--muted); font-size: 12.5px; flex: 1; }

/* ---------- Sadakat ---------- */
.rule-sentence { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; font-weight: 600; }
.rule-sentence input[type=number] { width: 84px; text-align: center; font-size: 20px; font-weight: 750; height: 50px; }
.rule-sentence input:not([type]) { flex: 1; min-width: 200px; height: 50px; font-size: 16px; font-weight: 600; }
.rule-preview { padding: 18px; border-radius: 16px; color: var(--brand-contrast); background: var(--brand); }
.rule-preview p { margin: 12px 0 0; }
.rule-preview-dots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rule-preview-dots i { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--brand-contrast) 50%, transparent); font-style: normal; display: grid; place-items: center; font-size: 12px; }
.rule-preview-dots i.on { background: var(--brand-contrast); border-style: solid; }
.rule-preview-dots i.gift { border-style: solid; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; }
.mini-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.mini-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.mini-dots i.on { background: var(--brand); }
.stat-value-sm { font-size: 22px; }
.customer-stats .stat { padding: 16px 18px; }
@media (max-width: 1400px) and (min-width: 1101px) { .customer-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
