/* Admin panel (admin.html). Shared tokens and buttons come from site.css. */
body { background: var(--bg-deep); }
[hidden] { display: none !important; }
.small { font-size: 13px; }
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate-box { max-width: 440px; width: 100%; padding: 36px 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.gate-box p { margin: 0; line-height: 1.6; }
.admin-tag { font-size: 10px; font-weight: 700; color: var(--bg); background: var(--warn); border-radius: 3px; padding: 2px 5px; }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.aside { flex: 0 0 240px; background: var(--strip); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
	position: sticky; top: 0; height: 100vh; }
.aside .logo { padding: 0 8px 18px; }
.aside .logo-mark { width: 32px; height: 32px; font-size: 16px; }
.aside .logo-name { font-size: 17px; letter-spacing: 0; }
.side-menu { display: flex; flex-direction: column; gap: 2px; }
.side-menu a { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-radius: 6px;
	color: var(--muted); font-weight: 600; font-size: 14px; }
.side-menu a:hover, .side-menu a.on { background: var(--line); color: var(--text); }
.count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--bg); font-size: 12px; font-weight: 700;
	display: inline-flex; align-items: center; justify-content: center; }
.me { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.me img { width: 32px; height: 32px; border-radius: 4px; background: var(--line-2); flex: none; }
.me a { color: var(--muted); }
.me-name { font-weight: 600; overflow-wrap: anywhere; }

.main { flex: 1 1 600px; min-width: 0; padding: 28px 32px 60px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.head h1 { font-size: 30px; }
.sub-head { margin-top: 4px; font-size: 14px; }
.state { color: var(--ok-text); }
.state.off { color: var(--danger-text); }
.sec { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.panel { padding: 22px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 17px; margin: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tile { padding: 18px; }
.tile .big { font-size: 28px; }
.tile .hint { margin-top: 6px; font-size: 12px; color: var(--muted); }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 34px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 600 13px Inter, sans-serif; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--line); color: var(--text); }

.chart-box { position: relative; height: 200px; }
#chart { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px;
	padding: 4px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.axis { display: flex; justify-content: space-between; font-size: 12px; }

.list { display: flex; flex-direction: column; }
.list .li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list .li:last-child { border-bottom: 0; }
.list .li .r { color: var(--muted); white-space: nowrap; }
.list button.li { background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.list button.li:hover { color: var(--accent); }

.search input { height: 40px; width: 260px; max-width: 70vw; }
.tbl { min-width: 680px; }
.tbl td { padding: 10px 8px; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--strip); }
.tag { display: inline-block; padding: 3px 7px; border-radius: 4px; font-size: 12px; font-weight: 700; background: var(--line); color: var(--muted); margin-right: 4px; }
.tag.on { background: var(--ok-bg); color: var(--ok-text); }
.tag.vip { background: #1F2A1C; color: var(--ok-text); }
.tag.admin { background: #3A2E18; color: var(--warn); }
.tag.ban { background: var(--danger-bg); color: var(--danger-text); }
.st-pending, .st-manual { color: var(--warn); }
.st-delivered, .st-done { color: var(--ok-text); }

.form { display: flex; flex-direction: column; gap: 10px; }
textarea { padding: 10px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: 500 14px Inter, sans-serif; resize: vertical; }
select { background: var(--bg); }
.msg-ok { color: var(--ok-text) !important; }
.msg-err { color: var(--danger-text) !important; }

.console { margin: 0; max-height: 560px; overflow: auto; background: #0B0A09; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
	font: 12px/1.6 var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-word; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { display: flex; gap: 6px; align-items: center; background: var(--strip); border-radius: 8px; padding: 6px; }
.cat input { height: 36px; width: 120px; }
.items-edit { display: flex; flex-direction: column; gap: 12px; }
.ie { background: var(--strip); border-radius: 10px; padding: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.ie .wide { grid-column: 1 / -1; }
.ie .field input, .ie .field select, .ie .field textarea { width: 100%; height: 38px; }
.ie .field textarea { height: 60px; }
.ie-items { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.ie-items .r { display: flex; gap: 6px; }
.ie-items .r input { height: 36px; }
.ie-items .r input:first-child { flex: 1 1 auto; min-width: 0; }
.ie-items .r input:nth-child(2) { width: 100px; }
.ie-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.save-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; position: sticky; bottom: 0; background: var(--panel); padding-top: 10px; }
.save-bar p { margin: 0; }

.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); border-left: 1px solid var(--line-2); z-index: 21;
	overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-close { position: absolute; top: 16px; right: 16px; }
.pc-head { display: flex; gap: 14px; align-items: center; padding-right: 48px; }
.pc-head img, .pc-head .ph { width: 64px; height: 64px; border-radius: 8px; background: var(--line-2); flex: none; }
.pc-head h2 { font-size: 22px; margin: 0; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.facts div { background: var(--strip); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.facts b { display: block; color: var(--text); font-size: 16px; margin-top: 4px; overflow-wrap: anywhere; }
.acts { display: flex; flex-direction: column; gap: 10px; }
.act { background: var(--strip); border-radius: 10px; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.act h3 { margin: 0; font-size: 14px; flex: 1 0 100%; }
.act input, .act select { height: 38px; flex: 1 1 120px; min-width: 0; }
.act .btn { height: 38px; }
.act p { margin: 0; flex: 1 0 100%; font-size: 13px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td { padding: 6px 4px; border-bottom: 1px solid var(--line); }

@media (max-width: 860px) {
	.aside { flex: 1 1 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
	.side-menu { flex-direction: row; flex-wrap: wrap; }
	.side-menu a { height: 38px; }
	.me { display: none; }
	.main { padding: 20px 16px 48px; }
}
