/* ── NASTY OS brand palette ───────────────────────────────────────────────── */
:root {
  --brand-yellow:      #FEEE05;   /* neon signature accent            */
  --brand-yellow-600:  #E6D800;   /* hover                            */
  --brand-yellow-700:  #C9BD00;   /* active / pressed                 */
  --brand-ink:         #14151B;   /* near-black surface & text        */
  --brand-ink-2:       #1D1F27;   /* raised dark surface              */
  --brand-ink-rgb:     20, 21, 27;

  /* Retint Bootstrap "primary" from FLATLY's blue-slate to a neutral brand ink
     so text-primary / bg-primary / tinted stat icons read as black, not blue.
     Yellow is layered on top as the signature accent (buttons, active nav…). */
  --bs-primary:        #14151B;
  --bs-primary-rgb:    20, 21, 27;
  --bs-link-color:     #14151B;
  --bs-link-color-rgb: 20, 21, 27;
  --bs-link-hover-color: #000000;
}

/* Primary call-to-action = brand yellow with ink text (login, save, …) */
.btn-primary {
  --bs-btn-bg:                    var(--brand-yellow);
  --bs-btn-border-color:          var(--brand-yellow);
  --bs-btn-color:                 var(--brand-ink);
  --bs-btn-hover-bg:              var(--brand-yellow-600);
  --bs-btn-hover-border-color:    var(--brand-yellow-600);
  --bs-btn-hover-color:           #000;
  --bs-btn-active-bg:             var(--brand-yellow-700);
  --bs-btn-active-border-color:   var(--brand-yellow-700);
  --bs-btn-active-color:          #000;
  --bs-btn-disabled-bg:           var(--brand-yellow);
  --bs-btn-disabled-border-color: var(--brand-yellow);
  --bs-btn-disabled-color:        var(--brand-ink);
  --bs-btn-focus-shadow-rgb:      254, 238, 5;
  font-weight: 600;
}

/* Yellow focus ring on inputs across the app */
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-yellow-700);
  box-shadow: 0 0 0 .2rem rgba(254, 238, 5, .22);
}

/* ── Reset & base ─────────────────────────────────────────────────────────── */
body {
  margin: 0;
  font-size: 0.9rem;
  background: #f0f2f5;
  overflow-x: hidden;
}

/* NastyOS watermark — only on authenticated pages (inside .app-wrapper) */

/* ── App shell ────────────────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Watermark: only inside authenticated shells */
.app-wrapper::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/assets/NastyOS_bg.png') center center / 40% auto no-repeat;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: 230px;
  min-width: 230px;
  background: linear-gradient(180deg, #1B1D25 0%, #0E0F14 100%);
  color: #AEB2BD;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: 2px 0 8px rgba(0,0,0,.18);
  z-index: 200;
}

.sidebar-brand {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}

.sidebar-divider {
  border-color: rgba(255,255,255,.08) !important;
  margin: 0 !important;
}

.sidebar-section {
  padding: 12px 14px;
}

.sidebar-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #8A8E99;
  display: block;
  margin-bottom: 5px;
}

/* ── Sidebar navigation ───────────────────────────────────────────────────── */
.sidebar-nav { padding: 6px 0 16px; width: 100%; }

.sidebar-navlink {
  color: #A9AEBA !important;
  border-radius: 7px !important;
  margin: 2px 10px !important;
  padding: 9px 14px !important;
  font-size: 0.85rem;
  display: flex !important;
  align-items: center !important;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.sidebar-navlink:hover {
  background: rgba(255,255,255,.09) !important;
  color: #FFFFFF !important;
  text-decoration: none;
}

.sidebar-navlink.active {
  background: var(--brand-yellow) !important;
  color: var(--brand-ink) !important;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(254,238,5,.35);
}

/* ── Main content area ────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 26px 28px;
  overflow-y: auto;
  min-height: 100vh;
  background: #f0f2f5;
}

/* ── Sidebar user card ────────────────────────────────────────────────────── */
.sidebar-user-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.20);
  box-shadow: 0 2px 8px rgba(0,0,0,.30);
  display: block;
  margin: 0 auto 8px;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #F0F1F4;
  text-align: center;
  letter-spacing: .01em;
}

.sidebar-user-role {
  font-size: 0.68rem;
  color: #8A8E99;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-user-avatar--clickable {
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.sidebar-user-avatar--clickable:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(254,238,5,.65), 0 4px 14px rgba(0,0,0,.35);
  border-color: var(--brand-yellow) !important;
}

/* ── Sidebar footer (logout) ──────────────────────────────────────────────── */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Mobile sidebar (hidden off-canvas + toggle) ─────────────────────────── */
.sidebar-toggle-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: var(--brand-ink);
    color: #F0F1F4;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.30);
    z-index: 300;
    cursor: pointer;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 260;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.sidebar-backdrop-visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 240;
  }

  .main-content {
    padding: 70px 12px 16px;
  }

  /* Tab bars: one scrollable line instead of wrapping into 2-3 rows */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;          /* Firefox */
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-link { white-space: nowrap; }

  /* Toolbars in card headers: let button groups wrap instead of overflowing */
  .card-header .btn-group { flex-wrap: wrap; }

  /* react-dates range picker: keep it inside the viewport */
  .DateRangePickerInput { max-width: 100%; }
  .DateInput { width: 105px !important; }

  /* Modals: edge-to-edge with a small margin */
  .modal-dialog { margin: 8px; }
}

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: #000;
  display: flex;
  align-items: stretch;
}

/* Two-column split */
.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left: logo panel */
.login-logo-col {
  flex: 0 0 58%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
}

.login-logo-col img {
  mix-blend-mode: screen;
  width: 100%;
  max-width: 540px;
  height: auto;
}

/* Right: form panel */
.login-form-col {
  flex: 0 0 42%;
  background: #101116;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  border-left: 1px solid rgba(254,238,5,.14);
}

.login-form-inner {
  width: 100%;
  max-width: 360px;
}

.login-input {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #e8f0f8 !important;
  border-radius: 8px !important;
}

.login-input::placeholder { color: #5a7490 !important; }
.login-input:focus {
  background: rgba(255,255,255,.09) !important;
  border-color: var(--brand-yellow) !important;
  box-shadow: 0 0 0 3px rgba(254,238,5,.20) !important;
  color: #fff !important;
}

/* Login on phones: stack the two columns, logo as a compact header */
@media (max-width: 768px) {
  .login-split { flex-direction: column; }
  .login-logo-col {
    flex: 0 0 auto;
    padding: 28px 24px 12px;
  }
  .login-logo-col img { max-width: 240px; }
  .login-form-col {
    flex: 1 1 auto;
    padding: 24px 20px 40px;
    border-left: none;
  }
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  border-radius: 10px !important;
  border: none !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-header {
  background: #fff !important;
  border-bottom: 1px solid #e9ecef !important;
  border-radius: 10px 10px 0 0 !important;
}

/* ── Stat icon circle ─────────────────────────────────────────────────────── */
.icon-circle {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Program builder table ────────────────────────────────────────────────── */
.program-table { font-size: 0.75rem; }
.program-table th { white-space: nowrap; background: var(--brand-ink); color: #fff; }
.program-table td { vertical-align: middle; padding: 3px 4px !important; }

/* ── Date picker ──────────────────────────────────────────────────────────── */
.DateInput_input { font-size: 0.8rem !important; padding: 4px 8px !important; }
.DateRangePickerInput { border-radius: 4px !important; }

/* ── AG Grid ──────────────────────────────────────────────────────────────── */
.ag-theme-alpine {
  --ag-font-size: 0.82rem;
  --ag-row-height: 36px;
  --ag-header-height: 38px;
  --ag-header-foreground-color: #212529;
  --ag-header-background-color: #f8f9fa;
  --ag-odd-row-background-color: #fafafa;
  --ag-border-color: #dee2e6;
  --ag-secondary-border-color: #dee2e6;
  --ag-row-border-color: #dee2e6;
  --ag-selected-row-background-color: rgba(254,238,5,.16);
  --ag-range-selection-border-color: #C9BD00;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

/* ── Badges & misc ────────────────────────────────────────────────────────── */
.badge { font-size: 0.72rem; }
.border-start.border-3 { padding-left: 0.6rem; }

/* ── Profile page ─────────────────────────────────────────────────────────── */
#profile-avatar-img {
  transition: opacity .2s;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
#profile-avatar-img:hover { opacity: .85; cursor: pointer; }

#profile-upload > div {
  border: none !important;
  padding: 0 !important;
}
