/* ==========================================================================
   CTW BOS (BUSINESS OPERATING SYSTEMS) — STANDALONE ENTERPRISE WORKSPACE
   Clean Sans-Serif Typography Only (Montserrat + Plus Jakarta Sans)
   Zero Double-Command · Full-Screen Dedicated Application
   ========================================================================== */
:root {
  --bos-accent: #176be0;
  --bos-sidebar: #0c111d;
  --bos-sidebar-border: #1e293b;
  --bos-bg: #f1f5f9;
  --bos-card: #ffffff;
  --bos-border: #e2e8f0;
  --bos-text: #0f172a;
  --bos-muted: #64748b;
  --bos-green: #15803d;
  --bos-amber: #b45309;
  --bos-red: #b91c1c;
}

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

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bos-bg);
  color: var(--bos-text);
  font-size: 13.5px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea, code {
  font-family: inherit;
}

.bos-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* APP SHELL */
.bos-shell {
  display: grid;
  grid-template-columns: 266px 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.bos-sidebar {
  background: var(--bos-sidebar);
  color: #e2e8f0;
  border-right: 1px solid var(--bos-sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.bos-brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--bos-sidebar-border);
  display: flex;
  align-items: center;
  gap: 11px;
}

.bos-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bos-accent), #0f3b7d);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 6px 16px rgba(23, 107, 224, 0.35);
}

.bos-brand-text strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.bos-brand-text small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 1px;
}

.bos-tenant-box {
  padding: 13px 16px;
  border-bottom: 1px solid var(--bos-sidebar-border);
  background: rgba(255, 255, 255, 0.03);
}

.bos-tenant-box label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.bos-tenant-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #162032;
  color: #ffffff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.bos-nav-group-lbl {
  padding: 14px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #64748b;
}

.bos-nav {
  list-style: none;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bos-nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  padding: 9.5px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.6px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}

.bos-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.bos-nav-btn.active {
  background: var(--bos-accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(23, 107, 224, 0.32);
}

.bos-nav-btn.builder-highlight {
  border: 1px dashed rgba(250, 204, 21, 0.45);
  color: #fde047;
}

.bos-nav-btn.builder-highlight.active {
  background: linear-gradient(135deg, #ca8a04, #ea580c);
  border-style: solid;
  border-color: transparent;
  color: #ffffff;
}

.bos-nav-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.bos-sidebar-foot {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--bos-sidebar-border);
  background: #080c15;
  font-size: 11px;
  color: #94a3b8;
}

.bos-foot-row {
  display: flex;
  justify-content: space-between;
  padding: 2.5px 0;
}

.bos-foot-row b {
  color: #f8fafc;
}

/* MAIN AREA */
.bos-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bos-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--bos-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 40;
}

.bos-topbar-left h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.bos-topbar-left p {
  font-size: 12px;
  color: var(--bos-muted);
  margin-top: 2px;
}

.bos-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bos-content {
  padding: 20px 24px 36px;
  max-width: 1560px;
  width: 100%;
}

/* BUTTONS & INPUTS */
.bos-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7.5px 13px;
  border-radius: 7px;
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.14s ease, transform 0.12s ease;
}

.bos-btn:hover { opacity: 0.92; }
.bos-btn.primary { background: var(--bos-accent); border-color: var(--bos-accent); }
.bos-btn.green   { background: #15803d; border-color: #15803d; }
.bos-btn.amber   { background: #d97706; border-color: #d97706; }
.bos-btn.outline { background: #ffffff; color: #0f172a; border-color: #cbd5e1; }
.bos-btn.sm      { padding: 5px 10px; font-size: 11.2px; }

.bos-input, .bos-select, .bos-textarea {
  padding: 7.5px 11px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 12.5px;
  width: 100%;
}

.bos-textarea {
  min-height: 92px;
  resize: vertical;
}

/* CHIPS */
.bos-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.8px;
  font-weight: 700;
  white-space: nowrap;
}
.bos-chip.green { background: #dcfce7; color: #15803d; }
.bos-chip.blue  { background: #dbeafe; color: #1d4ed8; }
.bos-chip.amber { background: #fef3c7; color: #b45309; }
.bos-chip.red   { background: #fee2e2; color: #b91c1c; }
.bos-chip.dark  { background: #1e293b; color: #f8fafc; }

/* HERO BANNER & KPIs */
.bos-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 58%, #0f3b7d 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bos-hero h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bos-hero p {
  font-size: 12.2px;
  color: #cbd5e1;
  margin-top: 4px;
}

.bos-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.bos-kpi {
  background: #ffffff;
  border: 1px solid var(--bos-border);
  border-top: 3px solid var(--bos-accent);
  border-radius: 10px;
  padding: 13px 15px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}
.bos-kpi.green { border-top-color: #16a34a; }
.bos-kpi.amber { border-top-color: #d97706; }
.bos-kpi.dark  { border-top-color: #0f172a; }

.bos-kpi small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bos-muted);
}

.bos-kpi strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  margin: 4px 0 2px;
  letter-spacing: -0.02em;
}

.bos-kpi span {
  font-size: 11.5px;
  color: #475569;
}

/* CARDS & TABLES */
.bos-card {
  background: #ffffff;
  border: 1px solid var(--bos-border);
  border-radius: 11px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.bos-card-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--bos-border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bos-card-head h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bos-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bos-wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 12px;
  padding: 16px;
}

.bos-wallet-card {
  border: 1.5px solid var(--bos-border);
  border-radius: 10px;
  padding: 13px 14px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.14s ease;
}

.bos-wallet-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.bos-wallet-card.active {
  border-color: var(--bos-accent);
  background: #f0f7ff;
  box-shadow: 0 0 0 2px rgba(23, 107, 224, 0.16);
}

.bos-wallet-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 11px;
  display: grid;
  place-items: center;
  flex: none;
}

.bos-wallet-bal {
  font-family: 'Montserrat', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.bos-bar {
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bos-bar > div {
  height: 100%;
  border-radius: 999px;
}

.bos-wallet-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 11px;
  color: #475569;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.bos-split-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

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

.bos-table th {
  background: #0f172a;
  color: #f8fafc;
  text-align: left;
  padding: 10px 13px;
  font-size: 10.8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.bos-table td {
  padding: 10px 13px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
}

.bos-table tbody tr:hover {
  background: #f8fafc;
}

.bos-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.bos-pill.active {
  background: var(--bos-accent);
  border-color: var(--bos-accent);
  color: #ffffff;
}

/* 5-STEP BUILDER STEPS */
.bos-steps-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.bos-step-card {
  background: #ffffff;
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  padding: 12px 13px;
}

.bos-step-card b {
  display: inline-block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bos-accent);
  margin-bottom: 3px;
}

.bos-step-card strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 12.8px;
  color: #0f172a;
  margin-bottom: 3px;
}

.bos-step-card p {
  font-size: 11.2px;
  color: var(--bos-muted);
}

/* MODAL */
.bos-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bos-modal-backdrop.show {
  display: flex;
}

.bos-modal {
  background: #ffffff;
  border-radius: 12px;
  width: min(680px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.bos-modal-head {
  padding: 14px 18px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bos-modal-head h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
}

.bos-form-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.bos-field.full {
  grid-column: 1 / -1;
}

.bos-field label {
  font-size: 11.2px;
  font-weight: 700;
  color: #334155;
}

.bos-modal-foot {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--bos-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* TOAST */
.bos-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 300;
  background: #0f172a;
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
}

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

@media (max-width: 1080px) {
  .bos-shell { grid-template-columns: 1fr; }
  .bos-sidebar { position: relative; height: auto; }
  .bos-split-2, .bos-steps-strip, .bos-form-grid { grid-template-columns: 1fr; }
}
