/* OrbiTags dashboard and admin panel. Uses the tokens from site.css. */

/* Site additions: flash messages, pricing, form errors */
.flash { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 13px 16px; border-radius: 14px; font-size: 14px; margin-bottom: 16px; background: var(--tint); color: var(--ink); }
.flash i[data-icon] { width: 20px; height: 20px; }
.flash.success { background: #e7f6ee; color: #14613c; }
.flash.error { background: #fdecea; color: #8a231d; }
.flash-wrap { max-width: 760px; margin: 0 auto 8px; }
.form-errors { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: #fdecea; color: #8a231d; display: grid; gap: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.auth-single { max-width: 480px; margin: 0 auto; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.price-card { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 16px; padding: 28px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); }
.price-card.featured { border: 1.5px solid var(--accent); box-shadow: var(--shadow); }
.price-card .tag { position: absolute; top: -12px; left: 24px; padding: 5px 12px; border-radius: var(--pill); background: var(--accent); color: #fff; font: 600 12px/1 var(--sans); }
.price-card h3 { font: 700 20px/1.2 var(--head); letter-spacing: -0.02em; color: var(--ink); }
.price-card .tagline { font-size: 14px; color: var(--muted); min-height: 22px; }
.price-card .amount { display: flex; align-items: baseline; gap: 6px; font: 700 40px/1 var(--head); letter-spacing: -0.04em; color: var(--ink); }
.price-card .amount small { font: 500 14px/1 var(--sans); letter-spacing: 0; color: var(--muted); }
.price-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; font-size: 14px; }
.price-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.price-list li i[data-icon] { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }
.price-list li.off { color: var(--subtle); }
.price-list li.off i[data-icon] { color: var(--subtle); }
.price-list b { font-weight: 600; color: var(--ink); }
.price-list li.off b { color: var(--subtle); font-weight: 400; }
.price-list span { display: block; color: var(--muted); font-size: 13px; }
.price-note { text-align: center; font-size: 14px; color: var(--muted); margin-top: 28px; }
.price-group + .price-group { margin-top: 56px; }
.bill-toggle { display: flex; width: max-content; margin: 0 auto 28px; padding: 5px; gap: 4px; border-radius: var(--pill); background: #fff; border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.bill-toggle[hidden] { display: none; }
.bill-toggle button { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted); font: 600 14.5px/1 var(--sans); cursor: pointer; transition: background-color .2s, color .2s; }
.bill-toggle button[aria-checked="true"] { background: var(--ink); color: #fff; }
.bill-toggle .save, .bill-note .save { display: inline-block; padding: 4px 8px; border-radius: var(--pill); background: #e7f6ee; color: #14613c; font: 600 11.5px/1 var(--sans); }
.price-group[data-billing="year"] .by-month, .price-group[data-billing="month"] .by-year { display: none; }
.price-card .bill-note { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.bill-pick { display: grid; gap: 8px; }
.bill-pick label { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); cursor: pointer; font-size: 13.5px; color: var(--muted); }
.bill-pick label:has(input:checked) { border-color: var(--accent); background: var(--tint-2); }
.bill-pick input { margin: 2px 0 0; accent-color: var(--accent); }
.bill-pick b { display: block; color: var(--ink); font-weight: 600; }
.price-group > h3 { font: 700 22px/1.3 var(--head); color: var(--ink); margin-bottom: 20px; text-align: center; }

/* Panel shell */
body.panel-ui { background: var(--canvas); font-size: 14px; }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.side .brand img { height: 22px; width: auto; }
.side .brand span { font: 600 11px/1 var(--sans); color: var(--accent); background: var(--tint); padding: 4px 8px; border-radius: var(--pill); }
.side-label { padding: 14px 12px 6px; font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.side a.item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font: 500 14px/1.2 var(--sans); color: var(--text); }
.side a.item i[data-icon] { width: 18px; height: 18px; color: var(--subtle); }
.side a.item:hover { background: var(--canvas); }
.side a.item.active { background: var(--tint); color: var(--accent); }
.side a.item.active i[data-icon] { color: var(--accent); }
.side a.item .count { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: var(--pill); background: var(--accent); color: #fff; font: 600 11px/1.2 var(--sans); text-align: center; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.who { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 6px 8px; }
.who .av { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 14px/1 var(--head); }
.who b { display: block; font: 600 13px/1.3 var(--sans); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; padding: 28px 32px 64px; }
.main-inner { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head h1 { font: 700 26px/1.2 var(--head); letter-spacing: -0.03em; color: var(--ink); }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumb:hover { color: var(--accent); }
.side-toggle { display: none; }

/* Buttons and form controls (compact versions of the site styles) */
.panel-ui .btn { height: 40px; padding: 0 16px; font-size: 14px; }
.panel-ui .btn svg, .panel-ui .btn i[data-icon] { width: 16px; height: 16px; }
.panel-ui .btn:hover svg { transform: none; }
.panel-ui .btn-primary { box-shadow: none; }
.panel-ui .btn-primary::after { display: none; }
.btn-xs { height: 30px !important; padding: 0 12px !important; font-size: 12.5px !important; }
.btn-line { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover { border-color: rgba(12, 23, 84, 0.3); }
.btn-danger { background: #c4322a; color: #fff; }
.btn-danger:hover { background: #a82820; }
.btn-danger-line { background: #fff; color: #a82820; border-color: #efc4c0; }
.btn-danger-line:hover { background: #fdecea; }
.panel-ui .input, .panel-ui select.input, .panel-ui textarea.input { height: 40px; border-radius: 10px; font-size: 14px; padding: 0 12px; }
.panel-ui textarea.input { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.panel-ui select.input { appearance: auto; }
.panel-ui .field { gap: 6px; }
.panel-ui .field label { font: 500 13px/1.2 var(--sans); color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.mono-input { font-family: var(--mono); font-size: 14px; letter-spacing: .01em; }
.field .hint a, .muted-sm a { color: var(--accent); font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.inline-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Boxes, stats, tables */
.box { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.box + .box, .box + .cols, .cols + .box, .stats-row + .box, .stats-row + .cols { margin-top: 18px; }
.box-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.box-head h2 { font: 600 16px/1.3 var(--head); color: var(--ink); }
.box-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.box-body { padding: 20px; }
.box-foot { padding: 14px 20px; border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols > .box + .box { margin-top: 0; }
.col-stack { display: grid; gap: 18px; }
.col-stack > .box + .box { margin-top: 0; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat-box { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.stat-box span { font-size: 13px; color: var(--muted); }
.stat-box b { display: block; margin-top: 6px; font: 700 28px/1.1 var(--head); letter-spacing: -0.03em; color: var(--ink); }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 11px 20px; font: 600 12px/1.2 var(--sans); color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfe; }
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfe; }
.tbl .main-cell b { display: block; font-weight: 600; color: var(--ink); }
.tbl .main-cell small { color: var(--muted); font-size: 12.5px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts form { display: inline; }
.tbl a.link, a.link { color: var(--accent); font-weight: 500; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pg-links { display: flex; gap: 6px; }
.pg { padding: 6px 12px; border-radius: var(--pill); border: 1px solid var(--line-strong); color: var(--ink); background: #fff; }
.pg.off { opacity: .45; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filters .input { width: auto; min-width: 150px; }
.filters .grow { flex: 1 1 220px; }

.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--pill); font: 600 12px/1.4 var(--sans); background: #eef0f6; color: #4a5072; white-space: nowrap; }
.pill.good { background: #e3f5ea; color: #14613c; }
.pill.bad { background: #fdecea; color: #8a231d; }
.pill.warn { background: #fdf2dc; color: #7a5200; }
.pill.info { background: var(--tint); color: var(--accent); }
.muted-sm { font-size: 12.5px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.keybox { width: 100%; min-height: 110px; padding: 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--canvas); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; resize: vertical; }

/* Usage meters */
.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.meter { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; gap: 8px; }
.meter.off { background: #fafbfe; color: var(--subtle); }
.meter-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.meter-top b { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.meter.off .meter-top b { color: var(--subtle); }
.meter-top span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bar { height: 6px; border-radius: 99px; background: #eef0f6; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.full > i { background: #c4322a; }
.meter small { font-size: 12px; color: var(--muted); }

/* Feature matrix (plan editor, overrides, roles) */
.matrix { width: 100%; border-collapse: collapse; }
.matrix th { text-align: left; padding: 10px 12px; font: 600 12px/1.2 var(--sans); color: var(--muted); border-bottom: 1px solid var(--line); }
.matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix .input { max-width: 150px; }
.matrix td small { display: block; color: var(--muted); font-size: 12.5px; }
.perm-group { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.perm-group:last-child { border-bottom: 0; }
.perm-group h3 { font: 600 14px/1.3 var(--head); color: var(--ink); margin-bottom: 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }

/* Timeline and notes */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.timeline .by { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.note-item { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.note-item p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.note-item small { color: var(--muted); font-size: 12.5px; }
details.fold > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; font-size: 13.5px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { margin-bottom: 12px; }
.sub-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.sub-card + .sub-card { margin-top: 14px; }
.sub-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; }
.sub-head h3 { font: 600 15px/1.3 var(--head); color: var(--ink); }
.callout { padding: 12px 14px; border-radius: 12px; background: var(--tint); color: var(--ink); font-size: 13.5px; }
.callout.warn { background: #fdf2dc; color: #6b4800; }
.callout.bad { background: #fdecea; color: #8a231d; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan-pick .price-card { padding: 22px; }
.plan-pick .price-card.current { border-color: var(--ink); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow); }
.login-card img { height: 26px; width: auto; margin-bottom: 22px; }

@media (max-width: 1000px) {
  .cols, .cols.even { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav, .side .side-foot { display: none; }
  .side.open nav, .side.open .side-foot { display: grid; }
  .side .brand { padding-bottom: 6px; justify-content: space-between; }
  .side-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--canvas); cursor: pointer; margin-left: auto; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .grid-4, .perm-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
