/* Demo xay dung admin — calm, dense, legible. Same type family as the website. */
@font-face { font-family: 'Archivo'; src: url('../fonts/archivo-vn.woff2') format('woff2'); font-weight: 400 700; font-stretch: 100% 125%; font-display: swap; }
@font-face { font-family: 'JBM'; src: url('../fonts/jbmono-vn.woff2') format('woff2'); font-weight: 500; font-display: swap; }
:root { --bg: #F3F2EE; --card: #FFFFFF; --ink: #0A0E22; --ink2: #2B3046; --muted: #6A6F82; --line: #E2E1DA; --line2: #CFCEC6; --navy: #2D368E; --navy2: #232B78; --red: #EA1F27;
  --green: #1F8A55; --amber: #B7791F; --blue: #2F6FD6; --sb: #0B0F24; --r: 6px; --f: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --m: 'JBM', ui-monospace, Menlo, Consolas, monospace; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.muted { color: var(--muted); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--m); font-size: 12px; letter-spacing: .04em; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line2); border-radius: var(--r); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--ink); transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--navy); border-color: var(--navy); color: #fff; } .btn--primary:hover { background: var(--navy2); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--green { background: var(--green); border-color: var(--green); color: #fff; }
.btn--danger { background: #fff; border-color: #f0b8bb; color: #B3131A; } .btn--danger:hover { background: #FDECEC; }
.btn--ghost { background: transparent; border-color: transparent; } .btn--ghost:hover { background: rgba(10, 14, 34, .05); border-color: transparent; }
.btn--sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn--block { width: 100%; min-height: 46px; }
.btn .ic { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--navy); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: var(--r); cursor: pointer; position: relative; }
.iconbtn:hover { background: rgba(10, 14, 34, .06); }

/* inputs */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field__l { font-size: 13px; font-weight: 600; color: var(--ink2); display: flex; justify-content: space-between; align-items: center; }
.field__h { font-size: 12.5px; color: var(--muted); }
.input { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line2); border-radius: var(--r); background: #fff; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(45, 54, 142, .15); }
.input.is-err { border-color: var(--red); }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { padding-right: 30px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%232B3046' stroke-width='1.5'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") right 11px center no-repeat; }
.input--title { font-size: 22px; font-weight: 600; font-stretch: 108%; min-height: 52px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__t { width: 38px; height: 22px; border-radius: 11px; background: var(--line2); position: relative; transition: background .2s; flex: none; }
.toggle__t::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle input:checked + .toggle__t { background: var(--navy); } .toggle input:checked + .toggle__t::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle__t { outline: 2px solid var(--navy); outline-offset: 2px; }
.grid2 { display: grid; gap: 0 16px; } .grid3 { display: grid; gap: 0 16px; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--grey { background: #EEEDE8; color: #5A5F70; } .badge--green { background: #E3F4EA; color: var(--green); } .badge--amber { background: #FBF0DC; color: var(--amber); }
.badge--red { background: #FCE7E8; color: #C0141B; } .badge--blue { background: #E4EDFB; color: var(--blue); } .badge--navy { background: #E6E8F6; color: var(--navy); }

/* login */
.login { min-height: 100vh; display: grid; }
.login__art { background: var(--sb); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; position: relative; overflow: hidden; min-height: 200px;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 48px 48px; }
.login__logo { width: 240px; position: absolute; left: 40px; top: 40px; }
.login__q { font-size: 28px; font-weight: 600; font-stretch: 112%; }
.login__m { font: 500 12px var(--m); letter-spacing: .1em; text-transform: uppercase; color: #9AA0B5; }
.login__box { padding: 48px 32px; max-width: 460px; width: 100%; margin: auto; }
.login__box h1 { font-size: 28px; font-stretch: 110%; margin-bottom: 6px; }
.login__f { margin-top: 28px; }
.login__err { color: #C0141B; min-height: 22px; font-size: 14px; margin: -4px 0 10px; }
.login__back { display: inline-block; margin-top: 28px; font-size: 14px; }
@media (min-width: 900px) { .login { grid-template-columns: 1.1fr 1fr; } .login__art { padding: 56px; } .login__q { font-size: 40px; } }

/* layout */
.layout { min-height: 100vh; }
.sb { position: fixed; inset: 0 auto 0 0; width: 252px; background: var(--sb); color: #C9CDDA; display: flex; flex-direction: column; z-index: 40; transform: translateX(-100%); transition: transform .25s; }
.sb-open .sb { transform: none; }
.sb__scrim { position: fixed; inset: 0; background: rgba(5, 7, 15, .5); z-index: 39; display: none; } .sb-open .sb__scrim { display: block; }
.sb__brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; color: #fff; }
.sb__brand img { width: 128px; } .sb__brand span { font: 500 10px var(--m); letter-spacing: .14em; text-transform: uppercase; color: #8A90A8; margin-top: 3px; }
.sb__nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.sb__g { font: 500 10px var(--m); letter-spacing: .14em; text-transform: uppercase; color: #6D7390; margin: 16px 10px 6px; }
.sb__a { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: var(--r); color: #C9CDDA; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; position: relative; }
.sb__a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb__a.is-on { background: rgba(255, 255, 255, .1); color: #fff; }
.sb__a.is-on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.sb__b { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sb__foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.main { min-width: 0; }
.tb { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: rgba(243, 242, 238, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.tb__crumb { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb__r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb__nwrap { position: relative; }
.dotc { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.tb__user { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 4px 8px 4px 4px; border-radius: 30px; }
.tb__user:hover { background: rgba(10, 14, 34, .05); }
.tb__user > span:last-child { display: none; flex-direction: column; line-height: 1.2; } .tb__user b { font-size: 13.5px; } .tb__user small { font-size: 12px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.notif { position: absolute; right: 0; top: 46px; width: min(380px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 40px rgba(10, 14, 34, .16); overflow: hidden; }
.notif__h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif__l { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }
.notif__l a { display: grid; gap: 2px; padding: 11px 14px; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; }
.notif__l li.is-new a { background: #F5F6FD; } .notif__l li.is-new a span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 7px; vertical-align: 1px; }
.notif__l small { color: var(--muted); font-size: 12px; }
.notif__all { display: block; text-align: center; padding: 10px; font-weight: 600; font-size: 14px; }
.view { padding: 22px 16px 80px; max-width: 1320px; margin: 0 auto; outline: 0; }
@media (min-width: 1024px) {
  .sb { transform: none; } .main { margin-left: 252px; } .tb__menu { display: none; } .sb__scrim { display: none !important; }
  .tb { padding: 0 28px; } .view { padding: 28px 32px 80px; } .tb__user > span:last-child { display: flex; }
}

/* page header */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.ph__t { font-size: 26px; line-height: 1.15; font-weight: 600; font-stretch: 110%; letter-spacing: -.01em; }
.ph__s { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.ph__a { display: flex; flex-wrap: wrap; gap: 8px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.card + .card { margin-top: 16px; }
.card__h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card__h h2, .card__h h3 { font-size: 15.5px; font-weight: 600; }
.card__h .muted { font-size: 13px; }
.cols { display: grid; gap: 16px; }
@media (min-width: 1100px) { .cols--main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .cols--2 { grid-template-columns: 1fr 1fr; } .cols--3 { grid-template-columns: repeat(3, 1fr); } .side-sticky { position: sticky; top: 76px; } }
.sec-t { font: 500 11px var(--m); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; }

/* KPIs + charts */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 4px; }
.kpi__l { font-size: 13px; color: var(--muted); }
.kpi__v { font-size: 28px; font-weight: 600; font-stretch: 112%; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__d { font-size: 12.5px; color: var(--muted); } .kpi__d.up { color: var(--green); } .kpi__d.down { color: #C0141B; }
a.kpi:hover { border-color: var(--ink2); }
.chart { width: 100%; height: 240px; display: block; }
.chart text { font: 500 10px var(--m); fill: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); } .legend i { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; gap: 4px; font-size: 13.5px; }
.bar__r { display: flex; justify-content: space-between; gap: 8px; } .bar__r span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__t { height: 6px; background: #EEEDE8; border-radius: 3px; overflow: hidden; } .bar__t i { display: block; height: 100%; background: var(--navy); border-radius: 3px; }
.feed { list-style: none; margin: 0; padding: 0; } .feed li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .feed li:last-child { border-bottom: 0; }
.feed small { color: var(--muted); font-size: 12.5px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-weight: 600; font-size: 14px; }
.quick a:hover { border-color: var(--navy); color: var(--navy); }

/* tabs + toolbars + tables */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: none; }
.tabs a, .tabs button { flex: none; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs .is-on { color: var(--ink); border-bottom-color: var(--red); }
.tabs sup { font: 500 11px var(--m); color: var(--muted); margin-left: 3px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 160px; flex: 1 1 200px; max-width: 320px; }
.search { position: relative; flex: 1 1 220px; max-width: 360px; } .search .input { padding-left: 34px; max-width: none; width: 100%; } .search .ic { position: absolute; left: 10px; top: 11px; color: var(--muted); }
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FBFBF9; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #FAFAF7; }
.tbl .t-title a { color: var(--ink); font-weight: 600; } .tbl .t-title a:hover { color: var(--navy); }
.tbl .t-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tbl .thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; background: #eee; }
.tbl .t-act { text-align: right; white-space: nowrap; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); }
.bulk { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #EEF0FA; border-radius: 8px; margin-bottom: 10px; font-size: 14px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); display: grid; gap: 14px; justify-items: center; background: #fff; border: 1px dashed var(--line2); border-radius: 10px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--muted); }
.loading span { width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* editor page */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; align-items: flex-start; }
.notice--warn { background: #FDF1F1; border: 1px solid #F5C9CB; color: #8E1016; }
.notice--info { background: #EEF0FA; border: 1px solid #D5D9F2; color: #232B78; }
.notice--ok { background: #E8F5EE; border: 1px solid #C2E5D2; color: #155E3A; }
.slugrow { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: -8px 0 16px; flex-wrap: wrap; }
.slugrow input { border: 0; border-bottom: 1px dashed var(--line2); background: transparent; padding: 2px 0; min-width: 220px; color: var(--ink2); font-family: var(--m); font-size: 12.5px; }
.rte .ql-toolbar.ql-snow { border: 1px solid var(--line2); border-radius: var(--r) var(--r) 0 0; background: #FBFBF9; position: sticky; top: 60px; z-index: 5; }
.rte .ql-container.ql-snow { border: 1px solid var(--line2); border-top: 0; border-radius: 0 0 var(--r) var(--r); font: 16px/1.7 var(--f); background: #fff; }
.rte .ql-editor { min-height: 360px; padding: 18px 20px; }
.rte .ql-editor h2 { font-size: 24px; font-stretch: 108%; margin: 1em 0 .4em; } .rte .ql-editor h3 { font-size: 19px; margin: 1em 0 .3em; }
.rte .ql-editor img { max-width: 100%; border-radius: 4px; margin: 8px 0; }
.rte .ql-editor blockquote { border-left: 3px solid var(--red); padding-left: 14px; color: var(--ink2); }
.slot { position: relative; background: #F1F0EB; border: 1px dashed var(--line2); border-radius: 8px; overflow: hidden; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot__empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px; }
.slot__empty .ic { width: 28px; height: 28px; }
.slot__a { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; }
.slot__a .btn { background: rgba(255, 255, 255, .95); }
.serp { border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: Arial, sans-serif; }
.serp__u { font-size: 12px; color: #1a6b37; } .serp__t { font-size: 17px; color: #1a0dab; margin: 2px 0; line-height: 1.3; } .serp__d { font-size: 13px; color: #4d5156; }
.counter { font-size: 12px; color: var(--muted); text-align: right; } .counter.over { color: #C0141B; }
.revs { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.revs li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.actions-col { display: grid; gap: 8px; }
.statusline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.chiplist { display: flex; flex-wrap: wrap; gap: 6px; }
.chiplist span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; background: #EEEDE8; border-radius: 99px; font-size: 13px; }
.chiplist button { border: 0; background: none; cursor: pointer; padding: 0 4px; color: var(--muted); }

/* media */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.mtile { position: relative; aspect-ratio: 1; border: 2px solid transparent; border-radius: 8px; overflow: hidden; padding: 0; background: #EEEDE8; cursor: pointer; }
.mtile img { width: 100%; height: 100%; object-fit: cover; }
.mtile__c { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; display: none; place-items: center; }
.mtile__c .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.mtile[aria-pressed="true"] { border-color: var(--navy); } .mtile[aria-pressed="true"] .mtile__c { display: grid; }
.mtile__n { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff; font-size: 11.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop { border: 2px dashed var(--line2); border-radius: 10px; padding: 22px; text-align: center; display: grid; gap: 6px; justify-items: center; color: var(--ink2); margin-bottom: 14px; transition: border-color .15s, background .15s; }
.drop .ic { width: 28px; height: 28px; color: var(--navy); }
.drop.is-over { border-color: var(--navy); background: #EEF0FA; } .drop.is-busy { opacity: .7; pointer-events: none; }
.picker__bar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; } .picker__bar .input { max-width: 320px; }
.picker .btn--ghost { margin: 14px auto 0; display: flex; }
.mdetail { display: grid; gap: 16px; } .mdetail img { width: 100%; max-height: 360px; object-fit: contain; background: #EEEDE8; border-radius: 8px; }
@media (min-width: 800px) { .mdetail { grid-template-columns: 1.1fr 1fr; } }
.gallery-ed { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.gitem { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; }
.gitem.is-drag { opacity: .5; outline: 2px dashed var(--navy); }
.gitem img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gitem__b { display: flex; gap: 4px; align-items: center; padding: 6px; }
.gitem__b .input { min-height: 32px; font-size: 13px; padding: 4px 8px; }
.handle { cursor: grab; touch-action: none; color: var(--muted); }

/* lists & rows for sortable services/projects */
.rows { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.row.is-drag { opacity: .5; outline: 2px dashed var(--navy); }
.row img { width: 72px; height: 50px; object-fit: cover; border-radius: 4px; background: #eee; }
.row__m { flex: 1; min-width: 0; } .row__m b { display: block; } .row__m small { color: var(--muted); }

/* repeater (principles, stats, tasks…) */
.rep { display: grid; gap: 8px; margin-bottom: 10px; }
.rep__i { display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: start; background: #FAFAF7; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.rep__f { display: grid; gap: 8px; } @media (min-width: 760px) { .rep__f--3 { grid-template-columns: 1fr 1fr 2fr; } .rep__f--2 { grid-template-columns: 1fr 2fr; } .rep__f--t { grid-template-columns: 3fr 1fr 1fr auto; align-items: center; } }
.rep__b { display: flex; gap: 2px; }

/* leads */
.kanban { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.kanban a { flex: 1 1 120px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: grid; gap: 2px; }
.kanban a.is-on { border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--navy); }
.kanban b { font-size: 20px; font-stretch: 110%; } .kanban span { font-size: 12.5px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { padding: 12px 0 12px 18px; border-left: 2px solid var(--line); position: relative; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); }
.timeline li.sys::before { background: var(--line2); }
.timeline small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 14px; } .dl dt { color: var(--muted); } .dl dd { margin: 0; word-break: break-word; }

/* modal + toasts */
.modal { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px rgba(5, 7, 15, .35); }
.modal--wide { width: min(1080px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(5, 7, 15, .55); }
.modal[open] { display: flex; flex-direction: column; }
.modal__h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); } .modal__h h2 { font-size: 17px; }
.modal__b { padding: 18px; overflow-y: auto; } .modal__b p + p { margin-top: 8px; }
.modal__f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #FBFBF9; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: grid; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: center; max-width: 420px; padding: 12px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 12px 30px rgba(5, 7, 15, .3); animation: tin .25s ease; transition: opacity .4s, transform .4s; }
.toast--err { background: #8E1016; } .toast--ok .ic { color: #6EE7A8; }
.toast.is-out { opacity: 0; transform: translateY(8px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 0; margin-top: 16px; background: linear-gradient(transparent, var(--bg) 30%); }
.savebar .muted { margin-right: auto; font-size: 13px; }
details.acc { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
details.acc > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary small { font-weight: 400; color: var(--muted); display: block; font-size: 13px; }
details.acc > summary::after { content: '+'; font-size: 20px; color: var(--muted); } details.acc[open] > summary::after { content: '–'; }
details.acc > .acc__b { padding: 0 18px 18px; }
.perm-table td, .perm-table th { text-align: center; } .perm-table td:first-child, .perm-table th:first-child { text-align: left; }
