:root {
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --line: #e5e7eb;
    --line-strong: #d1d5db;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #047857;
    --success-soft: #ecfdf5;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
p { margin: 0; }
code { background: #f1f5f9; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.clamp-1 { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.hidden, [hidden] { display: none !important; }

/* 顶部导航 */
.topbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1240px; margin: 0 auto; padding: 0 18px; height: 60px;
    display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); flex: 0 0 auto; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff; font-weight: 800; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .25);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-link {
    position: relative; color: #4b5563; font-size: 13.5px; font-weight: 500;
    padding: 7px 10px; border-radius: 8px; white-space: nowrap;
}
.nav-link:hover { background: #f3f4f6; color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-badge {
    display: inline-flex; min-width: 17px; height: 17px; align-items: center; justify-content: center;
    background: var(--danger); color: #fff; border-radius: 9px; font-size: 10px; padding: 0 4px; margin-left: 3px;
}
.user-area { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); padding: 4px 6px; border-radius: 8px; }
.user-chip:hover { background: #f3f4f6; }
.user-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: #e0e7ff; color: #3730a3;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-size: 12.5px; font-weight: 600; }
.user-role { font-size: 10.5px; color: var(--muted); }
.logout-form { margin: 0; }

.page-wrap { max-width: 1240px; margin: 0 auto; padding: 22px 18px 60px; }
.site-footer {
    max-width: 1240px; margin: 0 auto; padding: 0 18px 26px;
    display: flex; justify-content: space-between; color: #9ca3af; font-size: 11.5px;
}

/* 页面头 */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-head { align-items: center; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid transparent; border-radius: 9px; cursor: pointer;
    font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
    padding: 9px 14px; background: #fff; color: var(--text); text-decoration: none;
    transition: background .12s, border-color .12s, color .12s, transform .05s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: #374151; }
.btn-ghost:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 20px; font-size: 15px; border-radius: 10px; }
.btn-sm { padding: 6px 9px; font-size: 12px; border-radius: 7px; }
.danger-text { color: var(--danger); }
.danger-text:hover { background: var(--danger-soft); }

/* 卡片/表单 */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.form-card { padding: 20px; }
.narrow-card { max-width: 620px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: #374151; }
.field-label em { color: var(--danger); font-style: normal; }
.field-hint { font-size: 11.5px; color: var(--muted); }
.field-foot { display: flex; justify-content: space-between; align-items: center; }
.counter { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); font-weight: 700; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=date],
input[type=datetime-local], input[type=file], select, textarea {
    width: 100%; border: 1px solid var(--line-strong); border-radius: 9px;
    padding: 10px 11px; font-family: inherit; font-size: 14px; color: var(--text); background: #fff;
    outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
input[disabled], select[disabled], textarea[disabled] { background: #f3f4f6; color: #9ca3af; }
.check-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #374151; }
.check-row label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.input-with-button { display: flex; gap: 8px; align-items: stretch; }
.input-with-button input { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-section { padding: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 15px; }
.form-sticky {
    position: sticky; bottom: 0; z-index: 30; margin: 0 -18px -60px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.form-sticky-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }

/* flash */
.flash {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; font-size: 13px;
    border: 1px solid transparent;
}
.flash-success { background: var(--success-soft); color: #065f46; border-color: #a7f3d0; }
.flash-error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.flash-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.flash-info { background: var(--primary-soft); color: #1e40af; border-color: #bfdbfe; }
.flash-close { border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: .6; }
.warning-list { margin: 6px 0 0; padding-left: 18px; }
.warning-list li { margin: 2px 0; }

/* 列表 tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab {
    padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px;
    border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center;
}
.tab span { background: #f3f4f6; color: #6b7280; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab.active span { background: var(--primary-soft); color: var(--primary-dark); }

/* 筛选 */
.filter-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.search-row { display: flex; gap: 8px; align-items: center; }
.search-box { position: relative; flex: 1 1 auto; min-width: 0; }
.search-box input { padding-left: 34px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-52%); color: #9ca3af; font-size: 17px; }
.filter-toggle { display: none; }
.filter-panel { margin-top: 13px; border-top: 1px dashed var(--line); padding-top: 13px; }
.filter-group { margin-bottom: 12px; }
.filter-label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 7px; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
    display: inline-flex; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
    font-size: 12px; color: #4b5563; background: #fff; transition: all .12s;
}
.chip-check input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.compact-filter .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-actions { display: flex; gap: 8px; margin-top: 10px; }
.refresh-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
    padding: 9px 13px; border-radius: 9px; margin-bottom: 12px; font-size: 13px;
}

/* 表格 */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { font-size: 11.5px; color: var(--muted); font-weight: 600; background: #f9fafb; white-space: nowrap; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.col-thumb { width: 58px; }
.col-id { width: 62px; }
.col-money { width: 92px; white-space: nowrap; font-weight: 600; }
.col-actions { width: 150px; white-space: nowrap; text-align: right; }
.data-table td.col-actions { text-align: right; }
.thumb {
    position: relative; display: block; width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
    background: #f1f5f9; border: 1px solid var(--line);
}
.thumb img, .item-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-weight: 700; font-size: 15px; background: #f1f5f9;
}
.thumb-count {
    position: absolute; right: 2px; bottom: 2px; background: rgba(17, 24, 39, .7); color: #fff;
    font-size: 9px; border-radius: 5px; padding: 0 4px; line-height: 15px;
}
.id-link { font-weight: 700; color: #334155; font-variant-numeric: tabular-nums; }
.item-title { font-weight: 600; color: var(--text); }
.item-title:hover { color: var(--primary); }
.cat-badge { display: inline-flex; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #f1f5f9; color: #475569; }
.cat-phone { background: #eff6ff; color: #1d4ed8; }
.cat-tablet { background: #f5f3ff; color: #6d28d9; }
.cat-computer { background: #ecfdf5; color: #047857; }
.cat-phone_acc, .cat-tablet_acc, .cat-computer_acc { background: #fff7ed; color: #c2410c; }
.mini-badge { display: inline-flex; padding: 1px 6px; border-radius: 5px; font-size: 10px; background: #fef3c7; color: #92400e; margin-left: 4px; vertical-align: 1px; }
.status-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-in { background: #ecfdf5; color: #047857; }
.status-out { background: #f3f4f6; color: #6b7280; }
.status-pending { background: #fffbeb; color: #b45309; }
.role-badge { display: inline-flex; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.role-admin { background: #eff6ff; color: #1d4ed8; }
.role-clerk { background: #f3f4f6; color: #4b5563; }
.empty-cell { text-align: center !important; color: var(--muted); padding: 26px !important; }

.mobile-cards { display: none; }
.item-card {
    display: flex; gap: 11px; padding: 12px; border-bottom: 1px solid var(--line); color: var(--text);
}
.item-card:last-child { border-bottom: 0; }
.item-card-thumb { width: 66px; height: 66px; border-radius: 9px; overflow: hidden; background: #f1f5f9; flex: 0 0 66px; }
.item-card-main { flex: 1 1 auto; min-width: 0; }
.item-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-card-title { font-weight: 600; font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card-sub { font-size: 12px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.item-card-cost { font-weight: 700; color: #0f172a; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 20px 0 0; flex-wrap: wrap; }
.pager-btn { padding: 7px 11px; border: 1px solid var(--line-strong); background: #fff; border-radius: 7px; color: #374151; font-size: 12.5px; }
.pager-btn:hover { background: #f9fafb; }
.pager-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pager-gap { color: var(--muted); padding: 0 3px; }
.pager-info { color: var(--muted); font-size: 12.5px; padding: 0 6px; }

/* 空状态 */
.empty-state { text-align: center; padding: 44px 20px; }
.empty-icon { font-size: 30px; color: #94a3b8; margin-bottom: 10px; }
.empty-state h1, .empty-state h2 { font-size: 19px; margin-bottom: 7px; }
.empty-state p { color: var(--muted); max-width: 460px; margin: 0 auto 16px; }
.empty-actions { display: flex; justify-content: center; gap: 8px; }

/* FAB */
.fab {
    display: none; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 35;
    width: 54px; height: 54px; border-radius: 50%; background: var(--primary); color: #fff;
    font-size: 28px; font-weight: 300; align-items: center; justify-content: center;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .35);
}

/* 详情 */
.detail-kicker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.id-badge { font-weight: 800; color: #334155; font-size: 13px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.detail-main, .detail-side { min-width: 0; }
.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 12.5px; }
.detail-row dd { margin: 0; font-size: 13.5px; word-break: break-word; }
.detail-list.compact .detail-row { grid-template-columns: 82px minmax(0, 1fr); padding: 7px 0; }
.money { color: #0f172a; font-size: 15px; }
.action-card h2 { margin-bottom: 12px; }
.action-card form { margin-bottom: 8px; }
.detail-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.image-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.image-card { position: relative; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #f8fafc; aspect-ratio: 1 / 1; }
.image-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-badge { position: absolute; left: 5px; top: 5px; background: rgba(37, 99, 235, .9); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.image-actions { position: absolute; inset: auto 0 0 0; display: flex; gap: 2px; justify-content: flex-end; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.45)); }
.img-btn { border: 0; background: rgba(255,255,255,.9); color: #111; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; font-size: 13px; line-height: 1; }
.img-btn.danger { color: var(--danger); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 2px; width: 1px; background: var(--line); }
.timeline-body { font-size: 13px; }
.danger-zone { border-color: #fecaca; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--danger); }
.danger-zone[open] summary { margin-bottom: 8px; }
.json-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code-block { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px; overflow: auto; max-height: 340px; font-size: 11.5px; line-height: 1.45; }
.diff-table .old-value { color: #991b1b; background: #fef2f2; }
.diff-table .new-value { color: #065f46; background: #ecfdf5; }

/* 后台 */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.inline-form { display: inline-flex; margin: 0; vertical-align: middle; }
.inline-form input[type=text] { width: 86px; padding: 5px 7px; font-size: 12px; }
.reset-form { gap: 4px; }
.plain-list { margin: 0; padding-left: 18px; color: #4b5563; font-size: 13px; }
.plain-list li { margin: 5px 0; }

/* 图片上传 */
.upload-zone {
    border: 1.5px dashed #cbd5e1; border-radius: 10px; background: #f8fafc;
    padding: 22px 16px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s;
    margin-bottom: 12px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.upload-icon { font-size: 24px; color: #64748b; line-height: 1; }
.upload-title { font-weight: 600; margin-top: 6px; }
.upload-hint { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.preview-card .uploading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.8); font-size: 11px; color: #475569; }
.preview-card .remove-preview { position: absolute; top: 5px; right: 5px; z-index: 2; }
.preview-card.loaded .uploading { display: none; }

/* 标签选择 */
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tag { border: 1px solid var(--line-strong); background: #fff; color: #475569; border-radius: 999px; padding: 4px 9px; font-size: 11.5px; cursor: pointer; }
.tag:hover { border-color: var(--primary); color: var(--primary-dark); }
.tag.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 登录/安装 */
.no-nav { background: radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 55%), var(--bg); }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: 0 20px 50px rgba(15, 23, 42, .08); }
.auth-card-wide { max-width: 560px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.auth-brand h1 { font-size: 21px; }
.auth-brand p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.auth-tip { color: var(--muted); font-size: 11.5px; margin-top: 16px; text-align: center; }

@media (max-width: 1020px) {
    .filter-grid, .compact-filter .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-layout { grid-template-columns: minmax(0, 1fr) 270px; }
    .image-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .topbar-inner { height: 56px; padding: 0 12px; gap: 10px; }
    .brand-name { display: none; }
    .user-meta { display: none; }
    .main-nav { gap: 0; }
    .nav-link { padding: 7px 8px; font-size: 12.5px; }
    .page-wrap { padding: 16px 12px 80px; }
    .page-head { align-items: flex-start; flex-direction: column; gap: 10px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .list-head .page-actions { justify-content: flex-end; }
    .list-head .page-actions .btn { flex: 0 0 auto; }
    h1 { font-size: 21px; }
    .filter-toggle { display: inline-flex; }
    .filter-panel { display: none; }
    .filter-panel.open { display: block; }
    .filter-grid, .compact-filter .filter-grid { grid-template-columns: 1fr 1fr; }
    .search-row { flex-wrap: wrap; }
    .search-box { flex: 1 1 100%; }
    .search-row .btn { flex: 1 1 auto; }
    .table-card { overflow-x: auto; }
    .list-table-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
    .list-table-card .data-table { display: none; }
    .data-table { min-width: 760px; }
    .mobile-cards { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
    .fab { display: flex; }
    .detail-layout, .admin-grid { grid-template-columns: 1fr; }
    .detail-side { order: 2; }
    .action-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
    .action-card h2 { grid-column: 1 / -1; }
    .action-card form { margin: 0; }
    .action-card .btn-block { width: 100%; }
    .image-grid, .detail-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
    .json-grid { grid-template-columns: 1fr; }
    .form-sticky { margin: 0 -12px -80px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
    .form-sticky-inner { gap: 8px; }
    .form-sticky-inner .btn { flex: 1 1 auto; }
    .site-footer { padding: 0 12px 20px; }
    .inline-form input[type=text] { width: 76px; }
    .col-actions { width: auto; }
}

@media (max-width: 520px) {
    .filter-grid, .compact-filter .filter-grid { grid-template-columns: 1fr; }
    .image-grid, .detail-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .action-card { grid-template-columns: 1fr; }
    .tabs { overflow-x: auto; }
    .tab { padding: 8px 10px; }
}
