/* ==========================================================================
   UnsolvedX Back Office — Obsidian & Neon Pink Command Deck
   Zero inline styles in PHP — all back-office styling lives here.
   ========================================================================== */

:root {
  --bo-bg: #050209;
  --bo-sidebar: #090412;
  --bo-panel: #0e081a;
  --bo-panel-hi: #150c26;
  --bo-border: rgba(255, 255, 255, 0.08);
  --bo-border-pink: rgba(255, 0, 85, 0.34);
  --bo-pink: #ff0055;
  --bo-pink-bright: #ff3377;
  --bo-green: #00e639;
  --bo-amber: #fbbf24;
  --bo-text: #f5f2fb;
  --bo-muted: #a69cba;
  --bo-faint: #6f6485;
  --bo-display: 'Space Grotesk', system-ui, sans-serif;
  --bo-body: 'Inter', system-ui, sans-serif;
  --bo-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

body.bo-body {
  margin: 0;
  padding: 0;
  background: var(--bo-bg);
  background-image:
    radial-gradient(circle at 18% 0%, rgba(255, 0, 85, 0.1), transparent 36%),
    radial-gradient(circle at 90% 10%, rgba(109, 40, 217, 0.09), transparent 40%);
  color: var(--bo-text);
  font-family: var(--bo-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Login Screen ---------- */
.bo-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.bo-login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, rgba(22, 11, 38, 0.96), rgba(10, 5, 19, 0.99));
  border: 1px solid var(--bo-border-pink);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), 0 0 36px rgba(255, 0, 85, 0.12);
}

.bo-login-logo {
  height: 34px;
  width: auto;
  display: block;
  margin-bottom: 1.25rem;
  mix-blend-mode: screen;
}

.bo-eyebrow {
  font-family: var(--bo-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bo-pink-bright);
  margin-bottom: 0.4rem;
}

.bo-login-card h1 {
  margin: 0 0 0.45rem;
  font-family: var(--bo-display);
  font-size: 1.7rem;
  font-weight: 800;
}

.bo-login-sub {
  margin: 0 0 1.5rem;
  color: var(--bo-muted);
  font-size: 0.9rem;
}

/* ---------- Shell Layout ---------- */
.bo-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.bo-sidebar {
  background: var(--bo-sidebar);
  border-right: 1px solid rgba(255, 0, 85, 0.2);
  padding: 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.bo-side-brand {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0 0.35rem 1.1rem;
  border-bottom: 1px solid var(--bo-border);
}

.bo-side-logo {
  height: 30px;
  width: auto;
  display: block;
  mix-blend-mode: screen;
}

.bo-side-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.24rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 0, 85, 0.14);
  border: 1px solid rgba(255, 0, 85, 0.35);
  font-family: var(--bo-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff70a0;
}

.bo-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.bo-nav-label {
  font-family: var(--bo-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bo-faint);
  padding: 0.3rem 0.65rem;
}

.bo-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
  color: #cfc6e2;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 160ms ease;
}

.bo-nav-left {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.bo-nav-item:hover {
  background: rgba(255, 0, 85, 0.08);
  color: #ffffff;
}

.bo-nav-item.is-active {
  background: rgba(255, 0, 85, 0.18);
  border-color: rgba(255, 0, 85, 0.45);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(255, 0, 85, 0.16);
}

.bo-nav-count {
  font-family: var(--bo-mono);
  font-size: 0.68rem;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--bo-muted);
}

.bo-nav-item.is-active .bo-nav-count {
  background: rgba(255, 0, 85, 0.35);
  color: #ffffff;
}

.bo-side-foot {
  padding-top: 1rem;
  border-top: 1px solid var(--bo-border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bo-user-pill {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bo-border);
}

.bo-user-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}

.bo-user-role {
  font-family: var(--bo-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bo-pink-bright);
}

.bo-side-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.bo-side-btn {
  text-align: center;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--bo-border);
  background: rgba(255, 255, 255, 0.03);
  color: #d6cee8;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.bo-side-btn:hover {
  border-color: var(--bo-border-pink);
  color: #ffffff;
}

/* ---------- Main Content ---------- */
.bo-main {
  padding: 2rem 2.25rem 3.5rem;
  min-width: 0;
}

.bo-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.bo-page-title {
  margin: 0.25rem 0 0;
  font-family: var(--bo-display);
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  font-weight: 800;
  color: #ffffff;
}

.bo-subtabs {
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bo-border);
}

.bo-subtab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bo-muted);
}

.bo-subtab.is-active {
  background: linear-gradient(135deg, #ff0055 0%, #c80044 100%);
  color: #ffffff;
}

/* ---------- Cards, KPIs, Alerts ---------- */
.bo-alert {
  padding: 0.85rem 1.05rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 1.35rem;
}

.bo-alert-ok {
  background: rgba(0, 230, 57, 0.12);
  border: 1px solid rgba(0, 230, 57, 0.36);
  color: #93f7ad;
}

.bo-alert-err {
  background: rgba(255, 0, 85, 0.14);
  border: 1px solid rgba(255, 0, 85, 0.45);
  color: #ff9bb8;
}

.bo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.65rem;
}

.bo-kpi {
  background: var(--bo-panel);
  border: 1px solid var(--bo-border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
}

.bo-kpi-label {
  font-family: var(--bo-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bo-muted);
}

.bo-kpi-val {
  margin-top: 0.4rem;
  font-family: var(--bo-display);
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
}

.bo-kpi-val.is-pink { color: var(--bo-pink-bright); }
.bo-kpi-val.is-green { color: var(--bo-green); }

.bo-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.4rem;
  align-items: start;
}

.bo-panel {
  background: var(--bo-panel);
  border: 1px solid var(--bo-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.4rem;
}

.bo-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.bo-panel-title {
  margin: 0;
  font-family: var(--bo-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

/* ---------- Forms & Custom Dropdowns ---------- */
.bo-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bo-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.bo-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bo-field label,
.bo-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #d6cee8;
}

.bo-input,
.bo-textarea {
  width: 100%;
  padding: 0.68rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 3, 14, 0.92);
  color: #ffffff;
  font-family: var(--bo-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.bo-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.65;
}

.bo-textarea.is-tall {
  min-height: 260px;
}

.bo-input:focus,
.bo-textarea:focus {
  border-color: var(--bo-pink);
  box-shadow: 0 0 0 3px rgba(255, 0, 85, 0.18);
}

.bo-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  padding: 0.4rem 0;
}

.bo-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: #e6dff5;
  cursor: pointer;
}

.bo-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--bo-pink);
  cursor: pointer;
}

/* Custom-Styled Dropdown (never generic browser select) */
.bo-dd {
  position: relative;
  width: 100%;
}

.bo-dd-btn {
  width: 100%;
  height: 43px;
  padding: 0 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 3, 14, 0.92);
  color: #ffffff;
  font-family: var(--bo-body);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  cursor: pointer;
  text-align: left;
}

.bo-dd.is-open .bo-dd-btn {
  border-color: var(--bo-pink);
  box-shadow: 0 0 0 3px rgba(255, 0, 85, 0.16);
}

.bo-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #10081e;
  border: 1px solid var(--bo-border-pink);
  border-radius: 10px;
  padding: 0.35rem;
  z-index: 400;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.8);
}

.bo-dd.is-open .bo-dd-menu {
  display: block;
}

.bo-dd-opt {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #dfd8ee;
  font-family: var(--bo-body);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bo-dd-opt:hover,
.bo-dd-opt.is-selected {
  background: rgba(255, 0, 85, 0.2);
  color: #ffffff;
}

.bo-dd.is-compact {
  min-width: 132px;
  width: auto;
}

.bo-dd.is-compact .bo-dd-btn {
  height: 34px;
  padding: 0 0.7rem;
  font-size: 0.8rem;
}

/* ---------- Buttons ---------- */
.bo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.25rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: var(--bo-display);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms ease;
}

.bo-btn-primary {
  background: linear-gradient(135deg, #ff0055 0%, #c80044 100%);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(255, 0, 85, 0.32);
}

.bo-btn-primary:hover {
  filter: brightness(1.08);
}

.bo-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e6dff5;
}

.bo-btn-ghost:hover {
  border-color: var(--bo-border-pink);
  color: #ffffff;
}

.bo-btn-danger {
  background: rgba(255, 0, 85, 0.12);
  border-color: rgba(255, 0, 85, 0.35);
  color: #ff80a8;
}

.bo-btn-danger:hover {
  background: rgba(255, 0, 85, 0.28);
  color: #ffffff;
}

.bo-btn-sm {
  padding: 0.38rem 0.72rem;
  font-size: 0.76rem;
  border-radius: 7px;
}

.bo-btn-full {
  width: 100%;
}

/* ---------- Tables & Badges ---------- */
.bo-table-wrap {
  overflow-x: auto;
}

.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.bo-table th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  font-family: var(--bo-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bo-faint);
  border-bottom: 1px solid var(--bo-border);
  white-space: nowrap;
}

.bo-table td {
  padding: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e6dff5;
  vertical-align: middle;
}

.bo-table tr:hover td {
  background: rgba(255, 0, 85, 0.04);
}

.bo-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: var(--bo-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bo-badge-pink {
  background: rgba(255, 0, 85, 0.16);
  border: 1px solid rgba(255, 0, 85, 0.4);
  color: #ff6b9d;
}

.bo-badge-green {
  background: rgba(0, 230, 57, 0.12);
  border: 1px solid rgba(0, 230, 57, 0.35);
  color: #7df59b;
}

.bo-badge-muted {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--bo-muted);
}

.bo-badge-amber {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

.bo-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.bo-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.bo-muted {
  color: var(--bo-muted);
  font-size: 0.82rem;
}

.bo-mono {
  font-family: var(--bo-mono);
  font-size: 0.78rem;
}

.bo-search-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.bo-search-row .bo-input {
  max-width: 340px;
}

.bo-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: var(--bo-sidebar);
  border-bottom: 1px solid var(--bo-border-pink);
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .bo-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bo-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .bo-shell {
    grid-template-columns: 1fr;
  }
  .bo-mobile-bar {
    display: flex;
  }
  .bo-sidebar {
    display: none;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--bo-border-pink);
  }
  .bo-sidebar.is-open {
    display: flex;
  }
  .bo-main {
    padding: 1.5rem 1rem 2.5rem;
  }
  .bo-form-row {
    grid-template-columns: 1fr;
  }
}
