/* Brenav console */

.admin { background: #f4f3ec; color: var(--ink); }
.admin ::-webkit-scrollbar { width: 8px; height: 8px; }
.admin ::-webkit-scrollbar-thumb { background: #cfcbbb; border-radius: 8px; }

/* ------------------------------ shell ------------------------------ */
.a-side { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--ink-900); color: #e6e2d4; display: flex; flex-direction: column; z-index: 40; }
.a-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.a-brand img { height: 26px; }
.a-brand span { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.a-nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; font-size: 12.8px; color: rgba(230, 226, 212, 0.72); transition: background 0.18s ease, color 0.18s ease; }
.a-nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.a-nav-link.is-active { background: rgba(222, 121, 35, 0.16); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.a-nav-link .i { opacity: 0.8; }
.a-side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.a-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.a-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(222, 121, 35, 0.9); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.a-user-info { display: flex; flex-direction: column; min-width: 0; }
.a-user-info strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-user-info em { font-style: normal; font-size: 10.5px; color: rgba(230, 226, 212, 0.5); }
.a-side-actions { display: flex; gap: 6px; align-items: center; }
.a-side-actions form { display: inline-flex; }
.a-ghost { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; background: transparent; color: rgba(230, 226, 212, 0.75); cursor: pointer; }
.a-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.a-main { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }
.a-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 30px; background: #fbfaf5; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.a-top-title h1 { font-size: 21px; letter-spacing: -0.02em; }
.a-top-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.05em; margin-top: 2px; }
.a-top-actions { display: flex; gap: 8px; }
.a-content { padding: 24px 30px 60px; flex: 1; }
.pjax-inner { animation: pjax-in 0.22s ease; }
@keyframes pjax-in { from { opacity: 0; transform: translateY(4px); } }

.a-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.a-toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; animation: toast-in 0.22s ease both; max-width: 360px; }
.a-toast.is-error { background: #8e3830; }
.a-progress { position: fixed; top: 0; left: 236px; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); z-index: 210; animation: progress 1.1s linear infinite; }
@keyframes progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.a-overlay { position: fixed; inset: 0; background: rgba(250, 248, 242, 0.6); backdrop-filter: blur(2px); z-index: 150; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(49, 57, 40, 0.15); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ------------------------------ buttons + inputs ------------------------------ */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.8px; font-weight: 600; cursor: pointer; color: var(--ink); transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease; white-space: nowrap; }
.a-btn:hover { background: #fbfaf5; border-color: #c6c2b2; }
.a-btn:active { transform: translateY(1px); }
.a-btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.a-btn-primary:hover { background: var(--ink-700); border-color: var(--ink-700); color: #fff; }
.a-btn-ghost { background: transparent; border-color: transparent; color: var(--ink-700); }
.a-btn-ghost:hover { background: var(--paper-2); }
.a-btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.a-btn-danger:hover { background: #983831; color: #fff; }
.a-btn-danger-ghost { color: var(--err); border-color: transparent; }
.a-btn-danger-ghost:hover { background: #fbeceb; border-color: #f0cfcc; }
.a-btn-sm { padding: 6px 11px; font-size: 11.5px; border-radius: 7px; }
.a-btn-lg { padding: 13px 24px; font-size: 14px; }
.a-btn-block { width: 100%; }
.a-btn[disabled], .a-btn.is-disabled { opacity: 0.42; pointer-events: none; }
.a-btn.loading { color: transparent; position: relative; }
.a-btn.loading::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.a-icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.a-icon-btn:hover { background: var(--paper-2); color: var(--ink); }

.a-field { display: flex; flex-direction: column; gap: 6px; }
.a-field.is-wide { grid-column: 1 / -1; }
.a-label { font-size: 12px; font-weight: 600; color: var(--ink-700); letter-spacing: 0.01em; }
.a-label em { color: var(--accent-600); font-style: normal; margin-left: 3px; }
.a-input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; color: var(--ink); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.a-input:focus { outline: none; border-color: var(--ink-700); box-shadow: 0 0 0 3px rgba(49, 57, 40, 0.07); }
.a-input-sm { padding: 7px 10px; font-size: 12px; }
.a-textarea { resize: vertical; min-height: 80px; line-height: 1.6; font-family: inherit; }
.a-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='%23717a67' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.a-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a-form { display: flex; flex-direction: column; gap: 14px; }

.a-switch { display: inline-flex; align-items: center; }
.a-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.a-switch-track { width: 42px; height: 24px; border-radius: 999px; background: #d9d5c6; position: relative; transition: background 0.2s ease; cursor: pointer; display: inline-block; }
.a-switch-dot { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.a-switch input:checked + .a-switch-track { background: var(--ink-700); }
.a-switch input:checked + .a-switch-track .a-switch-dot { transform: translateX(18px); }

.a-image-row { display: flex; align-items: center; gap: 10px; }
.a-image-preview { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); }
.a-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.a-upload-btn { cursor: pointer; }
.a-perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; }
.a-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-700); cursor: pointer; padding: 3px 0; }
.a-check input { accent-color: var(--ink-700); }
.a-hint-block { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 9px; background: #fbfaf5; border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }

/* ------------------------------ toolbar + table ------------------------------ */
.a-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.a-toolbar-left { display: flex; align-items: baseline; gap: 12px; }
.a-toolbar-left h2 { font-size: 18px; }
.a-toolbar-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.a-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.a-search { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--muted); }
.a-search .a-input { border: 0; padding: 8px 0; box-shadow: none; width: 190px; }
.a-search .a-input:focus { box-shadow: none; }
.a-dropdown { position: relative; }
.a-dropdown-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 210px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 12px; z-index: 60; }
.a-dropdown-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.a-dropdown-panel .a-btn { margin-top: 8px; }

.a-batchbar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--accent-100); background: #fdf4ea; border-radius: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.a-batch-count { font-size: 12px; font-weight: 600; color: var(--accent-600); }
.a-batch-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.a-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.a-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 720px; }
.a-table thead th { position: sticky; top: 0; background: #fbfaf5; border-bottom: 1px solid var(--line); padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: left; z-index: 1; }
.a-table thead th.is-right { text-align: right; }
.a-th-check { width: 44px; }
.a-table td { padding: 11px 14px; border-bottom: 1px solid #f0eee4; font-size: 12.8px; vertical-align: middle; }
.a-table tbody tr:hover td { background: #fbfaf6; }
.a-table tbody tr:last-child td { border-bottom: 0; }
.a-table td.is-right { text-align: right; font-variant-numeric: tabular-nums; }
.a-td-check { width: 44px; }
.a-th-check input, .a-td-check input { accent-color: var(--ink-700); width: 15px; height: 15px; }
.a-row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.col-resizer { position: absolute; right: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 5; }
.a-table thead th { position: sticky; }
.col-resizer::after { content: ""; position: absolute; right: 4px; top: 22%; bottom: 22%; width: 1px; background: transparent; }
.a-table th[data-col]:hover .col-resizer::after { background: var(--line-strong); }
.a-cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.a-cell-main > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.a-cell-main strong { font-size: 12.8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-cell-main em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.a-thumb { width: 38px; height: 38px; border-radius: 7px; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); }
.a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 46px 20px; color: var(--muted); }
.a-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; }
.a-badge-ok { background: #e8f3ec; color: #256b45; }
.a-badge-warn { background: #fbf0db; color: #97610f; }
.a-badge-muted { background: #eeede5; color: #6a705f; }
.a-badge-olive { background: #eceee2; color: #4d583c; }
.a-pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.a-pager-btns { display: flex; gap: 6px; }

/* ------------------------------ dashboard ------------------------------ */
.a-dash { display: flex; flex-direction: column; gap: 18px; }
.a-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; background: linear-gradient(120deg, #2b3223, #414b33); color: #f4f1e8; border-radius: 16px; padding: 30px 32px; position: relative; overflow: hidden; }
.a-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(222, 121, 35, 0.35); box-shadow: 0 0 0 40px rgba(222, 121, 35, 0.06), 0 0 0 80px rgba(222, 121, 35, 0.04); }
.a-hero-copy h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 6px; }
.a-hero-copy p { font-size: 12.5px; color: rgba(244, 241, 232, 0.65); }
.a-eyebrow { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #e7b27e; display: block; margin-bottom: 10px; }
.a-hero-actions { display: flex; gap: 10px; position: relative; z-index: 2; }
.a-hero .a-btn-ghost { color: #f4f1e8; border-color: rgba(255, 255, 255, 0.22); }
.a-hero .a-btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

.a-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.a-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.a-stat-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.a-stat-head .i { color: var(--ink-700); opacity: 0.7; }
.a-stat-value { font-size: 26px; letter-spacing: -0.03em; }
.a-stat-sub { font-size: 11px; color: var(--muted); }
.a-stat::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 44px; background: var(--line-strong); }
.a-stat-orange::after { background: var(--accent); }
.a-stat-olive::after { background: var(--ink-700); }
.a-stat-cream::after { background: #c9c1a5; }
.a-stat-sage::after { background: var(--olive-500); }

.a-dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.a-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.a-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.a-panel-head h3 { font-size: 14.5px; }
.a-panel-head p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.a-link { font-size: 11.5px; color: var(--accent-600); display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.a-link:hover { color: var(--accent-600); text-decoration: underline; text-underline-offset: 3px; }
.a-mini-list { display: flex; flex-direction: column; }
.a-mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #f2f0e7; }
.a-mini-row:last-child { border-bottom: 0; }
.a-mini-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.a-mini-main strong { font-size: 12.5px; }
.a-mini-main em { font-style: normal; font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.a-mini-amount { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.a-rank-list { display: flex; flex-direction: column; gap: 2px; }
.a-rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid #f2f0e7; font-size: 12px; }
.a-rank { font-size: 10.5px; color: var(--accent-600); font-weight: 700; width: 20px; }
.a-rank-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-rank-sales { color: var(--muted); font-size: 10.5px; }
.a-release-list { display: flex; flex-direction: column; }
.a-release-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #f2f0e7; }
.a-release-row:last-child { border-bottom: 0; }
.a-version { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: var(--accent-100); color: var(--accent-600); font-weight: 700; }
.a-release-main { display: flex; flex-direction: column; min-width: 0; }
.a-release-main strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-release-main em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.a-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.a-quick { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf5; font-size: 12px; cursor: pointer; color: var(--ink-700); text-align: left; }
.a-quick:hover { border-color: var(--line-strong); background: #fff; color: var(--ink); }

/* ------------------------------ settings ------------------------------ */
.a-settings-form { display: flex; flex-direction: column; gap: 16px; }
.a-settings-intro { display: flex; flex-direction: column; gap: 4px; }
.a-settings-intro h2 { font-size: 19px; }
.a-settings-intro p { font-size: 12px; color: var(--muted); }
.a-save-stamp { font-size: 11px; color: var(--muted); margin-top: 4px; }
.a-settings-group .a-form-grid { margin-top: 4px; }
.a-settings-actions { display: flex; gap: 10px; position: sticky; bottom: 16px; background: rgba(244, 243, 236, 0.92); backdrop-filter: blur(8px); padding: 12px 0; border-top: 1px solid var(--line); }
.a-entry-row { display: flex; align-items: center; gap: 6px; }
.a-entry-prefix { font-size: 13px; color: var(--muted); font-family: ui-monospace, monospace; }
.a-entry-input { font-family: ui-monospace, monospace; }

/* ------------------------------ detail / misc ------------------------------ */
.a-detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.a-back { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.a-back:hover { color: var(--ink); }
.a-detail-head h2 { font-size: 21px; display: flex; align-items: center; gap: 10px; }
.a-muted { font-size: 12px; color: var(--muted); }
.a-detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.a-detail-side { display: flex; flex-direction: column; gap: 16px; }
.a-table-plain { min-width: 0; }
.a-totals { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; }
.a-totals > div { display: flex; justify-content: space-between; }
.a-totals .is-total { font-size: 15px; font-weight: 600; margin-top: 4px; }
.a-addr { font-size: 12.5px; line-height: 1.9; color: var(--ink-700); }
.a-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.a-alert { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 9px; font-size: 12px; line-height: 1.6; }
.a-alert-error { background: #fbeceb; border: 1px solid #f0cfcc; color: var(--err); }
.a-alert-warn { background: #fdf4e6; border: 1px solid #f2ddb8; color: #8a5a11; }
.a-alert-ok { background: #edf5ee; border: 1px solid #cfe6d5; color: #22583a; }
.a-cache-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.a-cache-item { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf5; display: flex; flex-direction: column; gap: 4px; }
.a-cache-item em { font-style: normal; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.a-cache-item strong { font-size: 19px; }
.a-cache-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.a-list { padding-left: 18px; font-size: 12.5px; line-height: 1.9; color: var(--ink-700); }
.a-profile { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.a-perm-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.a-tag { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 11px; color: var(--muted); }
.a-tag.is-on { background: #eceee2; border-color: #d4dac2; color: var(--ink-700); }
.a-filterbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.a-filter-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.a-filterbar .a-select { width: 150px; }
.a-denied { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 10px; }
.a-denied h1 { font-size: 56px; color: var(--accent); }
.a-denied p { color: var(--muted); margin-bottom: 10px; }

/* ------------------------------ modal ------------------------------ */
.a-modal-layer { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 24px; background: rgba(34, 39, 27, 0.45); backdrop-filter: blur(3px); animation: fade-in 0.18s ease; }
.a-modal { width: 100%; max-width: 780px; max-height: 90vh; background: var(--surface); border-radius: 14px; box-shadow: 0 30px 80px rgba(34, 39, 27, 0.3); display: flex; flex-direction: column; animation: modal-in 0.22s ease; overflow: hidden; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
.a-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.a-modal-head h2 { font-size: 16px; }
.a-modal-body { padding: 20px 22px; overflow-y: auto; }
.a-modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfaf5; }
.a-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.a-modal .a-form { gap: 14px; }

/* ------------------------------ login ------------------------------ */
.admin-login { background: var(--paper); }
.login-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-hero { background: var(--ink-900); color: #f4f1e8; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; bottom: -140px; border-radius: 50%; border: 1px solid rgba(222, 121, 35, 0.3); box-shadow: 0 0 0 60px rgba(222, 121, 35, 0.05), 0 0 0 120px rgba(222, 121, 35, 0.03); }
.login-brand img { height: 34px; }
.login-hero-copy h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; margin: 16px 0 14px; letter-spacing: -0.03em; }
.login-hero-copy p { font-size: 13.5px; color: rgba(244, 241, 232, 0.65); max-width: 340px; }
.login-hero-foot { font-size: 10.5px; letter-spacing: 0.1em; color: rgba(244, 241, 232, 0.4); text-transform: uppercase; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 430px; }
.login-logo { margin-bottom: 22px; }
.login-logo img { height: 30px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.qr-box { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.qr-code { width: 108px; height: 108px; flex: none; display: grid; place-items: center; background: #fff; border-radius: 8px; }
.qr-code svg { width: 100%; height: 100%; }
.qr-meta strong { font-size: 12.5px; display: block; }
.qr-meta p { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 4px 0 8px; }
.qr-state { font-size: 11px; color: var(--accent-600); display: block; margin-bottom: 6px; }
.qr-link { font-size: 10.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.login-locked { text-align: center; padding: 30px 20px; border: 1px solid #f0cfcc; background: #fbeceb; border-radius: 12px; color: var(--err); }
.login-locked .i { margin: 0 auto 10px; }
.login-locked h2 { font-size: 17px; margin-bottom: 6px; }
.login-locked p { font-size: 12px; line-height: 1.6; }

/* ------------------------------ scan ------------------------------ */
.admin-scan { background: var(--paper); }
.scan-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.scan-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.scan-brand { margin-bottom: 18px; }
.scan-brand img { height: 26px; }
.scan-card h1 { font-size: 22px; margin-bottom: 8px; }
.scan-sub { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 16px; }
.scan-ticket { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); background: var(--paper-2); padding: 8px 10px; border-radius: 7px; margin-bottom: 16px; word-break: break-all; }
.scan-ok { text-align: center; padding: 22px 0; color: var(--ok); }
.scan-ok .i { margin: 0 auto 8px; }
.scan-user { font-size: 12.5px; margin-bottom: 14px; }
.scan-card form { display: flex; flex-direction: column; gap: 10px; }
.scan-form { margin-top: 10px; }
.scan-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 10.5px; color: var(--muted); margin-top: 16px; }
.scan-card .a-btn { margin-top: 4px; }

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 1100px) {
  .a-stats { grid-template-columns: repeat(2, 1fr); }
  .a-dash-grid, .a-detail-grid, .a-profile { grid-template-columns: 1fr; }
  .a-cache-grid { grid-template-columns: repeat(2, 1fr); }
  .a-perm-grid { grid-template-columns: repeat(2, 1fr); }
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

@media (max-width: 860px) {
  .a-side { transform: translateX(-100%); transition: transform 0.25s ease; }
  .a-side.is-open { transform: translateX(0); }
  .a-main { margin-left: 0; }
  .a-top { padding: 16px 18px; }
  .a-content { padding: 18px 16px 50px; }
  .a-progress { left: 0; }
  .a-form-grid { grid-template-columns: 1fr; }
  .a-settings-group .a-form-grid { grid-template-columns: 1fr; }
  .a-hero { flex-direction: column; align-items: flex-start; }
  .a-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------ support desk ------------------------------ */
.a-nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; }
.a-nav-badge[hidden] { display: none; }

.a-support { display: flex; flex-direction: column; gap: 18px; min-height: calc(100vh - 160px); }
.a-support-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.a-support-top h2 { font-size: 24px; letter-spacing: -0.02em; margin: 5px 0 6px; }
.a-support-top p { font-size: 12.5px; line-height: 1.7; color: var(--muted); max-width: 560px; }
.a-eyebrow { font-size: 10px; letter-spacing: 0.18em; color: var(--accent-600); font-weight: 600; }
.a-support-kpis { display: flex; gap: 8px; flex: none; }
.a-kpi { min-width: 70px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.a-kpi strong { font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
.a-kpi em { font-style: normal; font-size: 10px; color: var(--muted); }

.a-support-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; flex: 1; min-height: 540px; }
.a-support-inbox { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.a-support-tools { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.a-support-tabs { display: flex; gap: 4px; padding: 3px; background: var(--paper-2); border-radius: 8px; }
.a-support-tabs button { flex: 1; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.a-support-tabs button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); font-weight: 600; }
.a-support-search { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); }
.a-support-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; color: var(--ink); }
.a-support-list { flex: 1; overflow-y: auto; min-height: 0; padding: 6px; }
.a-support-loading, .a-support-none { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 38px 16px; color: var(--muted); font-size: 12px; text-align: center; }
.a-spinner { width: 14px; height: 14px; border: 2px solid rgba(49, 57, 40, 0.16); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.a-support-item { width: 100%; display: flex; gap: 10px; padding: 11px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.a-support-item:hover { background: var(--paper-2); }
.a-support-item.is-active { background: #f2eee2; border-color: var(--line); }
.a-support-item.is-unread .a-support-item-top strong { color: var(--ink); }
.a-support-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #e9e3d2; color: var(--ink-700); font-size: 12px; font-weight: 700; }
.a-support-item.is-unread .a-support-avatar { background: var(--accent); color: #fff; }
.a-support-item-main { min-width: 0; flex: 1; }
.a-support-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.a-support-item-top strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-support-item-top time { font-size: 10px; color: var(--muted); flex: none; }
.a-support-item-preview { margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-support-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.a-support-item-foot span { font-size: 9.5px; color: var(--muted); letter-spacing: 0.03em; }
.a-support-count { min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px; background: var(--accent); color: #fff; font-size: 9.5px; line-height: 17px; text-align: center; font-weight: 700; }

.a-support-room { min-width: 0; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.a-support-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; color: var(--muted); }
.a-support-empty-mark { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--accent-600); margin-bottom: 12px; }
.a-support-empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 5px; }
.a-support-empty p { font-size: 11.5px; }
.a-support-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.a-support-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfaf5; }
.a-support-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.a-support-who strong { font-size: 14px; }
.a-support-who span { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-support-head-actions { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.a-support-assign { display: inline-flex; align-items: center; gap: 5px; }
.a-support-assign .a-select { width: 126px; min-width: 100px; }
.a-support-assign .a-btn { white-space: nowrap; }
.a-support-state { font-size: 10px; padding: 3px 8px; border-radius: 20px; background: #e8efe4; color: #3f6a3a; }
.a-support-state.is-closed { background: #eee; color: #777; }
.a-support-context { padding: 9px 18px; font-size: 10.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fffdf7; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.a-support-context a { color: var(--accent-600); text-decoration: underline; text-underline-offset: 2px; }
.a-support-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #f7f5ed; min-height: 220px; }
.a-support-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 76%; }
.a-support-msg.is-agent { align-self: flex-end; align-items: flex-end; }
.a-support-msg.is-system { align-self: center; max-width: 90%; align-items: center; }
.a-support-msg-meta { display: flex; align-items: center; gap: 7px; font-size: 9.5px; color: var(--muted); margin-bottom: 3px; }
.a-support-msg-body { padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.a-support-msg.is-agent .a-support-msg-body { background: var(--ink); border-color: var(--ink); color: #fff; }
.a-support-msg.is-system .a-support-msg-body { background: transparent; border: 0; padding: 2px 0; color: var(--muted); font-size: 10.5px; text-align: center; }
.a-support-msg-attachment { display: block; max-width: 240px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #f5f4ec; }
.a-support-msg-attachment img { display: block; width: 100%; max-height: 230px; object-fit: cover; }
.a-support-form { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.a-support-attach { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 8px; background: #f7f6ee; }
.a-support-attach[hidden] { display: none; }
.a-support-attach img { width: 42px; height: 42px; border-radius: 5px; object-fit: cover; flex: none; }
.a-support-attach span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.a-support-attach-remove { width: 24px; height: 24px; flex: none; border: 0; border-radius: 50%; background: rgba(49, 57, 40, 0.08); color: var(--ink-700); font-size: 16px; line-height: 1; cursor: pointer; }
.a-support-attach-remove:hover { background: rgba(222, 121, 35, 0.15); color: #a95512; }
.a-support-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.a-support-tools { position: relative; display: flex; gap: 3px; flex: none; padding-bottom: 1px; }
.a-support-tool { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; }
.a-support-tool:hover { background: rgba(49, 57, 40, 0.07); color: var(--ink); }
.a-support-tool svg { width: 17px; height: 17px; }
.a-support-emoji-pop { position: absolute; left: 0; bottom: 36px; z-index: 5; display: grid; grid-template-columns: repeat(7, 30px); gap: 2px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 10px 28px rgba(31, 37, 24, 0.16); }
.a-support-emoji-pop[hidden] { display: none; }
.a-support-emoji { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; font-size: 17px; line-height: 1; cursor: pointer; }
.a-support-emoji:hover { background: #f1efe4; }
.a-support-form textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 130px; resize: vertical; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 12.5px; line-height: 1.5; outline: none; background: #fff; }
.a-support-form textarea:focus { border-color: var(--ink-700); box-shadow: 0 0 0 3px rgba(49, 57, 40, 0.06); }
.a-support-form .a-btn { height: 42px; }
.a-support-tip { padding: 0 18px 10px; font-size: 9.5px; color: var(--muted); background: #fff; }

@media (max-width: 1180px) {
  .a-support-grid { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .a-support-top { flex-direction: column; align-items: flex-start; }
  .a-support-grid { grid-template-columns: 1fr; grid-template-rows: minmax(180px, 220px) minmax(420px, 1fr); }
  .a-support-inbox { min-height: 0; }
  .a-support-room { min-height: 420px; }
}
@media (max-width: 640px) {
  .a-support-kpis { width: 100%; }
  .a-kpi { flex: 1; min-width: 0; }
  .a-support-head { flex-wrap: wrap; }
  .a-support-form { flex-direction: column; align-items: stretch; }
  .a-support-compose-row { flex-wrap: wrap; }
  .a-support-compose-row textarea { min-width: 150px; }
  .a-support-tip { text-align: center; }
  .a-support-msg { max-width: 88%; }
}
/* ------------------------------ review moderation ------------------------------ */
.a-reviews { padding: 26px 30px 46px; max-width: 1180px; }
.a-review-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; background: linear-gradient(120deg, #2f3728, #4f5c3e); color: #f4f1e8; border-radius: 14px; padding: 28px 30px; margin-bottom: 18px; }
.a-review-hero .a-eyebrow { color: rgba(244, 241, 232, 0.65); }
.a-review-hero h2 { font-size: 32px; letter-spacing: -0.03em; margin: 6px 0 8px; }
.a-review-hero p { font-size: 12.5px; line-height: 1.7; color: rgba(244, 241, 232, 0.7); max-width: 560px; margin: 0; }
.a-review-hero-stat { text-align: right; white-space: nowrap; }
.a-review-hero-stat strong { display: block; font-size: 38px; line-height: 1; color: #e7b27e; }
.a-review-hero-stat span { font-size: 11px; letter-spacing: 0.08em; color: rgba(244, 241, 232, 0.6); text-transform: uppercase; }
.a-review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0; flex-wrap: wrap; }
.a-review-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.a-review-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fbfaf5; font-size: 12px; color: var(--ink-700); }
.a-review-tab span { min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #ece9df; color: var(--muted); font-size: 10.5px; }
.a-review-tab.is-active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.a-review-tab.is-active span { background: rgba(255, 255, 255, 0.16); color: #fff; }
.a-review-search { display: flex; align-items: center; gap: 8px; background: #fbfaf5; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px 4px 10px; }
.a-review-search .i { color: var(--muted); }
.a-review-search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 12px; width: 230px; color: var(--ink); }
.a-review-list { display: flex; flex-direction: column; gap: 12px; }
.a-review-card { background: #fbfaf5; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.a-review-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.a-review-product { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.a-review-product a { font-size: 13px; font-weight: 600; color: var(--ink); }
.a-review-product span { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.a-review-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.a-review-card-meta time { font-size: 10.5px; color: var(--muted); }
.a-review-rating { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.a-review-stars { color: #b67b28; letter-spacing: 2px; font-size: 14px; }
.a-review-rating strong { font-size: 12px; color: var(--muted); }
.a-review-title { font-size: 15px; margin: 12px 0 4px; }
.a-review-body { font-size: 12.5px; line-height: 1.7; color: var(--ink-700); margin: 8px 0 0; }
.a-review-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.a-review-media-item { width: 76px; height: 76px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); background: #111; display: grid; place-items: center; color: #f4f1e8; position: relative; }
.a-review-media-item img { width: 100%; height: 100%; object-fit: cover; }
.a-review-media-item.is-video { flex-direction: column; gap: 2px; font-size: 9.5px; color: #e7b27e; }
.a-review-no-media { display: block; font-size: 10.5px; color: var(--muted); margin-top: 10px; }
.a-review-note { font-size: 11.5px; color: #8a4a28; background: #f7eee8; border-radius: 6px; padding: 7px 9px; margin: 10px 0 0; }
.a-review-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.a-review-id { font-size: 10.5px; color: var(--muted); }
.a-review-actions > div { display: flex; gap: 6px; }
.a-review-empty { background: #fbfaf5; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 54px 20px; }
.a-review-empty .i { color: #b67b28; margin-bottom: 8px; }
@media (max-width: 760px) {
  .a-reviews { padding: 20px 16px 36px; }
  .a-review-hero { flex-direction: column; align-items: flex-start; }
  .a-review-hero-stat { text-align: left; }
  .a-review-card-head { flex-direction: column; }
  .a-review-card-meta { justify-content: flex-start; }
  .a-review-actions { flex-direction: column; align-items: flex-start; }
}