/* Premium layer: header drawers, launcher grid, shops, PIN, marketing. Loaded after app.css. */
.hd-spacer { display: none; }
.ill { width: 44px; height: 44px; flex: none; display: inline-block; }
.ill.sm { width: 22px; height: 22px; vertical-align: -6px; margin-right: 6px; }
.ill.xs { width: 26px; height: 26px; }
.topbar { gap: 10px; }
.hd-av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--p2), var(--p)); color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.hd-av.sm { width: 26px; height: 26px; font-size: 12px; }
.hd-av.lg { width: 44px; height: 44px; font-size: 18px; }
.hd-ic { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 38px; min-width: 38px; padding: 0 9px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.hd-ic:hover { background: #0b3d4a12; }
.hd-ic svg { width: 21px; height: 21px; }
.hd-lbl { font-size: 14px; }
details[data-pop] { position: relative; }
details[data-pop] > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
details[data-pop] > summary::-webkit-details-marker { display: none; }
.hd-prof > summary { padding: 3px; }
.hd-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 270px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px #0b3d4a26; padding: 10px; display: grid; gap: 6px; }
.pop.right { left: auto; right: 0; width: 300px; padding: 14px; gap: 10px; }
.pop-h { color: var(--mu); padding: 2px 8px; }
.pop form { margin: 0; }
.pop-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.pop-row:hover, .pop-row.on { background: #f0f7f7; }
.pop-row b { margin-left: auto; color: var(--g2); }
.pop-row.link { color: var(--p2); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.pp-head { display: flex; gap: 12px; align-items: center; }
.pp-head small { display: block; }
.pp-sub, .pp-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: inherit; background: #f7fafa; border: 0; width: 100%; font: inherit; cursor: pointer; }
.pp-sub { background: linear-gradient(90deg, #fff7e0, #fffbf2); border: 1px solid #fde68a; }
.pp-sub.warn { background: #fff1f0; border-color: #fecaca; }
.pp-sub em, .pp-row b { margin-left: auto; font-style: normal; font-size: 13px; color: var(--mu); }
.pp-row.danger { color: var(--red); background: #fff5f5; justify-content: center; font-weight: 600; }

.dk-overlay { position: fixed; inset: 0; background: #0b1f2666; z-index: 80; }
.dk-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: #fff; z-index: 90; display: flex; flex-direction: column; box-shadow: -20px 0 60px #0b3d4a33; transform: translateX(100%); transition: transform .22s ease; }
.dk-drawer.open { transform: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.dr-head h2 { margin: 0; font-size: 20px; }
.dr-x { border: 0; background: #f1f5f6; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.dr-body { flex: 1; overflow-y: auto; padding: 6px 20px 16px; display: grid; gap: 8px; align-content: start; }
.dr-body h3 { margin: 10px 0 2px; font-size: 13px; color: var(--mu); font-weight: 600; }
.dr-shop { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.dr-shop > div { flex: 1; min-width: 0; } .dr-shop small { display: block; }
.btn.dark { background: #0f2a33; color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.dr-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; min-height: 50px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; font: inherit; width: 100%; text-align: left; cursor: pointer; margin: 0; }
.dr-row:hover { border-color: #b6dadd; background: #fbfefe; }
.dr-row > span { flex: 1; }
.dr-row > i { font-style: normal; color: var(--mu); font-size: 18px; }
.dr-sel { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: #f7fafa; font: inherit; font-size: 13px; }
.dr-foot { padding: 12px 20px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; text-align: center; }
.dr-tabs { display: flex; gap: 6px; padding: 0 20px 8px; }
.dr-tabs button { flex: 1; border: 0; padding: 10px; border-radius: 10px; background: #f1f5f6; font: inherit; cursor: pointer; font-weight: 600; color: var(--mu); }
.dr-tabs button.on { background: var(--p2); color: #fff; }
.nt-row { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; margin-bottom: 8px; }
.nt-row.new { border-color: #99d5d8; background: #f2fbfb; }
.nt-row.tip { background: #fffbf0; border-color: #fdecc0; }
.dr-empty { text-align: center; padding: 30px 0; }
body.dk-lock { overflow: hidden; }
.dk-modal { position: fixed; z-index: 95; left: 50%; top: 50%; transform: translate(-50%, -48%); opacity: 0; transition: .2s; width: min(720px, 94vw); max-height: 90vh; overflow: auto; background: #fff; border-radius: 20px; padding: 0 20px 20px; box-shadow: 0 30px 80px #0b3d4a40; }
.dk-modal.open { transform: translate(-50%, -50%); opacity: 1; }
.dk-modal .dr-head { padding: 18px 0 6px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qr-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.qr-card img, .qr-empty { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: #f7fafa; display: grid; place-items: center; color: #b7c4c8; font-weight: 800; }
.qr-card input[type=file] { font-size: 12px; max-width: 100%; }
.qr-act { display: flex; gap: 6px; justify-content: center; }

/* Dashboard launcher */
.dl { margin: 0 0 16px; display: grid; gap: 14px; }
.dl-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dl-big a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px 10px; min-height: 120px; background: #fff; border-radius: 18px; text-decoration: none; color: var(--tx); font-size: 19px; font-weight: 700; box-shadow: 0 4px 16px #0b3d4a0d; border: 1px solid transparent; transition: .15s; }
.dl-big a:hover { transform: translateY(-2px); border-color: #b6dadd; box-shadow: 0 10px 26px #0b3d4a1a; }
.dl-big .ill { width: 56px; height: 56px; }
.dl-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.dl-group { background: #fff; border-radius: 18px; padding: 14px 16px 10px; box-shadow: 0 4px 16px #0b3d4a0d; }
.dl-group h3 { margin: 0 0 10px; font-size: 15px; color: var(--pd); }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; }
.dl-grid a { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 4px; border-radius: 12px; text-decoration: none; color: var(--tx); font-size: 13px; text-align: center; line-height: 1.25; }
.dl-grid a:hover { background: #f2f8f8; }
@media (max-width: 640px) {
    .dl-big { gap: 8px; } .dl-big a { min-height: 96px; font-size: 15px; padding: 14px 4px; }
    .dl-big .ill { width: 42px; height: 42px; }
    .dl-grid { grid-template-columns: repeat(4, 1fr); } .dl-grid .ill { width: 38px; height: 38px; }
    .dl-group { padding: 12px 8px 6px; }
    .hd-name, .hd-lbl { display: none; }
    .pop { position: fixed; left: 10px; right: 10px; top: 64px; width: auto; }
    .pop.right { width: auto; }
}

/* Page heads + My Shops */
.pg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.pg-head h2 { margin: 0 0 4px; font-size: 22px; } .pg-head p { margin: 0; }
.shop-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.shop-card { margin: 0; background: #fff; border-radius: 18px; box-shadow: 0 4px 16px #0b3d4a0d; border: 2px solid transparent; }
.shop-card.cur { border-color: #8fd0d4; }
.shop-card > button, .shop-card > summary { all: unset; box-sizing: border-box; display: grid; gap: 12px; width: 100%; padding: 16px; cursor: pointer; }
.shop-card:hover { box-shadow: 0 12px 30px #0b3d4a1f; }
.sc-top { display: flex; align-items: center; gap: 12px; }
.sc-logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #14b8a6, #0b5d6b); color: #fff; font-size: 22px; font-weight: 800; flex: none; }
.sc-name { flex: 1; min-width: 0; } .sc-name strong { display: block; font-size: 17px; } .sc-name small { display: block; }
.sc-plan { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fffbeb; font-size: 14px; }
.sc-plan em { margin-left: auto; font-style: normal; color: var(--mu); font-size: 12px; }
.sc-plan.warn { background: #fff7ed; } .sc-plan.bad { background: #fef2f2; }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sc-stats div { background: #f7fafa; border-radius: 10px; padding: 8px; }
.sc-stats small { display: block; color: var(--mu); font-size: 12px; } .sc-stats b { font-size: 15px; }
.sc-go { color: var(--p2); font-weight: 700; font-size: 14px; }
.shop-card.add { border: 2px dashed #b6dadd; box-shadow: none; background: #fbfefe; }
.shop-card.add summary { justify-items: center; text-align: center; padding: 28px 16px; }
.sc-plus { width: 52px; height: 52px; border-radius: 50%; background: var(--p2); color: #fff; font-size: 30px; display: grid; place-items: center; }
.sc-add-form { padding: 0 16px 16px; }

/* PIN */
.pin-boxes { display: flex; justify-content: center; gap: 10px; margin: 18px 0; }
.pin-box { width: 48px; height: 58px; text-align: center; font-size: 26px; font-weight: 700; border: 2px solid var(--line); border-radius: 14px; background: #f7fafa; }
.pin-box:focus { outline: none; border-color: var(--p2); background: #fff; box-shadow: 0 0 0 4px #0e7c8622; }
.pin-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pin-links form { margin: 0; }
.seg { display: inline-flex; gap: 6px; padding: 4px; background: #f1f5f6; border-radius: 12px; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; }
.seg label:has(input:checked) { background: #fff; box-shadow: 0 2px 8px #0b3d4a1a; }
.linkish { border: 0; background: none; color: var(--p2); cursor: pointer; font: inherit; padding: 0; }
@media (max-width: 400px) { .pin-box { width: 40px; height: 50px; } }

/* Global polish: consistent spacing/alignment */
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.field { margin-bottom: 14px; }
table.data th, table.data td { vertical-align: middle; }
table.data tfoot th { border-top: 2px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.block { display: flex; width: 100%; }

/* Dark theme (browser preference, no extra assets) */

/* ---------- Marketing SMS ---------- */
.mk-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; padding: 4px; background: #eef4f5; border-radius: 14px; width: fit-content; max-width: 100%; }
.mk-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-weight: 700; color: #4a6670; text-decoration: none; }
.mk-nav a svg { width: 18px; height: 18px; }
.mk-nav a.on { background: #fff; color: var(--p, #0f766e); box-shadow: 0 2px 8px #0b3d4a14; }
.mk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mk-stat { background: #fff; border: 1px solid #e3ecee; border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.mk-stat span { font-size: 12.5px; color: #5d7680; font-weight: 600; }
.mk-stat b { font-size: 20px; color: #0b3d4a; }
.mk-stat.ok b { color: #0f8a5f; } .mk-stat.bad b { color: #c2410c; } .mk-stat.warn b { color: #b7791f; }
.mk-file { font-size: 14px !important; overflow-wrap: anywhere; }
.mk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; margin-bottom: 20px; }
@media (max-width: 900px) { .mk-grid { grid-template-columns: 1fr; } }
.mk-grid > .card { padding: 16px; margin: 0; }
.mk-grid h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 10px; }
.mk-grid h2 svg { width: 20px; height: 20px; }
.mk-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid #e3ecee; margin-bottom: 12px; scrollbar-width: none; }
.mk-tab { border: 0; background: none; padding: 10px 12px; font-weight: 700; color: #5d7680; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; font: inherit; font-weight: 700; }
.mk-tab small { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #eef4f5; font-size: 11px; margin-left: 4px; }
.mk-tab.on { color: var(--p, #0f766e); border-bottom-color: var(--p, #0f766e); }
.mk-tabs-page { margin-bottom: 14px; }
.mk-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.mk-tools .search-box { flex: 1; }
.mk-list { max-height: 460px; overflow: auto; border: 1px solid #e3ecee; border-radius: 12px; }
.mk-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #f0f4f5; cursor: pointer; }
.mk-row:last-child { border-bottom: 0; }
.mk-row:hover { background: #f7fbfb; }
.mk-row input { width: 18px; height: 18px; accent-color: var(--p, #0f766e); flex: none; }
.mk-av { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #0f766e; background: linear-gradient(135deg, #d9f3ee, #c7e7f3); text-transform: uppercase; }
.mk-av.g { color: #7c3aed; background: linear-gradient(135deg, #ede4ff, #dfe8ff); }
.mk-who { display: flex; flex-direction: column; min-width: 0; }
.mk-who b { font-weight: 700; color: #16323b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-who small { color: #6b8590; font-size: 12.5px; }
.mk-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px; color: #6b8590; text-align: center; }
.mk-more { width: 100%; margin-top: 10px; }
.mk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mk-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.mk-recent { margin-top: 8px; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px; max-height: 150px; overflow: auto; padding: 10px; border: 1px dashed #cfdfe2; border-radius: 12px; background: #fafdfd; margin-bottom: 14px; }
.mk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 999px; background: #e3f4f0; color: #0b5b52; font-size: 12.5px; font-weight: 600; }
.mk-chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: #0f766e1f; color: #0b5b52; cursor: pointer; line-height: 1; }
.mk-chip button:hover { background: #0f766e; color: #fff; }
.mk-sig { margin: 6px 0 0; font-weight: 600; color: #3d5a63; font-size: 13px; }
.mk-meter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mk-meter span { padding: 4px 10px; border-radius: 8px; background: #f1f6f7; font-size: 12.5px; color: #3d5a63; }
.mk-meter b { color: #0b3d4a; }
.mk-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.mk-actions .btn { min-width: 180px; justify-content: center; display: inline-flex; gap: 8px; align-items: center; }
.mk-actions .btn svg { width: 18px; height: 18px; }
.mk-save-tpl { margin-top: 12px; font-size: 13.5px; }
.mk-save-tpl summary { cursor: pointer; color: #4a6670; font-weight: 600; }
.mk-inline { display: flex; gap: 8px; margin-top: 8px; }
.mk-inline input { flex: 1; }
#mk-at { margin-top: 8px; max-width: 260px; }
.mk-bar { height: 6px; background: #e6eef0; border-radius: 99px; margin-top: 6px; overflow: hidden; min-width: 90px; }
.mk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #0f766e); transition: width .4s; }
.mk-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 14px; }
.mk-filter input[type=search] { flex: 1 1 200px; }
.mk-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #5d7680; font-weight: 600; }
.mk-dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed #b9d6da; border-radius: 16px; background: #f6fbfb; cursor: pointer; text-align: center; margin-bottom: 12px; transition: border-color .2s, background .2s; }
.mk-dropzone:hover { border-color: #0f766e; background: #eef8f6; }
.mk-dropzone input { max-width: 100%; }
.mk-drop-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #14b8a6, #0f766e); color: #fff; font-size: 20px; }
.mk-drop .btn { width: 100%; }
.mk-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mk-group { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 0; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.mk-group:hover { transform: translateY(-2px); box-shadow: 0 8px 20px #0b3d4a14; }
.mk-group .pill { margin-left: auto; }
.mk-invalid { padding: 12px 16px; margin-bottom: 14px; }
.mk-invalid ul { columns: 3 200px; margin: 10px 0 0; padding-left: 18px; color: #9a3412; }
.mk-save { padding: 16px; }
.mk-save-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.mk-save-row .field { flex: 1 1 220px; margin: 0; }
.mk-name { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 8px; }
.mk-name:hover, .mk-name:focus { border-color: #cfdfe2; background: #fff; }
tr.mk-off td { opacity: .45; text-decoration: line-through; }
.mk-pages { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.pill.info { background: #e0edff; color: #1d4ed8; }

/* ---------- Admin: premium theme ---------- */
body.panel { background: radial-gradient(1200px 500px at 100% -10%, #e9e7ff 0, transparent 60%), #f5f6fb; }
body.panel .sidebar { background: linear-gradient(180deg, #14123a 0%, #1e1b4b 55%, #2a1f5c 100%); color: #d8d6f5; border-right: 0; }
body.panel .sidebar a, body.panel .sidebar .linkish, body.panel .sidebar summary { color: #c9c6ef; border-radius: 12px; }
body.panel .sidebar a:hover, body.panel .sidebar summary:hover { background: #ffffff12; color: #fff; }
body.panel .sidebar a.on { background: linear-gradient(90deg, #7c5cff, #5b8cff); color: #fff; box-shadow: 0 6px 18px #5b5cff55; }
body.panel .sidebar .brand small { color: #a5a1e0; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
body.panel .topbar { background: #ffffffcc; backdrop-filter: blur(10px); border-bottom: 1px solid #e7e8f3; }
body.panel .topbar h1 { font-weight: 800; letter-spacing: -.01em; color: #1b1840; }
body.panel .card { border: 1px solid #e8e9f4; border-radius: 16px; box-shadow: 0 1px 2px #1b18400a, 0 8px 24px #1b18400d; }
body.panel .tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: #eceefa; border-radius: 14px; width: fit-content; max-width: 100%; margin-bottom: 16px; scrollbar-width: none; }
body.panel .tabs a { padding: 8px 14px; border-radius: 10px; white-space: nowrap; color: #4b4a72; font-weight: 600; text-decoration: none; border: 0; }
body.panel .tabs a.on { background: #fff; color: #4f46e5; box-shadow: 0 2px 8px #1b184014; }
body.panel .btn.grad { background: linear-gradient(90deg, #7c5cff, #5b8cff); border: 0; color: #fff; }
body.panel table.data th { background: #f6f7fc; color: #5a5a7d; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
body.panel .user-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: linear-gradient(120deg, #ffffff 0%, #f3f0ff 100%); }
body.panel .user-badges { display: flex; gap: 6px; flex-wrap: wrap; }
body.panel .statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
body.panel .statgrid > div { background: #f7f7fd; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.panel .rowline { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
body.panel details > summary { cursor: pointer; font-weight: 600; margin: 10px 0; }
body.panel .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { body.panel .two { grid-template-columns: 1fr; } }
body.panel .main, body.panel .card, body.panel .table-wrap { min-width: 0; }
body.panel .table-wrap { overflow-x: auto; }

/* Subscriptions board */
.sx-top { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 12px; margin-bottom: 14px; align-items: stretch; }
.sx-side { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: #fff; border: 2px solid #e8e9f4; text-decoration: none; color: #1b1840; transition: .15s; }
.sx-side b { display: block; font-size: 26px; line-height: 1.1; }
.sx-side small { color: #6b6a8c; font-weight: 600; }
.sx-side .sx-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.sx-side.ok .sx-dot { background: #10b981; box-shadow: 0 0 0 5px #10b98122; }
.sx-side.warn .sx-dot { background: #f59e0b; box-shadow: 0 0 0 5px #f59e0b22; }
.sx-side.on.ok { border-color: #10b981; background: linear-gradient(120deg, #fff, #ecfdf5); }
.sx-side.on.warn { border-color: #f59e0b; background: linear-gradient(120deg, #fff, #fffbeb); }
.sx-link { display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 14px; background: #fff; border: 1px solid #e8e9f4; color: #4f46e5; font-weight: 700; text-decoration: none; }
.sx-link svg { width: 18px; height: 18px; }
.sx-filter { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; margin-bottom: 12px; }
.sx-filter input[type=search] { flex: 1 1 220px; }
.sx-list { display: flex; flex-direction: column; gap: 10px; }
.sx-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: 14px; align-items: center; padding: 14px 16px; margin: 0; }
.sx-shop { display: flex; gap: 12px; align-items: center; min-width: 0; }
.sx-shop > div { display: flex; flex-direction: column; min-width: 0; }
.sx-shop b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-av { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #7c5cff, #5b8cff); }
.sx-meta { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.sx-exp { display: flex; flex-direction: column; }
.sx-exp small { color: #6b6a8c; font-size: 11.5px; }
.bad-text { color: #dc2626; }
.sx-more { grid-column: 1 / -1; margin: 0; }
.sx-row .sx-more { grid-column: auto; justify-self: end; }
.sx-row .sx-more[open] { grid-column: 1 / -1; justify-self: stretch; }
.sx-more > summary { list-style: none; margin: 0 !important; display: inline-flex; }
.sx-more > summary::-webkit-details-marker { display: none; }
.sx-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 12px; background: #f7f7fd; border-radius: 12px; }
.sx-form, .sx-cancel { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.sx-form select, .sx-form input, .sx-cancel input { flex: 1 1 160px; min-width: 0; margin: 0; }
.sx-pack-shop { padding: 12px 0; border-bottom: 1px solid #eef0f7; }
.sx-pack-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sx-pack h2 { display: flex; align-items: center; gap: 8px; }
.sx-pack h2 svg { width: 20px; height: 20px; color: #f59e0b; }
@media (max-width: 900px) {
  .sx-top { grid-template-columns: 1fr 1fr; }
  .sx-row { grid-template-columns: 1fr; }
  .sx-row .sx-more { justify-self: stretch; }
  .sx-more > summary { width: 100%; justify-content: center; }
}
@media (max-width: 480px) { .sx-top { grid-template-columns: 1fr; } .sx-link { padding: 10px 16px; } }
.shop-card-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.shop-card-wrap.off .shop-card { opacity: .7; filter: grayscale(.4); }
.sc-manage { background: #fff; border: 1px solid #e3ecee; border-radius: 14px; padding: 4px 14px; }
.sc-manage > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 0; font-weight: 700; color: #3d5a63; }
.sc-manage > summary svg { width: 16px; height: 16px; }
.sc-manage form { margin: 8px 0 12px; }
.sc-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: end; }
.sc-edit .field { margin: 0; }
@media (max-width: 520px) { .sc-edit { grid-template-columns: 1fr; } }
.hd-ic.hd-lang { font-weight: 800; font-size: 12px; text-decoration: none; min-width: 38px; justify-content: center; }
.staff-report h3 { margin: 0 0 10px; }
@media (max-width: 420px) { .hd-ic.hd-lang { display: none; } }

/* r39: due balances — inline Collect form and New due row */
.row-between{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.collect-pop{position:relative;display:inline-block}
.collect-pop>summary{list-style:none;cursor:pointer}
.collect-pop>summary::-webkit-details-marker{display:none}
.collect-pop .collect-form{position:absolute;right:0;top:calc(100% + 6px);z-index:30;width:min(320px,86vw);padding:14px;border-radius:14px;background:var(--card,#fff);border:1px solid var(--line,#e5e7eb);box-shadow:0 12px 32px rgba(0,0,0,.18);text-align:left}
.collect-pop .collect-form .field{margin-bottom:8px}
.collect-pop .collect-form small{display:block;margin:6px 0 10px}

/* r40: global search + quick add */
.hd-kbd{font:600 11px/1 ui-monospace,monospace;padding:3px 5px;border:1px solid var(--line,#dfe7ea);border-radius:5px;color:var(--mu,#667);margin-left:2px}
.hd-search{border:1px solid var(--line,#e3ecee);min-width:38px}
@media (min-width:900px){.hd-search{min-width:210px;justify-content:flex-start;color:var(--mu,#667)}.hd-search .hd-kbd{margin-left:auto}}
@media (max-width:899px){.hd-kbd{display:none}}
.gs-modal{top:12vh;transform:translate(-50%,-4%);width:min(640px,94vw);max-height:76vh;padding:0 14px 14px}
.gs-modal.open{transform:translate(-50%,0)}
.gs-bar{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:10px;padding:12px 2px;background:inherit;border-bottom:1px solid var(--line,#e3ecee)}
.gs-bar svg{width:20px;height:20px;flex:none;color:var(--mu,#667)}
.gs-bar input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:inherit;font:inherit;font-size:17px;padding:6px 0}
.gs-results .pop-h,.gs-quick .pop-h{display:block;margin:12px 4px 4px}
.gs-results .rowline{border-radius:10px;padding:9px 8px}
.gs-results .rowline:hover,.gs-results .rowline:focus{background:var(--soft,#f2f8f8)}
.gs-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.gs-grid a{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;border-radius:12px;border:1px solid var(--line,#e3ecee);text-decoration:none;color:var(--tx,#0f2a33);font-size:13px;text-align:center;line-height:1.25}
.gs-grid a span{font-size:22px}
.gs-grid a:hover{background:var(--soft,#f2f8f8)}
.gs-hint{display:block;margin-top:12px;text-align:center}
@media (max-width:640px){.gs-modal{top:0;left:0;transform:none;width:100vw;max-height:100vh;height:100vh;border-radius:0}.gs-modal.open{transform:none}.gs-grid{grid-template-columns:repeat(2,1fr)}.gs-hint{display:none}}
.search-page{display:flex;gap:10px;align-items:center}
.search-page .input{flex:1;min-width:0}
.imei-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:12px}
.imei-kpis .card{margin:0}
.imei-ev .ic{font-size:20px;width:34px;flex:none;text-align:center}
.imei-ev{display:flex;align-items:center;gap:10px}
@media (max-width:480px){.imei-kpis{gap:8px}.imei-kpis .kpi b{font-size:20px}}
/* r40: delete audit rows */
.act-del{border-left:3px solid var(--bad,#d92d20);padding-left:10px}
.act-old summary{cursor:pointer;color:var(--mu,#667);font-size:13px;margin-top:4px}
.act-old dl{display:grid;grid-template-columns:minmax(90px,max-content) 1fr;gap:2px 12px;margin:6px 0 0;font-size:13px;background:var(--soft,#f6f9fa);border-radius:10px;padding:8px 10px}
.act-old dt{color:var(--mu,#667)}.act-old dd{margin:0;overflow-wrap:anywhere}
/* r40: low stock card spans the row; items flow in columns */
.low-stock .ls-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:0 18px}
/* r40: setup checklist */
.setup-card{margin-bottom:14px}
.setup-list{list-style:none;margin:10px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px 16px}
.setup-list li>a,.setup-list li.done{display:flex;align-items:center;gap:10px;padding:8px 6px;border-radius:10px;text-decoration:none;color:var(--tx,#0f2a33)}
.setup-list li>a:hover{background:var(--soft,#f6f9fa)}
.setup-list li>a i{margin-left:auto;font-style:normal;color:var(--mu,#667)}
.setup-list .chk{flex:none;width:22px;height:22px;border-radius:50%;border:2px solid var(--line,#cfdade);display:inline-grid;place-items:center;font-size:13px}
.setup-list li.done{color:var(--mu,#667);text-decoration:line-through}
.setup-list li.done .chk{background:var(--ok,#067647);border-color:var(--ok,#067647);color:#fff}

/* r40c: one close button in the search palette */
.gs-bar input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;display:none}

/* r41: staff list actions */
.staff-acts{white-space:nowrap}.staff-acts form{display:inline}
@media (max-width:760px){table.stack td.staff-acts{white-space:normal;flex-wrap:wrap;justify-content:flex-end;gap:6px}table.stack td.staff-acts::before{display:none}}

/* r49: installments (EMI) */
.inst-new { display: flex; gap: 8px; flex-wrap: wrap; }
.inst-kinds { margin-bottom: 10px; }
.kpi-warn { border-left: 4px solid #dc6803; } .kpi-warn b { color: #b54708; }
.inst-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.inst-grid > .card h2 { font-size: 1rem; margin: 2px 0 10px; }
.inst-grid > .card h2 ~ h2 { margin-top: 16px; }
.inst-money { border: 0; padding: 0; margin: 0; min-width: 0; }
.inst-money[disabled] { opacity: .6; }
.inst-calc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.inst-calc > div { background: #f3f8f8; border: 1px solid #dbe5e7; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.inst-calc span { font-size: 12px; color: var(--mu, #667085); } .inst-calc b { font-size: 1.05rem; }
.inst-preview { font-size: 13px; } .inst-preview td, .inst-preview th { padding: 5px 8px; }
.inst-form .table-wrap { max-height: 320px; overflow: auto; }
.inst-form .sticky-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.inst-row.inst-overdue td:first-child { box-shadow: inset 3px 0 0 var(--red, #d92d20); }
.inst-schedule tr.inst-due-overdue td { background: #fef3f2; }
.inst-schedule tr.inst-due-paid td { color: #067647; }
.inst-schedule .stack-title { display: none; }
.inst-toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; width: min(380px, calc(100vw - 24px)); background: #fff; border: 1px solid #f5c26b; border-left: 5px solid #dc6803; border-radius: 14px; box-shadow: 0 14px 40px rgba(16, 24, 40, .22); padding: 12px 14px; opacity: 0; transform: translateY(14px); transition: opacity .2s, transform .2s; }
.inst-toast.show { opacity: 1; transform: none; }
.inst-toast-head { display: flex; align-items: center; gap: 8px; }
.inst-toast-head strong { flex: 1; }
.inst-toast-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #fffaeb; color: #b54708; flex: none; }
.inst-toast-ic svg { width: 18px; height: 18px; }
.inst-toast-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #667085; padding: 2px 6px; }
.inst-toast ul { list-style: none; margin: 8px 0; padding: 0; }
.inst-toast li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px dashed #eaecf0; font-size: 13px; }
.inst-toast li span { color: #b54708; font-size: 12px; }
.inst-toast-actions { display: flex; gap: 8px; justify-content: flex-end; }
html[data-theme=dark] .inst-toast { background: var(--card, #1d2533); border-color: #7a4a10; }
html[data-theme=dark] .inst-calc > div { background: var(--soft, #1d2533); border-color: var(--line, #334); }
@media (max-width: 860px) {
    .inst-grid { grid-template-columns: 1fr; }
    .inst-toast { right: 12px; left: 12px; bottom: 76px; width: auto; }
    .inst-schedule .stack-title { display: block; }
    .inst-new .btn { flex: 1; text-align: center; }
}
