/* 场馆预约核销系统 - 后台管理样式 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --green-seat: #22c55e;
    --red-seat: #ef4444;
    --gray-seat: #9ca3af;
    --yellow-seat: #f59e0b;
    --bg: #f5f7fa;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #6b7280;
    --sidebar-bg: #ffffff;
    --radius: 8px;
    /* 座位图案（俯视座椅：靠背 + 坐垫）。用 mask 裁剪，背景色仍由座位自身的 color 决定，
       所以改价、禁用、选中这些只改 background 的逻辑一行都不用动。 */
    --seat-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='1' width='20' height='8' rx='4'/%3E%3Crect x='4' y='11.5' width='16' height='11.5' rx='4'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

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

/* 侧边栏 */
.admin-sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
}
.sidebar-brand i { font-size: 26px; }
.brand-title { font-size: 15px; font-weight: 700; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text-muted); }

.sidebar-menu { padding: 10px 0; flex: 1; }

.menu-group {
    padding: 14px 16px 6px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.menu-item:hover { background: var(--primary-light); color: var(--primary); }
.menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
.menu-item i { font-size: 16px; }

/* 主区域 */
.admin-main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; }

.admin-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 50;
}
.header-title h1 { font-size: 18px; font-weight: 600; margin: 0; }
.header-desc { font-size: 12px; color: var(--text-muted); }
.header-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 13px; color: var(--text); }

.admin-content { padding: 20px 24px; flex: 1; }

/* 卡片 */
.card-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}
.card-box-title {
    font-size: 15px; font-weight: 600; margin-bottom: 14px;
    display: flex; justify-content: space-between; align-items: center;
}

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
}
.stat-icon.blue { background: var(--primary); }
.stat-icon.green { background: var(--success); }
.stat-icon.orange { background: var(--warning); }
.stat-icon.red { background: var(--danger); }
.stat-icon.purple { background: #7c3aed; }
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 表格 */
.table-custom { width: 100%; font-size: 13px; }
.table-custom th {
    background: #f9fafb; font-weight: 600; color: var(--text-muted);
    border-bottom: 1px solid var(--border); padding: 10px 12px; white-space: nowrap;
}
.table-custom td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.table-custom tbody tr:hover { background: #fafbfc; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; line-height: 18px; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-orange { background: #fef3c7; color: #b45309; }
.tag-gray { background: #f3f4f6; color: #4b5563; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }

/* 座位图 */
.seat-grid { display: flex; flex-direction: column; gap: 10px; }
.seat-row { display: flex; gap: 10px; align-items: center; }
.seat-row-label { width: 28px; text-align: center; color: var(--text-muted); font-size: 12px; }
.seat {
    width: 38px; height: 38px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; cursor: pointer; user-select: none;
    border: 1px solid transparent; transition: transform .1s;
    color: #fff; font-weight: 500;
}
.seat:hover { transform: scale(1.08); }
/* 小程序座位图配色：0 可预约 1 已预约 2 维修禁用 3 锁定 */
.seat-0 { background: var(--green-seat); }   /* 可预约 */
.seat-1 { background: var(--red-seat); }    /* 已预约 */
.seat-2 { background: var(--gray-seat); }   /* 维修禁用 */
.seat-3 { background: var(--yellow-seat); } /* 锁定 */

.seat.selected {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    transform: scale(1.06);
    box-shadow: 0 0 0 1px #fff inset;
}
.seat-empty { width: 38px; height: 38px; }

.seat-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; font-size: 12px; }
.seat-legend span { display: flex; align-items: center; gap: 6px; }
/* 「可预约」是按区块颜色动态生成的多项（见 Order/Create.cshtml 的 renderZoneLegend），
   用 display:contents 让这些项直接参与 .seat-legend 的 flex 排版 —— 否则它们会被
   塞进一个不换行的小 flex 里，间距也和其它图例对不上。 */
.seat-legend #legendZones { display: contents; }
.legend-dot { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
/* 区块名跟在颜色块后面，弱化成灰色小字，不抢「可预约」本身 */
.seat-legend .legend-zone-name { color: var(--text-muted); }

/* 表单 */
.form-label { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.form-text { font-size: 12px; color: var(--text-muted); }

/* 筛选栏 */
.filter-bar {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
    display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; }

/* 登录页 */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}
.login-box {
    width: 380px; background: #fff; border-radius: 12px;
    padding: 32px; box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.login-logo { text-align: center; margin-bottom: 24px; color: var(--primary); }
.login-logo i { font-size: 46px; }
.login-logo h2 { font-size: 19px; margin: 10px 0 4px; color: var(--text); }
.login-logo p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* 核销工作台 */
.verify-box { text-align: center; padding: 20px; }
.verify-code-input {
    font-size: 30px; text-align: center; letter-spacing: 8px;
    height: 62px; font-weight: 700;
}
.verify-result { margin-top: 18px; padding: 18px; border-radius: var(--radius); display: none; }
.verify-result.success { background: #dcfce7; color: #15803d; display: block; }
.verify-result.fail { background: #fee2e2; color: #b91c1c; display: block; }
#qr-reader { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* 分页 */
.pagination { margin: 16px 0 0; }
.pagination .page-link { font-size: 13px; }

/* 图表容器 */
.chart-box { position: relative; height: 280px; }

/* 空状态 */
.empty-state { text-align: center; padding: 48px 0; color: var(--text-muted); }
.empty-state i { font-size: 42px; display: block; margin-bottom: 12px; }

/* ---------- 图片上传组件 ---------- */
.upload-cover {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 210px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, background .15s;
}
.upload-cover:hover { border-color: var(--primary); background: #f2f7ff; }
.upload-cover img { width: 100%; height: 100%; object-fit: cover; display: none; }
.upload-cover.has-image img { display: block; }
.upload-cover.has-image .upload-empty { display: none; }
.upload-empty { text-align: center; color: #9aa3af; font-size: 13px; padding: 0 16px; }
.upload-empty i { font-size: 30px; display: block; margin-bottom: 10px; }
.upload-empty .small { font-size: 12px; margin-top: 6px; }
.upload-mask {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, .55);
    color: #fff; font-size: 13px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    opacity: 0; transition: opacity .15s;
}
.upload-cover.has-image:hover .upload-mask { opacity: 1; }

.upload-drop {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    background: #fafbfc;
    color: #6b7280;
    transition: border-color .15s, background .15s, color .15s;
}
.upload-drop:hover, .upload-drop.dragover {
    border-color: var(--primary);
    background: #f2f7ff;
    color: var(--primary);
}
.upload-drop i { font-size: 32px; display: block; margin-bottom: 10px; }
.upload-drop .small { font-size: 12px; margin-top: 6px; color: #9aa3af; }

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.thumb-grid:empty { display: none; }
.thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #f3f4f6;
    cursor: move;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.dragging { opacity: .35; }
.thumb-del {
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px;
    border: none; border-radius: 50%;
    background: rgba(15, 23, 42, .62);
    color: #fff; font-size: 14px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.thumb-del:hover { background: #dc2626; }
.thumb-order {
    position: absolute; left: 6px; bottom: 6px;
    background: rgba(15, 23, 42, .62);
    color: #fff; font-size: 11px;
    padding: 1px 7px; border-radius: 8px;
}

/* 看板内的模块分隔标题 */
.section-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 26px 0 16px;
}
.section-divider > span {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 16px; font-weight: 700; color: var(--text);
    white-space: nowrap;
}
.section-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ============ 按钮点击反馈（全站） ============
   hover 只说明「鼠标在上面」，按下还得有自己的一下反馈，否则点没点中没把握，
   手机上更是完全没有 hover。这里统一给所有按钮加按下效果：
   轻微下沉 + 缩小 + 变暗 + 内阴影，松开立刻回弹。
   覆盖 <button>、<a class="btn">、<label class="btn">、input[type=button/submit/reset]，
   禁用态不动（:disabled / .disabled 排除掉）。
   注意：不要在这里用 will-change: transform —— 页面按钮很多，
   逐个提升成合成层反而更慢，普通 transition 足够。 */
.btn,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    transition: transform .08s ease, filter .08s ease, box-shadow .08s ease;
}

.btn:not(:disabled):not(.disabled):active,
.btn:not(:disabled):not(.disabled).active,
button:not(:disabled):active,
input[type="button"]:not(:disabled):active,
input[type="submit"]:not(:disabled):active,
input[type="reset"]:not(:disabled):active {
    transform: translateY(1px) scale(.97);
    filter: brightness(.92);
    box-shadow: inset 0 2px 6px rgba(15, 23, 42, .22);
}

/* ==================== 移动端专属链接：二维码弹层 ====================
   这里不用 Bootstrap 的 modal：生成二维码是「随时要能用」的小工具，
   少依赖一个外部脚本更稳。遮罩、弹窗、按钮的观感与站内其它弹窗保持一致。 */

.qr-mask {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .55);
}

.qr-mask.on { display: flex; }

.qr-dialog {
    width: 100%;
    max-width: 880px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .32);
}

.qr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-bottom: 1px solid #eef2f7;
}

.qr-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.qr-who { font-size: 13px; font-weight: 400; color: #64748b; }

.qr-x {
    border: 0;
    background: transparent;
    padding: 0 4px;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.qr-x:hover { color: #475569; }

.qr-body {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 16px 18px 18px;
}

.qr-left { flex: 0 0 auto; width: 266px; text-align: center; }

.qr-canvas-box {
    display: inline-block;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

/* canvas 的内部分辨率由脚本按所选尺寸设定（最大 2000），这里只决定屏幕上的显示大小 */
#qrCanvas {
    display: block;
    width: 244px;
    height: 244px;
    image-rendering: pixelated;
}

.qr-meta { margin-top: 8px; font-size: 12px; color: #64748b; }

.qr-right { flex: 1 1 400px; min-width: 300px; }
.qr-field { margin-bottom: 14px; }
.qr-label { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #334155; }

.qr-sizes { display: flex; flex-wrap: wrap; gap: 6px; }

.qr-sizes button {
    padding: 5px 12px;
    font-size: 12.5px;
    color: #334155;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.qr-sizes button:hover { border-color: #2563eb; color: #2563eb; }

.qr-sizes button.on {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    font-weight: 600;
}

.qr-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.qr-custom input {
    flex: 0 0 104px;
    width: 104px;
    padding: 4px 8px;
    font-size: 12.5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.qr-warn { margin-top: 6px; font-size: 12px; line-height: 1.6; }
.qr-warn.warn { color: #b45309; }
.qr-warn.err { color: #dc2626; font-weight: 600; }

.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.qr-tip {
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.7;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 10px;
}

@media (max-width: 719px) {
    .qr-left { width: 100%; }
    #qrCanvas { width: 200px; height: 200px; margin: 0 auto; }
}

/* ===== 账号弹窗（新增 / 修改共用）: 分区排版，一眼看清 ===== */
.adm-modal .modal-dialog { max-width: 880px; }
.adm-modal .modal-header { padding: 12px 18px; }
.adm-modal .modal-title { font-size: 15px; font-weight: 600; }
.adm-modal .modal-body { padding: 18px; }
.adm-modal .modal-footer { padding: 10px 18px; }

.adm-sec { margin-bottom: 20px; }
.adm-sec:last-child { margin-bottom: 0; }

.adm-sec-hd {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}
.adm-sec-hd .n {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}
.adm-sec-hd .hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}
.adm-sec-hd .adm-quick { margin-left: auto; }

.adm-req { color: var(--danger); margin-left: 2px; }

.adm-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.adm-checks .form-check { margin: 0; min-width: 112px; }
.adm-checks.is-venues .form-check { min-width: 156px; }
.adm-checks .form-check-label { font-size: 13px; }
.adm-checks .form-check-input { margin-top: 0.18em; }

.adm-quick { display: inline-flex; gap: 6px; }
.adm-quick button {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
}
.adm-quick button:hover { border-color: var(--primary); color: var(--primary); }

.adm-link-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.adm-link-row input { flex: 1 1 320px; min-width: 0; font-size: 12.5px; }

/* ===== 账号列表「操作」列：编辑 / 删除 两个按钮等宽同款 =====
   宽度写死成同一个值，并让图标与文字居中排布 —— 之前「删除」没有图标、
   和带图标的「编辑」宽度对不上，一排按钮看着参差不齐。 */
.op-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.op-btn {
    width: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}
/* 核销账户在列表里没有「编辑」（它跟着所属账号走），占位文字跟按钮同一行高 */
.op-hint { font-size: 12px; color: var(--text-muted); }

/* ===== 弹窗里「核销账户设置」的行 ===== */
.va-list { display: flex; flex-direction: column; gap: 8px; }
.va-list:not(:empty) { margin-bottom: 8px; }
.va-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.1fr) 32px;
    align-items: center;
    gap: 8px;
}
.va-idx {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
.va-row .form-control { font-size: 12.5px; }

/* 自动生成且不可修改的登录账号：看起来就是「系统填好的」，别让人以为漏填了 */
.va-row .form-control.is-ro {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    cursor: not-allowed;
}
.va-del {
    width: 32px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--danger);
    border-radius: 6px;
    cursor: pointer;
}
.va-del:hover { border-color: var(--danger); background: #fef2f2; }

@media (max-width: 719px) {
    /* 手机上四个输入框挤一行没法用，改成两列：序号+账号一行，姓名+密码一行 */
    .va-row { grid-template-columns: 22px minmax(0, 1fr) 32px; }
    .va-row [data-f="RealName"], .va-row [data-f="Password"] { grid-column: 2; }
    .va-row .va-del { grid-column: 3; grid-row: 1 / span 3; height: 100%; }
}

.adm-empty { font-size: 12.5px; color: var(--text-muted); }

@media (max-width: 719px) {
    .adm-modal .modal-body { padding: 14px; }
    .adm-checks .form-check { min-width: 46%; }
    .adm-checks.is-venues .form-check { min-width: 46%; }
}

/* ==================== 时段设置：开放方式 + 互斥两块 ==================== */

/* 开放方式二选一 */
.mode-opt {
    display: flex; align-items: flex-start; gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
    cursor: pointer;
    height: 100%;
}
.mode-opt:hover { border-color: var(--primary); }
.mode-opt input { margin-top: 3px; flex: none; }
.mode-opt .mode-title { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); }
.mode-opt .mode-desc { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.mode-opt-on { border-color: var(--primary); background: var(--primary-light); }

/* 互斥时整块置灰 */
.time-block { position: relative; }
.time-block-locked { background: #f8fafc; }
.time-block-locked .time-block-body { opacity: .5; }
.time-block .lock-tag {
    display: none;
    font-size: 12px; font-weight: normal;
    color: var(--warning);
}
.time-block-locked .lock-tag { display: inline; }
.time-block-locked input, .time-block-locked select, .time-block-locked textarea { cursor: not-allowed; }
