/* =============================================================================
   turku-shipping — yönetim paneli tasarım sistemi
   Bağımlılık yok (tek dosya). Bileşen sınıfları eski şablonlarla uyumludur.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root {
    --bg: #f4f5fa;
    --bg-grad: radial-gradient(1200px 600px at 12% -10%, #e7e9ff 0%, rgba(231, 233, 255, 0) 55%),
               radial-gradient(900px 500px at 100% 0%, #e2f5f3 0%, rgba(226, 245, 243, 0) 45%);

    --surface: #ffffff;
    --surface-2: #fafbff;
    --border: #e6e8f0;
    --border-strong: #d6d9e6;

    --text: #101828;
    --text-soft: #475467;
    --muted: #7a8699;

    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-soft: #eef0ff;
    --accent: #0d9488;
    --accent-soft: #e6f6f4;

    --ok: #067647;
    --ok-soft: #e7f6ee;
    --warn: #b54708;
    --warn-soft: #fdf3e7;
    --danger: #b42318;
    --danger-soft: #fdecea;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 20px -14px rgba(16, 24, 40, .25);
    --shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 18px 40px -22px rgba(16, 24, 40, .35);

    --sidebar: 264px;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background-color: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text);
    font: 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; letter-spacing: .01em; margin: 20px 0 8px; font-weight: 650; }

p { margin: 0 0 10px; }

code {
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-soft);
    padding: 1px 6px;
    border-radius: 6px;
}

::selection { background: var(--primary-soft); }

/* ------------------------------------------------------------ app shell -- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c6cf5 45%, var(--accent) 130%);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px;
    box-shadow: var(--shadow-xs);
}

.sidebar__name { font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.sidebar__sub { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.sidebar__nav { padding: 12px 10px 6px; overflow-y: auto; flex: 1 1 auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 6px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }

.nav-group {
    display: block;
    padding: 14px 10px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-weight: 550;
    font-size: 14px;
    transition: background .15s ease, color .15s ease;
}

.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.nav-link.is-active {
    background: var(--primary-soft);
    color: var(--primary-600);
    font-weight: 650;
}

.nav-link.is-active svg { color: var(--primary); }

.nav-link svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); }
.nav-link:hover svg { color: var(--text-soft); }

.sidebar__foot {
    border-top: 1px solid var(--border);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.user-chip:hover { text-decoration: none; border-color: var(--border-strong); }

.avatar {
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff, #ccfbf1);
    color: var(--primary-600);
    display: grid; place-items: center;
    font-weight: 700; font-size: 12px;
}

.user-chip__mail { font-size: 12.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar__toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    width: 36px; height: 36px;
    cursor: pointer;
    color: var(--text-soft);
}

.topbar__spacer { margin-left: auto; }

.topbar__title {
    font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
    color: var(--muted); text-transform: uppercase;
}

.content { padding: 22px; max-width: 1400px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head__text { min-width: 0; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; max-width: 90ch; font-size: 13.5px; }

/* -------------------------------------------------------------- surfaces -- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card:hover { border-color: var(--border-strong); transition: border-color .2s ease; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }

/* ------------------------------------------------------------------ text -- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.meta { color: var(--muted); font-size: 13px; word-break: break-word; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----------------------------------------------------------------- stats -- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }

.card.stat {
    display: flex; flex-direction: column; gap: 4px;
    padding: 16px 18px; margin: 0;
    position: relative; overflow: hidden;
}
.card.stat::after {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    opacity: .9;
}
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-value.ok { color: var(--ok); }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat--flat::after { background: var(--border-strong); }

.stats { display: flex; flex-wrap: wrap; gap: 22px; align-items: baseline; }
.stats > div { display: flex; flex-direction: column; }
.stats > div span { color: var(--muted); font-size: 12.5px; }
.stats > div strong { font-size: 21px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- buttons -- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font: inherit; font-size: 13.5px; font-weight: 600;
    box-shadow: var(--shadow-xs);
    transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.btn:hover { border-color: #b9bed0; text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(180deg, #5b52ea, var(--primary-600));
    border-color: var(--primary-600);
    color: #fff;
}
.btn-primary:hover { filter: brightness(1.06); border-color: var(--primary-600); color: #fff; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn:focus-visible, .nav-link:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(180deg, rgba(244, 245, 250, 0), var(--bg) 40%); }

/* ---------------------------------------------------------------- forms -- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="file"], input[type="date"], input[type="color"], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit; font-size: 14px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #c3c8d8; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); outline: none; }

textarea { min-height: 120px; resize: vertical; }
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; }
input[type="file"] { padding: 8px 10px; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8699' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 34px;
}

label { display: block; margin: 14px 0 5px; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
label code { text-transform: none; }

.check { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: var(--text); font-size: 14px; text-transform: none; letter-spacing: 0; }
.check input { width: auto; }

.inline-check { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 13.5px; color: var(--text-soft); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.inline-check input[type="checkbox"], .inline-check input[type="radio"] { width: auto; min-width: 0; flex: 0 0 auto; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

.filters {
    display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 8px;
}
.filters label { margin: 0 0 4px; }
.filters select, .filters input { width: auto; min-width: 170px; }
.filters .inline-check { align-self: center; padding-bottom: 4px; }
.bulk-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* --------------------------------------------------------------- tables -- */
.table-scroll { overflow-x: auto; border-radius: var(--radius); }

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 13.5px;
}
.table th {
    text-align: left;
    padding: 11px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcff; }
.table tbody tr.row-muted td { background: var(--surface-2); color: var(--muted); }
.table td.is-missing { background: #fff8ed; }
.table td.is-missing input { border-color: #f3c188; background: #fffdf7; }
.table-inputs input { min-width: 150px; }
.table-inputs th:first-child, .table-inputs td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 190px; }
.c { text-align: center; }

/* --------------------------------------------------------------- badges -- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-soft);
    white-space: nowrap;
}
.match-matched { background: var(--ok-soft); border-color: #bfe6d1; color: var(--ok); }
.match-no_tracking { background: var(--warn-soft); border-color: #f5d9ae; color: var(--warn); }
.match-no_match { background: #f1f2f6; border-color: var(--border-strong); color: var(--text-soft); }
.match-error { background: var(--danger-soft); border-color: #f5c9c3; color: var(--danger); }
.match-pending { background: var(--primary-soft); border-color: #ccd2fb; color: var(--primary-600); }
.role-admin { background: #f2ecfe; border-color: #ddd0fb; color: #6941c6; }
.role-operator { background: #e8f4fd; border-color: #c7e2f7; color: #0b6a9c; }

/* status pills used inline in tables */
.pill { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 650; }
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--off { background: #f1f2f6; color: var(--text-soft); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------- flashes -- */
.flash {
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font-size: 14px;
    display: flex; gap: 10px; align-items: flex-start;
}
.flash::before { content: ""; width: 3px; align-self: stretch; border-radius: 3px; background: var(--primary); }
.flash-success { background: var(--ok-soft); border-color: #bfe6d1; color: #04543a; }
.flash-success::before { background: var(--ok); }
.flash-warning { background: var(--warn-soft); border-color: #f5d9ae; color: #7a3c07; }
.flash-warning::before { background: var(--warn); }
.flash-danger { background: var(--danger-soft); border-color: #f5c9c3; color: #8a1c10; }
.flash-danger::before { background: var(--danger); }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.alert-danger { background: var(--danger-soft); border-color: #f5c9c3; color: var(--danger); }
.errors { margin: 8px 0 12px; padding-left: 18px; color: var(--danger); font-size: 13px; }
.errors li { margin-bottom: 3px; }

.empty {
    padding: 26px 20px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
}

/* ------------------------------------------------------ key/value lists -- */
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }

ul.kv { display: block; list-style: none; padding: 0; }
ul.kv li { display: grid; grid-template-columns: 200px 1fr; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
ul.kv li:last-child { border-bottom: 0; }
ul.kv li span:first-child { color: var(--muted); font-size: 12.5px; }

.count-list { list-style: none; margin: 0; padding: 0; }
.count-list li { border-bottom: 1px solid var(--border); }
.count-list li:last-child { border-bottom: 0; }
.count-list a { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.count { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- charts -- */
.chart-card { padding: 16px 18px 8px; }
.chart-card__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-card__head h2 { margin: 0; }
.chart-card__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chart { width: 100%; height: 300px; }
.chart--tall { height: 340px; }
.chart--sm { height: 240px; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13.5px; }

/* legacy CSS bar charts (kept for compatibility) */
.barchart { display: block; height: 10px; background: #eef0f6; border-radius: var(--radius-pill); overflow: hidden; }
.barchart__bar { display: block; float: left; height: 100%; border-radius: var(--radius-pill); }
.barchart__bar--pv { background: linear-gradient(90deg, var(--primary), #7c6cf5); }
.barchart__bar--search { background: linear-gradient(90deg, var(--accent), #34d3c4); }
.legend { margin: 10px 0 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot--pv { background: var(--primary); }
.dot--search { background: var(--accent); }

details.details > summary {
    cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--text-soft);
    padding: 8px 0; list-style: none;
}
details.details > summary::-webkit-details-marker { display: none; }
details.details > summary::before { content: "▸ "; color: var(--muted); }
details.details[open] > summary::before { content: "▾ "; }

/* ---------------------------------------------------------------- icons -- */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.icon-card {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 12px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); text-align: center;
}
.icon-card.is-final { border-color: #bfe6d1; background: #f7fdfa; }
.icon-card img { width: 26px; height: 26px; object-fit: contain; }

.icon-row { display: flex; align-items: center; gap: 10px; }
.icon-row img { width: 26px; height: 26px; object-fit: contain; }

.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] { width: 48px; flex: 0 0 48px; }

/* ------------------------------------------------------- live preview --- */
.tq-preview {
    --tq-primary: #4f46e5;
    --tq-text: #101828;
    --tq-muted: #7a8699;
    --tq-bg: #ffffff;
    --tq-done: #067647;
    --tq-pending: #dfe3ec;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--tq-bg);
    color: var(--tq-text);
    box-shadow: var(--shadow-xs);
}
.tq-preview h3 { margin: 0 0 12px; font-size: 16px; }
.tq-preview__search { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--tq-muted); font-size: 13px; }
.tq-preview__search .btn { margin-left: auto; background: var(--tq-primary); border-color: var(--tq-primary); color: #fff; }
.tq-preview__info { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 16px; margin: 14px 0; }
.tq-preview__info > div { display: flex; flex-direction: column; }
.tq-preview__info span { color: var(--tq-muted); font-size: 12px; }
.tq-preview__timeline { list-style: none; margin: 0; padding: 0; }
.tq-preview__timeline li { display: flex; gap: 10px; padding: 7px 0 7px 12px; border-left: 2px solid var(--tq-pending); }
.tq-preview__timeline li.is-current { border-left-color: var(--tq-done); }
.tq-preview__timeline small { color: var(--tq-muted); }
.tq-preview__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--tq-pending); }
.tq-preview__timeline li.is-current .tq-preview__dot { background: var(--tq-done); }
.tq-preview__note { margin-top: 10px; font-size: 12px; color: var(--tq-muted); }

/* ---------------------------------------------------------------- login -- */
body.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-wrap {
    width: 100%; max-width: 420px;
    display: flex; flex-direction: column; align-items: stretch; gap: 18px;
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px 28px 26px;
    box-shadow: var(--shadow-md);
    margin: 0;
}
.login-brand {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    text-align: left;
}
.login-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.login-brand strong { font-size: 15.5px; }
.login-brand h1 { font-size: 20px; margin: 0; }
.login-card label { margin-top: 14px; }
.login-card .btn { margin-top: 18px; }
.login-card .muted.small { font-size: 12.5px; }

/* --------------------------------------------------------------- footer -- */
.footer {
    padding: 18px 22px 26px;
    color: var(--muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ----------------------------------------------------------- responsive -- */
@media (max-width: 1080px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-md);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .topbar__toggle { display: inline-grid; place-items: center; }
    .content { padding: 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .kv, ul.kv li { grid-template-columns: 1fr; gap: 4px; }
    h1 { font-size: 22px; }
    .stat-value { font-size: 24px; }
}

@media (max-width: 640px) {
    .cards { grid-template-columns: 1fr 1fr; }
    .filters { gap: 8px; }
    .filters select, .filters input { min-width: 140px; }
}

/* eski şablonlarla uyumluluk: .main-bare (giriş sayfası sarmalayıcı) */
.main-bare { display: block; }

/* --------------------------------------------------- iframe/embed sayfası
   Sipariş satırındaki modal bu görünümü yükler: panel kabuğu yok, admin.css var. */
.embed-page { padding: 16px 16px 24px; background: var(--bg); min-height: 100vh; }
.embed-page .grid-2 { grid-template-columns: 1fr; }
.embed-page h1 { font-size: 20px; margin-top: 0; }

/* müşteri bilgisi hücresi (sipariş listesi) */
.cust { display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.cust__name { font-weight: 600; }
.cust a { color: var(--primary); text-decoration: none; }
.cust a:hover { text-decoration: underline; }
.cust--empty { color: var(--muted); }

/* --------------------------------------------------------------- sekmeler */
.tabs { display: flex; gap: 6px; margin: 0 0 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; margin-bottom: -1px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
    border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--text); background: var(--surface-2, rgba(0,0,0,.03)); }
.tab.is-active { color: var(--text); background: var(--surface); border-color: var(--border); }
.tab__count {
    background: var(--primary); color: #fff; border-radius: 999px;
    padding: 1px 8px; font-size: 12px; font-variant-numeric: tabular-nums;
}
.tab:not(.is-active) .tab__count { background: var(--muted); opacity: .75; }

/* --------------------------------------------------- satır içi bağlantı butonu */
.link-btn {
    background: none; border: 0; padding: 0; margin: 0;
    color: var(--primary); font: inherit; cursor: pointer; text-align: left;
    border-bottom: 1px dashed currentColor; line-height: 1.35;
}
.link-btn:hover { color: var(--text); }

/* --------------------------------------------------------------- modal */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); }
.modal__box {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    width: min(900px, calc(100vw - 32px)); height: min(88vh, 900px);
    background: var(--surface); border-radius: 12px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.modal__head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    background: var(--surface-2, rgba(0,0,0,.02));
}
.modal__head .btn { margin-left: auto; }
.modal__hint { color: var(--muted); font-size: 12.5px; }
.modal__frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }

@media (max-width: 640px) {
    .modal__box { width: 100vw; height: 100vh; border-radius: 0; }
    .modal__hint { display: none; }
}
