/**
 * Internal ops admin shell — sync with packages/design-tokens `toAdminShellCssRoot()`.
 */

/* ── Auth guard ──────────────────────────────────────────────────── */
/* Pages stay hidden until the nav's auth check passes and adds the  */
/* .auth-ready class to <body>. login.html overrides this inline.    */
body:not(.auth-ready) { visibility: hidden; }
@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Nunito+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300&display=swap");

@font-face {
  font-family: "BPdots";
  src: url("../../Assets/fonts/BPdotsUnicaseLight.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "BPdots";
  src: url("../../Assets/fonts/BPdotsUnicase.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "BPdots";
  src: url("../../Assets/fonts/BPdotsUnicaseBold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-bg: #141414;
  --color-bg-elevated: #141414;
  --color-surface: #1e1e1e;
  --color-surface-muted: #2a2a2a;
  --color-text: #f2e8cb;
  --color-text-secondary: #b8b5b0;
  --color-text-muted: #8a8680;
  --color-border: #444444;
  --color-border-strong: #666666;
  --color-brand: #fa2121;
  --color-brand-hover: #c41a1a;
  --color-brand-dim: rgba(250, 33, 33, 0.12);
  --color-success: #1d9e75;
  --color-success-dim: rgba(29, 158, 117, 0.14);
  --color-warning: #c9920a;
  --color-warning-dim: rgba(201, 146, 10, 0.15);
  --color-info-fg: #8a8680;
  --color-info-dim: #2a2a2a;
  --color-danger: #c0392b;
  --font-brand: "BPdots", "Nunito Sans", sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, sans-serif;
  --font-data: "Chakra Petch", "Nunito Sans", sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --font-size-badge: 11px;
  --badge-radius: var(--radius-sm);
  /* statusPill borders from packages/design-tokens componentTokens.statusPill */
  --badge-border-neutral: #d4d4d4;
  --badge-border-success: #a8e4cf;
  --badge-border-warning: #b8b5b0;
  --badge-border-danger: rgba(250, 33, 33, 0.55);
  --badge-border-info: #b8b5b0;
  --badge-border-brand: rgba(250, 33, 33, 0.55);
  --nav-w: 240px;
  --ink: var(--color-bg);
  --ink-2: var(--color-bg-elevated);
  --ink-3: var(--color-surface);
  --text-1: var(--color-text);
  --text-2: var(--color-text-secondary);
  --text-3: var(--color-text-muted);
  --border: var(--color-border);
  --border-2: var(--color-border-strong);
  --radius: var(--radius-md);
  --green: var(--color-success);
  --green-dim: var(--color-success-dim);
  --red: var(--color-brand);
  --red-dim: var(--color-brand-dim);
  --orange: var(--color-warning);
  --orange-dim: var(--color-warning-dim);
  --blue: var(--color-info-fg);
  --blue-dim: var(--color-info-dim);
}

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

html,
body {
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar shell — aligned with apps/internal-dashboard/src/ops-shell.css (#ops-nav) */
#admin-nav {
  width: var(--nav-w);
  min-height: 100vh;
  background: var(--color-bg-elevated);
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 16px;
  overflow-y: auto;
  z-index: 2;
}

.nav-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.nav-section {
  padding: 14px 0 0;
}

.nav-label {
  font-family: var(--font-data);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0 16px 8px;
}

#admin-nav a.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--color-text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}

#admin-nav a.nav-item:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

#admin-nav a.nav-item.active {
  color: var(--color-text);
  background: var(--color-brand-dim);
  border-left-color: var(--color-brand);
  box-shadow: none;
}

#admin-nav a.nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 10px;
  color: var(--color-text);
  flex-shrink: 0;
}

.sidebar-footer .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-footer .user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.sidebar-footer .user-role {
  font-size: 10px;
  color: var(--color-text-muted);
}

.nav-logo-wrap {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--color-border);
}

.nav-logo-wrap .ol-nav-logo {
  width: 100%;
}

/* Chakra Petch label band — aligns with .nav-item horizontal padding (16px) */
.nav-kicker {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px;
  padding: 14px 16px;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: none;
  text-align: left;
  line-height: 1.25;
  color: var(--color-brand);
  border-bottom: 1px solid var(--color-border);
}

.admin-main {
  margin-left: var(--nav-w);
  flex: 1;
  padding: 32px 36px;
  max-width: 1200px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--color-brand);
}

.page-title span {
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-brand);
  color: var(--color-text);
  border-color: var(--color-brand);
}

.btn-primary:hover {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border-strong);
}

.btn-ghost:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.btn-danger {
  background: var(--color-brand-dim);
  color: var(--color-brand);
  border-color: rgba(250, 33, 33, 0.45);
}

.btn-danger:hover {
  background: var(--color-brand);
  color: var(--color-text);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead th {
  text-align: left;
  padding: 8px 12px;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--color-surface-muted);
}

td {
  padding: 11px 12px;
  color: var(--color-text);
  vertical-align: middle;
}

td.muted {
  color: var(--color-text-secondary);
}

.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

/* Status chips: geometry + type from baseTokens; borders from componentTokens.statusPill */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--badge-radius);
  border: 1px solid transparent;
  font-family: var(--font-data);
  font-size: var(--font-size-badge);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-success {
  background: var(--color-success-dim);
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--badge-border-success) 55%, transparent);
}

.badge-info {
  background: var(--color-info-dim);
  color: var(--color-info-fg);
  border-color: color-mix(in srgb, var(--badge-border-info) 45%, transparent);
}

.badge-warning {
  background: var(--color-warning-dim);
  color: var(--color-warning);
  border-color: color-mix(in srgb, var(--badge-border-warning) 45%, transparent);
}

.badge-danger {
  background: var(--color-brand-dim);
  color: var(--color-brand);
  border-color: color-mix(in srgb, var(--badge-border-brand) 65%, transparent);
}

.badge-neutral {
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  border-color: color-mix(in srgb, var(--badge-border-neutral) 35%, transparent);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-grid.cols-1 {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field.span-2 {
  grid-column: span 2;
}

.field.span-3 {
  grid-column: span 3;
}

label {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 8px 11px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
  outline: none;
  appearance: none;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(250, 33, 33, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

select option {
  background: var(--color-surface);
}

textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--color-text-secondary);
}

.checkbox-field input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--color-brand);
}

.field-hint {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  padding: 28px 32px;
  position: relative;
}

.modal-lg {
  max-width: 860px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.section-divider {
  font-family: var(--font-data);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin: 20px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar input[type="text"],
.filter-bar select {
  width: auto;
  min-width: 160px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--color-success);
  color: #fff;
}

.toast-error {
  background: var(--color-brand);
  color: #fff;
}

.toast-info {
  background: var(--color-surface-muted);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.loading {
  text-align: center;
  padding: 32px;
  color: var(--color-text-muted);
  font-size: 12.5px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  #admin-nav {
    position: relative;
    width: 100%;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .admin-main {
    margin-left: 0;
    padding: 20px 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.span-2,
  .field.span-3 {
    grid-column: span 1;
  }

  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }
}
