/* Abygen app: layout on top of aby.css tokens */
body.cab { background: var(--bg-soft); }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sb { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sb .logo { font-size: 22px; padding: 4px 8px 16px; }
.sb .logo .logo-mark { width: 28px; height: 28px; }
.sb nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--muted); font-size: 14.5px; font-weight: 500; margin-bottom: 2px; }
.sb nav a svg { width: 18px; height: 18px; flex: none; }
.sb nav a:hover { background: var(--surface-2); color: var(--navy); }
.sb nav a.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.sb nav a .cnt { margin-left: auto; font-size: 11.5px; background: var(--amber-bg); color: var(--amber); border-radius: 10px; padding: 1px 8px; font-weight: 700; }
.sb .grp { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); margin: 18px 11px 8px; font-weight: 600; }
.sb .bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.sitesel { margin: 0 2px 14px; }
.sitesel select { width: 100%; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; font-size: 13.5px; }
.me .av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.me b { color: var(--navy); display: block; font-size: 13.5px; }
.me small { color: var(--soft); }
.me-actions { display: flex; gap: 6px; padding: 0 8px; }
.me-actions a, .me-actions button { font-size: 12.5px; color: var(--muted); }
.main-col { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 19px; letter-spacing: -.02em; }
.topbar .crumbs { color: var(--soft); font-size: 13px; }
.topbar .tb-r { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.mob-menu { display: none; }
.page { padding: 28px 32px 60px; max-width: 1240px; }

/* components */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-h h2, .panel-h h3 { font-size: 16px; letter-spacing: -.01em; }
.panel-h .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-b { padding: 20px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 20px; }
.grid2e { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
.stack { display: grid; gap: 20px; grid-template-columns: minmax(0,1fr); min-width: 0; }
.kpis4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kp { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.kp small { color: var(--soft); font-size: 12.5px; display: block; }
.kp b { font-size: 26px; color: var(--navy); letter-spacing: -.03em; display: block; margin-top: 4px; }
.kp span { font-size: 12.5px; color: var(--muted); }
.bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.list { display: grid; }
.li { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.li:first-child { border-top: 0; }
.li .t { min-width: 0; flex: 1; }
.li .t b { color: var(--navy); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t small { color: var(--soft); font-size: 12.5px; }
.li a.t:hover b { color: var(--accent); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14.5px; }
.empty img { width: 92px; height: 92px; margin: 0 auto 10px; }
.empty b { color: var(--navy); display: block; font-size: 16px; margin-bottom: 4px; }
.feed .li { align-items: flex-start; }
.feed .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-bg); color: var(--accent); }
.feed .ic svg { width: 15px; height: 15px; }
.feed .ic.g { background: var(--green-bg); color: var(--green); } .feed .ic.a { background: var(--amber-bg); color: var(--amber); } .feed .ic.r { background: #fdecec; color: #ef4444; }
.pill.r { background: #fdecec; color: #d92d20; }
:root[data-theme="dark"] .pill.r, :root[data-theme="dark"] .feed .ic.r { background: #2c1214; color: #f97066; }
.setup { display: grid; gap: 10px; }
.setup a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--navy); font-weight: 500; }
.setup a:hover { border-color: var(--accent-line); }
.setup .ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.setup .ck.done { background: var(--green); border-color: var(--green); color: #fff; }
.setup .ck svg { width: 12px; height: 12px; }
.setup .done-t { color: var(--soft); text-decoration: line-through; }

/* tables */
.tbl2 { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl2 th { text-align: left; font-size: 12px; color: var(--soft); font-weight: 600; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl2 td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.tbl2 tr:last-child td { border-bottom: 0; }
.tbl2 td b { color: var(--navy); font-weight: 600; }
.tbl2 td small { color: var(--soft); display: block; font-size: 12.5px; margin-top: 2px; }
.tbl2 tr:hover td { background: var(--surface-2); }
.tbl2 .num { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

/* tabs & filters */
.tabs2 { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs2::-webkit-scrollbar { display: none; }
.tabs2 a { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs2 a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.tabs2 a .n { font-size: 11.5px; color: var(--soft); margin-left: 4px; }

/* forms */
.fld { display: grid; gap: 6px; margin-bottom: 16px; }
.fld label { font-size: 13px; font-weight: 600; color: var(--navy); }
.fld .help { font-size: 12.5px; color: var(--soft); }
.fld .err, .errbox { font-size: 13px; color: #d92d20; }
.errbox { background: #fdecec; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], select, textarea {
  font: inherit; font-size: 14.5px; width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.chk-row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 14px; }
.chk-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.btn-xs { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-md { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn-ghost { color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { color: var(--navy); border-color: var(--accent-line); }
.btn-danger { color: #d92d20; border: 1px solid #f5c2bf; background: var(--surface); }
.btn-danger:hover { background: #fdecec; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(.95); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mono-box { font-family: 'JetBrains Mono', monospace; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; word-break: break-all; color: var(--navy); }
code { font-family: 'JetBrains Mono', monospace; font-size: .92em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
pre.code-sm { background: var(--code-bg); color: #c9d3ea; border-radius: 10px; padding: 14px 16px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.7; overflow-x: auto; }

/* flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.flash.success { background: var(--green-bg); color: var(--green); }
.flash.error { background: #fdecec; color: #d92d20; }
.flash.info { background: var(--accent-bg); color: var(--accent); }

/* article */
.art-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.art-head h2 { font-size: 26px; line-height: 1.2; }
.art-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--soft); font-size: 13px; margin-top: 8px; align-items: center; }
.cover { width: 100%; border-radius: 12px; aspect-ratio: 1216/640; object-fit: cover; background: var(--surface-2); }
.prose { font-size: 16px; line-height: 1.75; color: var(--ink); }
.prose h2 { font-size: 22px; margin: 28px 0 10px; }
.prose h3 { font-size: 18px; margin: 22px 0 8px; }
.prose p, .prose ul, .prose ol, .prose table { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--surface-2); }
.claim { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.claim:first-child { border-top: 0; }
.claim q { color: var(--navy); display: block; margin: 6px 0 4px; line-height: 1.5; }
.claim small { color: var(--soft); }
.stage { display: flex; align-items: center; gap: 10px; color: var(--accent); font-weight: 600; font-size: 14px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-bg); border-top-color: var(--accent); animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-soft); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px; box-shadow: var(--shadow-lg); }
.auth-card .logo { justify-content: center; margin-bottom: 22px; }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.auth-card p.sub { text-align: center; color: var(--muted); font-size: 14.5px; margin-bottom: 22px; }
.auth-card .btn { width: 100%; height: 46px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--soft); margin-top: 18px; }
.auth-foot a { color: var(--accent); }

/* plans */
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.plan-card { border: 1.5px solid var(--line); border-radius: 14px; padding: 22px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.plan-card.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.plan-card .amt { font-size: 34px; font-weight: 800; color: var(--navy); letter-spacing: -.03em; }
.plan-card .amt small { font-size: 14px; color: var(--soft); font-weight: 500; }
.plan-card ul { list-style: none; display: grid; gap: 7px; margin: 10px 0 16px; font-size: 14px; }
.plan-card li { display: flex; gap: 8px; }
.plan-card li svg { width: 16px; height: 16px; color: var(--green); flex: none; margin-top: 2px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sb { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sb.open { transform: none; }
  .mob-menu { display: grid; place-items: center; width: 38px; height: 38px; }
  .mob-menu svg { width: 22px; height: 22px; }
  .grid2, .grid2e, .plan-grid { grid-template-columns: minmax(0,1fr); }
  .kpis4 { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 20px 16px 50px; }
  .topbar { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
  .art-head { flex-direction: column; }
  .hide-m { display: none; }
}
.panel, .main-col > *, .grid2 > *, .grid2e > * { min-width: 0; }
