/* ============================================================
   宁夏源石酒庄 AI 数字人客服 · 管理后台样式
   主题：贺兰山岩 + 葡萄紫 + 酒红
   ============================================================ */

:root {
    --wine: #7b2342;
    --wine-deep: #5a1730;
    --wine-soft: #a63a5e;
    --purple: #6a3d7a;
    --gold: #c9a227;
    --gold-soft: #e2c374;
    --ink: #241a20;
    --ink-2: #4a3b44;
    --ink-3: #7b6a75;
    --cyan: #2f9e8f;
    --green: #3aa06f;
    --red: #d2453d;
    --orange: #d98324;
    --bg: #f5f2f4;
    --card: #ffffff;
    --line: #ece5ea;
    --sidebar-w: 232px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(36, 26, 32, .06), 0 1px 3px rgba(36, 26, 32, .04);
    --shadow: 0 4px 16px rgba(36, 26, 32, .08);
    --shadow-lg: 0 12px 40px rgba(36, 26, 32, .16);
    --font: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; }
p { margin: 0 0 8px; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: linear-gradient(180deg, var(--wine-deep) 0%, #3d1023 100%);
    color: #f4e8ee;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
}

.brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--wine-soft) 100%);
    display: grid;
    place-items: center;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(201, 162, 39, .35);
}

.brand-sub {
    margin-top: 6px;
    font-size: 11.5px;
    color: rgba(244, 232, 238, .55);
    letter-spacing: 1.5px;
}

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(244, 232, 238, .78);
    font-size: 13.5px;
    margin-bottom: 4px;
    transition: all .18s ease;
    position: relative;
}

.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.nav-item.active {
    background: linear-gradient(90deg, rgba(201, 162, 39, .22), rgba(255, 255, 255, .05));
    color: #fff;
    font-weight: 600;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gold);
}

.nav-item svg { width: 17px; height: 17px; opacity: .9; flex: 0 0 17px; }

.sidebar-foot {
    padding: 14px 18px 18px;
    font-size: 11.5px;
    color: rgba(244, 232, 238, .4);
    border-top: 1px solid rgba(255, 255, 255, .07);
    line-height: 1.7;
}

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 62px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 15;
}

.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-2);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wine-soft), var(--purple));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
}

.content { padding: 22px 26px 40px; flex: 1; }

/* ---------------- 卡片 / 栅格 ---------------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-desc { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }

.stat {
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.stat-label { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-unit { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 3px; }
.stat-foot { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.stat-badge { position: absolute; right: 16px; top: 16px; font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.stat-up { color: var(--green); background: rgba(58, 160, 111, .1); }
.stat-down { color: var(--red); background: rgba(210, 69, 61, .1); }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 13px;
    cursor: pointer;
    transition: all .16s ease;
    font-family: var(--font);
    white-space: nowrap;
}

.btn:hover { border-color: #d8cdd6; color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--wine) 0%, var(--wine-soft) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(123, 35, 66, .25);
}

.btn-primary:hover { color: #fff; box-shadow: 0 6px 18px rgba(123, 35, 66, .32); }

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #b8891c 100%);
    border-color: transparent;
    color: #fff;
}

.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: rgba(210, 69, 61, .3); background: rgba(210, 69, 61, .05); }
.btn-danger:hover { background: rgba(210, 69, 61, .1); color: var(--red); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 15px; }
.field-label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }

.input, .select, .textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    height: 36px;
    padding: 0 11px;
    font-size: 13.5px;
    font-family: var(--font);
    color: var(--ink);
    background: #fff;
    transition: border-color .16s, box-shadow .16s;
}

.textarea { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; min-height: 78px; }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--wine-soft);
    box-shadow: 0 0 0 3px rgba(166, 58, 94, .12);
}

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

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

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--wine-soft); }
.range-val { width: 54px; text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch-track {
    width: 40px;
    height: 22px;
    border-radius: 20px;
    background: #ddd4da;
    position: relative;
    transition: background .2s;
}
.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s;
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, var(--wine), var(--wine-soft)); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
.table th {
    text-align: left;
    padding: 11px 14px;
    background: #faf7f9;
    color: var(--ink-3);
    font-weight: 500;
    font-size: 12.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 14px; border-bottom: 1px solid #f4eff2; vertical-align: top; }
.table tbody tr:hover { background: #fdfbfc; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }
.table .col-time { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.table-empty { padding: 46px 0; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------------- 徽章 / 标签 ---------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    line-height: 1.7;
    white-space: nowrap;
}
.badge-gray { background: #f1edf0; color: var(--ink-3); }
.badge-wine { background: rgba(123, 35, 66, .1); color: var(--wine); }
.badge-green { background: rgba(58, 160, 111, .12); color: #2c7f57; }
.badge-red { background: rgba(210, 69, 61, .12); color: #b8352f; }
.badge-orange { background: rgba(217, 131, 36, .14); color: #a86414; }
.badge-gold { background: rgba(201, 162, 39, .16); color: #96760f; }
.badge-cyan { background: rgba(47, 158, 143, .12); color: #227a6d; }

/* 可点击的徽章（列表页状态列：点一下切换启用/停用） */
.badge-toggle {
    border: 1px solid transparent;
    font-family: inherit;
    cursor: pointer;
    transition: filter .15s, box-shadow .15s;
}
.badge-toggle:hover { filter: brightness(.96); box-shadow: 0 0 0 3px rgba(123, 35, 66, .08); }
.badge-toggle:active { transform: translateY(1px); }
.badge-toggle:disabled { cursor: default; opacity: .6; }
.badge-toggle.badge-green:hover { box-shadow: 0 0 0 3px rgba(58, 160, 111, .16); }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--green); }
.dot-off { background: #c9bfc6; }

/* ---------------- Tab ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; background: #fbf9fa; }
.tab {
    padding: 12px 16px;
    font-size: 13.5px;
    color: var(--ink-3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .16s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--wine); font-weight: 600; border-bottom-color: var(--wine); }
.panel { display: none; padding: 18px; }
.panel.active { display: block; }

/* ---------------- 上传控件 ---------------- */
.uploader {
    border: 1.5px dashed #ddd3da;
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: all .18s;
    background: #fdfbfc;
}
.uploader:hover, .uploader.drag { border-color: var(--wine-soft); background: rgba(166, 58, 94, .04); }
.uploader-icon { font-size: 22px; opacity: .5; }
.uploader-text { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.uploader-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.preview-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    position: relative;
}
.preview-thumb {
    height: 108px;
    background: linear-gradient(135deg, #efe9ee, #f8f5f7);
    display: grid;
    place-items: center;
    color: var(--ink-3);
    font-size: 12px;
    overflow: hidden;
}
.preview-thumb img, .preview-thumb video { width: 100%; height: 100%; object-fit: cover; }
.preview-meta { padding: 9px 11px; font-size: 12.5px; }
.preview-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-flag { position: absolute; top: 7px; left: 7px; }

/* ---------------- 弹窗 ---------------- */
.mask {
    position: fixed;
    inset: 0;
    background: rgba(36, 26, 32, .45);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.mask.show { display: flex; animation: fade .18s ease; }

.modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: pop .2s cubic-bezier(.2, .9, .3, 1.1);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--ink-3); line-height: 1; }

@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Toast ---------------- */
/* ---------------- 素材库选择器 ---------------- */
/* 独立遮罩：z-index 高于通用弹窗，上传弹窗不用关就能挑素材 */
.media-mask { z-index: 150; }
.media-modal { max-width: 780px; }
.media-item { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.media-item:hover { border-color: var(--wine-soft); }
.media-item.is-sel { border-color: var(--wine); box-shadow: 0 0 0 2px rgba(123, 35, 66, .16); }
.media-thumb { position: relative; height: 104px; background: linear-gradient(135deg, #efe9ee, #f8f5f7); display: grid; place-items: center; overflow: hidden; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-ext { position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 20px; font-size: 11px; background: rgba(36, 26, 32, .72); color: #fff; letter-spacing: .5px; }
.media-del { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; line-height: 18px; text-align: center; border-radius: 50%; font-size: 13px; color: #fff; background: rgba(210, 69, 61, .82); display: none; }
.media-item:hover .media-del { display: block; }
.media-name { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tip { font-size: 11.5px; color: #2a7a55; background: rgba(58, 160, 111, .08); border: 1px dashed rgba(58, 160, 111, .4); border-radius: 7px; padding: 6px 9px; margin-top: 6px; word-break: break-all; }
.pick-row { display: flex; align-items: center; gap: 8px; }
.pick-row .input[type="file"] { flex: 1; min-width: 0; }

.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
    padding: 9px 18px;
    border-radius: 22px;
    background: rgba(36, 26, 32, .92);
    color: #fff;
    font-size: 13px;
    box-shadow: var(--shadow);
    animation: pop .18s ease;
}
.toast.ok { background: linear-gradient(135deg, #2f8f68, #3aa06f); }
.toast.err { background: linear-gradient(135deg, #b5382f, #d2453d); }
.toast.warn { background: linear-gradient(135deg, #b8721a, #d98324); }

/* ---------------- 聊天气泡 ---------------- */
.chat-item { padding: 12px 14px; border-bottom: 1px dashed #f0eaf0; }
.chat-role { font-size: 12px; color: var(--ink-3); margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.bubble {
    display: inline-block;
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.65;
    word-break: break-word;
}
.bubble-user { background: linear-gradient(135deg, var(--wine) 0%, var(--wine-soft) 100%); color: #fff; border-radius: 12px 12px 4px 12px; }
.bubble-ai { background: #f7f3f6; color: var(--ink); border-radius: 12px 12px 12px 4px; }
.chat-row { display: flex; }
.chat-row.user { justify-content: flex-end; }
.chat-row.ai { justify-content: flex-start; }

/* ---------------- 杂项 ---------------- */
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-12 { margin-bottom: 12px; }
.flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.pill-tabs { display: inline-flex; background: #f3eff2; padding: 3px; border-radius: 9px; gap: 2px; }
.pill { padding: 5px 12px; border-radius: 7px; font-size: 12.5px; cursor: pointer; color: var(--ink-3); }
.pill.active { background: #fff; color: var(--wine); font-weight: 600; box-shadow: var(--shadow-sm); }

.progress { height: 6px; border-radius: 6px; background: #f0ebee; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--wine-soft), var(--gold)); width: 0; transition: width .2s; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 14px 18px; }
.pager a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; background: #fff; }
.pager a:hover { border-color: var(--wine-soft); color: var(--wine); }
.pager a.current { background: var(--wine); color: #fff; border-color: var(--wine); }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

.notice {
    border-left: 3px solid var(--gold);
    background: rgba(201, 162, 39, .07);
    padding: 11px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 12.8px;
    color: #7a6318;
    line-height: 1.7;
}
.notice.red { border-color: var(--red); background: rgba(210, 69, 61, .07); color: #a8392f; }
.notice.green { border-color: var(--green); background: rgba(58, 160, 111, .07); color: #2a7a55; }

.state-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; }
.state-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; background: #fff; }
.state-box.ready { border-color: rgba(58, 160, 111, .35); background: rgba(58, 160, 111, .03); }
.state-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.state-key { font-size: 13px; font-weight: 600; letter-spacing: .5px; }
.state-cname { font-size: 12px; color: var(--ink-3); }

/* ---------------- 登录页 ---------------- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(1200px 600px at 15% 20%, rgba(123, 35, 66, .55), transparent 60%),
        radial-gradient(900px 500px at 85% 80%, rgba(106, 61, 122, .5), transparent 60%),
        linear-gradient(135deg, #2a0d18 0%, #3d1023 50%, #241a20 100%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, .97);
    border-radius: 16px;
    padding: 34px 32px 30px;
    box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-mark {
    width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--wine) 100%);
    display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 700;
    box-shadow: 0 8px 22px rgba(201, 162, 39, .35);
}
.login-title { font-size: 18px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; letter-spacing: 1px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .sidebar { position: static; width: 100%; flex-basis: 100%; }
    .layout { flex-direction: column; }
    .main { margin-left: 0; }
    .nav { display: flex; flex-wrap: wrap; }
    .nav-item { width: auto; }
    .nav-item.active::before { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
