/* ==========================================================================
   LogicGigs admin — calm, dense, professional
   ========================================================================== */
.admin { background: #F5F7FB; font-size: 15px; }
.admin .brand-mark { width: 32px; height: 32px; }
.admin .brand-word { font: 900 20px/1 var(--f-display); letter-spacing: -.03em; color: #fff; text-transform: lowercase; }
.admin .brand-word b { color: var(--cyan); }
.admin .brand { display: inline-flex; align-items: center; gap: 9px; }
.admin .brand-img { height: 32px; width: auto; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: 13.5px; }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; box-shadow: none; }
.btn-ghost.danger { color: var(--red); }

.ad-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.ad-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #0A0F1F; color: #A9B1C6; padding: 18px 12px 30px; scrollbar-width: thin; scrollbar-color: #283049 transparent; }
.ad-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.ad-nav { display: grid; gap: 1px; }
.ad-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.ad-nav a .ic { width: 18px; height: 18px; opacity: .8; }
.ad-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.ad-nav a.on { background: var(--blue); color: #fff; }
.ad-nav a.on .ic { opacity: 1; }
.ad-nav em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 800; background: var(--pink); color: #fff; padding: 1px 7px; border-radius: 999px; }
/* Collapsible groups: the header shows the group's waiting total while closed; the chevron turns when open. */
.ad-grp > summary { list-style: none; display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 10px 12px 8px; border-radius: 9px; cursor: pointer; user-select: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: #7C86A2; transition: color .15s, background .15s; }
.ad-grp > summary::-webkit-details-marker { display: none; }
.ad-grp > summary:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.ad-grp > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.ad-grp > summary span { min-width: 0; }
.ad-grp > summary em { letter-spacing: 0; text-transform: none; }
.ad-grp > summary .ic { width: 14px; height: 14px; margin-left: auto; flex: none; opacity: .7; transition: transform .2s var(--ease); transform: rotate(-90deg); }
.ad-grp > summary em + .ic { margin-left: 0; }
.ad-grp[open] > summary .ic { transform: none; }
.ad-grp[open] > summary em { display: none; }
.ad-grp[open] > summary em + .ic { margin-left: auto; }
.ad-grp-items { display: grid; gap: 1px; padding-bottom: 4px; }
.ad-main { min-width: 0; }
.ad-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 28px; background: rgba(245, 247, 251, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ad-burger { display: none; width: 40px; height: 40px; border-radius: 10px; border: 0; background: #fff; box-shadow: 0 0 0 1px var(--line); place-items: center; }
.ad-links { display: flex; gap: 18px; }
.ad-links a { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.ad-links a:hover { color: var(--blue); }
.ad-links .ic { width: 16px; height: 16px; }
.ad-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ad-user .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; font-size: 13px; }
.ad-uname { font-weight: 700; font-size: 14px; line-height: 1.2; }
.ad-uname small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.ad-icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; }
.ad-icon-btn:hover { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.ad-icon-btn.danger:hover { color: var(--red); }
.ad-icon-btn .ic { width: 18px; height: 18px; }
.ad-content { padding: 26px 28px 60px; max-width: 1400px; }
.ad-scrim { display: none; }
@media (max-width: 1000px) {
  .ad-shell { grid-template-columns: minmax(0, 1fr); }
  .ad-side { position: fixed; z-index: 100; width: 270px; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .ad-open .ad-side { transform: none; }
  .ad-open .ad-scrim { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(10, 15, 31, .5); }
  .ad-burger { display: grid; }
  .ad-links { display: none; }
  .ad-uname { display: none; }
  .ad-content { padding: 20px 16px 60px; }
}

.card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(10, 15, 31, .04); }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font: 800 17px var(--f-body); letter-spacing: -.01em; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head a { font-weight: 700; font-size: 13.5px; color: var(--blue); }
.card-head.mt { margin-top: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font: 800 24px var(--f-display); letter-spacing: -.02em; }
.page-head .count { font: 600 14px var(--f-body); color: var(--muted); background: #fff; box-shadow: 0 0 0 1px var(--line); padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.page-head .chip a { margin-left: 4px; font-weight: 800; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-block; font-weight: 600; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.crumb:hover { color: var(--blue); }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }
.empty-big { text-align: center; padding: 50px 20px; }
.empty-big > .ic { width: 38px; height: 38px; color: var(--blue); margin: 0 auto 10px; }
.empty-big h2 { font-size: 19px; margin-bottom: 14px; }

/* Dashboard */
.ad-hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ad-hello h1 { font: 800 26px var(--f-display); letter-spacing: -.03em; }
.ad-hello p { color: var(--muted); margin: 4px 0 0; }
.ad-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-banner { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; background: #FFF8E1; box-shadow: inset 0 0 0 1px #FFE3A3; margin-bottom: 20px; flex-wrap: wrap; }
.ad-banner > div { flex: 1; min-width: 260px; }
.ad-banner p { margin: 2px 0 0; font-size: 14px; color: #6B5310; }
.ad-banner-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #FFD166; color: #3B2A00; }
.ad-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.ad-stat { display: grid; gap: 2px; padding: 16px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s; }
.ad-stat:hover { box-shadow: 0 0 0 1.5px var(--blue); transform: translateY(-2px); }
.ad-stat > span { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #EEF4FF; color: var(--blue); margin-bottom: 8px; }
.ad-stat b { font: 800 26px/1 var(--f-display); }
.ad-stat small { color: var(--muted); font-weight: 600; }
.ad-grid { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 16px; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.checklist a { display: flex; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.checklist a:hover { background: var(--bg-2); }
.checklist span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.checklist .ic { width: 14px; height: 14px; }
.checklist li.ok a { color: var(--muted); text-decoration: line-through; }
.checklist li.ok span { background: var(--green); color: #fff; box-shadow: none; }
.pbar-ad { height: 6px; border-radius: 9px; background: var(--bg-3); overflow: hidden; }
.pbar-ad i { display: block; height: 100%; background: var(--green); }
@media (max-width: 1300px) { .ad-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ad-grid { grid-template-columns: minmax(0, 1fr); } }

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 14px; background: #FAFBFD; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); font-size: 13px; }
.tbl tbody tr:hover { background: #FAFBFE; }
.tbl tr.clickable { cursor: pointer; }
.card .tbl td { padding-left: 4px; }
.card.flush .tbl td, .card.flush .tbl th { padding-left: 16px; }
.rowlink { font-weight: 700; color: var(--ink); display: block; }
.rowlink:hover { color: var(--blue); }
.actions { text-align: right; white-space: nowrap; }
.actions > * { display: inline-flex; vertical-align: middle; }
.actions form { display: inline; }
.actions-col { width: 1%; }
.thumb { display: grid; place-items: center; width: 56px; height: 42px; border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.empty { color: var(--muted-2); }
.thumb.tech { width: 42px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.thumb.tech img, .thumb.tech .tech-mono { width: 26px; height: 26px; object-fit: contain; font-size: 10px; border-radius: 6px; }
.tech-mono { display: inline-grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); font: 800 12px var(--f-display); text-transform: uppercase; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #D5DBE8; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(24, 178, 107, .15); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: -3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.st-new, .st-pending, .st-submitted { background: #FFF0F6; color: #C0145F; }
.st-published, .st-active, .st-graded, .st-open, .st-qualified { background: #EAFBF2; color: #0E7A48; }
.st-draft, .st-returned, .st-contacted { background: #FFF6E0; color: #8A5A00; }
.st-closed, .st-cancelled, .st-completed { background: var(--bg-2); color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .select { min-height: 42px; width: auto; min-width: 170px; border-radius: 10px; font-size: 14px; }
.tb-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); min-width: 280px; }
.tb-search input { border: 0; outline: none; background: transparent; flex: 1; font-size: 14px; min-width: 0; }
.tb-search .ic { color: var(--muted); width: 18px; }
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #fff; box-shadow: 0 0 0 1px var(--line); font-weight: 700; font-size: 14px; }
.pager a.on { background: var(--ink); color: #fff; box-shadow: none; }

/* Forms */
.form-card { padding: 24px; }
.fgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 18px; }
.ff { grid-column: span 6; display: grid; gap: 7px; align-content: start; min-width: 0; }
.ff.w-half { grid-column: span 3; }
.ff.w-third { grid-column: span 2; }
.ff .hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.req { color: var(--red); font-style: normal; }
.admin .input, .admin .select, .admin .textarea { min-height: 44px; border-radius: 10px; font-size: 14.5px; }
.admin .textarea.mono { font-size: 13.5px; line-height: 1.6; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; padding-top: 28px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: #D5DBE8; position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); }
.color-in { display: flex; gap: 8px; }
.color-in input[type=color] { width: 44px; height: 44px; padding: 3px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-3); }
.icon-pick input:checked + span { background: var(--blue); color: #fff; box-shadow: none; }
.icon-pick .ic { width: 18px; height: 18px; }
.md-editor { border-radius: 12px; box-shadow: 0 0 0 1.5px var(--line); overflow: hidden; background: #fff; }
.md-editor .textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 240px; }
.md-tabs { display: flex; gap: 4px; align-items: center; padding: 6px; background: #FAFBFD; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.md-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.md-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.md-help { margin-left: auto; font: 500 12px var(--f-mono); color: var(--muted-2); padding-right: 6px; }
.md-preview { padding: 18px 20px; min-height: 240px; font-size: 15.5px; }
.readonly-box { padding: 16px; border-radius: 12px; background: #FAFBFD; box-shadow: inset 0 0 0 1px var(--line); }
.kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; margin: 0; }
.kvs dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.kvs dd { margin: 3px 0 0; font-weight: 600; word-break: break-word; }
.kvs dd small { color: var(--muted); font-weight: 500; }
.kvs a { color: var(--blue); }
.msg { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); white-space: normal; font-size: 15px; }
.form-bar { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 0; background: linear-gradient(transparent, #F5F7FB 30%); }
.form-bar .muted { margin-right: auto; font-size: 13.5px; }
@media (max-width: 420px) { .form-bar .muted { display: none; } .form-bar .btn { flex: 1 1 0; padding-left: 10px; padding-right: 10px; } }
@media (max-width: 800px) { .ff.w-half, .ff.w-third { grid-column: span 6; } .switch { padding-top: 0; } }

/* Media field + gallery */
.media-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mf-preview { width: 180px; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(#F1F3F8 0 25%, #fff 0 50%) 0 0 / 16px 16px; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; }
.mf-preview img { width: 100%; height: 100%; object-fit: cover; }
.mf-preview.logo img { object-fit: contain; padding: 10px; }
.mf-empty { display: grid; justify-items: center; gap: 4px; color: var(--muted-2); text-align: center; padding: 8px; }
.mf-empty small { font-size: 11.5px; line-height: 1.3; }
.mf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gf-items { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.gf-item { position: relative; width: 130px; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); cursor: grab; background: var(--bg-2); }
.gf-item img { width: 100%; height: 100%; object-fit: cover; }
.gf-item button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(10, 15, 31, .75); color: #fff; font-weight: 800; }
.gf-item.dragging { opacity: .4; }

/* Media library */
.uploader { margin-bottom: 18px; display: grid; grid-template-columns: 1fr 220px; gap: 16px; }
.drop-zone { display: grid; justify-items: center; gap: 6px; padding: 30px 20px; border-radius: 14px; border: 2px dashed #CBD5E6; background: #FAFBFE; cursor: pointer; text-align: center; transition: border-color .2s, background .2s; }
.drop-zone:hover, .drop-zone.drag { border-color: var(--blue); background: #EEF4FF; }
.dz-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--blue); color: #fff; margin-bottom: 4px; }
.drop-zone small { color: var(--muted); }
.up-opts .label { display: grid; gap: 6px; }
.up-list { grid-column: 1 / -1; display: grid; gap: 6px; }
.up-list:empty { display: none; }
.up-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; }
.up-row.ok { background: #EAFBF2; color: #0E7A48; }
.up-row.err { background: #FFF0F0; color: #9E1C22; }
.folder-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.folder-pills a { padding: 7px 12px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--line); font-weight: 600; font-size: 13.5px; }
.folder-pills a span { color: var(--muted); font-size: 12px; margin-left: 2px; }
.folder-pills a.on { background: var(--ink); color: #fff; box-shadow: none; }
.folder-pills a.on span { color: #AEB6CC; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mcard { background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; position: relative; }
.mcard[open] { grid-row: span 2; box-shadow: 0 0 0 2px var(--blue); }
.mcard summary { list-style: none; cursor: pointer; }
.mcard summary::-webkit-details-marker { display: none; }
.mcard-img { display: block; aspect-ratio: 4/3; background: repeating-conic-gradient(#F1F3F8 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.mcard-img img { width: 100%; height: 100%; object-fit: cover; }
.mcard-img.svg img { object-fit: contain; padding: 18px; }
.mcard-meta { display: grid; padding: 10px 12px; }
.mcard-meta b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard-meta small { color: var(--muted); font-size: 12px; }
.mcard-warn { position: absolute; top: 8px; right: 8px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; background: #FFD166; color: #3B2A00; padding: 2px 6px; border-radius: 5px; }
.mcard-edit { display: grid; gap: 8px; padding: 0 12px 12px; }
.mcard-edit .label { display: grid; gap: 4px; font-size: 12.5px; }
.mcard-edit .input { min-height: 36px; font-size: 13.5px; padding: 6px 10px; }
.mcard-edit .row { display: flex; gap: 6px; }
.input.sm { font-size: 11.5px; }
@media (max-width: 800px) { .uploader { grid-template-columns: minmax(0, 1fr); } }

/* Picker modal */
.mp { position: fixed; inset: 0; z-index: 300; background: rgba(10, 15, 31, .6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.mp[hidden] { display: none; }
.mp-box { width: min(1000px, 100%); max-height: 88vh; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.mp-head { display: flex; gap: 10px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mp-head h2 { font: 800 18px var(--f-body); margin-right: auto; }
.mp-head .input { width: 240px; min-height: 38px; }
.mp-head label.btn { cursor: pointer; }
.mp-status { padding: 0 18px; font-size: 13.5px; color: var(--muted); }
.mp-status:not(:empty) { padding: 10px 18px; background: #EEF4FF; }
.mp-grid { padding: 18px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mp-item { border: 0; padding: 0; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); text-align: left; transition: box-shadow .15s, transform .15s; }
.mp-item:hover { box-shadow: 0 0 0 2px var(--blue); transform: translateY(-2px); }
.mp-item.sel { box-shadow: 0 0 0 3px var(--blue); }
.mp-item span { display: block; aspect-ratio: 4/3; background: repeating-conic-gradient(#F1F3F8 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.mp-item img { width: 100%; height: 100%; object-fit: cover; }
.mp-item small { display: block; padding: 6px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 80px; display: grid; gap: 2px; }
.settings-nav a { padding: 9px 12px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--ink-3); }
.settings-nav a:hover { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.settings-form { display: grid; gap: 16px; }
.settings-form .card { scroll-margin-top: 80px; }
.settings-form h2 { margin-bottom: 16px; font-size: 18px; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: minmax(0, 1fr); } .settings-nav { position: static; display: flex; flex-wrap: wrap; } }

/* Login */
.ad-login-page { background: #0A0F1F; }
.ad-login { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; }
.ad-login-art { position: relative; display: grid; place-items: center; padding: 6vw; overflow: hidden; background: radial-gradient(60% 60% at 60% 40%, rgba(31, 107, 255, .45), transparent 70%); }
.ad-login-art .vx { border-radius: 20px; box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .8); transform: perspective(1600px) rotateY(10deg) rotateX(4deg); background: transparent; }
.ad-login-art .vx-stage { padding: 0; }
.ad-login-form { background: #fff; display: grid; align-content: center; gap: 4px; padding: clamp(30px, 6vw, 80px); }
.ad-login-form .brand-word { color: var(--ink); }
.ad-login-form .brand-word b { color: var(--blue); }
.ad-login-form h1 { font: 800 32px var(--f-display); letter-spacing: -.03em; margin-top: 30px; }
.ad-login-form > p { color: var(--muted); margin-bottom: 20px; }
.ad-login-alt { display: block; text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
@media (max-width: 900px) { .ad-login { grid-template-columns: minmax(0, 1fr); } .ad-login-art { display: none; } }

/* Drag-to-reorder */
.drag-col { width: 34px; padding-right: 0 !important; }
.drag-handle { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted-2); cursor: grab; }
.drag-handle:hover { background: var(--bg-2); color: var(--ink); }
.drag-handle .ic { width: 15px; height: 15px; }
tr.dragging { opacity: .45; background: #EEF4FF; }
tbody.saved tr { transition: background .6s; background: #F1FBF6; }
tbody.save-failed tr { background: #FFF0F0; }

/* Logo placements */
.ad-brand .lg-sub { color: var(--lime); }
.ad-top-mark { display: none; }
@media (max-width: 1000px) { .ad-top-mark { display: inline-flex; } }
.ad-login-form > a .lg { margin-bottom: 6px; }
.install-logo { margin: 0 auto 18px; }

/* Brand kit */
.bk-hero { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; padding: 32px; margin-bottom: 26px; }
.bk-hero-mark { padding: 18px; border-radius: 40px; background: radial-gradient(circle, rgba(31, 107, 255, .12), transparent 70%); }
.bk-hero h2 { font: 800 26px/1.2 var(--f-display); margin: 12px 0 14px; letter-spacing: -.02em; }
.bk-meaning { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bk-meaning li { display: flex; gap: 10px; align-items: center; color: var(--ink-3); }
.bk-meaning i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.bk-h { font: 800 19px var(--f-display); margin: 8px 0 14px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 26px; }
.bk-cell { display: grid; gap: 4px; background: #fff; border-radius: 16px; padding: 12px 12px 16px; box-shadow: 0 0 0 1px var(--line); }
.bk-cell b { font-size: 14.5px; padding: 6px 4px 0; }
.bk-cell small { color: var(--muted); font-size: 13px; padding: 0 4px; }
.bk-stage { height: 150px; border-radius: 12px; display: grid; place-items: center; background: #F7F9FC; background-image: radial-gradient(#E3E8F2 1px, transparent 1.2px); background-size: 16px 16px; overflow: hidden; }
.bk-stage.dark { background: #0A0F1F; background-image: radial-gradient(#1C2440 1px, transparent 1.2px); background-size: 16px 16px; }
.bk-stage.photo { background: linear-gradient(135deg, #6C4DFF, #1F6BFF 60%, #19B6FF); }
.bk-stage.og { background: #0A0F1F; }
.bk-stage.og img { width: 100%; height: 100%; object-fit: cover; }
.bk-row { display: flex; gap: 16px; align-items: center; }
.bk-fav span { display: block; }
.bk-fav svg { width: 100%; height: 100%; display: block; }
.bk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.bk-two h2 { margin-bottom: 14px; }
.bk-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14.5px; }
.bk-rules li { display: flex; gap: 10px; align-items: flex-start; }
.bk-rules .ic { width: 20px; height: 20px; flex: none; padding: 3px; border-radius: 50%; color: #fff; stroke-width: 3; }
.bk-rules .do .ic { background: var(--green); }
.bk-rules .dont .ic { background: var(--red); }
.bk-colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bk-color { display: grid; gap: 2px; font-size: 13px; }
.bk-color i { height: 52px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); margin-bottom: 6px; }
.bk-color code { font-size: 12px; color: var(--muted); }
.bk-color small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.bk-type { margin: 16px 0 0; font-size: 13.5px; }
.bk-dls { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.bk-dl { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s; }
.bk-dl:hover { box-shadow: 0 0 0 1.5px var(--blue); }
.bk-ext { font: 800 11px var(--f-mono); background: var(--bg-2); padding: 6px 7px; border-radius: 7px; color: var(--ink-3); }
.bk-dl b { display: block; font-size: 14px; }
.bk-dl small { color: var(--muted); font-size: 12px; }
.dl-ic { transform: rotate(180deg); color: var(--muted); width: 18px; height: 18px; }
.bk-regen { margin-top: 16px; font-size: 13px; }
@media (max-width: 900px) { .bk-hero { grid-template-columns: minmax(0, 1fr); } .bk-two { grid-template-columns: minmax(0, 1fr); } .bk-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.portrait-preview { width: 140px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; }
.portrait-preview > * { width: 100%; height: 100%; object-fit: cover; }
.portrait-preview .tm-mono { font: 900 40px var(--f-display); color: var(--blue); width: auto; height: auto; }

/* LMS phase 4: status tabs on admin list pages */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tabs a { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line, #E3E6EE); color: inherit; text-decoration: none; }
.tabs a.on { background: var(--blue, #1F6BFF); color: #fff; box-shadow: none; }
.ticket-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticket-thread li { padding: 12px 14px; border-radius: 12px; background: #F4F5FA; }
.ticket-thread li.staff { background: #EEF4FF; }
.ticket-thread li.internal { background: #FFF8E6; }
.tm-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.tm-meta small { color: #5B6478; font-size: 12px; }
.post-body p { margin: 0 0 .6em; }
.cfile { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; }
.st-chip { --sc: #5B6478; display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, #fff); white-space: nowrap; }
.fee-history li.void { opacity: .6; }
.ad-user .avatar { overflow: hidden; }
.ad-user .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Small screens: long labels wrap instead of pushing the page sideways */
.ad-content .select, .ad-content .input { max-width: 100%; }
@media (max-width: 560px) {
  .card-head { flex-wrap: wrap; row-gap: 8px; gap: 8px 12px; }
  .card-head .st-chip { white-space: normal; }
  .page-head form { max-width: 100%; }
  .page-head form .btn { white-space: normal; overflow-wrap: anywhere; height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; text-align: left; }
}
