/* ── Ghost Admin colour tokens (light) ──────────────────────────────────── */
:root {
  --g-black:     #15171A;
  --g-green:     #30CF43;
  --g-green-bg:  #edfbef;
  --g-100:       #F4F5F6;
  --g-200:       #EBEEF0;
  --g-300:       #D9D9D9;
  --g-400:       #AEB7C0;
  --g-500:       #738A94;
  --g-600:       #50656D;
  --g-white:     #FFFFFF;
  --g-shadow:    0 1px 3px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.05);
  --g-shadow-lg: 0 6px 20px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.06);
  --g-radius:    6px;
  --g-radius-lg: 8px;
  --g-font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.sgad-dashboard-page {
  min-height: 100vh;
  background: var(--g-100);
  color: var(--g-black);
  font-family: var(--g-font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Login page ─────────────────────────────────────────────────────────── */
.sgad-dashboard-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--g-100);
  color: var(--g-black);
  font-family: var(--g-font);
  -webkit-font-smoothing: antialiased;
}

.sgad-auth-shell {
  width: min(100%, 900px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  min-height: 560px;
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--g-radius-lg);
  overflow: hidden;
  box-shadow: var(--g-shadow-lg);
}

/* left branding panel - light */
.sgad-auth-brief {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(32px, 5vw, 56px);
  background: var(--g-100);
  border-right: 1px solid var(--g-200);
}

.sgad-auth-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--g-radius);
}

.sgad-auth-brief h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--g-black);
}

.sgad-auth-brief > p {
  margin: 0;
  color: var(--g-500);
  font-size: 14px;
  line-height: 1.6;
}

.sgad-auth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sgad-auth-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--g-300);
  border-radius: 999px;
  background: var(--g-white);
  color: var(--g-600);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* right form panel */
.sgad-auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: clamp(32px, 5vw, 56px);
  background: var(--g-white);
}

.sgad-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--g-200);
  border-radius: var(--g-radius);
  background: var(--g-100);
}

.sgad-auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: calc(var(--g-radius) - 1px);
  background: transparent;
  color: var(--g-500);
  font-family: var(--g-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.sgad-auth-tabs button.is-active {
  background: var(--g-white);
  color: var(--g-black);
  box-shadow: var(--g-shadow);
}

.sgad-auth-form {
  display: grid;
  gap: 16px;
}

.sgad-auth-form__head { display: grid; gap: 4px; }

.sgad-auth-form__head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--g-black);
}

.sgad-auth-shell .sgad-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--g-green);
}

.sgad-dashboard-field {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.sgad-dashboard-field span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--g-500);
}

.sgad-auth-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--g-300);
  border-radius: var(--g-radius);
  background: var(--g-white);
  color: var(--g-black);
  font-family: var(--g-font);
  font-size: 14px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}

.sgad-auth-form input::placeholder { color: var(--g-400); }

.sgad-auth-form input:focus {
  border-color: var(--g-green);
  box-shadow: 0 0 0 2px rgba(48,207,67,.15);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.sgad-btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--g-radius);
  background: var(--g-black);
  color: var(--g-white);
  font-family: var(--g-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .12s;
  text-decoration: none;
}

.sgad-btn--primary:hover  { filter: brightness(1.3); }
.sgad-btn--primary:active { filter: brightness(1.5); }
.sgad-btn--primary:disabled { opacity: .45; cursor: not-allowed; }

.sgad-btn--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--g-300);
  border-radius: var(--g-radius);
  background: var(--g-white);
  color: var(--g-black);
  font-family: var(--g-font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}

.sgad-btn--secondary:hover { background: var(--g-100); border-color: var(--g-400); }

.sgad-btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--g-radius);
  background: transparent;
  color: var(--g-500);
  font-family: var(--g-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.sgad-btn--ghost:hover { background: var(--g-200); color: var(--g-black); }

.sgad-btn--small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

/* ── Form feedback ──────────────────────────────────────────────────────── */
.sgad-dashboard-error {
  margin: 0;
  color: #e02424;
  font-size: 13px;
  font-weight: 600;
}

.sgad-dashboard-success {
  margin: 0;
  color: #0f7b3b;
  font-size: 13px;
  font-weight: 600;
}

.sgad-auth-field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--g-500);
  line-height: 1.5;
}

.sgad-auth-field-hint--ok  { color: #0f7b3b; font-weight: 600; }
.sgad-auth-field-hint--err { color: #e02424; }

.sgad-auth-form__terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--g-500);
  cursor: pointer;
}

.sgad-auth-form__terms input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--g-green);
}

.sgad-auth-form__terms a { color: var(--g-black); text-decoration: underline; }

.sgad-auth-form__link-btn {
  justify-self: start;
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--g-500);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--g-font);
}

.sgad-auth-form__link-btn:hover { color: var(--g-black); }

/* ── Dashboard shell ────────────────────────────────────────────────────── */
.sgad-dashboard {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar - light ────────────────────────────────────────────────────── */
.sgad-dashboard__sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--g-white);
  border-right: 1px solid var(--g-200);
  overflow-y: auto;
}

.sgad-dashboard__brand {
  padding: 8px 8px 16px;
  border-bottom: 1px solid var(--g-200);
  margin-bottom: 8px;
}

.sgad-dashboard__brand .sgad-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--g-green-bg);
  color: #0f7b3b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sgad-dashboard__brand h1 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--g-black);
}

.sgad-dashboard__brand p {
  margin: 0;
  color: var(--g-500);
  font-size: 12px;
  line-height: 1.5;
}

.sgad-dashboard__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sgad-dashboard__nav button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--g-radius);
  background: transparent;
  color: var(--g-600);
  font-family: var(--g-font);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .1s, color .1s;
}

.sgad-dashboard__nav button:hover {
  background: var(--g-100);
  color: var(--g-black);
}

.sgad-dashboard__nav button.is-active {
  background: var(--g-200);
  color: var(--g-black);
  font-weight: 600;
}

.sgad-dashboard__sidebar-actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--g-200);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Main content ───────────────────────────────────────────────────────── */
.sgad-dashboard__main {
  min-width: 0;
  padding: 32px 40px;
  background: var(--g-100);
}

.sgad-dashboard__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--g-200);
}

.sgad-dashboard__top p.sgad-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--g-green);
}

.sgad-dashboard__top h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--g-black);
}

.sgad-dashboard__top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sgad-dashboard__session {
  margin: 0;
  color: var(--g-500);
  font-size: 13px;
  font-weight: 500;
}

/* ── Content grid / panels ──────────────────────────────────────────────── */
.sgad-dashboard__content,
.sgad-dashboard-grid,
.sgad-dashboard-list {
  display: grid;
  gap: 16px;
}

.sgad-dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sgad-dashboard-panel,
.sgad-dashboard-metric {
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--g-radius-lg);
  box-shadow: var(--g-shadow);
}

.sgad-dashboard-panel { padding: 24px; }

.sgad-dashboard-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--g-200);
}

.sgad-dashboard-panel__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--g-black);
}

/* ── Metrics ────────────────────────────────────────────────────────────── */
.sgad-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sgad-dashboard-metric { padding: 20px; }

.sgad-dashboard-metric--link {
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}

.sgad-dashboard-metric--link:hover {
  border-color: var(--g-green);
  box-shadow: var(--g-shadow-lg);
}

.sgad-dashboard-metric--link:focus-visible {
  outline: 2px solid var(--g-green);
  outline-offset: 2px;
}

.sgad-dashboard-metric p {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--g-500);
}

.sgad-dashboard-metric strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--g-black);
}

.sgad-dashboard-metric span {
  font-size: 12px;
  color: var(--g-500);
}

/* ── List items ─────────────────────────────────────────────────────────── */
.sgad-dashboard-list-item {
  padding: 16px;
  border: 1px solid var(--g-200);
  border-radius: var(--g-radius);
  background: var(--g-white);
}

.sgad-dashboard-list-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--g-black);
}

.sgad-dashboard-list-item p {
  margin: 0 0 10px;
  color: var(--g-500);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.sgad-dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.sgad-dashboard-toolbar .sgad-dashboard-field { gap: 4px; min-width: 180px; }
.sgad-dashboard-toolbar .sgad-dashboard-field span { font-size: 11px; }

/* ── Table ──────────────────────────────────────────────────────────────── */
.sgad-dashboard-table-wrap { overflow: auto; }

.sgad-dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.sgad-dashboard-table th,
.sgad-dashboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--g-200);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.sgad-dashboard-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--g-500);
  background: var(--g-100);
}

.sgad-dashboard-table tr:last-child td { border-bottom: 0; }

/* ── Pills ──────────────────────────────────────────────────────────────── */
.sgad-dashboard-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--g-200);
  color: var(--g-600);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sgad-dashboard-pill--success { background: #d1fae5; color: #065f46; }
.sgad-dashboard-pill--warning { background: #fef3c7; color: #92400e; }
.sgad-dashboard-pill--error   { background: #fee2e2; color: #991b1b; }

.sgad-dashboard-pill--priority {
  background: #fee2e2;
  color: #991b1b;
  gap: 5px;
}

.sgad-dashboard-pill__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.sgad-dashboard-pill__close:hover { background: rgba(153,27,27,.15); }

/* ── Empty state ────────────────────────────────────────────────────────── */
.sgad-dashboard-empty {
  padding: 32px;
  border: 1px dashed var(--g-300);
  border-radius: var(--g-radius-lg);
  color: var(--g-500);
  background: var(--g-white);
  text-align: center;
  font-size: 14px;
}

/* ── Misc controls ──────────────────────────────────────────────────────── */
.sgad-dashboard-card__meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--g-500);
}

.sgad-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

select.sgad-action-select,
select.sgad-input,
.sgad-input--date {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--g-300);
  border-radius: var(--g-radius);
  background: var(--g-white);
  color: var(--g-black);
  font-family: var(--g-font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color .12s;
}

select.sgad-action-select:focus,
select.sgad-input:focus,
.sgad-input--date:focus {
  border-color: var(--g-green);
  box-shadow: 0 0 0 2px rgba(48,207,67,.15);
}

select.sgad-action-select { min-width: 120px; }
.sgad-dashboard-field--status select { min-width: 180px; }
select.sgad-input:disabled { opacity: .5; cursor: not-allowed; }

.sgad-dashboard-schedule-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sgad-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--g-200);
  color: var(--g-600);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sgad-auth-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .sgad-auth-brief { display: none; }

  .sgad-dashboard {
    grid-template-columns: 1fr;
  }

  .sgad-dashboard__sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .sgad-dashboard__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .sgad-dashboard__main {
    padding: 20px 16px;
  }
}

@media (max-width: 768px) {
  .sgad-dashboard-grid,
  .sgad-dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .sgad-dashboard__top {
    flex-direction: column;
    align-items: flex-start;
  }
}
