/* =========================================================
   PC 管理后台 · 翼享会员运营中心
   ========================================================= */
.admin-body { background: #f4f5f1; min-height: 100vh; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.admin-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column;
  background: #14261f; color: #dbe3dd; border-right: 1px solid #0e1c16;
  padding: 0 12px 14px;
}
.admin-logo { display: flex; align-items: center; gap: 10px; padding: 20px 10px 18px; }
.admin-logo .brand-seal { width: 34px; height: 34px; background: rgba(255,255,255,.06); border: 1px solid rgba(220,190,135,.38); color: #e8d2a9; font-size: 17px; }
.admin-logo .al-name { font-size: 14px; font-weight: 600; color: #f0eade; letter-spacing: .01em; }
.admin-logo .al-sub { margin-top: 1px; font-size: 8px; letter-spacing: .16em; color: rgba(235,229,217,.38); font-family: var(--num); }
.admin-nav { flex: 1; overflow: auto; scrollbar-width: thin; }
.admin-nav-group { margin-top: 13px; }
.admin-nav-label { padding: 0 11px 6px; font-size: 9px; letter-spacing: .12em; color: rgba(225,233,227,.32); }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 11px;
  border-radius: 6px; color: rgba(224,232,226,.72); font-size: 12px;
  transition: background .14s ease, color .14s ease; position: relative;
}
.admin-nav-item:hover { background: rgba(255,255,255,.055); color: #f0f4ef; }
.admin-nav-item.is-active { background: rgba(255,255,255,.075); color: #f3eee2; font-weight: 600; }
.admin-nav-item.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 2px; background: #c39a5e; border-radius: 0 2px 2px 0; }
.admin-nav-item .icon { width: 17px; height: 17px; opacity: .72; }
.admin-nav-item.is-active .icon { opacity: 1; color: #d9bd8a; }
.admin-nav-item .nav-count { margin-left: auto; min-width: 18px; height: 17px; padding: 0 5px; border-radius: 9px; background: rgba(195,154,94,.18); color: #dcc08f; font-family: var(--num); font-size: 9px; line-height: 17px; text-align: center; }
.admin-side-foot { border-top: 1px solid rgba(255,255,255,.075); padding-top: 11px; }
.admin-user { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 7px; }
.admin-user:hover { background: rgba(255,255,255,.05); }
.admin-user .avatar { width: 31px; height: 31px; border-radius: 8px; background: rgba(255,255,255,.08); color: #e9d5b3; border: 1px solid rgba(255,255,255,.08); font-size: 11px; }
.admin-user .au-name { font-size: 11px; color: #ecefe9; font-weight: 550; }
.admin-user .au-role { margin-top: 1px; font-size: 8.5px; color: rgba(224,232,226,.4); }
.admin-user .logout-btn { margin-left: auto; width: 27px; height: 27px; border: 0; background: transparent; border-radius: 5px; color: rgba(224,232,226,.5); display: grid; place-items: center; }
.admin-user .logout-btn:hover { background: rgba(255,255,255,.07); color: #f0dfe0; }

/* Topbar */
.admin-topbar {
  position: sticky; top: 0; z-index: 35;
  display: flex; align-items: center; gap: 16px;
  min-height: 58px; padding: 0 26px;
  background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.admin-breadcrumb { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.admin-breadcrumb .root { color: var(--muted); }
.admin-breadcrumb .sep { color: #c1c8c1; }
.admin-topbar .spacer { flex: 1; }
.admin-global-search { width: 230px; position: relative; }
.admin-global-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9aa39c; }
.admin-global-search input {
  width: 100%; height: 34px; border: 1px solid #e2e6df; border-radius: 6px; background: #f8f9f6;
  padding: 0 10px 0 33px; font-size: 11px; outline: none;
}
.admin-global-search input:focus { background: #fff; border-color: #b9ccc0; box-shadow: 0 0 0 3px rgba(27,102,81,.08); }
.admin-date { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.admin-date .icon { color: var(--muted); }
.admin-top-icon { width: 34px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: 7px; color: var(--ink-3); display: grid; place-items: center; position: relative; }
.admin-top-icon:hover { background: var(--paper); color: var(--ink); }
.admin-top-icon .dot-alert { position: absolute; right: 7px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: #c07f3d; box-shadow: 0 0 0 2px #fff; }
.admin-top-avatar { width: 32px; height: 32px; border-radius: 8px; background: #e8eee9; color: #305544; border: 0; font-size: 11px; font-weight: 600; }

/* Content */
.admin-content { padding: 24px 28px 46px; flex: 1; width: 100%; max-width: 1520px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-head h1 { font-size: 23px; font-weight: 650; letter-spacing: -.025em; line-height: 1.25; }
.page-head .sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex: none; }
.page-head .actions .btn { min-height: 36px; font-size: 12px; }
.section-caption { font-size: 10.5px; color: var(--muted); }

/* Filter bar */
.filter-bar {
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 13px;
}
.filter-bar .search-field { min-width: 210px; }
.filter-bar .input, .filter-bar .select { min-height: 34px; font-size: 11px; }
.filter-bar .search-field { flex: 0 1 240px; min-width: 200px; }
.filter-bar .search-field .input { width: 100%; }
.filter-bar .select { width: auto; min-width: 112px; flex: 0 0 auto; }
.filter-bar .grow { flex: 1; }
.filter-bar .btn { min-height: 34px; font-size: 11px; }
.filter-sep { width: 1px; height: 18px; background: var(--line); margin: 0 1px; }

/* Cards */
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(23,34,29,.025); }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 11px; }
.admin-card-head h2 { font-size: 13px; font-weight: 600; }
.admin-card-head .sub { margin-top: 2px; font-size: 10px; color: var(--muted); }
.admin-card-head .actions { display: flex; gap: 6px; align-items: center; }
.admin-card-body { padding: 0 16px 16px; }
.admin-card-pad { padding: 16px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 15px 16px 13px; position: relative; overflow: hidden; }
.kpi-card .kpi-label { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.kpi-card .kpi-value { margin-top: 6px; font-family: var(--num); font-size: 26px; font-weight: 550; letter-spacing: -.02em; line-height: 1.15; }
.kpi-card .kpi-value small { font-size: 13px; font-weight: 400; margin-right: 2px; color: var(--ink-2); }
.kpi-card .kpi-foot { margin-top: 7px; display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted); }
.kpi-card .delta-up { color: #2c6b4e; display: inline-flex; align-items: center; gap: 2px; font-family: var(--num); }
.kpi-card .delta-down { color: #b4453c; display: inline-flex; align-items: center; gap: 2px; font-family: var(--num); }
.kpi-card .kpi-icon { position: absolute; right: 13px; top: 12px; color: #dfe6e0; }

/* Overview layout */
.overview-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.85fr); gap: 13px; margin-top: 13px; align-items: start; }
.overview-bottom { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr) minmax(300px,.7fr); gap: 13px; margin-top: 13px; align-items: start; }
.chart-area { padding: 2px 16px 10px; }
.chart-head-actions { display: flex; align-items: center; gap: 7px; }
.chart-head-actions .segmented button { min-height: 25px; padding: 0 8px; font-size: 9px; }
.rank-list { padding: 3px 16px 14px; }
.rank-row { display: grid; grid-template-columns: 20px 1fr auto; gap: 9px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1f3ef; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { font-family: var(--num); font-size: 10px; color: #a0a8a1; text-align: center; }
.rank-no.top { color: var(--gold); font-weight: 600; }
.rank-main .rank-name { font-size: 11.5px; font-weight: 550; display: flex; align-items: center; justify-content: space-between; }
.rank-main .rank-name span { font-family: var(--num); font-size: 11px; color: var(--ink-2); }
.rank-main .rank-track { height: 4px; background: #eef0eb; border-radius: 2px; overflow: hidden; margin-top: 6px; }
.rank-main .rank-track span { display: block; height: 100%; background: #2c7a60; border-radius: 2px; }
.rank-main .rank-meta { margin-top: 3px; font-size: 8.5px; color: var(--muted); }
.level-bars { padding: 4px 16px 14px; }
.level-bar-row { display: grid; grid-template-columns: 66px 1fr 44px 38px; gap: 8px; align-items: center; padding: 7px 0; }
.level-bar-row .lb-name { font-size: 10.5px; color: var(--ink-2); }
.level-bar-row .lb-track { height: 6px; border-radius: 3px; background: #eef0eb; overflow: hidden; }
.level-bar-row .lb-track span { display: block; height: 100%; background: #2c7a60; border-radius: 3px; }
.level-bar-row .lb-value { font-family: var(--num); font-size: 10.5px; text-align: right; }
.level-bar-row .lb-pct { font-family: var(--num); font-size: 9.5px; color: var(--muted); text-align: right; }
.todo-list { padding: 2px 16px 12px; }
.todo-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 0; border: 0; border-bottom: 1px solid #f1f3ef; background: transparent; }
.todo-row:last-child { border-bottom: 0; }
.todo-row .todo-ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.todo-row .todo-ico.red { background: var(--danger-soft); color: var(--danger); }
.todo-row .todo-ico.green { background: var(--brand-wash); color: var(--brand); }
.todo-row .todo-title { font-size: 11px; font-weight: 550; }
.todo-row .todo-sub { margin-top: 1px; font-size: 9.5px; color: var(--muted); }
.todo-row .icon-chev { margin-left: auto; color: #b8c0b9; }
.activity-mini { padding: 2px 16px 10px; }
.mini-activity { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f1f3ef; }
.mini-activity:last-child { border-bottom: 0; }
.mini-activity .ma-dot { width: 5px; height: 5px; border-radius: 50%; background: #b08a4a; margin-top: 7px; flex: none; }
.mini-activity .ma-title { font-size: 10.5px; font-weight: 550; }
.mini-activity .ma-sub { margin-top: 1px; font-size: 9.5px; color: var(--muted); line-height: 1.5; }
.mini-activity .ma-time { font-size: 8.5px; color: #a1a9a2; font-family: var(--num); white-space: nowrap; margin-left: auto; }

/* Tables */
.admin-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 9px; overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.admin-table th {
  text-align: left; font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  background: #fafbf8; padding: 10px 13px; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.admin-table td { padding: 11px 13px; border-bottom: 1px solid #eff1ec; font-size: 11.5px; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfcf9; }
.admin-table tbody tr.is-clickable { cursor: pointer; }
.admin-table .cell-user { display: flex; align-items: center; gap: 9px; }
.admin-table .cell-user .cn { font-size: 11.5px; font-weight: 600; }
.admin-table .cell-user .cs { margin-top: 1px; font-size: 9px; color: var(--muted); font-family: var(--num); }
.admin-table .num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.admin-table .right { text-align: right; }
.admin-table .actions button + button { margin-left: 4px; }
.admin-table .empty-cell { padding: 0; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 2px 0; }
.table-foot .count { font-size: 10.5px; color: var(--muted); }
.admin-pagination { display: flex; align-items: center; gap: 3px; }
.admin-pagination button { min-width: 27px; height: 27px; border: 1px solid var(--line); background: #fff; border-radius: 5px; font-size: 10.5px; color: var(--ink-2); }
.admin-pagination button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.admin-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; z-index: 210; background: rgba(12,22,17,.36); animation: fadeIn .18s ease both; }
.admin-drawer {
  position: fixed; z-index: 211; top: 0; right: 0; bottom: 0; width: min(470px, 100vw);
  background: #fff; box-shadow: -14px 0 40px rgba(15,28,21,.17);
  display: flex; flex-direction: column; animation: drawerIn .24s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head h2 { font-size: 16px; font-weight: 650; }
.drawer-head .sub { margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.drawer-body { padding: 17px 20px 22px; overflow: auto; flex: 1; }
.drawer-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex: none; }
.drawer-close { width: 31px; height: 31px; border: 1px solid var(--line); background: #fff; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.drawer-profile { display: flex; align-items: center; gap: 11px; padding: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.drawer-profile .avatar { width: 44px; height: 44px; font-size: 16px; border-radius: 11px; }
.drawer-profile .dp-name { font-size: 14px; font-weight: 600; }
.drawer-profile .dp-sub { margin-top: 2px; font-size: 10px; color: var(--muted); }
.drawer-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 13px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.drawer-stat { padding: 11px 12px; text-align: center; border-right: 1px solid var(--line); }
.drawer-stat:last-child { border-right: 0; }
.drawer-stat b { display: block; font-family: var(--num); font-size: 16px; font-weight: 550; }
.drawer-stat span { display: block; margin-top: 2px; font-size: 9px; color: var(--muted); }
.drawer-section { margin-top: 16px; }
.drawer-section h3 { font-size: 11.5px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.drawer-kv { display: grid; grid-template-columns: 78px 1fr; gap: 8px 12px; font-size: 10.5px; }
.drawer-kv .k { color: var(--muted); }
.drawer-kv .v { color: var(--ink-2); }
.drawer-list { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.drawer-list-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-bottom: 1px solid #f1f3ef; font-size: 10.5px; }
.drawer-list-row:last-child { border-bottom: 0; }
.drawer-list-row .dl-main { font-weight: 550; }
.drawer-list-row .dl-sub { margin-top: 1px; font-size: 9px; color: var(--muted); }
.drawer-list-row .dl-right { margin-left: auto; text-align: right; }
.drawer-list-row .dl-right b { display: block; font-family: var(--num); font-size: 10.5px; font-weight: 550; }
.drawer-list-row .dl-right span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.drawer-note { margin-top: 14px; padding: 9px 11px; background: var(--brand-wash); border-radius: 6px; font-size: 9.5px; color: var(--brand-3); line-height: 1.6; }

/* Stores */
.stores-layout { display: grid; grid-template-columns: 286px minmax(0,1fr); gap: 13px; align-items: start; }
.store-tree-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: sticky; top: 76px; }
.store-tree-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); }
.store-tree-head h2 { font-size: 12px; font-weight: 600; }
.store-tree-head button { border: 0; background: none; color: var(--brand); font-size: 10px; display: inline-flex; align-items: center; gap: 2px; }
.store-tree { padding: 8px 8px 12px; max-height: calc(100vh - 190px); overflow: auto; }
.tree-merchant { margin-bottom: 2px; }
.tree-merchant-btn { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 7px; border: 0; background: transparent; border-radius: 5px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); text-align: left; }
.tree-merchant-btn:hover { background: var(--surface-2); }
.tree-merchant-btn .count { margin-left: auto; font-size: 8.5px; color: var(--muted); font-family: var(--num); }
.tree-brand { margin-left: 10px; }
.tree-brand-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 7px; border: 0; background: transparent; border-radius: 4px; font-size: 10px; color: var(--ink-3); text-align: left; }
.tree-brand-btn:hover { background: var(--surface-2); }
.tree-store {
  display: flex; align-items: center; gap: 6px; width: 100%; margin: 1px 0 1px 14px; padding: 7px 8px;
  border: 1px solid transparent; background: transparent; border-radius: 5px; font-size: 10.5px; color: var(--ink-2); text-align: left;
}
.tree-store:hover { background: var(--surface-2); }
.tree-store.is-active { background: var(--brand-wash); border-color: #d4e3da; color: var(--brand); font-weight: 600; }
.tree-store .code { margin-left: auto; font-size: 8.5px; color: var(--muted); font-family: var(--num); }
.tree-arrow { color: #aab2ac; transition: transform .15s ease; }
.tree-arrow.open { transform: rotate(90deg); }
.tree-empty { padding: 12px; font-size: 10px; color: var(--muted); }
.store-detail { min-width: 0; }
.store-hero-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 17px 18px; }
.store-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.store-title { display: flex; align-items: center; gap: 9px; }
.store-title h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.store-title .code { font-size: 9.5px; color: var(--muted); font-family: var(--num); background: var(--paper); border-radius: 3px; padding: 1px 5px; }
.store-hero-actions { display: flex; gap: 6px; flex: none; }
.store-hero-actions .btn { min-height: 31px; font-size: 10.5px; }
.store-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; margin-top: 15px; padding-top: 13px; border-top: 1px solid #eff1ed; font-size: 10.5px; }
.store-info-grid .k { color: var(--muted); font-size: 9.5px; }
.store-info-grid .v { margin-top: 2px; color: var(--ink-2); }
.store-lower { display: grid; grid-template-columns: minmax(0,1fr) 212px; gap: 13px; margin-top: 13px; align-items: start; }
.store-qr-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.store-qr-card .qr-frame { border: 0; padding: 4px; }
.store-qr-card .qr-frame svg { width: 158px; height: 158px; }
.store-qr-card .qr-title { margin-top: 5px; font-size: 10.5px; font-weight: 600; }
.store-qr-card .qr-sub { margin-top: 2px; font-size: 8.5px; color: var(--muted); line-height: 1.5; }
.store-qr-card .qr-actions { display: flex; gap: 5px; margin-top: 9px; }
.store-qr-card .qr-actions .btn { flex: 1; min-height: 29px; font-size: 9.5px; padding: 0 5px; }
.store-rules-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.store-rule-tabs { padding: 0 13px; border-bottom: 1px solid var(--line); }
.store-rule-tabs .tabs { border-bottom: 0; gap: 20px; }
.store-rule-tabs .tabs button { padding: 11px 0 10px; font-size: 10.5px; }
.store-rule-body { padding: 14px 15px; }
.rule-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.rule-table th { text-align: left; font-size: 9.5px; font-weight: 500; color: var(--muted); padding: 6px 7px; border-bottom: 1px solid var(--line); }
.rule-table td { padding: 9px 7px; border-bottom: 1px solid #f1f3ef; vertical-align: middle; }
.rule-table tr:last-child td { border-bottom: 0; }
.rule-table td.num { font-family: var(--num); text-align: right; }
.rule-table th.num { text-align: right; }
.rule-table .rule-actions { white-space: nowrap; text-align: right; }
.rule-table .rule-actions .btn { min-height: 25px; font-size: 9px; padding: 0 7px; }
.rule-note { margin-top: 9px; font-size: 9px; color: var(--muted); line-height: 1.6; }

/* Permissions */
.permission-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.permission-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.permission-table th { font-size: 10.5px; font-weight: 600; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbf8; text-align: center; }
.permission-table th:first-child { text-align: left; }
.permission-table td { padding: 9px 14px; border-bottom: 1px solid #f1f3ef; font-size: 10.5px; text-align: center; }
.permission-table td:first-child { text-align: left; }
.permission-table tr:last-child td { border-bottom: 0; }
.permission-table .role-head { font-size: 11px; }
.permission-table .role-head span { display: block; font-size: 8.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.permission-table .perm-check { width: 16px; height: 16px; accent-color: var(--brand); }
.permission-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-top: 1px solid var(--line); background: #fbfcf9; }
.permission-foot span { font-size: 9.5px; color: var(--muted); }
.permission-foot .btn { min-height: 32px; font-size: 10.5px; }
.matrix-wrap { overflow: auto; }

/* Documents */
.doc-type {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 3px;
  font-size: 9.5px; background: var(--paper-2); color: var(--ink-3);
}
.doc-timeline { position: relative; padding-left: 20px; }
.doc-timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 8px; width: 1px; background: #e0e5de; }
.doc-timeline-item { position: relative; padding: 0 0 15px 0; }
.doc-timeline-item:last-child { padding-bottom: 0; }
.doc-timeline-item::before { content: ""; position: absolute; left: -19px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid #b8c4bc; }
.doc-timeline-item.is-done::before { background: var(--brand); border-color: var(--brand); }
.doc-timeline-item .dt-title { font-size: 10.5px; font-weight: 550; }
.doc-timeline-item .dt-time { font-size: 8.5px; color: var(--muted); margin-top: 1px; font-family: var(--num); }
.doc-timeline-item .dt-sub { font-size: 9.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.doc-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; font-size: 10.5px; }
.doc-detail-grid .k { font-size: 9px; color: var(--muted); }
.doc-detail-grid .v { margin-top: 2px; }
.doc-detail-grid .full { grid-column: 1 / -1; }

/* Export */
.export-layout { display: grid; grid-template-columns: 370px minmax(0,1fr); gap: 13px; align-items: start; }
.export-form-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; position: sticky; top: 76px; }
.export-form-card h2 { font-size: 13px; font-weight: 600; }
.export-form-card .sub { margin-top: 3px; font-size: 9.5px; color: var(--muted); line-height: 1.6; }
.export-form { margin-top: 15px; display: flex; flex-direction: column; gap: 12px; }
.export-form .field-label { font-size: 10px; }
.export-form .input, .export-form .select { min-height: 36px; font-size: 11px; }
.export-form .form-row { gap: 8px; }
.export-form .btn { min-height: 38px; font-size: 11.5px; margin-top: 2px; }
.export-note { margin-top: 12px; padding: 9px 10px; border-radius: 6px; background: var(--surface-2); font-size: 9px; color: var(--muted); line-height: 1.65; }
.export-task-name { font-size: 10.5px; font-weight: 550; }
.export-task-sub { margin-top: 1px; font-size: 8.5px; color: var(--muted); }
.export-progress { min-width: 130px; }
.export-progress .track { height: 5px; background: #eef0eb; border-radius: 3px; overflow: hidden; }
.export-progress .track span { display: block; height: 100%; border-radius: 3px; background: #2c7a60; transition: width .3s ease; }
.export-progress .meta { display: flex; justify-content: space-between; margin-top: 3px; font-size: 8px; color: var(--muted); font-family: var(--num); }
.export-status-failed { color: var(--danger); }

/* Admin login */
.admin-login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: #f4f5f1; }
.admin-login-left {
  position: relative; overflow: hidden; padding: 34px 42px; color: #f1eadc;
  background:
    repeating-linear-gradient(118deg, rgba(255,255,255,.025) 0 1px, transparent 1px 11px),
    radial-gradient(ellipse at 88% 10%, rgba(188,148,84,.16), transparent 58%),
    #102e24;
  display: flex; flex-direction: column;
}
.admin-login-left::after { content: ""; position: absolute; right: -120px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(220,188,135,.14); box-shadow: 0 0 0 30px rgba(220,188,135,.025), 0 0 0 60px rgba(220,188,135,.014); }
.admin-login-brand { display: flex; align-items: center; gap: 10px; position: relative; }
.admin-login-brand .brand-seal { width: 38px; height: 38px; background: rgba(255,255,255,.06); border: 1px solid rgba(220,188,135,.4); color: #e9d5ae; font-size: 19px; }
.admin-login-brand .alb-name { font-size: 14px; font-weight: 600; }
.admin-login-brand .alb-sub { margin-top: 1px; font-size: 8px; letter-spacing: .16em; color: rgba(240,233,217,.4); font-family: var(--num); }
.admin-login-copy { position: relative; margin: auto 0; padding: 46px 0; max-width: 490px; }
.admin-login-copy .eyebrow { color: #cdb17f; }
.admin-login-copy h1 { margin-top: 13px; font-size: clamp(32px, 4vw, 46px); font-weight: 600; line-height: 1.2; letter-spacing: -.035em; }
.admin-login-copy p { margin-top: 15px; max-width: 380px; font-size: 11.5px; line-height: 1.8; color: rgba(242,234,220,.5); }
.admin-login-metrics { position: relative; display: flex; gap: 38px; padding-top: 18px; border-top: 1px solid rgba(236,220,192,.14); }
.admin-login-metrics div b { display: block; font-family: var(--num); font-size: 19px; font-weight: 500; color: #e9d6b5; }
.admin-login-metrics div span { display: block; margin-top: 2px; font-size: 8px; color: rgba(242,234,220,.38); }
.admin-login-right { display: flex; align-items: center; justify-content: center; padding: 40px; }
.admin-login-form { width: min(360px, 100%); }
.admin-login-form .login-brand-mini { display: flex; align-items: center; gap: 8px; margin-bottom: 27px; }
.admin-login-form .login-brand-mini .brand-seal { width: 29px; height: 29px; font-size: 14px; }
.admin-login-form .login-brand-mini span { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.admin-login-form h2 { font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.admin-login-form .lg-sub { margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.admin-login-form .form { margin-top: 25px; display: flex; flex-direction: column; gap: 14px; }
.admin-login-form .field-label { font-size: 10px; }
.admin-login-form .input { min-height: 44px; background: #fff; }
.admin-login-form .login-error { min-height: 16px; font-size: 10.5px; color: var(--danger); }
.admin-login-form .btn { min-height: 44px; margin-top: 2px; }
.admin-login-form .lg-tip { margin-top: 14px; padding: 8px 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font-size: 9px; color: var(--muted); line-height: 1.6; display: flex; gap: 5px; }
.admin-login-form .lg-foot { margin-top: 22px; text-align: center; font-size: 9px; color: #a1a8a2; }
.admin-login-form .lg-foot a { color: var(--brand); }

/* Misc admin */
.admin-empty { padding: 45px 20px; text-align: center; color: var(--muted); }
.admin-empty .icon { color: #b7beb8; }
.admin-empty .t { margin-top: 9px; font-size: 12px; font-weight: 550; color: var(--ink-2); }
.admin-empty .d { margin-top: 4px; font-size: 10px; line-height: 1.6; }
.admin-note { margin-top: 13px; font-size: 9.5px; color: var(--muted); line-height: 1.7; }
.admin-inline-actions { display: flex; gap: 5px; align-items: center; }
.admin-inline-actions .btn { min-height: 27px; font-size: 9.5px; padding: 0 8px; }
.toggle-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; }
.toggle-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: #2c7a60; }
.toggle-pill.off .dot { background: #b0b7b1; }
.toggle-pill.off { color: var(--muted); }

@media (max-width: 1240px) {
  .admin-shell { grid-template-columns: 210px minmax(0,1fr); }
  .admin-content { padding-left: 22px; padding-right: 22px; }
  .overview-bottom { grid-template-columns: 1fr 1fr; }
  .overview-bottom > :last-child { grid-column: 1 / -1; }
  .kpi-card .kpi-value { font-size: 23px; }
}
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { padding: 18px 16px 40px; }
  .admin-topbar { padding: 0 16px; }
  .admin-global-search { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-bottom { grid-template-columns: 1fr; }
  .overview-bottom > :last-child { grid-column: auto; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .stores-layout { grid-template-columns: 1fr; }
  .store-tree-card { position: static; }
  .store-lower { grid-template-columns: 1fr; }
  .export-layout { grid-template-columns: 1fr; }
  .export-form-card { position: static; }
  .admin-login-page { grid-template-columns: 1fr; }
  .admin-login-left { display: none; }
  .admin-login-right { padding: 26px; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .admin-table { min-width: 760px; }
  .page-head { flex-direction: column; }
  .page-head .actions { flex-wrap: wrap; }
  .filter-bar .search-field { min-width: 100%; }
  .filter-bar .select { flex: 1; min-width: 90px; }
  .admin-drawer { width: 100vw; }
  .admin-content { padding-left: 12px; padding-right: 12px; }
}

.export-task-table { min-width: 680px; }
.export-task-table th, .export-task-table td { padding-left: 9px; padding-right: 9px; }
