/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #0b1f4d 0%, #1e6bff 100%); }
.login-card { width: 380px; max-width: 100%; background: #fff; border-radius: 14px; padding: 30px 28px 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font-size: 18px; }
.login-tip { margin: 14px 0 0; }
.login-page .powered { color: rgba(255, 255, 255, .7); }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.side { width: 220px; flex: none; background: #0f1b3d; color: #c9d3ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.side nav { flex: 1; padding: 8px 10px; overflow: auto; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #c9d3ea; margin-bottom: 2px; text-decoration: none; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.active { background: var(--primary); color: #fff; }
.side .side-sub { font-size: 12px; color: #7d8bb0; padding: 14px 12px 6px; }
.side-foot { padding: 12px 18px; font-size: 12px; color: #6b7aa3; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.topbar .crumb { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user { display: flex; align-items: center; gap: 10px; color: var(--text-2); flex: none; }
.menu-btn { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; margin-right: 8px; }
.content { padding: 20px; flex: 1; min-width: 0; }
.banner { background: #fff4e6; color: #a34700; border: 1px solid #ffd8a8; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.banner-info { background: var(--primary-l); color: #1d4ed8; border-color: #c5d8ff; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15, 23, 42, .05); border: 1px solid #edf0f5; padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .input { width: auto; min-width: 200px; }

.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.act-card { background: #fff; border-radius: 12px; border: 1px solid #edf0f5; overflow: hidden; display: flex; flex-direction: column; }
.act-cover { height: 96px; position: relative; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 12px 14px; color: #fff; }
.act-cover::before { content: ""; position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .45)); }
.act-cover > * { position: relative; }
.act-cover h3 { margin: 0; font-size: 17px; text-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.act-cover .tag { position: absolute; right: 12px; top: 12px; }
.act-body { padding: 12px 14px; flex: 1; }
.act-stats { display: flex; gap: 18px; margin: 6px 0 4px; }
.act-stats b { font-size: 18px; display: block; color: var(--text); }
.act-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid #f1f3f6; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabs a { padding: 10px 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none !important; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs .badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 10px; border-bottom: 1px solid #f0f2f5; text-align: left; vertical-align: middle; }
.table th { background: #fafbfc; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.table tr:hover td { background: #fafcff; }
.table td.actions { white-space: nowrap; text-align: right; }
.table .avatar { width: 32px; height: 32px; font-size: 13px; }
.row-void td { color: var(--muted); text-decoration: line-through; }
.row-void td.actions, .row-void td .tag { text-decoration: none; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.img-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-picker .preview { width: 120px; height: 68px; border-radius: 8px; border: 1px dashed #cfd6e4; background: #f8fafc center / contain no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.img-picker.square .preview { width: 68px; }
.custom-field { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fcfdff; }
.custom-field .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row .input { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid #edf0f5; border-radius: 10px; padding: 14px 16px; }
.stat .num { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat .lbl { color: var(--muted); font-size: 12px; }
.status-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.status-switch button { border: 0; background: #fff; padding: 0 14px; height: 34px; cursor: pointer; color: var(--text-2); border-right: 1px solid var(--border); }
.status-switch button:last-child { border-right: 0; }
.status-switch button.on { background: var(--primary); color: #fff; }
.link-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.link-box code { background: #f4f6fa; padding: 7px 10px; border-radius: 6px; word-break: break-all; flex: 1; min-width: 200px; font-size: 13px; }
.qr-preview { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: 8px; image-rendering: pixelated; background: #fff; }
.qr-wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }

.bars .bar-row { margin-bottom: 8px; }
.bars .bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; gap: 8px; }
.bars .bar-track { height: 10px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.bars .bar-fill { height: 100%; background: var(--primary); border-radius: 5px; transition: width .5s; }

.vote-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.vote-card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.vote-card h4 { margin: 0; font-size: 15px; }
.dm-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f3f6; align-items: flex-start; }
.dm-item .body { flex: 1; min-width: 0; }
.dm-item .content { word-break: break-all; white-space: pre-wrap; }
.dm-item .ops { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.pill-filter { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pill-filter button { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 0 12px; height: 30px; cursor: pointer; }
.pill-filter button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

@media (max-width: 768px) {
  .side { position: fixed; left: -240px; z-index: 100; transition: left .2s; }
  .side.open { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-block; }
  .content { padding: 12px; }
  .topbar { padding: 0 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .act-grid { grid-template-columns: 1fr; }
  .toolbar .input { min-width: 0; flex: 1; }
  .card { padding: 14px; }
  .topbar .user .uname { display: none; }
}
