/* ==========================================================================
   MBP Orthodontics — Clean Clinical Staff & Payroll Design System
   Calm, uncluttered, mobile-first interface with slide-out navigation drawer
   ========================================================================== */

:root {
  /* Refined Clinical Slate & Teal Palette (HSL) */
  --bg-page: hsl(210, 30%, 98%);
  --bg-surface: hsl(0, 0%, 100%);
  --bg-subtle: hsl(210, 24%, 95%);
  --bg-elevated: hsl(210, 33%, 99%);

  --text-primary: hsl(215, 32%, 13%);
  --text-secondary: hsl(215, 16%, 42%);
  --text-muted: hsl(215, 14%, 56%);

  --border-subtle: hsl(214, 22%, 90%);
  --border-strong: hsl(214, 18%, 80%);

  --brand-primary: hsl(188, 76%, 26%);
  --brand-primary-hover: hsl(188, 82%, 21%);
  --brand-soft: hsl(188, 55%, 94%);
  --brand-text: hsl(188, 85%, 20%);

  --status-success-bg: hsl(152, 56%, 94%);
  --status-success-text: hsl(154, 75%, 22%);
  --status-success-border: hsl(152, 45%, 82%);

  --status-warn-bg: hsl(38, 92%, 94%);
  --status-warn-text: hsl(32, 85%, 26%);
  --status-warn-border: hsl(38, 80%, 78%);

  --status-danger-bg: hsl(356, 85%, 96%);
  --status-danger-text: hsl(356, 72%, 34%);
  --status-danger-border: hsl(356, 68%, 84%);

  --status-info-bg: hsl(208, 78%, 95%);
  --status-info-text: hsl(210, 78%, 28%);
  --status-info-border: hsl(208, 60%, 84%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 44px rgba(15, 23, 42, 0.14);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Tabular figures for payroll precision */
.num,
.mono,
table td,
input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ==========================================================================
   Topbar Navigation & Burger Button
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.burger-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.burger-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.burger-btn:active {
  transform: scale(0.97);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.brand-subtitle {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Slide-Out Side Navigation Drawer (Burger Menu)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
  transition: opacity 0.2s ease;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 290px;
  max-width: 86vw;
  z-index: 90;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  transform: translateX(-104%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

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

.drawer-top {
  padding: 1.15rem 1.15rem 0.75rem;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-user-card {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.drawer-user-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.drawer-user-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.drawer-section-label {
  margin: 1.2rem 0 0.45rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.drawer-nav-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.68rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.drawer-nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.drawer-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-text);
}

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

.drawer-footer {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ==========================================================================
   View Complexity Switcher (Simple vs Advanced) & User Strip
   ========================================================================== */

.mode-toggle-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.mode-toggle-btn {
  border: none;
  background: transparent;
  padding: 0.32rem 0.68rem;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-toggle-btn.active {
  background: var(--bg-surface);
  color: var(--brand-primary);
  box-shadow: var(--shadow-xs);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.68rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 0.82rem;
  font-weight: 500;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.48rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge.admin {
  background: var(--brand-soft);
  color: var(--brand-text);
}

.role-badge.employee {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

/* ==========================================================================
   Main Layout & Page Header
   ========================================================================== */

.main-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.segmented-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

/* ==========================================================================
   Summary KPI Strip & Cards
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-fill.warn {
  background: hsl(34, 90%, 46%);
}

.progress-fill.danger {
  background: hsl(356, 75%, 48%);
}

/* ==========================================================================
   Tabs & Section Panels
   ========================================================================== */

.tabs-bar {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 0.65rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.tab-count.urgent {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid var(--status-warn-border);
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.panel-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.panel-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.panel-body {
  padding: 1.35rem;
}

/* ==========================================================================
   Two-Column Layout
   ========================================================================== */

.split-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.35rem;
  align-items: start;
}

@media (max-width: 920px) {
  .split-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Schedule Calendar Grid
   ========================================================================== */

.period-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}

.day-cell {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.day-cell:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.day-cell.off-day {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.day-cell.bridge-day {
  border-style: dashed;
  border-color: hsl(208, 60%, 68%);
}

.day-cell.stat-holiday {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
}

.day-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
}

.day-hours {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.day-shift-note {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Badges & Status Pills
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.badge.pending {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid var(--status-warn-border);
}

.badge.approved,
.badge.open,
.badge.paid {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.badge.rejected,
.badge.unpaid,
.badge.locked {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

.badge.info,
.badge.bridge,
.badge.processed {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border: 1px solid var(--status-info-border);
}

/* ==========================================================================
   Forms, Inputs & Buttons
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.95rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.58rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px hsla(188, 76%, 26%, 0.14);
}

.form-textarea {
  min-height: 74px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-success {
  background: hsl(154, 65%, 30%);
  color: #fff;
}

.btn-success:hover {
  background: hsl(154, 70%, 24%);
}

.btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: var(--status-danger-border);
}

.btn-danger:hover {
  background: hsl(356, 80%, 90%);
}

.btn-sm {
  padding: 0.35rem 0.68rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   Data Tables
   ========================================================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 0.78rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table th {
  background: var(--bg-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--bg-elevated);
}

.data-table td.right,
.data-table th.right {
  text-align: right;
}

.net-hours-cell {
  font-weight: 700;
  color: var(--brand-text);
  background: hsla(188, 55%, 93%, 0.45);
}

.bonus-input {
  width: 92px;
  padding: 0.32rem 0.48rem;
  text-align: right;
  font-size: 0.83rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

/* ==========================================================================
   Alerts & Callouts
   ========================================================================== */

.callout {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.callout.info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border-color: var(--status-info-border);
}

.callout.warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border-color: var(--status-warn-border);
}

.callout.danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: var(--status-danger-border);
}

.callout.success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}

/* ==========================================================================
   Auth Card & Modals
   ========================================================================== */

.auth-wrapper {
  max-width: 420px;
  margin: 3.5rem auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
}

.modal-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.35rem;
}

/* ==========================================================================
   Toast Notifications & Loading State
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--brand-primary);
  animation: toastSlideIn 0.2s ease-out;
}

.toast.success {
  border-left-color: hsl(152, 68%, 42%);
}

.toast.error {
  border-left-color: hsl(356, 78%, 55%);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
  gap: 0.75rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 0.65rem 0.9rem;
  }
  .brand-subtitle {
    display: none;
  }
  .main-container {
    padding: 1.2rem 0.9rem 3rem;
  }
  .user-pill span:first-child {
    display: none;
  }
}

/* ==========================================================================
   Dual-Role Workspace Switcher & Active Section Location Bar
   ========================================================================== */

.workspace-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.workspace-switch-btn {
  border: none;
  background: transparent;
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.workspace-switch-btn:hover {
  color: var(--text-primary);
}

.workspace-switch-btn.active-admin {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.25);
}

.workspace-switch-btn.active-employee {
  background: hsl(212, 78%, 34%);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(29, 78, 216, 0.25);
}

.location-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.location-context-bar.admin-theme {
  border-left: 4px solid var(--brand-primary);
  background: linear-gradient(90deg, hsla(188, 65%, 96%, 0.7) 0%, #ffffff 45%);
}

.location-context-bar.employee-theme {
  border-left: 4px solid hsl(212, 78%, 38%);
  background: linear-gradient(90deg, hsla(210, 85%, 96%, 0.75) 0%, #ffffff 45%);
}

.location-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.workspace-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workspace-mode-pill.admin {
  background: var(--brand-soft);
  color: var(--brand-text);
  border: 1px solid hsla(188, 60%, 35%, 0.22);
}

.workspace-mode-pill.employee {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border: 1px solid var(--status-info-border);
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
}

.breadcrumb-group {
  color: var(--text-secondary);
  font-weight: 600;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 700;
  background: var(--bg-subtle);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.category-switch-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.category-switch-pill {
  border: none;
  background: transparent;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-switch-pill:hover {
  color: var(--text-primary);
}

.category-switch-pill.active {
  background: var(--bg-surface);
  color: var(--brand-text);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.drawer-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-text);
  border-left: 3px solid var(--brand-primary);
  padding-left: calc(0.85rem - 3px);
  font-weight: 700;
}

.drawer-current-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #ffffff;
}

/* ==========================================================================
   Modern Interactive Data Table Toolbars, Filters, Sorting & Exports
   ========================================================================== */

.table-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 1.15rem;
  background: linear-gradient(180deg, #fafcfd 0%, #f4f7f9 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.table-toolbar-left {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.42rem;
  flex: 1 1 auto;
  min-width: 0;
}

.table-toolbar-right {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.table-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 1 1 170px;
  min-width: 125px;
  max-width: 215px;
  height: 32px;
}

.table-search-icon {
  position: absolute;
  left: 0.58rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
  line-height: 1;
}

.table-search-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}

.table-search-input {
  width: 100%;
  height: 32px;
  margin: 0;
  padding: 0 0.55rem 0 1.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  line-height: 1;
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.table-search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px hsla(188, 78%, 27%, 0.12);
}

.table-filter-select {
  height: 32px;
  margin: 0;
  padding: 0 0.5rem;
  flex: 0 1 auto;
  min-width: 105px;
  max-width: 152px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
  cursor: pointer;
  box-sizing: border-box;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease;
}

.table-filter-select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.table-count-pill {
  margin: 0;
  padding: 0 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: none;
  white-space: nowrap;
}

.table-reset-btn {
  height: 32px;
  margin: 0;
  padding: 0 0.58rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 6px;
  border: 1px dashed var(--border-strong);
  background: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

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

.export-btn-group {
  display: inline-flex;
  align-items: stretch;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

.btn-export {
  height: 100%;
  margin: 0;
  padding: 0 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  border: none;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  background: #ffffff;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.btn-export:last-child {
  border-right: none;
}

.btn-export svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  display: block;
}

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

.btn-export.primary-export {
  background: var(--brand-primary);
  color: #ffffff;
  border-right-color: rgba(255, 255, 255, 0.2);
}

.btn-export.primary-export:hover {
  background: var(--brand-primary-hover);
  color: #ffffff;
}

@media (max-width: 1040px) {
  .table-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .table-toolbar-left {
    width: 100%;
    flex-wrap: wrap;
  }
  .table-search-wrap {
    max-width: 240px;
  }
  .table-toolbar-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border-subtle);
  }
}

@media (max-width: 640px) {
  .table-toolbar-right {
    flex-wrap: wrap;
    gap: 0.45rem;
  }
}

/* Sortable Table Column Headers */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.14s ease, color 0.14s ease;
  position: relative;
  white-space: nowrap;
}

.th-sort-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  line-height: 1.2;
  vertical-align: middle;
}

.data-table th.right .th-sort-inner {
  justify-content: flex-end;
  width: 100%;
}

.th-sort-label {
  display: inline-block;
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: var(--text-muted);
  opacity: 0.55;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.sort-indicator svg {
  width: 11px;
  height: 11px;
  display: block;
}

.data-table th.sortable:hover {
  background: #eef6f8;
  color: var(--brand-text);
}

.data-table th.sortable:hover .sort-indicator {
  opacity: 0.9;
  color: var(--brand-primary);
}

.data-table th.sortable.sorted-active {
  background: #eef7f8;
  color: var(--brand-text);
  border-bottom: 1px solid var(--border-strong);
}

.data-table th.sortable.sorted-active .sort-indicator {
  opacity: 1;
  color: var(--brand-primary);
  background: rgba(15, 118, 110, 0.12);
}

/* Table Totals / Summary Footer */
.data-table tfoot.table-summary-footer td {
  background: linear-gradient(90deg, hsla(188, 65%, 95%, 0.7) 0%, #f8fafc 100%);
  font-weight: 700;
  color: var(--text-primary);
  border-top: 2px solid var(--brand-primary);
  border-bottom: none;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

