/* Kaydee TV – adminpanelen (/admin). Bygger på variablerna i site.css. */
body.adm { background: #0A0A0A; }
.adm .btn { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 8px; border: 1px solid #2E2E2E; background: #1C1C1C; }
.adm .btn:hover { background: #262626; }
.adm .btn.primary { border-color: transparent; background: var(--accent); }
.adm .btn.primary:hover { background: #F08A50; }
.adm .btn.danger { background: rgba(240,106,90,.1); color: #F06A5A; border-color: rgba(240,106,90,.3); }
.adm .btn.wide { height: 50px; font-size: 15px; }
.adm-tag { font-size: 11px; color: var(--accent); font-weight: 800; letter-spacing: .2em; margin-top: 8px; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.lnk { display: block; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }

/* Inloggning */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 360px; max-width: 100%; border-radius: 18px; background: #121212; border: 1px solid #242424; padding: 32px; text-align: center; }
.login-card p { color: var(--muted); font-size: 14px; margin: 18px 0 22px; }
.login-msg { margin-top: 14px; font-size: 13px; color: #F06A5A; min-height: 18px; }

/* Ramen */
.shell { display: flex; min-height: 100vh; }
.side { width: 230px; flex: none; border-right: 1px solid #1C1C1C; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side-logo { padding: 0 8px 22px; }
.side-logo .logo.brand { font-size: 20px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nv { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; border: 0; background: none; color: #A3A3A3; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left; }
.nv:hover { color: #fff; }
.nv.on { background: #1C1C1C; color: #fff; }
.nv span { font-size: 12px; color: var(--dim); }
.side-me { margin-top: auto; padding: 12px; border-radius: 10px; background: #141414; font-size: 12px; color: var(--dim); word-break: break-all; }
.side-me b { color: #E5E5E5; }

.main { flex: 1; min-width: 0; padding: 26px 28px 60px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.head h1 { font-size: 26px; font-weight: 900; margin: 0; }
.head-r { display: flex; gap: 8px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.kpi { border-radius: 14px; background: #141414; border: 1px solid #242424; padding: 16px 18px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.kpi:hover { border-color: #333; }
.kpi .l { font-size: 11px; color: var(--dim); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kpi .n { font-size: 28px; font-weight: 900; margin-top: 4px; }
.kpi .s { font-size: 12px; color: var(--dim); margin-top: 2px; min-height: 16px; }

.tools { display: flex; gap: 10px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.search { flex: 1 1 260px; height: 40px; border-radius: 10px; background: #141414; border: 1px solid #262626; color: #fff; font: inherit; font-size: 14px; padding: 0 14px; }
.search:focus, .inp:focus, .sel:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; background: #161616; color: #B3B3B3; border: 1px solid #262626; cursor: pointer; }
.chip.on { background: #F5F5F5; color: #141414; border-color: #F5F5F5; }
.sel { height: 36px; border-radius: 8px; background: #161616; color: #D4D4D4; border: 1px solid #262626; font: inherit; font-size: 13px; padding: 0 10px; }

.table { margin-top: 14px; border-radius: 14px; border: 1px solid #1F1F1F; overflow: hidden; background: #0E0E0E; }
.tr { display: grid; grid-template-columns: 130px 110px minmax(0, 1fr) 130px 130px 110px; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #1A1A1A; font-size: 14px; }
.tr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell.dr-open .tr { grid-template-columns: 120px 100px minmax(0, 1fr) 120px 110px; }
.shell.dr-open .tr > :nth-child(6) { display: none; }
.tr.th { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #6B6B6B; text-transform: uppercase; padding: 11px 18px; }
#rows .tr { cursor: pointer; }
#rows .tr:hover { background: #141414; }
#rows .tr.sel { background: rgba(232,120,59,.08); box-shadow: inset 3px 0 0 var(--accent); }
.tr .id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; }
.tr .pl, .tr .un { color: #B3B3B3; }
.tr .no { color: #E5E5E5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .no.none { color: #4A4A4A; }
.tr .fs { color: var(--dim); }
.empty { padding: 28px; text-align: center; color: var(--dim); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-paid { color: #7FD1B9; background: rgba(127,209,185,.14); }
.p-trial { color: #F2B84B; background: rgba(242,184,75,.14); }
.p-free { color: #8FB4FF; background: rgba(143,180,255,.14); }
.p-review { color: #C9A2FF; background: rgba(201,162,255,.14); }
.p-locked { color: #F06A5A; background: rgba(240,106,90,.14); }
.p-blocked { color: #B3B3B3; background: rgba(255,255,255,.08); }

/* Panelen till höger */
.drawer { width: 380px; flex: none; border-left: 1px solid #1C1C1C; background: #0E0E0E; padding: 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dr-top { display: flex; justify-content: space-between; align-items: center; }
.dr-eb { font-size: 12px; color: var(--dim); font-weight: 700; letter-spacing: .1em; }
.dr-eb.hist { margin-top: 26px; }
.x { border: 0; background: none; color: #6B6B6B; font-size: 26px; line-height: 1; cursor: pointer; }
.dr-code { font-size: 30px; font-weight: 900; letter-spacing: .08em; margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dr-st { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.dr-lbl { display: block; margin-top: 20px; font-size: 12px; color: var(--dim); font-weight: 700; }
.inp { width: 100%; height: 42px; margin-top: 6px; border-radius: 8px; background: #141414; border: 1px solid #2A2A2A; color: #fff; font: inherit; font-size: 14px; padding: 0 12px; color-scheme: dark; }
.box-x { margin-top: 20px; border-radius: 12px; background: #141414; border: 1px solid #242424; padding: 16px; }
.box-x .chips { margin-top: 12px; }
.box-x .btn { margin-top: 14px; }
.box-x .small { margin-top: 10px; line-height: 1.5; }
.dr-acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dr-msg { min-height: 18px; margin-top: 10px; font-size: 13px; color: #F06A5A; }

.loglist .li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid #1C1C1C; font-size: 13px; }
.loglist .li .d { color: #6B6B6B; flex: none; width: 92px; }
.loglist .li .t { color: #D4D4D4; flex: 1; min-width: 0; }
.loglist .li .by { color: #5A5A5A; flex: none; }
.loglist .li .k { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #B3B3B3; cursor: pointer; margin-right: 8px; }
#logAll { margin-top: 18px; max-width: 900px; }

.card-x { margin-top: 18px; max-width: 640px; border-radius: 14px; background: #141414; border: 1px solid #242424; padding: 20px; }
.card-x h3 { margin: 0; font-size: 17px; }
.card-x p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 10px 0 0; }
.card-x code { background: #0A0A0A; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.meter { margin-top: 16px; height: 8px; border-radius: 4px; background: #262626; overflow: hidden; }
.meter div { height: 100%; width: 0; background: #C9A2FF; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; border-radius: 10px; background: #F5F5F5; color: #141414; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 50; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .drawer { position: fixed; right: 0; top: 0; bottom: 0; z-index: 40; box-shadow: -20px 0 60px rgba(0,0,0,.6); }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-right: 0; border-bottom: 1px solid #1C1C1C; }
  .side-logo { padding: 0 12px 0 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-me { display: none; }
  .main { padding: 18px 16px 60px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr { grid-template-columns: 110px minmax(0, 1fr) auto; }
  .tr .pl, .tr .un, .tr .fs, .tr.th span:nth-child(2), .tr.th span:nth-child(5), .tr.th span:nth-child(6) { display: none; }
  .drawer { width: 100%; }
}
