/* Admin console pages beyond the card library, from the "Candles Admin" design.
   Builds on the variables and components in index.html (.pill, .btn, .toggle, .tabs, .search…). */
a.nav { text-decoration: none; cursor: pointer; }
.nav .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.c-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.c-head h1 { font-size: 34px; margin: 0; }
.c-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; padding: 3px; border-radius: 999px; background: var(--chip); }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(29,26,22,.1); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; border-radius: 18px; background: #fff; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d { font-size: 12.5px; font-weight: 600; }
.kpi .d span { color: var(--faint); font-weight: 500; }
.up { color: #2F8A3F; } .down { color: #C8372D; } .flat { color: var(--faint); }

.panel { padding: 20px; border-radius: 18px; background: #fff; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel h3 { font-size: 15px; font-weight: 600; margin: 0; }
.panel .s { font-size: 12.5px; color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 220px; }
.chart .col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .stack { width: 100%; display: flex; flex-direction: column; border-radius: 8px 8px 3px 3px; overflow: hidden; }
.chart .stack div { transition: height .3s; }
.chart .lab { font-size: 11px; color: var(--faint); white-space: nowrap; }
.chart-empty { height: 220px; display: grid; place-items: center; color: var(--muted); font-size: 13.5px; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel .row1 { display: flex; justify-content: space-between; font-size: 13px; }
.funnel .row1 span { color: var(--faint); }
.bar8 { height: 8px; border-radius: 4px; background: #F3EFE8; }
.bar8 div { height: 100%; border-radius: 4px; transition: width .3s; }
.sec { display: flex; justify-content: space-between; align-items: center; }
.sec b { font-size: 15px; }
.sec a { font-size: 13px; font-weight: 600; color: #8A5A1F; cursor: pointer; text-decoration: none; }

.table { border-radius: 18px; background: #fff; overflow: hidden; }
.tr { display: grid; gap: 16px; padding: 12px 20px; align-items: center; font-size: 13.5px; border-bottom: 1px solid rgba(29,26,22,.05); }
.tr > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--faint); border-bottom: 1px solid rgba(29,26,22,.07); text-transform: uppercase; }
.tr.click { cursor: pointer; transition: background .12s; }
.tr.click:hover { background: #FBF8F3; }
.tr:last-child { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.who .sb { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink); }
.av.big { width: 56px; height: 56px; font-size: 22px; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; padding: 2px 0; white-space: normal !important; }
.chip { flex: none; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; display: flex; align-items: center; white-space: nowrap; }
.st { height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill .cnt { font-size: 11.5px; opacity: .6; margin-left: 6px; }
.empty-box { padding: 40px; text-align: center; font-size: 14px; color: var(--muted); }
.big-empty { padding: 60px; text-align: center; border-radius: 18px; background: #fff; }
.big-empty .display { font-size: 26px; }
.big-empty p { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.loading { padding: 60px; display: grid; place-items: center; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer .shade { position: absolute; inset: 0; background: rgba(29,26,22,.25); animation: cFade .2s ease both; }
.drawer .sheet { position: absolute; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100%; background: #fff; box-shadow: -20px 0 50px rgba(29,26,22,.15); padding: 24px; display: flex; flex-direction: column; gap: 18px; animation: cIn .28s cubic-bezier(.2,.9,.25,1) both; overflow-y: auto; }
.drawer .ref { font-family: ui-monospace, monospace; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.drawer .close { width: 34px; height: 34px; border-radius: 50%; background: #F3EFE8; display: flex; align-items: center; justify-content: center; font-size: 14px; border: 0; flex: none; }
.drawer .ttl { font-size: 24px; line-height: 1.1; }
.fields { border-radius: 14px; background: var(--bg); padding: 4px 14px; }
.fields div.f { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 13.5px; border-bottom: 1px solid rgba(29,26,22,.06); }
.fields div.f:last-child { border-bottom: 0; }
.fields .k { color: var(--muted); flex: none; }
.fields .val { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.drawer h4 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.acts { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acts.one { grid-template-columns: 1fr; }
.act { height: 44px; border-radius: 999px; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 0; }
.act.red { background: #fff; box-shadow: inset 0 0 0 1px rgba(29,26,22,.16); color: #C8372D; }
.act.ink { background: var(--ink); color: var(--bg); }
.act:disabled { opacity: .45; cursor: default; }
.media-prev { border-radius: 14px; overflow: hidden; background: var(--bg); }
.media-prev img, .media-prev video { display: block; width: 100%; }
.media-prev audio { display: block; width: 100%; padding: 10px; }
.lyrics { white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: var(--bg); border-radius: 14px; padding: 12px 14px; max-height: 280px; overflow: auto; }
@keyframes cFade { from { opacity: 0; } }
@keyframes cIn { from { transform: translateX(40px); opacity: 0; } }

/* Gift catalog */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.btile { border-radius: 18px; background: #fff; padding: 14px; display: flex; flex-direction: column; gap: 12px; transition: opacity .2s; }
.btile.off { opacity: .6; }
.btile.off .gc { filter: grayscale(1); }
.gc { position: relative; aspect-ratio: 1.58 / 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: filter .2s; }
.gc::before { content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.1); }
.gc span { position: relative; text-align: center; padding: 0 10px; }
.btile .foot .t { font-size: 15px; }
.btile .foot .m { font-size: 12.5px; white-space: normal; }

/* Moderation */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.mod { border-radius: 18px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.mod.flag { box-shadow: 0 0 0 2px var(--red); }
.mod .pic { position: relative; height: 200px; background: linear-gradient(#EFEAE2, #E3DCD1); display: grid; place-items: center; color: var(--muted); font-weight: 600; cursor: pointer; }
.mod .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mod .pic .shade2 { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.6)); }
.mod .pic .tag { position: absolute; left: 12px; top: 12px; }
.mod .pic .cap { position: absolute; left: 12px; right: 12px; bottom: 12px; color: #fff; font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 17px; line-height: 1.1; text-align: left; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mod .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.mod .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.mod .meta b { color: var(--ink); }
.mod .why { font-size: 12.5px; color: var(--ink); }
.mod .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mod .btns button { height: 34px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 0; }
.mod .btns .no { background: #fff; box-shadow: inset 0 0 0 1px rgba(29,26,22,.14); color: #C8372D; }
.mod .btns .yes { background: var(--ink); color: var(--bg); }

/* Revenue mix and settings */
.mix { height: 22px; border-radius: 11px; overflow: hidden; display: flex; background: #F3EFE8; }
.mixrow { display: grid; grid-template-columns: 22px 1fr 100px 120px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(29,26,22,.06); font-size: 14px; }
.mixrow .sw { width: 14px; height: 14px; border-radius: 4px; }
.mixrow .p { text-align: right; color: var(--muted); }
.mixrow .v { text-align: right; font-weight: 600; }
.settings { border-radius: 18px; background: #fff; max-width: 720px; display: flex; flex-direction: column; }
.setrow { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid rgba(29,26,22,.06); }
.setrow:last-child { border-bottom: 0; }
.setrow .t2 { font-size: 15px; font-weight: 600; }
.setrow .d2 { font-size: 13px; color: var(--muted); margin-top: 2px; }
.setrow .warn { font-size: 12.5px; color: #A8322A; margin-top: 4px; font-weight: 600; }
.setrow .v { font-weight: 600; }
.toggle.lg { width: 50px; height: 30px; border-radius: 15px; }
.toggle.lg::after { width: 24px; height: 24px; }
.toggle.lg.on::after { left: 23px; }

@media (max-width: 760px) {
  .tr { gap: 10px; padding: 12px 14px; }
  .hide-sm { display: none !important; }
  .c-head h1 { font-size: 28px; }
}
@media (max-width: 760px) {
  body aside { flex-wrap: wrap; }
  body aside #nav { display: flex; order: 3; width: 100%; overflow-x: auto; gap: 4px; padding-top: 10px; }
  body aside #nav .nav { flex: none; }
  .table { overflow-x: auto; }
  .table .tr { min-width: 680px; }
}
.setrow input[type=number] { width: 72px; height: 34px; margin-right: 8px; padding: 0 10px; border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(29,26,22,.14); font: inherit; text-align: right; background: #fff; }
.setrow input[type=tel], .setrow input[type=email] { width: 210px; max-width: 45vw; height: 34px; margin-right: 8px; padding: 0 10px; border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(29,26,22,.14); font: inherit; background: #fff; }
.setrow .btn { height: 34px; padding: 0 16px; border-radius: 999px; border: 0; font-size: 13px; font-weight: 600; background: var(--ink); color: var(--bg); cursor: pointer; }
.setrow .consent { margin-top: 4px; font-size: 12px; }
