/* =========================================================
   OptaNet Event Management Portal – Main Stylesheet
   ========================================================= */

/* ---- Custom properties ---- */
:root {
  --brand-primary:  #0057b8;
  --brand-dark:     #003d82;
  --brand-light:    #e8f0fb;
  --accent:         #00a8e8;

  --sidebar-bg:     #0f1c38;
  --sidebar-hover:  #1a2d54;
  --sidebar-active: #0057b8;
  --sidebar-width:  248px;

  --text-primary:   #111827;
  --text-secondary: #6b7280;
  --text-inverse:   #ffffff;

  --bg-page:        #f3f6fb;
  --bg-card:        #ffffff;
  --bg-input:       #ffffff;

  --border:         #e5e7eb;
  --border-focus:   #0057b8;

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.14);

  --success:  #16a34a;
  --warning:  #d97706;
  --danger:   #dc2626;
  --info:     #0284c7;

  --transition: 200ms ease;

  font-size: 16px;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  height: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

tr.expense-edit-row {
  cursor: pointer;
}

tr.expense-edit-row:hover td,
tr.expense-edit-row:focus-visible td {
  background: var(--brand-light);
}

img { max-width: 100%; display: block; }

/* =========================================================
   LAYOUT
   ========================================================= */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: transform var(--transition);
  z-index: 200;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-decoration: none;
}

.logo-img {
  max-width: 140px;
  height: auto;
  /* white logo visible on dark sidebar */
  filter: brightness(0) invert(1);
}

.logo-sub {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}

/* ---- Sidebar nav ---- */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 10px 4px;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
  padding: 4px 12px;
}

/* ---- Expandable nav groups ---- */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.nav-group-header:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-group.open > .nav-group-header {
  color: #fff;
}

.nav-group-arrow {
  margin-left: auto;
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.nav-group.open .nav-group-arrow {
  transform: rotate(180deg);
}

.nav-sub {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding-left: 16px;
}

.nav-group.open .nav-sub {
  display: flex;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.6);
  font-size: .84rem;
  font-weight: 400;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-sub-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.nav-sub-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

/* ---- Sidebar footer ---- */
.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info { flex: 1; display: flex; align-items: center; gap: 10px; overflow: hidden; }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-details { overflow: hidden; }
.user-name {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: .7rem;
  color: rgba(255,255,255,.4);
}

.btn-logout {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.btn-logout svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-logout:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

/* ---- Main content ---- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Top bar ---- */
.top-bar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.page-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-settings-menu {
  position: relative;
}

.topbar-settings-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.topbar-settings-trigger::-webkit-details-marker {
  display: none;
}

.topbar-settings-trigger:hover,
.topbar-settings-trigger:focus-visible,
.topbar-settings-menu[open] .topbar-settings-trigger {
  color: var(--brand-primary);
  border-color: rgba(0, 87, 184, 0.28);
  box-shadow: 0 8px 24px rgba(15, 28, 56, 0.08);
}

.topbar-settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 28, 56, 0.16);
  z-index: 40;
}

.topbar-settings-link {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}

.topbar-settings-link:hover {
  background: var(--brand-light);
  text-decoration: none;
}

.top-bar-user {
  font-size: .85rem;
  color: var(--text-secondary);
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 36px;
  height: 36px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.mobile-menu-btn:hover { background: var(--brand-light); border-color: var(--border-focus); }
.mobile-menu-btn svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

body.sidebar-collapsed .sidebar {
  margin-left: calc(-1 * var(--sidebar-width));
}

body.sidebar-collapsed .sidebar {
  box-shadow: none;
}

body.sidebar-collapsed .sidebar-overlay.open {
  display: none;
}

/* ---- Content area ---- */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
}

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---- Stat cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card.accent { border-top: 3px solid var(--brand-primary); }
.stat-card.success { border-top: 3px solid var(--success); }
.stat-card.warning { border-top: 3px solid var(--warning); }
.stat-card.danger  { border-top: 3px solid var(--danger); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-outline   { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-page); }

.btn-ghost     { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-page); color: var(--text-primary); }

.btn-sm { padding: 6px 13px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }

.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =========================================================
   FORMS
   ========================================================= */
.form-group {
  margin-bottom: 18px;
}

.form-group.has-error label {
  color: var(--danger);
}

label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,87,184,.15);
}

.form-group.has-error input[type="text"],
.form-group.has-error input[type="email"],
.form-group.has-error input[type="password"],
.form-group.has-error input[type="number"],
.form-group.has-error input[type="date"],
.form-group.has-error input[type="search"],
.form-group.has-error select,
.form-group.has-error textarea,
.upload-zone.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus,
.upload-zone.has-error:hover,
.upload-zone.has-error.drag-over {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.16);
}

input:disabled,
select:disabled,
textarea:disabled,
.input-disabled {
  background: #f3f4f6;
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 1;
}

textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.expense-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.expense-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fcfdff;
  padding: 18px;
}

.expense-panel-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.expense-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.expense-panel-header .expense-panel-title {
  margin-bottom: 0;
}

.expense-readonly-field {
  min-height: 41px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  display: flex;
  align-items: center;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  .expense-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .expense-layout { grid-template-columns: 1fr; }
}

.form-hint {
  font-size: .76rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-error {
  font-size: .8rem;
  color: var(--danger);
  margin-top: 4px;
}

/* File upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand-primary);
  background: var(--brand-light);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  display: block;
}

.upload-label {
  font-weight: 600;
  color: var(--brand-primary);
  font-size: .9rem;
}

.upload-hint {
  color: var(--text-secondary);
  font-size: .78rem;
  margin-top: 4px;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--brand-light);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: .85rem;
  color: var(--brand-dark);
  font-weight: 500;
}

/* Camera capture button */
.btn-camera {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  border: none;
  transition: background var(--transition);
}
.btn-camera:hover { background: #0284c7; }

/* =========================================================
   TABLES
   ========================================================= */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

.collapsible-card {
  padding: 0;
  overflow: hidden;
}

.collapsible-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary:hover {
  background: #f8faff;
}

.collapsible-arrow {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-right: 6px;
}

details[open] > .collapsible-summary .collapsible-arrow {
  transform: rotate(225deg);
}

.collapsible-content {
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
}

.staffing-hero-card {
  margin-bottom: 18px;
}

.staffing-year-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.staffing-year-label {
  margin: 0;
}

.staffing-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.staffing-control-card {
  align-self: start;
}

.staffing-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.staffing-grid-card {
  overflow: hidden;
}

.staffing-grid-support {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--border);
}

.staffing-visible-jobs {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.staffing-support-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.staffing-support-subtitle {
  margin-top: 4px;
  font-size: .82rem;
  color: var(--text-secondary);
}

.staffing-visible-job-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.staffing-visible-job {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-primary);
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
}

.staffing-visible-job:hover,
.staffing-visible-job:focus-visible {
  border-color: rgba(0, 87, 184, 0.25);
  box-shadow: 0 10px 24px rgba(15, 28, 56, 0.08);
  outline: none;
}

.staffing-visible-job.is-active {
  border-color: var(--brand-primary);
  background: #eef5ff;
  box-shadow: 0 10px 24px rgba(0, 87, 184, 0.16);
  transform: translateY(-1px);
}

.staffing-visible-job-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--job-swatch-bg, #e7eef6);
  box-shadow: inset 0 0 0 1px var(--job-swatch-border, #b8c7db);
  flex: 0 0 auto;
}

.staffing-visible-job-name {
  font-size: .85rem;
  font-weight: 600;
}

.staffing-visible-empty {
  font-size: .8rem;
  color: var(--text-secondary);
}

.staffing-visible-empty {
  display: inline-flex;
  padding: 4px 0;
}

.staffing-grid-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-height: 70vh;
}

.staffing-visible-empty-state {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: .85rem;
}

.staffing-grid-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  user-select: none;
}

.staffing-grid-table th,
.staffing-grid-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.staffing-month-header,
.staffing-day-header {
  position: sticky;
  top: 0;
  z-index: 3;
}

.staffing-month-header {
  background: #eef4ff;
  color: var(--brand-primary);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 0;
}

.staffing-month-header.is-even {
  background: #eef4ff;
}

.staffing-month-header.is-odd {
  background: #e4edf9;
}

.staffing-day-header {
  background: var(--bg-page);
  width: 22px;
  min-width: 22px;
  padding: 6px 0;
  text-align: center;
  font-size: .58rem;
}

.staffing-day-header.weekend {
  background: #f6f8fb;
}

.staffing-day-header.month-start,
.staffing-cell.month-start {
  border-left: 2px solid #9fb1ca;
}

.staffing-sticky-col {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fff;
}

.staffing-person-header,
.staffing-person-subheader {
  min-width: 150px;
  text-align: left;
}

.staffing-person-cell {
  padding: 8px 10px;
}

.staffing-person-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: .74rem;
  line-height: 1.2;
}

.staffing-person-name-button {
  display: inline-flex;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color var(--transition);
}

.staffing-person-name-button:hover,
.staffing-person-name-button:focus-visible {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.staffing-cell {
  width: 22px;
  min-width: 22px;
  height: 32px;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  font-size: .52rem;
  font-weight: 700;
  cursor: crosshair;
  background: #fff;
  color: var(--text-secondary);
  line-height: 1;
  overflow: visible;
  position: relative;
}

.staffing-cell-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.staffing-cell-top {
  height: 13px;
  position: relative;
  overflow: visible;
  line-height: 13px;
}

.staffing-cell-bottom {
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 19px;
}

.staffing-span-label {
  position: absolute;
  top: 0;
  left: 1px;
  white-space: nowrap;
  overflow: visible;
  font-size: .48rem;
  font-weight: 600;
  line-height: 13px;
  color: var(--staffing-text, var(--brand-primary));
  opacity: .85;
  pointer-events: none;
  z-index: 2;
}

.staffing-span-label + .staffing-span-label {
  top: 13px;
}

.staffing-cell.weekend {
  background: #fbfcfe;
}

.staffing-cell.assigned {
  background: var(--staffing-bg, #e8f0fb);
  color: var(--staffing-text, var(--brand-primary));
  box-shadow: inset 0 0 0 1px var(--staffing-border, #9fb8e2);
}

.staffing-cell.has-day-key {
  box-shadow: inset 0 0 0 1px var(--staffing-border, #9fb8e2), inset 0 -3px 0 var(--staffing-accent, #9fb8e2);
}

.staffing-cell.no-short-code {
  background: #fef08a !important;
  box-shadow: inset 0 0 0 1px #ca8a04 !important;
  color: #854d0e !important;
}

/* Green highlight for fields changed during a modal session */
.staffing-changed {
  background: #d1fae5 !important;
  border-color: #059669 !important;
  transition: background .3s, border-color .3s;
}
select.staffing-changed {
  outline: 2px solid #059669;
  outline-offset: -1px;
}

.staffing-cell.has-overlap {
  cursor: pointer;
}

.staffing-cell.has-overlap-warning {
  position: relative;
  background: var(--staffing-warning-bg, #dc2626);
  box-shadow: inset 0 0 0 1px var(--staffing-warning-border, #7f1d1d);
  color: transparent;
}

.staffing-cell.has-overlap-warning::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid #fff8db;
}

.staffing-cell.has-overlap-warning::after {
  content: '!';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -22%);
  color: #991b1b;
  font-size: .62rem;
  font-weight: 900;
  line-height: 1;
}

.staffing-cell.has-overlap-warning.selected {
  background: var(--staffing-warning-bg, #dc2626);
  box-shadow: inset 0 0 0 1px var(--staffing-warning-border, #7f1d1d), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  color: transparent;
}

.staffing-cell.has-overlap-warning.day-selected {
  background: var(--staffing-warning-bg, #dc2626);
  box-shadow: inset 0 0 0 1px var(--staffing-warning-border, #7f1d1d), inset 0 0 0 2px #1f3f73, inset 0 0 0 4px rgba(255,255,255,0.8);
  color: transparent;
}

.staffing-cell.has-overlap-warning.selected.day-selected {
  background: var(--staffing-warning-bg, #dc2626);
  box-shadow: inset 0 0 0 1px var(--staffing-warning-border, #7f1d1d), inset 0 0 0 2px #1f3f73, inset 0 0 0 4px rgba(255,255,255,0.8);
  color: transparent;
}

.staffing-cell.selected {
  background: rgba(0, 87, 184, 0.18);
  box-shadow: inset 0 0 0 2px rgba(0, 87, 184, 0.5);
  color: var(--brand-primary);
}

.staffing-cell.day-selected {
  box-shadow: inset 0 0 0 2px #1f3f73, inset 0 0 0 4px rgba(255,255,255,0.8);
}

.staffing-cell.staffing-legend-match {
  box-shadow: inset 0 0 0 2px rgba(0, 87, 184, 0.72), inset 0 0 0 4px rgba(255,255,255,0.7);
}

.staffing-cell.staffing-legend-dim {
  opacity: 0.26;
}

.staffing-cell.staffing-legend-match.staffing-cell.has-overlap-warning {
  box-shadow: inset 0 0 0 1px var(--staffing-warning-border, #7f1d1d), inset 0 0 0 2px rgba(0, 87, 184, 0.78), inset 0 0 0 4px rgba(255,255,255,0.68);
  opacity: 1;
}

.staffing-cell.staffing-legend-match.selected,
.staffing-cell.staffing-legend-match.day-selected,
.staffing-cell.staffing-legend-match.selected.day-selected {
  opacity: 1;
}

.staffing-job-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--staffing-job-badge-bg, #e8f0fb);
  color: var(--staffing-job-badge-text, #31506d);
  box-shadow: inset 0 0 0 1px var(--staffing-job-badge-border, #9fb8e2);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.2;
}

.staffing-modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.staffing-modal-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
}

.staffing-modal-tab.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.staffing-modal-panel {
  display: none;
}

.staffing-modal-panel.is-active {
  display: block;
}

.staffing-person-modal-card {
  width: min(96vw, 1720px);
  max-width: none;
}

.staffing-person-modal-grid-wrap {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.staffing-person-focus-table {
  min-width: max-content;
}

.staffing-person-focus-label {
  min-width: 220px;
}

.staffing-person-focus-cell {
  min-width: 220px;
  background: #fff;
}

.staffing-person-focus-badge {
  justify-content: flex-start;
}

.staffing-person-modal-empty {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: .88rem;
}

.staffing-person-focus-actionable {
  cursor: pointer;
}

.staffing-person-focus-actionable:hover,
.staffing-person-focus-actionable:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(0, 87, 184, 0.45);
  outline: none;
}

.staffing-day-key-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.staffing-day-key-row {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdff;
}

.staffing-day-key-date {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.staffing-day-key-select {
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

thead th {
  background: var(--bg-page);
  padding: 11px 14px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Data table: bordered columns with vertical rotated headers ── */
.data-table {
  border-collapse: collapse;
  width: 100%;
}

.data-table thead th {
  text-align: center;
  vertical-align: bottom;
  padding: 6px 6px 4px;
  min-width: 56px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: .75rem;
}

.data-table thead th:first-child,
.data-table tbody td:first-child {
  border-left: 1px solid var(--border);
}

.data-table tbody td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover td {
  background: var(--brand-light);
}

/* Vertical rotated header label — used inside .data-table th */
.col-hdr {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  display: inline-block;
  text-align: left;
  white-space: nowrap;
  line-height: 1.2;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8faff; }

td {
  padding: 11px 14px;
  vertical-align: middle;
}

/* Status row background colours */
tr[data-status="approved"] { background: #f0fdf4; }
tr[data-status="approved"]:hover { background: #dcfce7; }
tr[data-status="pending"] { background: #fefce8; }
tr[data-status="pending"]:hover { background: #fef9c3; }
tr[data-status="declined"] { background: #fef2f2; }
tr[data-status="declined"]:hover { background: #fee2e2; }
tr[data-status="rejected"] { background: #fef2f2; }
tr[data-status="rejected"]:hover { background: #fee2e2; }

.total-row td {
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: var(--brand-light);
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}

.badge-success  { background: #dcfce7; color: var(--success); }
.badge-warning  { background: #fef3c7; color: var(--warning); }
.badge-danger   { background: #fee2e2; color: var(--danger); }
.badge-info     { background: #e0f2fe; color: var(--info); }
.badge-primary  { background: var(--brand-light); color: var(--brand-primary); }
.badge-muted    { background: var(--bg-page); color: var(--text-secondary); }

.job-name-badge {
  background: var(--job-badge-bg, #e8f0fb);
  color: var(--job-badge-text, #31506d);
  box-shadow: inset 0 0 0 1px var(--job-badge-border, #9fb8e2);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

a.job-name-badge:hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.job-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 10px;
}

.job-color-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.job-color-option:hover {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.job-color-option:has(input[type="radio"]:checked) {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.14);
}

.job-color-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.job-color-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  border-radius: 10px;
  background: var(--job-color-swatch);
  box-shadow: inset 0 0 0 1px rgba(49, 80, 109, 0.12);
}

.job-color-count {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(0, 0, 0, 0.45);
  pointer-events: none;
  user-select: none;
}

.job-color-option-custom {
  grid-column: span 2;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.job-color-custom-label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.job-color-option-custom input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.job-city-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.job-city-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, .8fr) minmax(180px, 1fr) minmax(220px, 1.4fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.job-city-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-city-field label {
  margin: 0;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.job-city-field-wide {
  min-width: 0;
}

.job-city-field select[multiple] {
  min-height: 118px;
}

.job-city-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 26px;
}

/* =========================================================
   ALERTS / FLASH MESSAGES
   ========================================================= */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 18px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1c38 0%, #0057b8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  display: block;
  max-width: 180px;
  margin: 0 auto 8px;
}

.login-tagline {
  text-align: center;
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: 30px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 22px;
}

.login-section { margin-bottom: 8px; }
.login-section-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-secondary);
  margin: 0 0 10px;
}
.login-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-secondary); font-size: .8rem; margin: 18px 0;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: .95rem;
  margin-top: 4px;
}

/* Microsoft sign-in button */
.btn-ms-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #fff;
  border: 1.5px solid #8c8c8c;
  border-radius: var(--radius);
  color: #1a1a1a;
  font-size: .93rem;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}
.btn-ms-signin:hover {
  background: #f3f3f3;
  border-color: #5a5a5a;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.btn-ms-signin svg { flex-shrink: 0; }

/* "or sign in with email" divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--text-secondary);
  font-size: .78rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =========================================================
   MODAL
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: 28px 28px 24px;
}
.modal-card-wide {
  max-width: 1120px;
}
.edit-expense-layout {
  margin-bottom: 20px;
}
.edit-expense-secondary-panel {
  margin-bottom: 20px;
}
.edit-expense-layout-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.edit-expense-layout-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.modal-close {
  background: none; border: none; font-size: 1.4rem; line-height: 1;
  cursor: pointer; color: var(--text-secondary); padding: 4px 8px;
  border-radius: var(--radius); transition: background .15s;
}
.modal-close:hover { background: var(--bg-secondary); }

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-actions-primary,
.modal-actions-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-card {
  padding: 0;
  overflow: hidden;
}

.report-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 28px 22px;
  background:
    radial-gradient(circle at top right, rgba(0, 87, 184, 0.16), transparent 34%),
    linear-gradient(135deg, #f7fbff 0%, #eef5ff 100%);
  border-bottom: 1px solid var(--border);
}

.report-eyebrow {
  margin-bottom: 8px;
  color: var(--brand-primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.report-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.15;
}

.report-subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
  font-size: .92rem;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 28px 0;
}

.report-metric {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 28, 56, 0.04);
}

.report-metric-label {
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.report-metric-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.report-metric-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-metric-meta {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: .78rem;
}

.report-callout {
  margin: 18px 28px 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.report-callout-warning {
  background: #fff0f0;
  border-color: #f5b7b7;
  color: #8f1d1d;
}

.report-callout-success {
  background: #effbf3;
  border-color: #b7e8c3;
}

.settings-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(0, 87, 184, 0.12), transparent 36%),
    linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

.settings-hero h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.settings-hero p {
  margin: 0;
  max-width: 780px;
  color: var(--text-secondary);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.settings-tab-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-tab-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(0, 87, 184, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.settings-tab-link:hover,
.settings-tab-link:focus-visible {
  border-color: rgba(0, 87, 184, 0.24);
  color: var(--brand-primary);
  text-decoration: none;
}

.settings-tab-link.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 87, 184, 0.18);
}

.settings-stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.settings-stat-link .stat-card {
  height: 100%;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.settings-stat-link:hover .stat-card,
.settings-stat-link:focus-visible .stat-card {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.settings-stat-link.active .stat-card {
  box-shadow: var(--shadow-md);
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.settings-inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-inline-form-wide {
  align-items: flex-end;
}

.settings-inline-form .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 180px;
}

.settings-section-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: .85rem;
}

.settings-usage {
  color: var(--text-secondary);
  font-size: .78rem;
}

/* ── Budget Placeholder Availability Grid ── */

.bp-placeholder-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.bp-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.bp-picker-btn:hover:not([disabled]) {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.bp-picker-btn.active {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: #fff;
}

.bp-picker-btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.bp-picker-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  background: var(--surface-alt);
  color: var(--text-secondary);
}

.bp-picker-btn.active .bp-picker-badge {
  background: rgba(255,255,255,.25);
  color: #fff;
}

.bp-picker-badge.full {
  background: #dcfce7;
  color: #166534;
}

.bp-unstaffed-row th {
  background: #f0f7ff;
}

.bp-unstaffed-row .staffing-cell.bp-placeholder-cell {
  background: var(--staffing-bg, #e8f0fb);
  box-shadow: inset 0 0 0 1px var(--staffing-border, #9fb8e2);
}

.bp-staff-row {
  cursor: pointer;
  transition: background .1s;
}

.bp-staff-row:hover th {
  background: #f5f8ff;
}

.bp-staff-row .staffing-cell.bp-highlight {
  position: relative;
}

.bp-staff-row .staffing-cell.bp-highlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--brand-primary);
  border-left: none;
  border-right: none;
  pointer-events: none;
  z-index: 5;
}

.bp-staff-row .staffing-cell.bp-highlight-start::after {
  border-left: 2px solid var(--brand-primary);
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.bp-staff-row .staffing-cell.bp-highlight-end::after {
  border-right: 2px solid var(--brand-primary);
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.bp-staff-row .staffing-cell.bp-highlight.bp-conflict::after {
  border-color: #dc2626;
  background: rgba(220, 38, 38, .12);
}

.bp-staff-row .staffing-cell.bp-highlight:not(.assigned)::after {
  background: rgba(0, 87, 184, .08);
}

.bp-staff-row.bp-locked {
  outline: 2px solid var(--brand-primary);
  outline-offset: -1px;
}

.bp-grid-hint {
  padding: 10px 16px;
  font-size: .82rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.bp-on-this-job th {
  background: #f0f7ff;
}

.bp-on-job-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  vertical-align: middle;
}

.bp-staffed-list {
  margin-top: 4px;
}
.bp-staffed-person {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  line-height: 1.6;
}
.bp-staffed-name {
  color: var(--text-secondary);
}
.bp-unstaff-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  padding: 0 2px;
  opacity: .6;
  transition: opacity .15s;
}
.bp-unstaff-btn:hover {
  opacity: 1;
}

.settings-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-mono {
  font-family: Consolas, 'Courier New', monospace;
  font-size: .82rem;
}

.report-callout-title {
  margin-bottom: 4px;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.report-callout-text {
  font-size: .9rem;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
  padding: 20px 28px 28px;
}

.report-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.report-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
}

.report-panel-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.report-panel-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .82rem;
}

.report-table-wrap {
  border-radius: 0;
}

.report-table td {
  vertical-align: top;
}

.report-summary-row {
  cursor: pointer;
}

.report-summary-row:hover td,
.report-summary-row:focus-visible td,
.report-summary-row.is-open td {
  background: var(--brand-light);
}

.report-detail-row td {
  padding: 0;
  background: #f8fbff;
}

.report-detail-card {
  padding: 16px 18px 18px;
  border-top: 1px solid rgba(0, 87, 184, 0.12);
}

.report-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.report-detail-table-wrap {
  border: 1px solid rgba(0, 87, 184, 0.12);
  border-radius: 10px;
  overflow: hidden;
}

.report-detail-table td {
  background: #fff;
}

.report-strong {
  font-weight: 700;
}

.report-muted {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: .76rem;
  line-height: 1.35;
}

.report-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 8px 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-primary);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.report-chip-success {
  background: #dcfce7;
  color: var(--success);
}

.report-chip-warning {
  background: #fef3c7;
  color: var(--warning);
}

.report-chip-danger {
  background: #fee2e2;
  color: var(--danger);
}

.report-footer-note {
  padding: 0 28px 24px;
  color: var(--text-secondary);
  font-size: .78rem;
}

@media (max-width: 900px) {
  .edit-expense-layout-two,
  .edit-expense-layout-three {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    align-items: stretch;
  }

  .modal-actions-primary,
  .modal-actions-secondary {
    width: 100%;
  }

  .report-hero {
    flex-direction: column;
  }

  .settings-hero {
    flex-direction: column;
  }

  .settings-tab-nav {
    justify-content: flex-start;
  }

  .report-actions {
    width: 100%;
  }

  .report-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .report-metrics,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .settings-hero {
    flex-direction: column;
  }

  .staffing-layout {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MISC UTILITIES
   ========================================================= */
.text-muted    { color: var(--text-secondary); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-right    { text-align: right; }
.text-center   { text-align: center; }

.fw-bold  { font-weight: 700; }
.fw-semi  { font-weight: 600; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }

.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-2       { gap: 10px; }
.gap-3       { gap: 16px; }
.ml-auto     { margin-left: auto; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state-text { font-size: .9rem; }

.file-link {
  color: var(--brand-primary);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* amount column */
.amount { font-variant-numeric: tabular-nums; font-weight: 600; }

/* =========================================================
   RESPONSIVE SIDEBAR
   ========================================================= */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-collapsed .sidebar {
    margin-left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 190;
  }

  .sidebar-overlay.open { display: block; }

  .content-area { padding: 20px 14px; }
  .top-bar { padding: 0 14px; }

  .login-card { padding: 28px 22px; }
  .form-row { grid-template-columns: 1fr; }

  .report-hero,
  .report-metrics,
  .report-grid,
  .report-footer-note {
    padding-left: 16px;
    padding-right: 16px;
  }

  .report-callout {
    margin-left: 16px;
    margin-right: 16px;
  }
}
