/* Admin shell: fixed dark sidebar 212px, white main area, 60px top bar. */
body { background: var(--page-bg); }
.shell { display: flex; min-height: 100vh; background: var(--bg); }
.side { width: 212px; flex: none; background: var(--side-bg); color: var(--side-fg); padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.side .brand .mark { width: 26px; height: 26px; border: 2px solid #8b5cf6; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.side .brand .mark i { width: 9px; height: 9px; border: 1.5px solid #fff; border-radius: 2px; display: block; }
.side .brand b { font-size: 14.5px; font-weight: 600; color: #fff; }
.side .brand b span { color: #a9a4f5; font-weight: 600; }
.side .slabel { font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--side-label); padding: 14px 8px 6px; }
.side .slabel:first-of-type { padding-top: 6px; }
.side .nav { padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 9px; cursor: pointer; color: var(--side-fg); width: 100%; text-align: left; }
.side .nav:hover { background: var(--side-hover); }
.side .nav.active { background: var(--side-active); color: #fff; font-weight: 600; }
.side .nav .ic { width: 14px; display: inline-flex; justify-content: center; opacity: .85; }
.side .nav .cnt { margin-left: auto; font-size: 10px; font-weight: 700; background: #a06b12; color: #fff; border-radius: 999px; padding: 1px 6px; }
.side .proj { margin: 2px 4px 6px; padding: 8px 10px; border-radius: 8px; background: #16161f; display: flex; flex-direction: column; gap: 2px; }
.side .proj select { background: transparent; border: 0; color: #fff; font-weight: 600; font-size: 13px; width: 100%; outline: none; }
.side .proj select option { color: #1c1c24; }
.side .proj .meta { color: #8a8a9c; font-size: 11px; }
.side .user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--side-hair); }
.side .user .av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side .user b { display: block; font-size: 12.5px; color: #fff; }
.side .user span { display: block; font-size: 11px; color: #8a8a9c; }
.side .user button { color: #8a8a9c; margin-left: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--hair); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.topbar .search { width: 440px; max-width: 50%; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 12.5px; color: var(--fg-3); }
.topbar .bell { position: relative; cursor: pointer; }
.topbar .bell i { position: absolute; top: -8px; right: -11px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; border-radius: 999px; padding: 1px 5px; font-style: normal; }
.content { padding: 26px 40px 60px; display: flex; flex-direction: column; gap: 18px; }
.crumbs { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--fg); font-weight: 600; }
.titlebar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.titlebar .ini { width: 64px; height: 64px; border-radius: 16px; background: var(--soft); color: var(--fg-3); font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.titlebar .ini img { width: 100%; height: 100%; object-fit: cover; }
.titlebar h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.titlebar .sub { font-size: 12.5px; color: var(--muted); }
.titlebar .acts { margin-left: auto; display: flex; gap: 14px; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 1px solid var(--hair); }
.kpi { padding: 18px 20px 18px 0; border-right: 1px solid var(--hair); margin-right: 20px; }
.kpi:last-child { border-right: 0; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; }
.cols > div:first-child { padding-right: 36px; }
.cols > div:last-child { border-left: 1px solid var(--hair); padding-left: 30px; min-width: 0; }
.cols.eq { grid-template-columns: 1fr 1fr; }
.cols.eq > div:last-child { padding-left: 30px; }
@media (max-width: 980px) { .cols, .cols.eq { grid-template-columns: 1fr; } .cols > div:last-child { border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); padding-top: 18px; } .cols > div:first-child { padding-right: 0; } }

.list { display: flex; flex-direction: column; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hair-2); }
.list .it:first-child { border-top: 0; }
.list .it .t { flex: 1; min-width: 0; }
.list .it .t b { display: block; font-weight: 600; }
.list .it .t span { font-size: 12px; color: var(--muted); }

.swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: 8px; border: 1px solid rgba(0,0,0,.08); }
.matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cell .th { aspect-ratio: 16/9; border-radius: var(--radius-m); background: var(--soft); overflow: hidden; position: relative; border: 1px solid var(--hair); }
.cell .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell.missing .th { border: 1.5px dashed var(--underline); background: repeating-linear-gradient(45deg, #fafafc 0 8px, #fff 8px 16px); }
.cell .th .tag { position: absolute; left: 6px; top: 6px; }
.cell .nm { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.cell .k { font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: var(--muted); word-break: break-all; }
.cell .acts { display: flex; gap: 12px; font-size: 12px; font-weight: 600; }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 32px; }
.form .field .in { font-size: 13.5px; }
.code { background: var(--soft); border-radius: var(--radius-s); padding: 10px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; overflow-x: auto; white-space: pre; }
.int { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--hair-2); }
.int .logo { width: 40px; height: 40px; border-radius: 9px; background: var(--soft); color: var(--fg-3); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.int .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.int .t b { font-size: 14px; }
.int .t .acts { display: flex; gap: 14px; margin-top: 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: flex-end; }
.inline-form .field { min-width: 120px; flex: 1; }
.inline-form .field.w2 { flex: 2; min-width: 180px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--page-bg); padding: 16px; }
.login .card { width: 100%; max-width: 380px; background: var(--bg); border: 1px solid var(--border); border-radius: 18px; padding: 36px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 18px; }
.login .card h1 { font-size: 22px; letter-spacing: -.02em; }
.login .err { color: var(--danger); font-size: 12.5px; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .side .brand { padding: 0 8px; width: 100%; }
  .side .slabel { display: none; }
  .side .proj { width: 100%; }
  .side .user { margin: 0; width: 100%; border: 0; padding-top: 6px; }
  .content { padding: 20px 16px 48px; }
  .topbar { padding: 0 16px; }
  .topbar .search { display: none; }
  .kpi { border-right: 0; margin-right: 0; }
}

.tbl td.acts { min-width: 300px; }
.actrow { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.actrow .link { white-space: nowrap; }
.tbl td.acts { padding-left: 28px; }
