/* ARAH SISTEM — UI stylesheet. Developed by Coach Tegar Prajaksa */
:root {
  --primary: #0b2a4a; --primary-2: #16406b; --accent: #f5a524; --sidebar: #0b2a4a; --bg: #eef2f7;
  --surface: rgba(255,255,255,.78); --surface-solid: #ffffff; --surface-2: #f6f8fb; --border: rgba(15,35,60,.10); --border-2: #dfe5ee;
  --text: #13202e; --muted: #5f6b7a; --faint: #8b96a5; --ok: #0f9d6b; --warn: #d98a06; --danger: #d14343; --info: #2563eb;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 10px 30px -12px rgba(11,42,74,.25), 0 2px 6px rgba(11,42,74,.06);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --blur: 18px;
  --side-w: 256px;
}
:root[data-mode="dark"] {
  --bg: #0b1320; --surface: rgba(20,31,48,.78); --surface-solid: #141f30; --surface-2: #1a273b; --border: rgba(255,255,255,.08); --border-2: #26354c;
  --text: #e6edf6; --muted: #9fb0c5; --faint: #6f8199;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.glass { background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%), radial-gradient(900px 500px at 110% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--primary-2); text-decoration: none; }
:root[data-mode="dark"] a { color: #8ab8ff; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex: none; background: var(--sidebar); color: #dbe6f3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
body.glass .sidebar { background: linear-gradient(180deg, var(--sidebar), color-mix(in srgb, var(--sidebar) 82%, #000)); }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; }
.brand .logo-box { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.12); display: grid; place-items: center; overflow: hidden; flex: none; }
.brand .logo-box img { width: 100%; height: 100%; object-fit: contain; }
.brand .logo-box svg { width: 24px; height: 24px; color: var(--accent); }
.brand .name { font-weight: 800; font-size: 16px; color: #fff; letter-spacing: .02em; line-height: 1.15; }
.brand .tag { font-size: 11px; color: rgba(255,255,255,.55); line-height: 1.3; }
.brand-logo-full { max-height: 44px; max-width: 200px; object-fit: contain; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.nav .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.4); margin: 16px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: rgba(255,255,255,.78); font-weight: 500; font-size: 13.5px; margin-bottom: 2px; transition: .15s; position: relative; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav .badge { margin-left: auto; background: var(--accent); color: #1b1300; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 0 7px; line-height: 18px; }
.side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: rgba(255,255,255,.5); }
.side-foot b { color: rgba(255,255,255,.85); font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 26px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .sub { color: var(--muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.btn.menu-btn { display: none; }
.content { padding: 24px 26px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.credit { text-align: center; color: var(--faint); font-size: 12px; padding: 18px; }
.credit b { color: var(--muted); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
body.glass .card { backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
body:not(.glass) .card { background: var(--surface-solid); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-h .spacer { flex: 1; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hr { height: 1px; background: var(--border); margin: 14px 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-solid); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border-2)); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 6px 16px -8px var(--primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.accent { background: var(--accent); color: #1c1400; border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { height: 31px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 31px; }
.btn.ai { background: linear-gradient(120deg, #6d28d9, #2563eb); color: #fff; border: 0; }
.btn-group { display: inline-flex; }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface-solid); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: 0 20px 40px -12px rgba(0,0,0,.25); padding: 6px; z-index: 50; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; }
.dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu button svg { width: 18px; height: 18px; }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 5px 4px; }
.dropdown-menu .dsc { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--faint); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface-solid); outline: none; transition: .15s; font-size: 13.5px; }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.fgrid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px 14px; }
.fgrid .w1 { grid-column: span 1; } .fgrid .w2 { grid-column: span 2; } .fgrid .w3 { grid-column: span 3; } .fgrid .w4 { grid-column: span 4; } .fgrid .w6 { grid-column: span 6; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #c3ccd8; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------- tables ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--border-2); border-radius: 11px; background: var(--surface-solid); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: var(--surface-2); text-align: left; font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: color-mix(in srgb, var(--primary) 3%, transparent); }
.tbl.edit td { padding: 4px 5px; vertical-align: top; }
.tbl.edit .input { height: 32px; font-size: 12.5px; border-radius: 7px; padding: 0 8px; }
.tbl.edit textarea.input { min-height: 32px; height: 54px; padding: 6px 8px; }
.tbl.edit td.num { width: 34px; text-align: center; color: var(--faint); font-size: 12px; padding-top: 11px; }
.tbl.edit td.act { width: 88px; white-space: nowrap; }
.tbl.edit tr.hl td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill.ok { background: #e7f7ef; color: #0b7a53; border-color: #c4ebd8; } .pill.warn { background: #fff4e0; color: #9a5b00; border-color: #fde2b0; } .pill.danger { background: #fdecec; color: #b42323; border-color: #f7cccc; } .pill.info { background: #e8f0ff; color: #1d4ed8; border-color: #cddcff; }
:root[data-mode="dark"] .pill.ok { background: #0f3326; color: #7be0b5; } :root[data-mode="dark"] .pill.warn { background: #3a2a07; color: #ffc766; } :root[data-mode="dark"] .pill.danger { background: #3b1414; color: #ff9d9d; } :root[data-mode="dark"] .pill.info { background: #13244a; color: #9ab8ff; }

/* ---------- dashboard ---------- */
.hero { padding: 26px 28px; border-radius: calc(var(--radius) + 4px); color: #fff; background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #2a6fb5)); position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero::after { pointer-events: none; content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%); opacity: .55; }
.hero h2 { font-size: 24px; font-weight: 800; position: relative; }
.hero p { margin: 6px 0 0; color: rgba(255,255,255,.8); max-width: 720px; position: relative; }
.hero .row { position: relative; margin-top: 16px; }
.qgen { display: flex; gap: 8px; margin-top: 18px; position: relative; flex-wrap: wrap; }
.qgen select, .qgen input { height: 44px; border-radius: 11px; border: 0; padding: 0 14px; background: rgba(255,255,255,.95); color: #13202e; }
.qgen input { flex: 1; min-width: 240px; }
.tcard { padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: .18s; position: relative; overflow: hidden; }
.tcard:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -16px rgba(11,42,74,.35); }
.tcard .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.tcard .ic svg { width: 22px; height: 22px; }
.tcard h4 { font-size: 14.5px; font-weight: 700; }
.tcard .n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.tcard .d { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tcard .go { position: absolute; right: 14px; top: 16px; color: var(--faint); }
.stat { padding: 16px 18px; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 2px; letter-spacing: -.02em; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover .t { color: var(--primary-2); }
.list-item .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.list-item .dot svg { width: 17px; height: 17px; }
.list-item .t { font-weight: 600; font-size: 13.5px; }
.list-item .s { font-size: 12px; color: var(--muted); }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr); gap: 16px; align-items: start; }
.editor.full { grid-template-columns: 1fr; }
.editor.full .ed-preview { position: static; max-height: none; }
.editor.full .ed-preview .card-b { max-height: 88vh; }
.ed-form { min-width: 0; }
.ed-sec { margin-bottom: 14px; }
.ed-sec > .card-h { cursor: pointer; user-select: none; }
.ed-sec > .card-h .chev { transition: .2s; color: var(--faint); }
.ed-sec.collapsed > .card-h .chev { transform: rotate(-90deg); }
.ed-sec.collapsed > .card-b { display: none; }
.ed-sec .card-h .cnt { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.ed-preview { position: sticky; top: 74px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; }
.ed-preview .card-b { overflow: auto; padding: 16px; background: color-mix(in srgb, var(--bg) 65%, #9aa7b8 12%); border-radius: 0 0 var(--radius) var(--radius); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .title-input { flex: 1; min-width: 220px; font-size: 16px; font-weight: 700; height: 42px; }
.save-state { font-size: 12px; color: var(--faint); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 11px; border: 1px solid var(--border); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.issues { margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.issues li { padding: 6px 10px; border-radius: 8px; margin-bottom: 4px; display: flex; gap: 8px; }
.issues li.error { background: #fdecec; color: #9b1c1c; } .issues li.warn { background: #fff4e0; color: #8a5200; } .issues li.info { background: #e8f0ff; color: #1d4ed8; }
.diagram-box { overflow: auto; border: 1px solid var(--border-2); border-radius: 12px; background: #fff; padding: 8px; }
.diagram-box svg { display: block; height: auto; width: 100%; }
.zoombar { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- document paper preview ---------- */
.paper { background: #fff; color: #1b2430; width: 100%; max-width: 820px; margin: 0 auto 16px; padding: 34px 40px 40px; box-shadow: 0 8px 28px -10px rgba(0,0,0,.35); font-family: Carlito, Calibri, 'Segoe UI', Arial, sans-serif; font-size: 12.6px; line-height: 1.5; border-radius: 3px; }
.paper .dc { display: grid; grid-template-columns: 25% 40% 35%; border: 1.3px solid var(--doc); margin-bottom: 18px; }
.paper .dc > div { border-right: 1px solid var(--doc); min-height: 86px; }
.paper .dc > div:last-child { border-right: 0; }
.paper .dc .c1 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center; font-weight: 700; color: var(--doc); font-size: 12px; }
.paper .dc .c1 img { max-height: 40px; max-width: 90%; object-fit: contain; }
.paper .dc .c2 .t { background: var(--doc); color: #fff; font-weight: 700; text-align: center; padding: 6px; font-size: 12px; }
.paper .dc .c2 .j { text-align: center; font-weight: 700; padding: 12px 8px; font-size: 13.5px; }
.paper .dc .c3 div { display: grid; grid-template-columns: 70px 1fr; font-size: 10px; white-space: nowrap; border-bottom: 1px solid #c9d2de; padding: 3px 6px; }
.paper .dc .c3 div:last-child { border-bottom: 0; }
.paper .dc .c3 span:first-child { color: #5b6675; }
.paper .dc .c3 span:last-child { font-weight: 700; }
.paper .kop { display: flex; gap: 14px; align-items: center; padding-bottom: 8px; border-bottom: 3px double var(--doc); margin-bottom: 18px; }
.paper .kop img { max-height: 56px; max-width: 90px; object-fit: contain; }
.paper .kop .n { font-size: 18px; font-weight: 800; color: var(--doc); }
.paper .kop .a { font-size: 11px; color: #5b6675; }
.paper h2 { font-size: 14.5px; color: var(--doc); border-left: 4px solid var(--doc); padding: 1px 0 3px 9px; border-bottom: 1px solid color-mix(in srgb, var(--doc) 30%, #fff); margin: 18px 0 9px; }
.paper h2.plain { border-left: 0; border-bottom: 0; padding-left: 0; }
.paper h3 { font-size: 13px; color: var(--doc); margin: 12px 0 6px; }
.paper p { margin: 0 0 9px; }
.paper p.j { text-align: justify; }
.paper ul, .paper ol { margin: 0 0 10px; padding-left: 22px; }
.paper li { margin-bottom: 2px; text-align: justify; }
.paper table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 11.4px; }
.paper th { background: var(--doc); color: #fff; padding: 5px 6px; border: 1px solid var(--doc); font-weight: 700; text-align: center; }
.paper td { padding: 4px 6px; border: 1px solid #b9c4d2; vertical-align: top; white-space: pre-line; }
.paper tr:nth-child(even) td { background: #f7f9fc; }
.paper table.kv td:first-child { background: color-mix(in srgb, var(--doc) 12%, #fff); font-weight: 700; width: 32%; }
.paper table.kv tr td { background-color: transparent; }
.paper table.kv tr td:first-child { background: color-mix(in srgb, var(--doc) 12%, #fff); }
.paper table.g2 td.h { background: color-mix(in srgb, var(--doc) 12%, #fff); font-weight: 700; color: var(--doc); }
.paper .dg { text-align: center; margin: 6px 0 14px; }
.paper .dg .svgw { overflow-x: auto; border: 1px solid #e3e8ef; border-radius: 4px; }
.paper .dg svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.paper .dg.land svg { min-width: 100%; }
.paper .dg .cap { font-size: 10.5px; font-style: italic; color: #5b6675; margin-top: 4px; }
.paper .sign { display: grid; gap: 8px; margin-top: 8px; }
.paper .sign > div { border: 1px solid #b9c4d2; text-align: center; min-height: 120px; display: flex; flex-direction: column; }
.paper .sign .r { background: color-mix(in srgb, var(--doc) 12%, #fff); font-weight: 700; color: var(--doc); font-size: 11px; padding: 3px; }
.paper .sign .nm { margin-top: auto; font-weight: 700; font-size: 11.5px; }
.paper .sign .jb { font-size: 10.5px; color: #5b6675; padding-bottom: 6px; }
.paper .title { text-align: center; margin: 4px 0 18px; }
.paper .title b { font-size: 16px; display: block; }
.paper .party { display: grid; grid-template-columns: 20px 150px 10px 1fr; margin-bottom: 2px; }
.paper .party-t { padding-left: 20px; text-align: justify; margin-bottom: 12px; }
.paper .clause { margin: 14px 0 6px; text-align: center; font-weight: 700; }
.paper .ci { display: grid; grid-template-columns: 30px 1fr; text-align: justify; margin-bottom: 4px; }
.paper .csign { display: grid; grid-template-columns: 1fr 1fr; text-align: center; margin-top: 16px; }
.paper .csign .m { width: 70px; height: 44px; border: 1px dashed #8a96a6; margin: 12px auto; font-size: 9px; color: #8a96a6; display: grid; place-items: center; }
.paper .note { padding: 9px 12px; border-left: 4px solid var(--doc); background: color-mix(in srgb, var(--doc) 9%, #fff); margin-bottom: 12px; }
.paper .note.warn { border-color: #d97706; background: #fff7e6; } .paper .note.danger { border-color: #c0392b; background: #fdecea; }
.paper .stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.paper .stats > div { background: color-mix(in srgb, var(--doc) 10%, #fff); border-radius: 6px; padding: 8px; text-align: center; font-size: 10.5px; }
.paper .stats b { display: block; color: var(--doc); font-size: 10px; }
.paper .stats .d { font-size: 15px; font-weight: 800; }
.paper .pb { border-top: 2px dashed #c9d2de; margin: 22px -40px; position: relative; }
.paper .pb::after { content: 'Halaman baru'; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); background: #fff; padding: 0 8px; font-size: 10px; color: #8a96a6; }
.paper .foot { margin-top: 22px; padding-top: 6px; border-top: 1px solid #d6dde7; font-size: 9.5px; color: #8a96a6; display: flex; justify-content: space-between; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #1e5aa0)); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; background-size: cover; background-position: center; }
.auth-side::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 88%, transparent), color-mix(in srgb, var(--primary) 70%, transparent)); }
.auth-side > * { position: relative; }
.auth-side h1 { font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: auto; }
.auth-side p { color: rgba(255,255,255,.8); font-size: 15.5px; max-width: 520px; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 26px 0 auto; max-width: 560px; }
.auth-feats div { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.9); }
.auth-feats svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; padding: 32px; }
.auth-card h2 { font-size: 24px; font-weight: 800; }
.auth-card .sub { color: var(--muted); margin: 4px 0 22px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--faint); margin-top: 22px; }
.alert { padding: 10px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.alert.err { background: #fdecec; color: #9b1c1c; } .alert.ok { background: #e7f7ef; color: #0b6b48; } .alert.info { background: #e8f0ff; color: #1d4ed8; } .alert.warn { background: #fff4e0; color: #8a5200; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8,18,32,.5); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 640px; background: var(--surface-solid); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: pop .18s; }
.modal.lg { max-width: 920px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 17px; font-weight: 700; flex: 1; }
.modal-b { padding: 20px 22px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #13202e; color: #fff; padding: 11px 16px; border-radius: 11px; font-size: 13.5px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); max-width: 380px; animation: pop .2s; display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { background: #0b6b48; } .toast.err { background: #a42020; } .toast.warn { background: #8a5200; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
.spin.dark { border-color: rgba(0,0,0,.15); border-top-color: var(--primary); }
@keyframes sp { to { transform: rotate(360deg); } }
.loading-over { position: fixed; inset: 0; background: rgba(8,18,32,.45); z-index: 150; display: grid; place-items: center; }
.loading-over .box { background: var(--surface-solid); padding: 22px 28px; border-radius: 14px; display: flex; gap: 14px; align-items: center; font-weight: 600; box-shadow: var(--shadow); }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 8px; }
.engine-opt { display: grid; gap: 8px; }
.engine-opt label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border-2); border-radius: 12px; cursor: pointer; }
.engine-opt label:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.engine-opt input { margin-top: 3px; accent-color: var(--primary); }
.engine-opt b { display: block; font-size: 13.5px; }
.engine-opt span { font-size: 12px; color: var(--muted); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 120px; border: 2px solid var(--border-2); border-radius: 12px; padding: 8px; cursor: pointer; font-size: 12px; font-weight: 600; text-align: center; }
.swatch.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.swatch .p { height: 38px; border-radius: 8px; display: flex; overflow: hidden; margin-bottom: 6px; }
.swatch .p i { flex: 1; }
.imgslot { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px dashed var(--border-2); border-radius: 12px; }
.imgslot .pv { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; border: 1px solid var(--border); }
.imgslot .pv img { max-width: 100%; max-height: 100%; object-fit: contain; }
.glyphs { display: flex; gap: 8px; flex-wrap: wrap; }
.glyphs button { width: 44px; height: 44px; border-radius: 11px; border: 1.5px solid var(--border-2); background: var(--surface-solid); cursor: pointer; display: grid; place-items: center; }
.glyphs button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.glyphs svg { width: 22px; height: 22px; }
.metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.mc { padding: 14px 16px; }
.mc .l { font-size: 12px; font-weight: 600; color: var(--muted); }
.mc .from { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mc .to { font-size: 20px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.mc .d { font-weight: 800; font-size: 14px; margin-top: 2px; }
.good { color: var(--ok); } .bad { color: var(--warn); }
.dropzone { border: 2px dashed var(--border-2); border-radius: 14px; padding: 28px; text-align: center; cursor: pointer; transition: .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 4%, transparent); }
.dropzone svg { width: 36px; height: 36px; color: var(--faint); }
.kbd { font-family: ui-monospace, monospace; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 5px; }

@media (max-width: 1180px) { .editor { grid-template-columns: 1fr; } .ed-preview { position: static; max-height: none; } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: .25s; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .topbar .sub, #newBtn span { display: none; }
  .topbar h1 { font-size: 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fgrid .w3, .fgrid .w4, .fgrid .w6 { grid-column: span 2; }
  .auth { grid-template-columns: 1fr; } .auth-side { display: none; }
  .paper { padding: 18px 16px; }
  .paper .pb { margin: 22px -16px; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } .auth-main { padding: 16px; } .auth-card { padding: 22px; } }
@media print { .sidebar, .topbar, .toolbar, .ed-form { display: none !important; } .editor { display: block; } .ed-preview { position: static; max-height: none; } .paper { box-shadow: none; } }
