/* ============================================================================
   jebi-theme.css
   Jebi Design System — Material 3 Expressive
   Target app: TM Labeling (Flask / Bootstrap 5)

   Sections:
     0.  Google Fonts import
     1.  M3E Design Tokens (CSS custom properties)
     2.  Global reset & base
     3.  Typography
     4.  Navigation (navbar)
     5.  Layout & page shell
     6.  Cards
     7.  Buttons
     8.  Tables
     9.  Forms (inputs, selects, switches, checkboxes)
    10.  Badges
    11.  Alert / flash messages
    12.  Modals
    13.  Spinners & loading states
    14.  Breadcrumbs
    15.  Autocomplete dropdown (manage page)
    16.  Project cards (manage page sidebar)
    17.  User Jobs monitor cards
    18.  Login page
    19.  Empty / placeholder states
    20.  Motion & transitions (prefers-reduced-motion respected)
    21.  Utility overrides
   ============================================================================ */


/* ============================================================================
   0. GOOGLE FONTS IMPORT
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Poppins:wght@300;400;500;600&display=swap');


/* ============================================================================
   1. M3E DESIGN TOKENS — CSS CUSTOM PROPERTIES
   ============================================================================ */

:root {

  /* ── Primary — Jebi Red ── */
  --md-sys-color-primary:                 #FE3B1F;
  --md-sys-color-on-primary:              #FFFFFF;
  --md-sys-color-primary-container:       #FFDAD4;
  --md-sys-color-on-primary-container:    #410000;
  --md-sys-color-inverse-primary:         #FFB4A8;

  /* ── Secondary — Jebi Blue/Teal ── */
  --md-sys-color-secondary:               #174F64;
  --md-sys-color-on-secondary:            #FFFFFF;
  --md-sys-color-secondary-container:     #D1E4F4;
  --md-sys-color-on-secondary-container:  #001F28;

  /* ── Tertiary — Accent Teal ── */
  --md-sys-color-tertiary:                #5396A5;
  --md-sys-color-on-tertiary:             #FFFFFF;
  --md-sys-color-tertiary-container:      #C2E8F5;
  --md-sys-color-on-tertiary-container:   #003640;

  /* ── Error ── */
  --md-sys-color-error:                   #BA1A1A;
  --md-sys-color-on-error:                #FFFFFF;
  --md-sys-color-error-container:         #FFDAD6;
  --md-sys-color-on-error-container:      #410002;

  /* ── Surface — Light scheme ── */
  --md-sys-color-surface:                 #FEFCF6;
  --md-sys-color-on-surface:              #002634;
  --md-sys-color-surface-variant:         #F2DDD8;
  --md-sys-color-on-surface-variant:      #534340;
  --md-sys-color-surface-container-lowest:  #FFFFFF;
  --md-sys-color-surface-container-low:     #FEF1EE;
  --md-sys-color-surface-container:         #FCE8E4;
  --md-sys-color-surface-container-high:    #F7E0DC;
  --md-sys-color-surface-container-highest: #F1DAD5;
  --md-sys-color-outline:                 #857371;
  --md-sys-color-outline-variant:         #D8C2BE;

  /* ── Jebi brand extended tokens ── */
  --jebi-dark:          #002634;
  --jebi-dark-2:        #01202e;
  --jebi-dark-3:        #012735;
  --jebi-red-primary:   #FE3B1F;
  --jebi-red-bright:    #FE1E1F;
  --jebi-red-muted:     #C8321A;
  --jebi-blue-medium:   #174F64;
  --jebi-teal:          #5396A5;
  --jebi-amber:         #FEB91F;
  --jebi-surface-dim:   #D8C2BE;

  /* ── Shape corner scale ── */
  --shape-none:         0px;
  --shape-xs:           4px;
  --shape-sm:           8px;
  --shape-md:           12px;
  --shape-lg:           16px;
  --shape-xl:           28px;
  --shape-2xl:          32px;
  --shape-3xl:          40px;
  --shape-full:         9999px;

  /* ── Elevation shadows ── */
  --elevation-1: 0 1px 2px rgba(0,0,0,.10), 0 1px 3px 1px rgba(0,0,0,.07);
  --elevation-2: 0 1px 2px rgba(0,0,0,.12), 0 2px 6px 2px rgba(0,0,0,.08);
  --elevation-3: 0 1px 3px rgba(0,0,0,.14), 0 4px 8px 3px rgba(0,0,0,.09);
  --elevation-4: 0 2px 3px rgba(0,0,0,.15), 0 6px 10px 4px rgba(0,0,0,.10);
  --elevation-5: 0 4px 4px rgba(0,0,0,.16), 0 8px 12px 6px rgba(0,0,0,.11);

  /* ── Motion ── */
  --motion-fast:            150ms;
  --motion-default:         250ms;
  --motion-slow:            350ms;
  --motion-extra-slow:      500ms;
  --motion-spring:          cubic-bezier(0.05, 0.7, 0.1, 1);
  --motion-standard:        cubic-bezier(0.2, 0, 0, 1);
  --motion-accel:           cubic-bezier(0.3, 0, 0.8, 0.15);

  /* ── Typography scale ── */
  --font-display:   'Montserrat', system-ui, sans-serif;
  --font-body:      'Poppins', system-ui, sans-serif;
}


/* ============================================================================
   2. GLOBAL RESET & BASE
   ============================================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;            /* Body Large — 16px */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.03125em; /* +0.5px */
  color: var(--md-sys-color-on-surface);
  background-color: var(--md-sys-color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bootstrap primary color override via CSS variable bridge */
:root {
  --bs-primary:           var(--jebi-red-primary);
  --bs-primary-rgb:       254, 59, 31;
  --bs-secondary-rgb:     23, 79, 100;
  --bs-success-rgb:       22, 120, 77;
  --bs-danger-rgb:        186, 26, 26;
  --bs-warning-rgb:       254, 185, 31;
  --bs-info-rgb:          83, 150, 165;
  --bs-body-font-family:  var(--font-body);
  --bs-body-color:        var(--md-sys-color-on-surface);
  --bs-body-bg:           var(--md-sys-color-surface);
  --bs-border-radius:     var(--shape-md);
  --bs-border-radius-sm:  var(--shape-sm);
  --bs-border-radius-lg:  var(--shape-lg);
  --bs-border-radius-xl:  var(--shape-xl);
  --bs-link-color:        var(--jebi-red-primary);
  --bs-link-hover-color:  var(--jebi-red-muted);
}

/* Focus ring — accessible, on-brand */
:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  border-radius: var(--shape-xs);
}

/* Remove default Bootstrap focus shadow and replace with our ring */
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  box-shadow: none;
}

/* Links */
a {
  color: var(--jebi-red-primary);
  text-decoration: none;
  transition: color var(--motion-fast) var(--motion-standard);
}

a:hover {
  color: var(--jebi-red-muted);
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin: 1.5rem 0;
}


/* ============================================================================
   3. TYPOGRAPHY
   Dual scale: Baseline (Poppins) + Emphasized (Montserrat / heavier weights)
   ============================================================================ */

/* ── Display ── */
h1, .display-1,
h2, .display-2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.016em;
  color: var(--md-sys-color-on-surface);
  line-height: 1.15;
  margin-bottom: 0.5em;
}

h1, .h1 {
  font-size: 2rem;        /* Headline Large — 32px */
  font-weight: 700;
}

h2, .h2 {
  font-size: 1.75rem;     /* Headline Medium — 28px */
  font-weight: 600;
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;      /* Headline Small — 24px */
  font-weight: 600;
  line-height: 1.333;
  margin-bottom: 0.5em;
}

h4, .h4 {
  font-family: var(--font-display);
  font-size: 1.375rem;    /* Title Large — 22px */
  font-weight: 600;
  line-height: 1.272;
  margin-bottom: 0.5em;
}

h5, .h5 {
  font-family: var(--font-body);
  font-size: 1rem;        /* Title Medium — 16px */
  font-weight: 500;
  letter-spacing: 0.009em;
  line-height: 1.5;
  margin-bottom: 0.5em;
}

h6, .h6 {
  font-family: var(--font-body);
  font-size: 0.875rem;    /* Title Small — 14px */
  font-weight: 500;
  letter-spacing: 0.006em;
  line-height: 1.428;
  margin-bottom: 0.5em;
}

p {
  font-size: 1rem;        /* Body Large — 16px */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.031em;
  margin-bottom: 1rem;
}

small, .small, .text-sm {
  font-size: 0.75rem;     /* Body Small — 12px */
  font-weight: 400;
  letter-spacing: 0.025em;
}

/* Bootstrap text-muted override */
.text-muted {
  color: var(--md-sys-color-on-surface-variant) !important;
}

/* Semibold utility (emphasized body) */
.fw-semibold {
  font-weight: 600;
}

/* Label Large — buttons, tabs */
.label-lg {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  line-height: 1.428;
}


/* ============================================================================
   4. NAVIGATION (NAVBAR)
   Dark background (#002634), Jebi Red active indicator, M3E pill indicator
   ============================================================================ */

.navbar {
  background-color: var(--jebi-dark) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-top: 0;
  padding-bottom: 0;
  min-height: 60px;
  box-shadow: var(--elevation-2);
}

/* Brand / logo text */
.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF !important;
  padding: 0.875rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity var(--motion-fast) var(--motion-standard);
}

.navbar-brand::before {
  display: none;
}

.navbar-brand:hover {
  opacity: 0.88;
}

/* Nav links */
.navbar-nav .nav-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.009em;
  color: rgba(255,255,255,0.75) !important;
  padding: 0.875rem 0.875rem;
  border-radius: var(--shape-full);
  transition:
    color       var(--motion-fast) var(--motion-standard),
    background  var(--motion-fast) var(--motion-standard);
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: #FFFFFF !important;
  background-color: rgba(255,255,255,0.08);
}

.navbar-nav .nav-link:focus-visible {
  color: #FFFFFF !important;
  outline: 3px solid var(--jebi-red-primary);
  outline-offset: -1px;
}

/* Active nav link — M3E pill indicator style */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link[aria-current="page"] {
  color: #FFFFFF !important;
  background-color: rgba(254, 59, 31, 0.18);
  font-weight: 600;
}

/* Right-aligned user/logout section */
.navbar-nav:last-child .nav-link {
  color: rgba(255,255,255,0.6) !important;
  font-size: 0.8125rem;
}

.navbar-nav:last-child .nav-link:hover {
  color: #FFFFFF !important;
  background-color: rgba(255,255,255,0.08);
}

/* Navbar toggler (mobile) */
.navbar-toggler {
  border-color: rgba(255,255,255,0.2);
  padding: 0.25rem 0.5rem;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/* ============================================================================
   5. LAYOUT & PAGE SHELL
   ============================================================================ */

/* Main content container — top padding since navbar is not sticky by default */
body > .container {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* Page-level heading rows (d-flex justify-content-between) */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

/* Utility: bottom margin after header-action rows the templates use */
.d-flex.justify-content-between.align-items-center.mb-3 h2 {
  margin-bottom: 0;
}


/* ============================================================================
   6. CARDS
   Elevated variant (default): surface bg, elevation-1, medium corner (12dp)
   ============================================================================ */

.card {
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-md);
  box-shadow: var(--elevation-1);
  transition:
    box-shadow   var(--motion-default) var(--motion-standard),
    border-color var(--motion-fast)    var(--motion-standard),
    transform    var(--motion-slow)    var(--motion-spring);
}

.card:hover {
  box-shadow: var(--elevation-2);
}

/* Card header — contained with contrasting surface tone */
.card-header {
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-md) var(--shape-md) 0 0;
  padding: 0.875rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
}

.card-body {
  padding: 1.25rem;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 0.75rem;
}

.card-footer {
  background-color: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 0 0 var(--shape-md) var(--shape-md);
  padding: 0.875rem 1.25rem;
}

/* Clickable / interactive project cards */
.project-card {
  cursor: pointer;
  border-radius: var(--shape-md);
  border: 1.5px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-low);
  transition:
    border-color  var(--motion-fast)    var(--motion-standard),
    box-shadow    var(--motion-default) var(--motion-standard),
    background    var(--motion-fast)    var(--motion-standard),
    transform     var(--motion-slow)    var(--motion-spring);
}

.project-card:hover {
  border-color: var(--jebi-blue-medium);
  box-shadow: var(--elevation-2);
  background-color: var(--md-sys-color-surface-container);
  transform: translateY(-1px);
}

/* Selected state — shape morphs to 16dp, primary border */
.project-card.border-primary,
.project-card.border-primary.border-2 {
  border-color: var(--md-sys-color-primary) !important;
  border-width: 2px !important;
  background-color: var(--md-sys-color-primary-container);
  box-shadow: var(--elevation-2);
  border-radius: var(--shape-lg); /* shape morph: 12 → 16dp */
}

/* User jobs monitor cards */
#usersContainer .card {
  border-radius: var(--shape-md);
  overflow: hidden;
}

#usersContainer .card-header {
  background-color: var(--jebi-dark);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  border-radius: 0;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--motion-fast) var(--motion-standard);
}

#usersContainer .card-header:hover {
  background-color: var(--jebi-dark-2);
}

#usersContainer .card-header .text-muted {
  color: rgba(255,255,255,0.55) !important;
}

#usersContainer .card-body {
  background-color: var(--md-sys-color-surface-container-low);
}


/* ============================================================================
   7. BUTTONS
   Filled (primary), Elevated, Tonal, Outlined, Text
   All heights 40dp; touch targets 48dp via padding extension
   ============================================================================ */

/* Shared button base */
.btn {
  font-family: var(--font-body);
  font-size: 0.875rem;        /* Label Large — 14px */
  font-weight: 600;           /* Emphasized label weight */
  letter-spacing: 0.006em;
  line-height: 1.428;
  border-radius: var(--shape-full);
  padding: 0.5625rem 1.25rem; /* ~9px 20px → 40dp height */
  min-height: 40px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition:
    background-color  var(--motion-fast) var(--motion-standard),
    box-shadow        var(--motion-fast) var(--motion-standard),
    color             var(--motion-fast) var(--motion-standard),
    border-color      var(--motion-fast) var(--motion-standard),
    transform         var(--motion-slow) var(--motion-spring);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: middle;
}

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

/* ── Filled / Primary ── */
.btn-primary {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--elevation-1);
}

.btn-primary:hover {
  background-color: #e5340c;  /* ~8% darker */
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--elevation-2);
}

.btn-primary:focus-visible {
  background-color: var(--md-sys-color-primary);
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.btn-primary:active {
  background-color: #cc2e0a;
  box-shadow: var(--elevation-1);
}

.btn-primary:disabled,
.btn-primary.disabled {
  background-color: rgba(0,38,52,0.12);
  color: rgba(0,38,52,0.38);
  box-shadow: none;
}

/* ── Secondary (Tonal / secondary container) ── */
.btn-secondary {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: #b8cfde;
  color: var(--md-sys-color-on-secondary-container);
}

.btn-secondary:disabled,
.btn-secondary.disabled {
  background-color: rgba(0,38,52,0.12);
  color: rgba(0,38,52,0.38);
}

/* ── Outlined ── */
.btn-outline-primary {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1.5px solid var(--md-sys-color-primary);
  box-shadow: none;
}

.btn-outline-primary:hover {
  background-color: rgba(254,59,31,0.08);
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.btn-outline-primary:focus-visible {
  background-color: rgba(254,59,31,0.08);
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.btn-outline-secondary {
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border: 1.5px solid var(--md-sys-color-outline);
}

.btn-outline-secondary:hover {
  background-color: rgba(83,67,64,0.08);
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-on-surface-variant);
}

/* ── Success (green) — tonal ── */
.btn-success {
  background-color: #16784D;
  color: #FFFFFF;
  box-shadow: var(--elevation-1);
}

.btn-success:hover {
  background-color: #125e3c;
  color: #FFFFFF;
  box-shadow: var(--elevation-2);
}

.btn-outline-success {
  background-color: transparent;
  color: #16784D;
  border: 1.5px solid #16784D;
}

.btn-outline-success:hover {
  background-color: rgba(22,120,77,0.08);
  color: #16784D;
  border-color: #16784D;
}

/* ── Danger / Destructive ── */
.btn-danger {
  background-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  box-shadow: var(--elevation-1);
}

.btn-danger:hover {
  background-color: #9a1616;
  color: var(--md-sys-color-on-error);
  box-shadow: var(--elevation-2);
}

.btn-outline-danger {
  background-color: transparent;
  color: var(--md-sys-color-error);
  border: 1.5px solid var(--md-sys-color-error);
}

.btn-outline-danger:hover {
  background-color: rgba(186,26,26,0.08);
  color: var(--md-sys-color-error);
  border-color: var(--md-sys-color-error);
}

/* ── Warning ── */
.btn-warning {
  background-color: var(--jebi-amber);
  color: #2A1A00;
  box-shadow: var(--elevation-1);
}

.btn-warning:hover {
  background-color: #e0a41a;
  color: #2A1A00;
  box-shadow: var(--elevation-2);
}

.btn-outline-warning {
  background-color: transparent;
  color: #8B5E00;
  border: 1.5px solid var(--jebi-amber);
}

.btn-outline-warning:hover {
  background-color: rgba(254,185,31,0.12);
  color: #8B5E00;
  border-color: var(--jebi-amber);
}

/* ── Info / Teal ── */
.btn-info {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  box-shadow: none;
}

.btn-info:hover {
  background-color: #a0d3e1;
  color: var(--md-sys-color-on-tertiary-container);
}

.btn-outline-info {
  background-color: transparent;
  color: var(--jebi-teal);
  border: 1.5px solid var(--jebi-teal);
}

.btn-outline-info:hover {
  background-color: rgba(83,150,165,0.08);
  color: var(--jebi-teal);
  border-color: var(--jebi-teal);
}

/* ── Small button ── */
.btn-sm {
  font-size: 0.75rem;       /* Label Medium — 12px */
  padding: 0.3125rem 0.75rem;
  min-height: 32px;
  border-radius: var(--shape-full);
}

/* ── Large button ── */
.btn-lg {
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  min-height: 48px;
}

/* Full-width (login page) */
.btn.w-100 {
  min-height: 48px;
}

/* Icon-only button (project card action buttons) */
.btn svg {
  flex-shrink: 0;
}


/* ============================================================================
   8. TABLES
   Flat with subtle row alternation; dark header uses jebi-dark
   ============================================================================ */

.table {
  font-family: var(--font-body);
  font-size: 0.875rem;     /* Body Medium — 14px */
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-outline-variant);
  margin-bottom: 0;
  --bs-table-striped-bg: rgba(242,221,216,0.35); /* surface-variant at low opacity */
  --bs-table-hover-bg:   rgba(254,59,31,0.06);
  --bs-table-border-color: var(--md-sys-color-outline-variant);
}

/* Table wrapper card */
.table-responsive {
  border-radius: var(--shape-md);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--elevation-1);
}

/* Standalone table (no .table-responsive wrapper) */
.table:not(.table-bordered):not(.table-sm) {
  border-collapse: separate;
  border-spacing: 0;
}

/* Header row — jebi dark + white text */
.table > thead > tr > th,
.table-dark th {
  background-color: var(--jebi-dark) !important;
  color: rgba(255,255,255,0.90) !important;
  font-family: var(--font-body);
  font-size: 0.75rem;      /* Label Medium — 12px */
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(255,255,255,0.10) !important;
  white-space: nowrap;
}

/* thead.table-dark override */
.table > thead.table-dark > tr > th {
  background-color: var(--jebi-dark) !important;
  color: rgba(255,255,255,0.90) !important;
  border-color: rgba(255,255,255,0.10) !important;
}

/* tbody cells */
.table > tbody > tr > td {
  padding: 0.625rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
}

/* Last row — no bottom border */
.table > tbody > tr:last-child > td {
  border-bottom: none;
}

/* Striped */
.table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: rgba(242,221,216,0.3);
}

/* Dense / small table */
.table-sm > tbody > tr > td,
.table-sm > thead > tr > th {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

/* Hierarchical child rows (projects browser, manage page) */
.child-row > td {
  background-color: var(--md-sys-color-surface-container-low);
}

.db-child-row > td {
  background-color: var(--md-sys-color-surface-container);
}

/* Sub-header rows (table-info / table-warning used in projects browser) */
.table-info {
  --bs-table-bg: var(--md-sys-color-tertiary-container) !important;
  color: var(--md-sys-color-on-tertiary-container) !important;
}

.table-info > th,
.table-info th {
  background-color: var(--md-sys-color-tertiary-container) !important;
  color: var(--md-sys-color-on-tertiary-container) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-color: rgba(83,150,165,0.20) !important;
}

.table-warning {
  --bs-table-bg: #FFF8E7 !important;
  color: #2A1A00 !important;
}

.table-warning > th,
.table-warning th {
  background-color: #FFF3CC !important;
  color: #2A1A00 !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-color: rgba(254,185,31,0.25) !important;
}

/* table-light sub-headers (history sections) */
.table-light > th,
.table-light th {
  background-color: var(--md-sys-color-surface-container-high) !important;
  color: var(--md-sys-color-on-surface-variant) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Indent utilities for hierarchical tables */
.ps-4 { padding-left: 1.25rem !important; }
.ps-5 { padding-left: 2rem !important; }

/* Bordered table (history detail panes) */
.table-bordered {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-sm);
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
  border: 1px solid var(--md-sys-color-outline-variant);
}

/* Expand arrow in jobs table */
.expand-arrow {
  color: var(--md-sys-color-on-surface-variant);
  transition: transform var(--motion-default) var(--motion-standard);
}

/* Detail row background */
.bg-light {
  background-color: var(--md-sys-color-surface-container) !important;
}

/* Toggle buttons in tree tables */
.toggle-btn,
.db-toggle-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: var(--shape-sm);
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ============================================================================
   9. FORMS
   Text fields: outlined, extra-small corners (4dp), 56dp height
   Selects, switches, checkboxes
   ============================================================================ */

/* ── Labels ── */
.form-label {
  font-family: var(--font-body);
  font-size: 0.875rem;    /* Body Medium */
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 0.375rem;
  letter-spacing: 0.009em;
}

/* ── Text inputs & textareas ── */
.form-control {
  font-family: var(--font-body);
  font-size: 1rem;        /* Body Large */
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  background-color: var(--md-sys-color-surface-container-lowest);
  border: 1.5px solid var(--md-sys-color-outline);
  border-radius: var(--shape-xs);   /* M3E: 4dp for text fields */
  padding: 0.6875rem 0.875rem;      /* ~11px 14px → 56dp height with label */
  min-height: 48px;                 /* touch target */
  transition:
    border-color var(--motion-fast) var(--motion-standard),
    box-shadow   var(--motion-fast) var(--motion-standard),
    background   var(--motion-fast) var(--motion-standard);
}

.form-control::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.6;
}

.form-control:hover:not(:focus):not(:disabled) {
  border-color: var(--md-sys-color-on-surface-variant);
}

.form-control:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  background-color: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  box-shadow: none;
  outline: none;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  border-color: var(--md-sys-color-outline-variant);
  cursor: not-allowed;
}

/* Small form control */
.form-control-sm {
  font-size: 0.875rem;
  min-height: 36px;
  padding: 0.375rem 0.75rem;
}

/* ── Select ── */
.form-select {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  background-color: var(--md-sys-color-surface-container-lowest);
  border: 1.5px solid var(--md-sys-color-outline);
  border-radius: var(--shape-xs);
  min-height: 48px;
  padding: 0.6875rem 2.5rem 0.6875rem 0.875rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23534340' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  transition:
    border-color var(--motion-fast) var(--motion-standard),
    box-shadow   var(--motion-fast) var(--motion-standard);
}

.form-select:hover:not(:focus):not(:disabled) {
  border-color: var(--md-sys-color-on-surface-variant);
}

.form-select:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  box-shadow: none;
  outline: none;
}

.form-select:disabled {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  border-color: var(--md-sys-color-outline-variant);
  cursor: not-allowed;
}

/* ── Input groups ── */
.input-group > .form-control,
.input-group > .form-select {
  border-radius: var(--shape-xs);
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
  border-right: none;
  border-radius: var(--shape-xs) 0 0 var(--shape-xs);
}

.input-group > .btn:last-child {
  border-radius: 0 var(--shape-xs) var(--shape-xs) 0;
}

.input-group > .btn:not(:last-child):not(:first-child) {
  border-radius: 0;
}

.input-group > .btn:first-child {
  border-radius: var(--shape-xs) 0 0 var(--shape-xs);
}

.input-group-sm > .form-control,
.input-group-sm > .btn {
  min-height: 36px;
  font-size: 0.875rem;
}

/* ── Checkboxes & radios ── */
.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border: 1.5px solid var(--md-sys-color-outline);
  border-radius: var(--shape-xs);
  background-color: var(--md-sys-color-surface-container-lowest);
  cursor: pointer;
  transition:
    border-color     var(--motion-fast) var(--motion-standard),
    background-color var(--motion-fast) var(--motion-standard),
    box-shadow       var(--motion-fast) var(--motion-standard);
  flex-shrink: 0;
}

.form-check-input:hover {
  border-color: var(--md-sys-color-primary);
}

.form-check-input:checked {
  background-color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:focus {
  box-shadow: none;
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.form-check-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  padding-left: 0.25rem;
}

/* ── Switch ── */
.form-switch .form-check-input {
  width: 2.5rem;
  height: 1.375rem;
  border-radius: var(--shape-full);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23857371'/%3e%3c/svg%3e");
  background-color: var(--md-sys-color-surface-variant);
  border-color: var(--md-sys-color-outline);
  transition:
    background-color var(--motion-default) var(--motion-spring),
    background-image var(--motion-fast)    var(--motion-standard);
}

.form-switch .form-check-input:checked {
  background-color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23FFFFFF'/%3e%3c/svg%3e");
}

/* File browser container */
.border.rounded {
  border: 1.5px solid var(--md-sys-color-outline-variant) !important;
  border-radius: var(--shape-sm) !important;
}

/* Helper text */
.form-text,
.text-muted.form-text {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 0.25rem;
}


/* ============================================================================
   10. BADGES
   M3E: pill shape (full corner), color-coded with icon+text redundancy
   ============================================================================ */

.badge {
  font-family: var(--font-body);
  font-size: 0.6875rem;     /* Label Small — 11px */
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3em 0.625em;
  border-radius: var(--shape-full);
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}

/* Role / status badge colors */
.badge.bg-primary {
  background-color: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-on-primary) !important;
}

.badge.bg-secondary {
  background-color: var(--md-sys-color-surface-container-highest) !important;
  color: var(--md-sys-color-on-surface-variant) !important;
}

.badge.bg-success {
  background-color: #D4EDDA !important;
  color: #0F4C2A !important;
}

.badge.bg-danger {
  background-color: var(--md-sys-color-error-container) !important;
  color: var(--md-sys-color-on-error-container) !important;
}

.badge.bg-warning {
  background-color: #FFF3CC !important;
  color: #5C3D00 !important;
}

.badge.bg-warning.text-dark {
  background-color: #FFF3CC !important;
  color: #5C3D00 !important;
}

.badge.bg-info {
  background-color: var(--md-sys-color-tertiary-container) !important;
  color: var(--md-sys-color-on-tertiary-container) !important;
}

/* Status-specific semantic badges */
.badge-status-completed {
  background-color: #D4EDDA;
  color: #0F4C2A;
}

.badge-status-annotation {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.badge-status-validation {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.badge-status-new {
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
}


/* ============================================================================
   11. ALERTS / FLASH MESSAGES
   M3E: Container with icon+text, high visibility, accessible colors
   Safety-critical: never auto-dismiss
   ============================================================================ */

.alert {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  border-radius: var(--shape-md);
  border: 1.5px solid transparent;
  padding: 0.875rem 1rem 0.875rem 1.125rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  line-height: 1.5;
  box-shadow: var(--elevation-1);
}

/* Alert variants */
.alert-danger,
.alert-error {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-color: rgba(186,26,26,0.25);
}

.alert-success {
  background-color: #D4EDDA;
  color: #0F4C2A;
  border-color: rgba(22,120,77,0.25);
}

.alert-warning {
  background-color: #FFF3CC;
  color: #5C3D00;
  border-color: rgba(254,185,31,0.40);
}

.alert-info {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border-color: rgba(83,150,165,0.30);
}

.alert-primary {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: rgba(254,59,31,0.25);
}

.alert-secondary {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-outline-variant);
}

/* Dismiss button inside alerts */
.alert-dismissible {
  padding-right: 3rem;
}

.btn-close {
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0.6;
  filter: none;
  background-size: 0.75rem;
  transition: opacity var(--motion-fast) var(--motion-standard);
}

.btn-close:hover {
  opacity: 1;
}

/* Flash message animation */
.alert.fade.show {
  animation: alert-slide-in var(--motion-slow) var(--motion-spring) forwards;
}

@keyframes alert-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================================
   12. MODALS
   M3E: extra-large corners (28dp), surface-container-low bg, elevation-5
   ============================================================================ */

.modal-content {
  background-color: var(--md-sys-color-surface-container-low);
  border: none;
  border-radius: var(--shape-xl);   /* M3E: 28dp */
  box-shadow: var(--elevation-5);
  overflow: hidden;
}

.modal-header {
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding: 1.25rem 1.5rem;
  border-radius: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.375rem;      /* Title Large — 22px */
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin: 0;
  line-height: 1.272;
}

.modal-body {
  padding: 1.5rem;
  background-color: var(--md-sys-color-surface-container-low);
}

.modal-footer {
  background-color: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 1rem 1.5rem;
  gap: 0.5rem;
}

/* Modal close button */
.modal-header .btn-close {
  color: var(--md-sys-color-on-surface-variant);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23534340'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
  opacity: 0.55;
}

.modal-header .btn-close:hover {
  opacity: 1;
}

/* Backdrop */
.modal-backdrop {
  background-color: rgba(0,38,52,0.55);
}

/* Modal animation — spring-like entry */
.modal.fade .modal-dialog {
  transform: scale(0.94) translateY(-12px);
  transition:
    transform var(--motion-slow) var(--motion-spring),
    opacity   var(--motion-default) var(--motion-standard);
  opacity: 0;
}

.modal.show .modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Modal sizes */
.modal-dialog.modal-xl .modal-content {
  border-radius: var(--shape-xl);
}

.modal-dialog.modal-lg .modal-content {
  border-radius: var(--shape-xl);
}


/* ============================================================================
   13. SPINNERS & LOADING STATES
   On-brand colors, accessible
   ============================================================================ */

.spinner-border {
  color: var(--md-sys-color-primary);
  border-width: 0.2em;
}

.spinner-border.text-primary {
  color: var(--md-sys-color-primary) !important;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Inline spinner inside buttons */
.btn .spinner-border-sm {
  width: 0.875rem;
  height: 0.875rem;
  margin-right: 0.25rem;
}


/* ============================================================================
   14. BREADCRUMBS
   Used in file browser (manage page)
   ============================================================================ */

.breadcrumb {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  background-color: transparent;
  padding: 0;
  margin: 0;
}

.breadcrumb-item {
  color: var(--md-sys-color-on-surface-variant);
}

.breadcrumb-item a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--motion-fast) var(--motion-standard);
}

.breadcrumb-item a:hover {
  color: var(--jebi-red-muted);
}

.breadcrumb-item.active {
  color: var(--md-sys-color-on-surface);
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--md-sys-color-outline);
  content: "/";
}


/* ============================================================================
   15. AUTOCOMPLETE DROPDOWN (manage page — job assignee)
   ============================================================================ */

.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  z-index: 1060;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background-color: var(--md-sys-color-surface-container-low);
  border: 1.5px solid var(--md-sys-color-outline);
  border-top: none;
  border-radius: 0 0 var(--shape-sm) var(--shape-sm);
  box-shadow: var(--elevation-3);
  display: none;
}

.autocomplete-list.show {
  display: block;
}

.autocomplete-item {
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  transition:
    background-color var(--motion-fast) var(--motion-standard),
    color            var(--motion-fast) var(--motion-standard);
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.autocomplete-item .text-muted {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant) !important;
}

.autocomplete-item:hover .text-muted,
.autocomplete-item.active .text-muted {
  color: rgba(255,255,255,0.70) !important;
}


/* ============================================================================
   16. PROJECT CARDS — MANAGE PAGE SIDEBAR
   ============================================================================ */

#projectsList {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Project card body */
.project-card .card-body {
  padding: 0.625rem 0.875rem;
}

.project-card .fw-semibold {
  font-size: 0.9375rem;
  color: var(--md-sys-color-on-surface);
}

/* Small action buttons inside project cards */
.project-card .btn-sm {
  min-height: 28px;
  padding: 0.25rem 0.5rem;
}

/* Project placeholder text */
#tasksPlaceholder {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--shape-md);
  border: 1.5px dashed var(--md-sys-color-outline-variant);
}


/* ============================================================================
   17. USER JOBS MONITOR
   Collapsible user cards with job detail tables
   ============================================================================ */

/* Accepted/Active stat badges in user card header */
#usersContainer .card-header .badge.bg-success {
  background-color: rgba(22,120,77,0.22) !important;
  color: #A8F0C6 !important;
  border: 1px solid rgba(22,120,77,0.35);
}

#usersContainer .card-header .badge.bg-primary {
  background-color: rgba(254,59,31,0.22) !important;
  color: #FFB4A8 !important;
  border: 1px solid rgba(254,59,31,0.35);
}

/* Task/project grouping inside user card body */
#usersContainer .card-body h6 {
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding-bottom: 0.375rem;
  margin-bottom: 0.75rem;
}

#usersContainer .card-body .ms-3 {
  border-left: 3px solid var(--md-sys-color-outline-variant);
  padding-left: 1rem;
  margin-left: 0.5rem !important;
}


/* ============================================================================
   18. LOGIN PAGE
   Centered card with Jebi branding
   ============================================================================ */

/* Full-page centering container for login */
.row.justify-content-center.mt-5 {
  min-height: calc(80vh - 60px);
  align-items: center;
}

/* Login card */
.row.justify-content-center .card {
  border-radius: var(--shape-xl);
  box-shadow: var(--elevation-3);
  border: none;
  background-color: var(--md-sys-color-surface-container-low);
  overflow: hidden;
}

.row.justify-content-center .card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--jebi-red-primary) 0%, var(--jebi-blue-medium) 100%);
}

.row.justify-content-center .card .card-body {
  padding: 2rem 2rem 2.25rem;
}

.row.justify-content-center .card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--jebi-dark);
  text-align: center;
  margin-bottom: 1.5rem;
}


/* ============================================================================
   19. EMPTY / PLACEHOLDER STATES
   ============================================================================ */

.text-muted.fst-italic,
p.text-muted {
  color: var(--md-sys-color-on-surface-variant) !important;
  font-style: normal;
}

/* Empty state containers */
#emptyMsg,
#tasksPlaceholder {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* No results rows inside tables */
.table tbody tr td.text-muted.fst-italic {
  padding: 1.5rem 1rem;
  font-size: 0.875rem;
}


/* ============================================================================
   20. MOTION & TRANSITIONS
   Spatial spring for positional changes; Effects spring for color/opacity
   Always respect prefers-reduced-motion
   ============================================================================ */

/* Default motion-enabled transitions are defined inline with each component.
   This section adds global page-level transition rules. */

/* Smooth collapse/expand for Bootstrap collapse components */
.collapsing {
  transition: height var(--motion-slow) var(--motion-spring) !important;
}

/* Fade transitions */
.fade {
  transition: opacity var(--motion-default) var(--motion-standard) !important;
}

/* ── Prefers-reduced-motion override ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .modal.fade .modal-dialog {
    transform: none;
    transition: none;
  }

  .alert.fade.show {
    animation: none;
  }

  .collapsing {
    transition: none !important;
  }

  .btn:active {
    transform: none;
  }

  .project-card:hover {
    transform: none;
  }
}


/* ============================================================================
   21. UTILITY OVERRIDES
   Bootstrap utility classes adjusted to Jebi tokens
   ============================================================================ */

/* Spacing utility: mb-3, mb-4 used extensively */
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

/* Gap utilities */
.gap-1 { gap: 0.375rem !important; }
.gap-2 { gap: 0.625rem !important; }

/* Row/column gutter */
.g-2 { --bs-gutter-x: 0.625rem; --bs-gutter-y: 0.625rem; }

/* Status indicator dots (can be used programmatically) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-active   { background-color: #16784D; }
.status-dot-warning  { background-color: var(--jebi-amber); }
.status-dot-error    { background-color: var(--md-sys-color-error); }
.status-dot-inactive { background-color: var(--md-sys-color-outline); }

/* Selected count label in modal footer */
#cvatSelectedCount,
#selectedCount {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Vertical divider in flex rows */
.vr {
  width: 1px;
  background-color: var(--md-sys-color-outline-variant);
  opacity: 1;
  align-self: stretch;
}


/* ============================================================================
   22. DASHBOARD
   ============================================================================ */

/* Stat cards */
.dash-stat-card {
  border: none;
  box-shadow: var(--elevation-1);
  transition: box-shadow var(--motion-fast) var(--motion-standard),
              transform var(--motion-fast) var(--motion-spring);
}

.dash-stat-card:hover {
  box-shadow: var(--elevation-2);
  transform: translateY(-2px);
}

.dash-stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  letter-spacing: 0.02em;
}

.dash-stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--md-sys-color-on-surface);
}

.dash-stat-sub {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 0.25rem;
}

.dash-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--shape-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-stat-icon-primary {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.dash-stat-icon-secondary {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.dash-stat-icon-warning {
  background-color: #FFF3CD;
  color: #856404;
}

.dash-stat-icon-danger {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

/* Quick links */
.dash-quick-link {
  border: 1px dashed var(--md-sys-color-outline-variant) !important;
  transition: border-color var(--motion-fast) var(--motion-standard),
              box-shadow var(--motion-fast) var(--motion-standard);
}

.dash-quick-link:hover {
  border-color: var(--md-sys-color-primary) !important;
  box-shadow: var(--elevation-1);
}

/* Summary/sync result alert inline */
#summaryDiv.alert-info {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: rgba(23,79,100,0.25);
}

/* Project count / DB count helper text */
#projectCount,
#dbCount,
#cvatCount {
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Sync button width */
#syncBtn {
  min-width: 96px;
}

/* Expand arrow in job rows */
tr[style*="cursor: pointer"]:hover > td:first-child .expand-arrow {
  color: var(--md-sys-color-primary);
}

/* File browser "select all" row */
#fileListContainer .form-check:first-child {
  margin-bottom: 0;
}

/* Training badge in project cards — warm amber tonal */
.badge.bg-warning.text-dark {
  background-color: #FFF3CC !important;
  color: #5C3D00 !important;
}

/* Code / pre elements */
code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.875rem;
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--shape-xs);
  padding: 0.125em 0.375em;
  color: var(--md-sys-color-on-surface);
}

/* Responsive table card for narrow viewports */
@media (max-width: 767px) {
  .table-responsive {
    border-radius: var(--shape-sm);
  }

  .navbar .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .modal-content {
    border-radius: var(--shape-lg);
    margin: 0.5rem;
  }

  .row.justify-content-center .card .card-body {
    padding: 1.5rem 1.25rem;
  }

  .btn-sm {
    padding: 0.3125rem 0.625rem;
  }
}

/* ── Manage page: expand arrow animation ── */
.expand-arrow {
  transition: transform var(--motion-default) var(--motion-standard);
  display: inline-block;
}

/* ── Section divider (Projects Browser: hr between live and local) ── */
hr.my-4 {
  border-color: var(--md-sys-color-outline-variant);
  margin: 2rem 0;
  opacity: 1;
}

/* ── Form check spacing in file browser ── */
#fileList .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--shape-xs);
  transition: background-color var(--motion-fast) var(--motion-standard);
}

#fileList .form-check:hover {
  background-color: var(--md-sys-color-surface-container);
}

#fileList .form-check-label {
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  flex: 1;
}

/* Folder navigation links in file browser */
#fileList a.text-decoration-none {
  font-size: 0.8125rem;
  color: var(--jebi-blue-medium);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

#fileList a.text-decoration-none:hover {
  color: var(--md-sys-color-primary);
}

#fileList a.text-decoration-none svg {
  color: var(--jebi-blue-medium);
  flex-shrink: 0;
}

/* ── Level modal inline edit inputs ── */
.input-group.input-group-sm .btn-success {
  background-color: #16784D;
  color: #FFFFFF;
  border-radius: 0;
}

.input-group.input-group-sm .btn-secondary {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 0 var(--shape-xs) var(--shape-xs) 0;
}

/* ── Import result div (CVAT users modal) ── */
#importResultDiv,
#cvatImportResult {
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

/* ── CVAT spinner centered ── */
#cvatSpinner,
#dbSpinner,
#spinner {
  color: var(--md-sys-color-primary);
}

/* ── Manage page inline task count ── */
#tasksCount,
#jobsCount {
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 0.375rem;
}

/* ── User jobs monitor search input ── */
#searchFilter {
  max-width: 100%;
}

/* ── Training filter switch label ── */
#trainingFilter + .form-check-label {
  font-weight: 400;
}

/* ============================================================================
   END OF JEBI THEME
   Version: 1.0.0 — Material 3 Expressive / Jebi Brand
   App: TM Labeling CVAT Management Dashboard
   ============================================================================ */
