/* ==========================================================================
   Kısalt – panel arayüzü
   Tek dosya, framework yok. Renk ve ölçüler değişkenlerle yönetilir.
   ========================================================================== */

:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #fafbfd;
    --border: #e6e8f0;
    --border-strong: #d3d7e4;

    --text: #171a25;
    --text-soft: #5b6178;
    --text-mute: #8b90a5;

    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-soft: #eef0ff;

    --success: #15803d;
    --success-soft: #e8f7ee;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --warning: #b45309;
    --warning-soft: #fff5e6;
    --info: #0e7490;
    --info-soft: #e5f6fa;

    --sidebar: #14162b;
    --sidebar-soft: #1e2140;
    --sidebar-text: #b9bdd4;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(18, 20, 40, .04), 0 8px 24px -12px rgba(18, 20, 40, .12);
    --shadow-lg: 0 12px 40px -12px rgba(18, 20, 40, .22);

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

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------- İskelet ---------- */

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

.sidebar {
    width: 244px;
    flex: 0 0 244px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--brand), #8b5cf6);
    font-size: 16px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav-item:hover { background: var(--sidebar-soft); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--brand); color: #fff; }
.nav-item.is-active svg { opacity: 1; }

.sidebar-cta { margin-top: 18px; }

.sidebar-foot { margin-top: auto; padding-top: 18px; display: grid; gap: 10px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--sidebar-soft);
    border-radius: var(--radius-sm);
}

.user-chip strong { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.user-chip small { color: #7d84a8; font-size: 11.5px; }

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--brand), #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 26px;
    height: 62px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 17px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.short-domain {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 999px;
}

.content { padding: 24px 26px 60px; max-width: 1320px; width: 100%; }

.menu-toggle { display: none; }

/* ---------- Kartlar ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.card-head h2, .card-head h3 { font-size: 14.5px; }
.card-head .spacer { margin-left: auto; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-mute); }
.card-body { padding: 18px; }
.card-body.tight { padding: 10px 6px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 18px; }

/* ---------- İstatistik kutuları ---------- */

.stat {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-mute);
    font-weight: 500;
}

.stat-value {
    margin-top: 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.stat-foot { margin-top: 6px; font-size: 12.5px; color: var(--text-soft); }

.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--text-mute); }

/* ---------- Butonlar ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s, color .15s;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-outline { border-color: var(--border-strong); color: var(--text-soft); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.btn-ghost { background: transparent; color: var(--sidebar-text); border-color: rgba(255, 255, 255, .14); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
}

.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn svg { width: 17px; height: 17px; }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Formlar ---------- */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field > label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.field .hint { margin: 5px 0 0; font-size: 12.5px; color: var(--text-mute); }
.field .error { margin: 5px 0 0; font-size: 12.5px; color: var(--danger); font-weight: 500; }

input[type=text], input[type=url], input[type=password], input[type=number],
input[type=search], input[type=datetime-local], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}

input.has-error, textarea.has-error { border-color: var(--danger); }

textarea { resize: vertical; min-height: 78px; }

.mono { font-family: var(--mono); font-size: 13px; }

.input-group { display: flex; }
.input-group .prefix {
    display: flex;
    align-items: center;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-mute);
    font-family: var(--mono);
    font-size: 12.5px;
    white-space: nowrap;
}
.input-group input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; }

.switch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
}

.switch input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.switch strong { display: block; font-size: 13.5px; font-weight: 600; }
.switch small { color: var(--text-mute); font-size: 12.5px; }

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset:last-of-type { margin-bottom: 0; }

.legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-mute);
}

.legend .step {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 700;
}

/* ---------- Etiket / rozet ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-soft);
    border: 1px solid var(--border);
}

.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
    padding: 5px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Tablolar ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-mute);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }

.cell-title { font-weight: 600; }
.cell-sub { display: block; font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }

.truncate { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Kopyalanabilir kısa link ---------- */

.copy-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 11px;
    background: var(--brand-soft);
    border: 1px solid #dcdcfb;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--brand-dark);
    font-weight: 600;
}

.copy-link button {
    border: 0;
    background: #fff;
    color: var(--brand);
    border-radius: 999px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 12px;
}

.copy-link button:hover { background: var(--brand); color: #fff; }

.url-preview {
    display: block;
    padding: 11px 13px;
    background: #0f172a;
    color: #a5f3d0;
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: 12.5px;
    word-break: break-all;
    line-height: 1.6;
}

.url-preview .u-param { color: #fbbf72; }
.url-preview .u-base { color: #93c5fd; }

/* ---------- Grafik ---------- */

.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { fill: var(--text-mute); font-size: 10.5px; font-family: var(--font); }
/* Alan dolgusu SVG içinde tanımlanan degradeye bağlanır, burada belirtilmez. */
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-secondary { fill: none; stroke: #a5b4fc; stroke-width: 1.8; stroke-dasharray: 4 4; }
.chart .point { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.chart .hover-band { fill: transparent; cursor: crosshair; }
.chart .hover-band:hover { fill: rgba(79, 70, 229, .06); }

.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--text-soft);
}

.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--brand); }
.chart-legend i.dashed { background: #a5b4fc; }

/* ---------- Sıralı liste (bar) ---------- */

.bar-list { display: grid; gap: 11px; }

.bar-row { display: grid; gap: 5px; }

.bar-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13.5px;
}

.bar-top .label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-top .value { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-top .pct { color: var(--text-mute); font-size: 12px; min-width: 42px; text-align: right; }

.bar-track { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #818cf8);
    transition: width .4s ease;
}

.bar-fill.alt { background: linear-gradient(90deg, #0e7490, #22d3ee); }

/* ---------- Yoğunluk haritası ---------- */

.heatmap { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; min-width: 620px; }
.heatmap .hm-label { font-size: 11px; color: var(--text-mute); display: flex; align-items: center; }
.heatmap .hm-hour { font-size: 9.5px; color: var(--text-mute); text-align: center; }
.heatmap .hm-cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }

/* ---------- Uyarı kutuları ---------- */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    animation: slideDown .25s ease;
}

.alert span { flex: 1; word-break: break-word; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }

.alert-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: .55;
}

.alert-close:hover { opacity: 1; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.notice-box {
    padding: 13px 15px;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-soft);
}

/* ---------- Boş durum ---------- */

.empty { padding: 46px 20px; text-align: center; color: var(--text-mute); }
.empty .emoji { font-size: 34px; display: block; margin-bottom: 10px; }
.empty h3 { font-size: 15.5px; color: var(--text); margin-bottom: 5px; }
.empty p { margin: 0 auto 16px; max-width: 380px; font-size: 13.5px; }

/* ---------- Sayfalama ---------- */

.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 16px; flex-wrap: wrap; }

.pagination a, .pagination span {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--surface);
}

.pagination a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .gap { border: 0; background: none; }

/* ---------- Filtre barı ---------- */

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

.toolbar form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .search { min-width: 240px; }
.toolbar select { width: auto; }
.toolbar .spacer { margin-left: auto; }

.range-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }

.range-tabs a {
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
}

.range-tabs a:hover { background: var(--surface-2); text-decoration: none; }
.range-tabs a.is-active { background: var(--brand); color: #fff; }

/* ---------- QR ---------- */

.qr-box { display: flex; gap: 16px; align-items: center; }
.qr-box img { width: 132px; height: 132px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; padding: 6px; }

/* ---------- Bildirim ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    padding: 11px 20px;
    background: #14162b;
    color: #fff;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 100;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Giriş / açılış sayfaları ---------- */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 12% -10%, #e5e7ff 0%, transparent 60%),
        radial-gradient(700px 500px at 100% 100%, #e6fbff 0%, transparent 55%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 396px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.auth-card .brand-mark { width: 44px; height: 44px; font-size: 21px; border-radius: 13px; margin-bottom: 16px; }
.auth-card h1 { font-size: 19px; margin-bottom: 5px; }
.auth-card .sub { color: var(--text-mute); font-size: 13.5px; margin: 0 0 22px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--text-mute); }

.public-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
    text-align: center;
    background:
        radial-gradient(900px 500px at 50% -10%, #e5e7ff 0%, transparent 60%),
        var(--bg);
}

.public-card {
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 38px 32px;
    box-shadow: var(--shadow-lg);
}

.public-card .emoji { font-size: 42px; display: block; margin-bottom: 14px; }
.public-card h1 { font-size: 20px; margin-bottom: 8px; }
.public-card p { color: var(--text-soft); margin: 0 0 8px; font-size: 14px; }
.public-card code { font-family: var(--mono); background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: 13px; }

/* ---------- Yardımcılar ---------- */

.muted { color: var(--text-mute); }
.soft { color: var(--text-soft); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }

/* ---------- Duyarlı düzen ---------- */

@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        z-index: 60;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.is-open { transform: none; }
    .menu-toggle { display: grid; }
    .content { padding: 18px 15px 50px; }
    .topbar { padding: 0 15px; }
    .short-domain { display: none; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
    .truncate { max-width: 190px; }
}

@media (max-width: 520px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-value { font-size: 21px; }
    .qr-box { flex-direction: column; align-items: flex-start; }
}

@media print {
    .sidebar, .topbar, .btn, .toolbar { display: none !important; }
    .content { padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}
