/* DentAxis subscription admin. Accent-ladder face: clinical cyan ladder. */

/* Author display rules otherwise override the HTML hidden attribute. */
[hidden] {
  display: none !important;
}

:root {
  --ground: #f5fafb;
  --surface: #ffffff;
  --raised: #eef6f8;
  --active: #d9eef3;
  --border: #dde8ec;
  --rule: #eef3f5;
  --control: #c5d4da;
  --text: #0f1c24;
  --muted: #5a6670;
  --faint: #5c6670;
  --accent: #0e7490;
  --accent-soft: #ecfeff;
  --accent-track: #a5f3fc;
  --accent-ink: #155e75;
  --primary: #0e7490;
  --primary-ink: #ffffff;
  --positive: #247b50;
  --negative: #c4242a;
  --warning: #92400e;
  --chart-1: #0e7490;
  --chart-2: #6b7280;
  --chart-3: #22d3ee;
  --pill-positive-bg: #dcfce7;
  --pill-positive-ink: #14532d;
  --pill-negative-bg: #ffedea;
  --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb;
  --pill-warning-ink: #92400e;
  --pill-neutral-bg: #eef2f4;
  --pill-neutral-ink: #374151;
  --pill-accent-bg: #ecfeff;
  --pill-accent-ink: #155e75;
  --radius-card: 8px;
  --radius-control: 6px;
  --row-height: 56px;
  --sidebar-width: 230px;
  --gap: 24px;
  --pad: 24px;
  --card-pad: 20px;
  --control-height: 32px;
  --fs-title: 24px;
  --fs-section: 16px;
  --fs-kpi: 24px;
  --fs-body: 14px;
  --fs-small: 12px;
  --font: "DM Sans", system-ui, sans-serif;
}

body {
  font-family: var(--font);
}

/* Brand mark */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 20px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
}
.brand-mark svg {
  width: 16px;
  height: 16px;
}
.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-scope {
  font-size: var(--fs-small);
  color: var(--muted);
}

.nav-item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.nav-item[aria-current="page"] svg {
  stroke: var(--accent);
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-user .avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-track);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.sidebar-user .meta {
  min-width: 0;
}
.sidebar-user .meta strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.sidebar-user .meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Title */
.title-row h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.title-row .sub strong {
  color: var(--text);
  font-weight: 600;
}

/* Signature: WhatsApp activation queue */
.queue {
  background: var(--accent-soft);
  border: 1px solid var(--accent-track);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin-bottom: var(--gap);
}
.queue header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.queue header h2 {
  font-size: var(--fs-section);
  font-weight: 600;
  color: var(--accent-ink);
}
.queue header .hint {
  font-size: var(--fs-small);
  color: var(--muted);
}
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid transparent;
}
.queue-row:hover,
.queue-row:focus-within {
  border-color: var(--accent-track);
}
.queue-row .who {
  min-width: 0;
}
.queue-row .who strong {
  display: block;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row .who span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row .paid {
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.queue-row .paid em {
  display: block;
  font-style: normal;
  color: var(--text);
  font-weight: 500;
}
.queue-empty {
  padding: 12px;
  color: var(--muted);
  font-size: var(--fs-body);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  position: relative;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--fs-body);
  cursor: pointer;
}
.tab[aria-selected="true"] {
  color: var(--text);
  font-weight: 500;
}
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.tab .n {
  margin-left: 6px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] .n {
  color: var(--muted);
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.toolbar .search {
  width: min(316px, 100%);
  height: var(--control-height);
  padding: 0 12px 0 34px;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7680' stroke-width='1.5'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3.5 3.5'/%3E%3C/svg%3E")
    10px 50% no-repeat;
}
.toolbar .search::placeholder {
  color: var(--faint);
}
.toolbar .count {
  margin-left: auto;
  font-size: var(--fs-small);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
table.clinics {
  width: 100%;
  border-collapse: collapse;
}
table.clinics th {
  height: 40px;
  padding: 0 16px;
  text-align: left;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--muted);
  background: transparent;
}
table.clinics th.num,
table.clinics td.num {
  text-align: right;
}
table.clinics td {
  height: var(--row-height);
  padding: 8px 16px;
  border-top: 1px solid var(--rule);
  vertical-align: middle;
}
table.clinics tbody tr {
  cursor: pointer;
}
table.clinics tbody tr:hover {
  background: var(--raised);
}
table.clinics tbody tr[aria-selected="true"] {
  background: var(--accent-soft);
}
table.clinics tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.clinic-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.clinic-cell .dot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.clinic-cell .id {
  min-width: 0;
}
.clinic-cell .id strong {
  display: block;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clinic-cell .id span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}
.pill-active {
  background: var(--pill-positive-bg);
  color: var(--pill-positive-ink);
}
.pill-trial {
  background: var(--pill-accent-bg);
  color: var(--pill-accent-ink);
}
.pill-expired {
  background: var(--pill-negative-bg);
  color: var(--pill-negative-ink);
}
.pill-wait {
  background: var(--pill-warning-bg);
  color: var(--pill-warning-ink);
}
.pill-neutral {
  background: var(--pill-neutral-bg);
  color: var(--pill-neutral-ink);
}

.row-action {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--control);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.row-action:hover {
  background: var(--raised);
}
.row-action.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.row-action.primary:hover {
  filter: brightness(0.95);
}
.row-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Detail sheet (right panel) */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
.workspace.has-detail {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  position: sticky;
  top: var(--pad);
}
.detail[hidden] {
  display: none;
}
.detail .crumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail .crumb button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.detail .crumb button:hover {
  color: var(--text);
}
.detail h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.detail .email {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  word-break: break-all;
}
.detail-meta {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}
.detail-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
}
.detail-meta div:first-child {
  border-top: 0;
}
.detail-meta dt {
  color: var(--muted);
}
.detail-meta dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.detail .msg {
  padding: 12px;
  background: var(--raised);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.45;
}
.detail .msg[hidden] {
  display: none;
}
.activate-box {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 14px;
}
.activate-box label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--accent-ink);
}
.activate-box .row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.activate-box select {
  flex: 1;
  height: var(--control-height);
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  padding: 0 10px;
  background: var(--surface);
}
.activate-box .preview {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.activate-box .preview strong {
  color: var(--text);
  font-weight: 500;
}
.btn-activate {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-activate:hover {
  filter: brightness(0.96);
}
.btn-activate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 50;
}
.toast[hidden] {
  display: none;
}

.phone-bar {
  display: none;
}

.boot {
  min-height: 100svh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 24px;
  background: var(--ground);
  box-sizing: border-box;
}

.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}

.login-brand {
  padding: 0 0 20px;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 20px;
}

.btn-google {
  width: 100%;
  height: 40px;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
}

.btn-google:hover {
  background: var(--raised);
}

.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--faint);
  font-size: 12px;
}

.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.password-form {
  display: grid;
  gap: 8px;
}

.password-form label {
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
}

.password-form input {
  height: 40px;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  padding: 0 12px;
  background: var(--surface);
}

.password-form .btn-activate {
  margin-top: 12px;
  width: 100%;
}

.login-error {
  margin-top: 14px;
  color: var(--negative);
  font-size: 13px;
}

.sign-out {
  margin-top: 4px;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 1100px) {
  .workspace.has-detail {
    grid-template-columns: 1fr;
  }
  .detail {
    position: static;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--ground);
    width: 100%;
    height: 100%;
    padding: 16px;
  }
  .phone-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--ground);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .phone-bar button {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .phone-bar strong {
    font-size: 15px;
    font-weight: 600;
  }
  .canvas {
    padding: 16px;
  }
  .queue-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .queue-row .paid {
    text-align: left;
  }
  .tabs {
    overflow-x: auto;
    gap: 16px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .search {
    width: 100%;
  }
  .toolbar .count {
    margin-left: 0;
  }
  table.clinics thead {
    display: none;
  }
  table.clinics,
  table.clinics tbody,
  table.clinics tr,
  table.clinics td {
    display: block;
    width: 100%;
  }
  table.clinics tr {
    padding: 12px 16px;
    border-top: 1px solid var(--rule);
  }
  table.clinics td {
    height: auto;
    padding: 2px 0;
    border: 0;
  }
  table.clinics td::before {
    content: attr(data-label);
    float: left;
    color: var(--muted);
    font-size: 12px;
  }
  table.clinics td.identity {
    padding-bottom: 8px;
  }
  table.clinics td.identity::before {
    display: none;
  }
  table.clinics td.action {
    padding-top: 8px;
  }
  table.clinics td.action::before {
    display: none;
  }
  table.clinics td.num,
  table.clinics td.status-cell {
    text-align: right;
  }
}
