:root {
  --bg: #f3f6f9; --card: #fff; --line: #e3eaf0; --line2: #eef2f6; --txt: #0f1f2e; --sub: #5b6f80; --muted: #8a9aa8;
  --primary: #1a8cc4; --primary-d: #1260a0; --green: #5cb82e; --wa: #25d366; --danger: #d92d20; --warn: #f2a900;
  --side: #071b2e; --side-txt: #a9c2d6; --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --font: 'Inter', system-ui, sans-serif; --display: 'Poppins', 'Inter', sans-serif;
}
[data-theme="dark"] { --bg: #0b1622; --card: #111f2e; --line: #1f3246; --line2: #18293a; --txt: #e6eef5; --sub: #9db2c4; --muted: #7690a5; --side: #050f19; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); background: var(--bg); color: var(--txt); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; }
code { background: var(--line2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.muted { color: var(--muted); } small.muted, .help { display: block; font-size: 12px; color: var(--muted); }
.grow { flex: 1; }
[hidden] { display: none !important; }

/* shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-txt); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 18px 12px; scrollbar-width: thin; }
.side-brand { display: block; padding: 4px 10px 18px; }
.side-brand img { height: 46px; width: auto; max-width: 100%; object-fit: contain; }
.side-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #59768d; padding: 14px 12px 6px; font-weight: 600; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-txt); font-weight: 500; transition: background .15s, color .15s; }
.side-link svg { width: 18px; height: 18px; flex: 0 0 18px; }
.side-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.side-link.on { color: #fff; background: linear-gradient(135deg, rgba(26,140,196,.38), rgba(26,140,196,.14)); box-shadow: inset 0 0 0 1px rgba(78,200,244,.25); }
.side-link em { margin-left: auto; font-style: normal; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 100px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 26px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-title { font-size: 16px; font-weight: 700; }
.top-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 38px; width: 260px; }
.top-search svg { width: 16px; color: var(--muted); }
.top-search input { border: 0; background: none; outline: 0; color: var(--txt); flex: 1; font: inherit; min-width: 0; }
.burger { display: none !important; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; color: var(--txt); padding: 4px; border-radius: 10px; font: inherit; }
.user-btn .who { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-btn .who small { color: var(--muted); font-size: 11.5px; }
.user-btn svg { width: 16px; color: var(--muted); }
.user-drop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.14); min-width: 190px; padding: 6px; display: none; }
.user-drop.open { display: block; }
.user-drop a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--txt); }
.user-drop a:hover { background: var(--bg); }
.user-drop svg { width: 16px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--green)); color: #fff; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.content { padding: 26px; max-width: 1440px; width: 100%; }
.backdrop { display: none; }

/* headings */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--sub); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.narrow { max-width: 720px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-title a { font-size: 13px; font-weight: 600; }
.card h4 { margin-bottom: 10px; }

/* 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(--line); background: var(--card); color: var(--txt); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, transform .1s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); color: #fff; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 46px; font-size: 15px; }
.btn.block { width: 100%; margin-bottom: 8px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--sub); display: inline-grid; place-items: center; cursor: pointer; transition: .15s; }
.icon-btn:hover { background: var(--bg); color: var(--primary); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.wa { color: #128c7e; } .icon-btn.wa:hover { background: #e7f9ee; }
.icon-btn.star.on { color: #f5b301; } .icon-btn.star.on svg { fill: #f5b301; }
form.inline { display: inline; }

/* alerts */
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; background: #ebf7e1; color: #2f6b13; border: 1px solid #c8eab1; }
.alert.error { background: #fdecec; color: #b42318; border-color: #f7c4c0; }
.alert svg { width: 18px; flex: 0 0 18px; }
.note { background: #fff8e6; border: 1px solid #ffe3a3; color: #7a5200; padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.note.ok { background: #ebf7e1; border-color: #c8eab1; color: #2f6b13; }
.hint { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; margin: 12px 0 0; }
.hint svg { width: 14px; }

/* forms */
.input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: 14px var(--font); color: var(--txt); background: var(--card); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.input.auto { width: auto; }
.input.xs { height: 28px; font-size: 12px; padding: 0 8px; }
.fgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-weight: 600; font-size: 13px; }
.req { color: var(--danger); }
.w-full { grid-column: span 6; } .w-half { grid-column: span 3; } .w-third { grid-column: span 2; }
.fhead { padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 6px; }
.fhead:first-child { border: 0; padding-top: 0; margin-top: 0; }
.fhead h4 { font-size: 14px; } .fhead p { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }
.fgroup { grid-column: span 6; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; }
.fgroup legend { font-weight: 700; padding: 0 6px; }
.counter { font-size: 11.5px; color: var(--muted); text-align: right; margin-top: -2px; }
.counter.over { color: var(--danger); font-weight: 600; }
.toggle-field { flex-direction: row; align-items: center; gap: 12px; padding: 6px 0; }
.toggle-field b { font-size: 13.5px; }
.switch { position: relative; width: 44px; height: 24px; flex: 0 0 44px; }
.switch input[type=checkbox] { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd8df; border-radius: 30px; cursor: pointer; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.colorfield { display: flex; gap: 8px; } .colorfield input[type=color] { width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--card); cursor: pointer; }
.imgfield { display: flex; gap: 12px; align-items: center; border: 1px dashed var(--line); border-radius: 12px; padding: 10px; }
.imgprev { width: 84px; height: 84px; flex: 0 0 84px; border-radius: 10px; background: repeating-conic-gradient(#f1f4f7 0 25%, #fff 0 50%) 50% / 14px 14px; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
[data-theme=dark] .imgprev { background: #0d1b29; }
.imgprev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.imgctl { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.gallery-items { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.gitem { position: relative; width: 84px; height: 84px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: #f4f5f7; cursor: grab; }
.gitem img { width: 100%; height: 100%; object-fit: contain; }
.gitem button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.rep-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.kv-row { display: grid; grid-template-columns: 22px 1fr 1.4fr 34px; gap: 8px; align-items: center; }
.handle { cursor: grab; color: var(--muted); display: grid; place-items: center; } .handle svg { width: 16px; }
.card-item { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.rep-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rep-head b { font-size: 13px; }
.rep-body { padding: 14px; }
.card-item.collapsed .rep-body { display: none; }
.card-item.collapsed [data-collapse] svg { transform: rotate(180deg); }
.sortable-ghost { opacity: .4; }
.rte { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.rte .ql-toolbar { border: 0 !important; border-bottom: 1px solid var(--line) !important; background: var(--bg); }
.rte .ql-container { border: 0 !important; font: 15px/1.7 var(--font); min-height: 260px; }
.rte .ql-editor { min-height: 260px; }
[data-theme=dark] .rte .ql-stroke { stroke: #9db2c4; } [data-theme=dark] .rte .ql-fill { fill: #9db2c4; } [data-theme=dark] .rte .ql-picker { color: #9db2c4; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px -4px 18px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 14px; font: 600 13.5px var(--font); color: var(--sub); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }

/* edit layout */
.edit-layout { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.edit-side .sticky { position: sticky; top: 82px; }
.meta { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.danger-zone { display: inline-block; margin-right: 8px; }
.accordion { display: flex; flex-direction: column; gap: 10px; }
.acc { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.acc summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary svg { width: 18px; color: var(--primary); }
.acc[open] summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: 16px; }

/* tables */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.searchbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 38px; background: var(--card); min-width: 240px; }
.searchbox svg { width: 16px; color: var(--muted); }
.searchbox input { border: 0; outline: 0; background: none; font: inherit; color: var(--txt); flex: 1; min-width: 0; }
.table-wrap { overflow-x: auto; margin: 0 -20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tr:hover td { background: color-mix(in srgb, var(--primary) 3%, transparent); }
.table .w0 { width: 1%; }
.table .handle { cursor: grab; }
.thumb { width: 46px; height: 46px; border-radius: 10px; background: #f4f5f7; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.thumb img { max-width: 42px; max-height: 42px; object-fit: contain; }
.cell-title { font-weight: 600; color: var(--txt); display: block; }
.cell-title:hover { color: var(--primary); }
.row-actions { white-space: nowrap; text-align: right; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 100px; background: var(--line2); color: var(--sub); white-space: nowrap; }
.b-active, .b-published, .b-won, .b-delivered, .b-confirmed { background: #ebf7e1; color: #3e8a1a; }
.b-draft, .b-hidden, .b-disabled, .b-lost, .b-cancelled { background: #eef1f4; color: #5b6f80; }
.b-new, .b-clicked { background: #fff4db; color: #a86b00; }
.b-contacted, .b-quoted, .b-header, .b-chatbot { background: #e8f4fb; color: #1260a0; }
.b-super { background: #f1ebfc; color: #6b3fc6; } .b-admin { background: #e8f4fb; color: #1260a0; }
[data-theme=dark] .badge { filter: brightness(.9) saturate(1.2); }
.stars { color: #f5b301; letter-spacing: 1px; }
.clip { max-width: 260px; display: inline-block; }
.bulkbar { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 10px; background: color-mix(in srgb, var(--primary) 8%, var(--card)); border-radius: 10px; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--txt); font-weight: 600; }
.pager a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; margin-bottom: 8px; }
.empty h3 { color: var(--txt); margin-bottom: 10px; }
.empty.sm { padding: 18px; }

/* dashboard */
.hello { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding: 22px 24px; border-radius: 18px; color: #fff;
  background: radial-gradient(700px 300px at 90% 0%, #2aa6d9 0%, transparent 60%), linear-gradient(135deg, #0d4f85, #071b2e); }
.hello h2 { font-family: var(--display); font-size: 24px; }
.hello p { margin: 4px 0 0; color: #b9cfe0; }
.hello .btn:not(.primary) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; color: var(--txt); position: relative; transition: transform .2s, box-shadow .2s; box-shadow: var(--shadow); }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(13,79,133,.12); }
.kpi-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); flex: 0 0 46px; }
.kpi b { font-family: var(--display); font-size: 24px; display: block; line-height: 1.1; }
.kpi span { color: var(--sub); font-size: 12.5px; }
.kpi em { position: absolute; top: 12px; right: 14px; font-style: normal; font-size: 11.5px; font-weight: 700; }
.up { color: #3e8a1a; } .down { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.grid-2 > .card { margin-bottom: 18px; }
.chart-box { position: relative; height: 260px; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.list-row:last-child { border: 0; }
.bar-row { display: grid; grid-template-columns: 1fr 120px 30px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.bar { height: 8px; background: var(--line2); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--wa), #128c7e); border-radius: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.timeline li small { display: block; }
.tl-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; color: var(--primary); flex: 0 0 32px; }
.tl-ic svg { width: 15px; }
.a-delete { color: var(--danger); } .a-create { color: #3e8a1a; }

/* pages */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--txt); display: flex; flex-direction: column; gap: 4px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 12px 30px rgba(13,79,133,.1); }
.tile-ic { width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); display: grid; place-items: center; margin-bottom: 8px; }
.tile small { color: var(--muted); }

/* SEO */
.serp { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 16px; background: var(--card); }
.serp small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.serp-url { color: #188038; font-size: 13px; margin-top: 6px; word-break: break-all; }
.serp-title { color: #1a0dab; font-size: 19px; line-height: 1.3; margin: 2px 0; }
[data-theme=dark] .serp-title { color: #8ab4f8; }
.serp-desc { color: #4d5156; font-size: 13.5px; }
[data-theme=dark] .serp-desc { color: #bdc1c6; }
.seo-checks { margin-top: 12px; display: grid; gap: 6px; }
.seo-checks div { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.seo-checks i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.seo-checks .g i { background: #3e8a1a; } .seo-checks .y i { background: var(--warn); } .seo-checks .r i { background: var(--danger); }
.score { font-family: var(--display); font-size: 18px; padding: 4px 12px; border-radius: 10px; }
.score.sg { background: #ebf7e1; color: #3e8a1a; } .score.sy { background: #fff4db; color: #a86b00; } .score.sr { background: #fdecec; color: var(--danger); }
.audit-link { display: block; padding: 4px 0; }

/* users */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role input { position: absolute; opacity: 0; }
.role span { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.role span svg { color: var(--primary); }
.role small { color: var(--muted); }
.role input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.perm-group h5 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.perm { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.perm svg { width: 16px; color: var(--sub); }
.perm input { width: 17px; height: 17px; accent-color: var(--primary); }
.perm:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.usercell { display: flex; gap: 10px; align-items: center; }

/* media */
.media-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; max-height: 60vh; overflow-y: auto; }
.media-grid.page { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: none; }
.mitem { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--card); transition: border-color .15s, transform .15s; }
.mitem:hover { border-color: var(--primary); transform: translateY(-2px); }
.mitem.sel { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 30%, transparent); }
.mitem .mthumb, .mcard .mthumb { height: 110px; background: #f4f5f7; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.mthumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mitem small { display: block; padding: 6px 8px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sub); }
.mcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.mcard .mthumb { height: 140px; }
.minfo { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.minfo b { font-size: 12.5px; } .minfo small { color: var(--muted); font-size: 11.5px; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.dropzone.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); color: var(--primary); }
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(7,27,46,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.modal-box { background: var(--card); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-box.wide { width: min(1000px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* chatbot / whatsapp */
.testchat { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tc-body { height: 300px; overflow-y: auto; padding: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.tc-body div { max-width: 88%; padding: 8px 11px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; }
.tc-body .u { align-self: flex-end; background: var(--primary); color: #fff; }
.tc-body .a { background: var(--card); border: 1px solid var(--line); }
.tc-body small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.testchat .tc-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.convo { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.convo summary { padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.convo summary span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.convo-msgs { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.convo-msgs div { font-size: 13px; padding: 8px 11px; border-radius: 10px; max-width: 90%; }
.convo-msgs .u { background: color-mix(in srgb, var(--primary) 12%, var(--card)); align-self: flex-end; }
.convo-msgs .a { background: var(--bg); }
.convo-msgs small { display: block; color: var(--muted); font-size: 10.5px; }
.wa-preview { background: #e5ddd5; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.wa-preview div { background: #dcf8c6; color: #111; border-radius: 10px 0 10px 10px; padding: 9px 11px; font-size: 13px; white-space: pre-wrap; margin-left: auto; max-width: 95%; }
.stat-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-list div { background: var(--bg); border-radius: 12px; padding: 12px; } .stat-list b { display: block; font-size: 20px; font-family: var(--display); } .stat-list span { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 300; background: #0f1f2e; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 14px 30px rgba(0,0,0,.25); }

/* login */
.login-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(900px 500px at 20% 10%, #12497a, #071b2e); display: flex; align-items: flex-end; padding: 56px; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 9s ease-in-out infinite; }
.o1 { width: 380px; height: 380px; background: #1a8cc4; top: -60px; right: -40px; } .o2 { width: 300px; height: 300px; background: #5cb82e; bottom: -60px; left: -40px; animation-delay: -4s; }
@keyframes float { 50% { transform: translate(20px, -20px) scale(1.08); } }
.login-copy { position: relative; color: #fff; max-width: 460px; }
.login-copy h2 { font-family: var(--display); font-size: 40px; line-height: 1.1; }
.login-copy h2 span { background: linear-gradient(90deg, #7ddc4a, #4ec8f4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-copy p { color: #b9cfe0; font-size: 16px; }
.login-side { display: grid; place-items: center; padding: 24px; background: var(--card); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-logo { height: 70px; width: auto; align-self: flex-start; }
.login-card h1 { font-family: var(--display); font-size: 26px; margin-top: 8px; }

@media (max-width: 1100px) { .edit-layout, .grid-2 { grid-template-columns: 1fr; } .edit-side .sticky { position: static; } .top-search { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 100; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(7,27,46,.5); z-index: 90; }
  .burger { display: inline-grid !important; }
  .content { padding: 16px; } .top { padding: 0 14px; }
  .user-btn .who { display: none; }
  .fgrid { grid-template-columns: 1fr; } .w-full, .w-half, .w-third, .fgroup { grid-column: span 1; }
  .login-page { grid-template-columns: 1fr; } .login-art { display: none; }
  .role-pick { grid-template-columns: 1fr; } .stat-list { grid-template-columns: 1fr 1fr; }
  .kv-row { grid-template-columns: 18px 1fr 34px; } .kv-row input:nth-of-type(2) { grid-column: 2; }
}
