/* GIG-tech ID Studio — modern production UI (v1.0.5) */

:root,
[data-theme="light"] {
  --gig-primary: #0b3d91;
  --gig-primary-hover: #092f70;
  --gig-accent: #00a3a1;
  --gig-success: #198754;
  --gig-warning: #d97706;
  --gig-danger: #c0392b;
  --gig-secondary: #6c757d;
  --gig-bg: #f0f3f8;
  --gig-surface: #ffffff;
  --gig-border: #e2e8f0;
  --gig-text: #1a1d21;
  --gig-muted: #64748b;
  --gig-sidebar: #0a2540;
  --gig-sidebar-text: #e8eef5;
  --gig-sidebar-active: #134a8a;
  --gig-sidebar-width: 248px;
  --gig-radius: 0.55rem;
  --gig-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --gig-input-bg: #fff;
  --gig-toast-bg: #0f172a;
  --gig-toast-fg: #f8fafc;
}

[data-theme="dark"] {
  --gig-primary: #3b82f6;
  --gig-primary-hover: #2563eb;
  --gig-accent: #2dd4bf;
  --gig-success: #22c55e;
  --gig-warning: #f59e0b;
  --gig-danger: #ef4444;
  --gig-secondary: #94a3b8;
  --gig-bg: #0f172a;
  --gig-surface: #1e293b;
  --gig-border: #334155;
  --gig-text: #e2e8f0;
  --gig-muted: #94a3b8;
  --gig-sidebar: #020617;
  --gig-sidebar-text: #e2e8f0;
  --gig-sidebar-active: #1e3a5f;
  --gig-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --gig-input-bg: #0f172a;
  --gig-toast-bg: #e2e8f0;
  --gig-toast-fg: #0f172a;
}

* {
  box-sizing: border-box;
}

body.gig-app {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--gig-text);
  background: var(--gig-bg);
  -webkit-font-smoothing: antialiased;
}

/* Semantic action buttons */
.btn-primary,
.btn-gig-save {
  background-color: var(--gig-primary);
  border-color: var(--gig-primary);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-gig-save:hover {
  background-color: var(--gig-primary-hover);
  border-color: var(--gig-primary-hover);
  color: #fff;
}
.btn-success,
.btn-gig-capture,
.btn-gig-print {
  background-color: var(--gig-success) !important;
  border-color: var(--gig-success) !important;
  color: #fff !important;
}
.btn-gig-print-next,
.btn-warning.btn-gig-print-next {
  background-color: var(--gig-warning) !important;
  border-color: var(--gig-warning) !important;
  color: #111 !important;
}
.btn-outline-secondary,
.btn-gig-cancel {
  color: var(--gig-secondary);
  border-color: var(--gig-border);
  background: var(--gig-surface);
}
.btn-danger,
.btn-gig-delete {
  background-color: var(--gig-danger);
  border-color: var(--gig-danger);
  color: #fff;
}

.btn {
  border-radius: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}
.btn:active {
  transform: translateY(1px);
}

[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-outline-secondary {
  background: var(--gig-surface);
  color: var(--gig-text);
  border-color: var(--gig-border);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
  background: var(--gig-input-bg);
  color: var(--gig-text);
  border-color: var(--gig-border);
}
[data-theme="dark"] .card,
[data-theme="dark"] .gig-card,
[data-theme="dark"] .table {
  --bs-table-bg: var(--gig-surface);
  --bs-table-color: var(--gig-text);
  background: var(--gig-surface);
  color: var(--gig-text);
}
[data-theme="dark"] .dropdown-menu {
  background: var(--gig-surface);
  border-color: var(--gig-border);
}
[data-theme="dark"] .dropdown-item {
  color: var(--gig-text);
}
[data-theme="dark"] .dropdown-item:hover {
  background: #334155;
}

/* Sidebar */
.gig-sidebar {
  width: var(--gig-sidebar-width);
  min-height: 100vh;
  background: var(--gig-sidebar);
  color: var(--gig-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.gig-sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gig-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gig-primary), var(--gig-accent));
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.gig-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.gig-about-logo {
  border-radius: 12px;
  box-shadow: var(--gig-shadow);
}

/* Empty states & polish */
.gig-empty-state {
  text-align: center;
  color: var(--gig-muted);
  padding: 2rem 1rem;
}

.gig-empty-state i {
  font-size: 2rem;
  opacity: 0.45;
  display: block;
  margin-bottom: 0.75rem;
}

.gig-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(244, 246, 249, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.gig-loading[hidden] {
  display: none !important;
}

.gig-signature-thumb {
  max-width: 100px;
  max-height: 48px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--gig-border);
  border-radius: 4px;
  padding: 2px;
}

.gig-help-card:hover {
  border-color: var(--gig-primary);
  box-shadow: 0 4px 12px rgba(11, 61, 145, 0.1);
}

.alert {
  border-radius: var(--gig-radius);
}

.table > :not(caption) > * > * {
  padding: 0.65rem 0.75rem;
}

.form-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.btn {
  border-radius: 0.4rem;
}

.badge {
  font-weight: 600;
}

/* Desktop-app feel: denser sidebar scroll */
.gig-nav-link {
  transition: background 0.12s ease, color 0.12s ease;
}

.gig-content .card.gig-card + .card.gig-card {
  margin-top: 0;
}

/* Status chips for verification */
.gig-status-valid { color: var(--gig-success); }
.gig-status-expired { color: var(--gig-warning); }
.gig-status-suspended,
.gig-status-revoked { color: var(--gig-danger); }

.gig-brand-title {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

.gig-brand-sub {
  font-size: 0.72rem;
  opacity: 0.75;
}

.gig-nav {
  padding: 0.75rem 0.5rem;
  flex: 1;
}

.gig-nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
  padding: 0.75rem 0.75rem 0.35rem;
}

.gig-nav-collapse-btn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  padding: 0.35rem 0.75rem;
  color: var(--gig-sidebar-text);
}
.gig-nav-collapse-btn:hover {
  opacity: 1;
}
.gig-nav-advanced {
  padding-bottom: 0.5rem;
}
.gig-nav-link.gig-nav-cta {
  background: linear-gradient(135deg, #0d9488, #0b3d91);
  color: #fff !important;
  font-weight: 700;
  margin: 0.35rem 0.35rem 0.65rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.gig-nav-link.gig-nav-cta:hover,
.gig-nav-link.gig-nav-cta.active {
  filter: brightness(1.08);
  background: linear-gradient(135deg, #14b8a6, #134a8a);
}

.gig-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2px;
  border-radius: 0.4rem;
  color: var(--gig-sidebar-text);
  text-decoration: none;
  font-size: 0.92rem;
}

.gig-nav-link i {
  font-size: 1rem;
  opacity: 0.9;
}

.gig-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.gig-nav-link.active {
  background: var(--gig-sidebar-active);
  color: #fff;
}

.gig-nav-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.gig-sidebar-footer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  opacity: 0.85;
  line-height: 1.35;
}

/* Main */
.gig-main {
  min-width: 0;
  background: var(--gig-bg);
}

.gig-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  background: var(--gig-surface);
  border-bottom: 1px solid var(--gig-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.gig-topbar-title {
  font-weight: 600;
  font-size: 1rem;
}

.gig-content {
  padding: 1.25rem 1.5rem 2rem;
}

.gig-footer {
  padding: 0.65rem 1.5rem;
  border-top: 1px solid var(--gig-border);
  background: var(--gig-surface);
  font-size: 0.78rem;
  color: var(--gig-muted);
}

.gig-footer a {
  color: var(--gig-primary);
  text-decoration: none;
}

.gig-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.gig-card {
  border: 1px solid var(--gig-border);
  border-radius: var(--gig-radius);
  box-shadow: var(--gig-shadow);
  background: var(--gig-surface);
}

.gig-card .card-header {
  background: transparent;
  font-weight: 600;
  border-bottom: 1px solid var(--gig-border);
}

.gig-kpi {
  border: 1px solid var(--gig-border);
  border-radius: var(--gig-radius);
  box-shadow: var(--gig-shadow);
}

.gig-kpi-label {
  font-size: 0.8rem;
  color: var(--gig-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gig-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gig-primary);
  line-height: 1.2;
  margin: 0.25rem 0;
}

.gig-kpi-hint {
  font-size: 0.78rem;
  color: var(--gig-muted);
}

.gig-global-search {
  flex: 1 1 auto;
  max-width: 420px;
}

.gig-global-search .form-control {
  border-left: 0;
}

.gig-logo-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  background: #eef2f7;
  flex-shrink: 0;
}

.gig-logo-thumb.placeholder {
  color: var(--gig-muted);
  font-size: 0.95rem;
}

.gig-logo-preview {
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
  background: #fff;
}

.gig-timeline-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef3fb;
  color: var(--gig-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gig-timeline .list-group-item {
  border-left: 0;
  border-right: 0;
}

.col-xl {
  flex: 1 1 12%;
  min-width: 140px;
}

.gig-ch-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  background: #eef2f7;
}

.gig-ch-grid-photo {
  height: 160px;
  object-fit: cover;
  background: #eef2f7;
}

.gig-ch-profile-photo {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #eef2f7;
  border: 1px solid var(--gig-border);
}

/* Guest / login */
body.gig-guest {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(145deg, #0a2540 0%, #0b3d91 55%, #00a3a1 140%);
  color: var(--gig-text);
}

.gig-guest-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gig-guest-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 0.75rem;
}

.gig-guest .gig-brand-mark {
  width: 52px;
  height: 52px;
  font-size: 1rem;
}

/* Toasts — unobtrusive professional feedback */
.gig-toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.gig-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.55rem;
  background: var(--gig-toast-bg);
  color: var(--gig-toast-fg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.88rem;
  animation: gig-toast-in 0.18s ease;
}
.gig-toast.success { border-left: 4px solid #22c55e; }
.gig-toast.error { border-left: 4px solid #ef4444; }
.gig-toast.warning { border-left: 4px solid #f59e0b; }
.gig-toast.info { border-left: 4px solid #3b82f6; }
.gig-toast .gig-toast-msg { flex: 1; }
.gig-toast .gig-toast-close {
  all: unset;
  cursor: pointer;
  opacity: 0.7;
  font-size: 1.1rem;
  line-height: 1;
}
@keyframes gig-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Collapsible form sections */
.gig-fieldset {
  border: 1px solid var(--gig-border);
  border-radius: var(--gig-radius);
  background: var(--gig-surface);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.gig-fieldset > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  font-weight: 650;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gig-muted);
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 61, 145, 0.03);
}
.gig-fieldset > summary::-webkit-details-marker { display: none; }
.gig-fieldset > summary::after {
  content: "▾";
  opacity: 0.55;
  transition: transform 0.15s ease;
}
.gig-fieldset:not([open]) > summary::after {
  transform: rotate(-90deg);
}
.gig-fieldset .gig-fieldset-body {
  padding: 0.75rem 0.85rem 0.9rem;
  border-top: 1px solid var(--gig-border);
}

/* KPI hover polish */
a .gig-kpi {
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
a:hover .gig-kpi {
  border-color: var(--gig-primary);
  box-shadow: 0 6px 16px rgba(11, 61, 145, 0.1);
  transform: translateY(-1px);
}

.gig-page-header h1 {
  letter-spacing: -0.02em;
}

/* Accessibility & commercial polish */
:focus-visible {
  outline: 2px solid var(--gig-accent);
  outline-offset: 2px;
}
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.gig-nav-link:focus-visible {
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--gig-accent) 35%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* Touch-friendly targets on tablets */
@media (pointer: coarse) {
  .btn, .gig-nav-link, .class-chip {
    min-height: 44px;
  }
}
/* Empty states */
.gig-empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--gig-muted);
  border: 1px dashed var(--gig-border);
  border-radius: var(--gig-radius);
  background: color-mix(in srgb, var(--gig-surface) 90%, var(--gig-bg));
}
.gig-empty-state i {
  font-size: 2rem;
  opacity: 0.55;
  display: block;
  margin-bottom: 0.75rem;
}
/* Skeleton loaders */
.gig-skeleton {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--gig-border) 60%, transparent) 25%,
    color-mix(in srgb, var(--gig-surface) 80%, var(--gig-border)) 50%,
    color-mix(in srgb, var(--gig-border) 60%, transparent) 75%);
  background-size: 200% 100%;
  animation: gig-skel 1.2s ease-in-out infinite;
  border-radius: 6px;
  min-height: 1rem;
}
@keyframes gig-skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* High contrast support */
@media (prefers-contrast: more) {
  :root, [data-theme="light"], [data-theme="dark"] {
    --gig-border: currentColor;
  }
  .btn, .form-control, .form-select {
    border-width: 2px;
  }
}

/* Responsive */
@media (max-width: 991.98px) {
  .gig-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

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

  .gig-footer span.mx-2 {
    display: none;
  }
}

/* =====================================================================
   Dashboard control center (operator / admin)
   ===================================================================== */

/* Header v2 */
.gig-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.gig-dash-header h1 {
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.gig-dash-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gig-dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.gig-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--gig-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--gig-surface) 92%, var(--gig-border));
  color: var(--gig-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}
.gig-chip .gig-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--gig-primary);
}
.gig-chip strong {
  color: var(--gig-text);
  font-weight: 600;
}
.gig-clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Stat cards — colored icon, subtext, hover */
.gig-stat-card {
  position: relative;
  border: 1px solid var(--gig-border);
  border-radius: var(--gig-radius);
  background: var(--gig-surface);
  box-shadow: var(--gig-shadow);
  height: 100%;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.gig-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--gig-primary);
  box-shadow: 0 8px 20px rgba(11, 61, 145, 0.12);
}
[data-theme="dark"] .gig-stat-card:hover {
  border-color: var(--gig-primary);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}
.gig-stat-card .card-body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
}
.gig-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.gig-stat-icon.tone-primary { background: color-mix(in srgb, var(--gig-primary) 14%, var(--gig-surface)); color: var(--gig-primary); }
.gig-stat-icon.tone-success { background: color-mix(in srgb, var(--gig-success) 15%, var(--gig-surface)); color: var(--gig-success); }
.gig-stat-icon.tone-warning { background: color-mix(in srgb, var(--gig-warning) 15%, var(--gig-surface)); color: var(--gig-warning); }
.gig-stat-icon.tone-danger  { background: color-mix(in srgb, var(--gig-danger) 15%, var(--gig-surface)); color: var(--gig-danger); }
.gig-stat-icon.tone-info    { background: color-mix(in srgb, var(--gig-accent) 15%, var(--gig-surface)); color: var(--gig-accent); }
.gig-stat-icon.tone-secondary { background: color-mix(in srgb, var(--gig-secondary) 18%, var(--gig-surface)); color: var(--gig-secondary); }
.gig-stat-body { flex: 1; min-width: 0; }
.gig-stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gig-text);
  font-variant-numeric: tabular-nums;
}
.gig-stat-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gig-muted);
  font-weight: 600;
}
.gig-stat-sub {
  font-size: 0.78rem;
  color: var(--gig-muted);
  margin-top: 0.2rem;
}
.gig-stat-sub .ok { color: var(--gig-success); }
.gig-stat-sub .warn { color: var(--gig-warning); }
.gig-stat-sub .bad { color: var(--gig-danger); }
.gig-stat-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

/* Print permission v2 card */
.gig-pp-panel {
  border: 1px solid var(--gig-border);
  border-radius: var(--gig-radius);
  background: var(--gig-surface);
  box-shadow: var(--gig-shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.gig-pp-panel .gig-pp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--gig-border);
}
.gig-pp-panel .gig-pp-head-title {
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.gig-pp-panel .gig-pp-body {
  padding: 1rem;
}
.gig-pp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}
.gig-pp-tile {
  border: 1px solid var(--gig-border);
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
  background: color-mix(in srgb, var(--gig-surface) 96%, var(--gig-border));
}
.gig-pp-tile .gig-pp-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gig-muted);
  margin-bottom: 0.25rem;
}
.gig-pp-tile .gig-pp-value {
  font-weight: 700;
  color: var(--gig-text);
  font-size: 0.95rem;
}
.gig-pp-disabled {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--gig-danger) 12%, var(--gig-surface));
  border: 1px solid color-mix(in srgb, var(--gig-danger) 35%, var(--gig-border));
  color: var(--gig-danger);
  font-weight: 600;
  font-size: 0.88rem;
}
.gig-pp-enabled {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--gig-success) 12%, var(--gig-surface));
  border: 1px solid color-mix(in srgb, var(--gig-success) 35%, var(--gig-border));
  color: var(--gig-success);
  font-weight: 600;
  font-size: 0.88rem;
}

/* Quick action cards */
.gig-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.gig-quick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--gig-border);
  border-radius: var(--gig-radius);
  background: var(--gig-surface);
  box-shadow: var(--gig-shadow);
  color: var(--gig-text);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.gig-quick:hover {
  transform: translateY(-1px);
  border-color: var(--gig-primary);
  box-shadow: 0 6px 16px rgba(11, 61, 145, 0.1);
  color: var(--gig-text);
}
.gig-quick .gig-quick-icon {
  width: 38px;
  height: 38px;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--gig-primary) 12%, var(--gig-surface));
  color: var(--gig-primary);
}
.gig-quick .gig-quick-body { min-width: 0; }
.gig-quick .gig-quick-title { font-weight: 650; font-size: 0.92rem; }
.gig-quick .gig-quick-sub { font-size: 0.74rem; color: var(--gig-muted); }

/* System status list */
.gig-status-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid var(--gig-border);
  background: color-mix(in srgb, var(--gig-surface) 96%, var(--gig-border));
  margin-bottom: 0.5rem;
}
.gig-status-item .gig-status-name { flex: 1; font-weight: 600; font-size: 0.88rem; }
.gig-status-item .gig-status-detail { font-size: 0.76rem; color: var(--gig-muted); }
.gig-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gig-status-dot.ok { background: var(--gig-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gig-success) 20%, transparent); }
.gig-status-dot.warn { background: var(--gig-warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gig-warning) 20%, transparent); }
.gig-status-dot.bad { background: var(--gig-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gig-danger) 20%, transparent); }
.gig-status-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.gig-status-badge.ok { color: var(--gig-success); }
.gig-status-badge.warn { color: var(--gig-warning); }
.gig-status-badge.bad { color: var(--gig-danger); }

/* Live pulsing badge */
.gig-badge-live {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--gig-border);
  color: var(--gig-muted);
  background: color-mix(in srgb, var(--gig-surface) 94%, var(--gig-border));
  white-space: nowrap;
}
.gig-badge-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gig-success);
  animation: gig-pulse 1.6s ease-in-out infinite;
}
.gig-badge-live.has-pending::before { background: var(--gig-warning); }
.gig-badge-live.has-error::before { background: var(--gig-danger); }
@keyframes gig-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* Today's production tiles */
.gig-prod-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
}
.gig-prod-tile {
  border: 1px solid var(--gig-border);
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--gig-surface) 96%, var(--gig-border));
  padding: 0.75rem 0.6rem;
  text-align: center;
}
.gig-prod-tile .gig-prod-value { font-size: 1.35rem; font-weight: 700; color: var(--gig-text); font-variant-numeric: tabular-nums; }
.gig-prod-tile .gig-prod-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gig-muted); }
.gig-prod-tile .gig-prod-value.ok { color: var(--gig-success); }
.gig-prod-tile .gig-prod-value.warn { color: var(--gig-warning); }
.gig-prod-tile .gig-prod-value.bad { color: var(--gig-danger); }
.gig-progress-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gig-surface) 88%, var(--gig-border));
  overflow: hidden;
}
.gig-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gig-success);
  transition: width 0.5s ease;
}

/* Recent activity highlight rows */
.gig-highlight-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid var(--gig-border);
  background: color-mix(in srgb, var(--gig-surface) 96%, var(--gig-border));
  margin-bottom: 0.5rem;
}
.gig-highlight-row .gig-highlight-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--gig-primary) 12%, var(--gig-surface));
  color: var(--gig-primary);
}
.gig-highlight-row .gig-highlight-title { font-weight: 600; font-size: 0.88rem; }
.gig-highlight-row .gig-highlight-meta { font-size: 0.74rem; color: var(--gig-muted); }

/* =====================================================================
   Dashboard polish (v2.3.22) — stat bars/trends, status pills,
   production tile icons, online users, focus states
   ===================================================================== */

/* Stat card progress bar + trend line */
.gig-stat-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.gig-stat-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gig-surface) 86%, var(--gig-border));
  overflow: hidden;
}
.gig-stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gig-primary), var(--gig-accent));
  transition: width 0.5s ease;
}
.gig-stat-bar-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gig-muted);
  font-variant-numeric: tabular-nums;
  min-width: 2.6em;
  text-align: right;
}
.gig-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gig-stat-trend.up { color: var(--gig-success); }
.gig-stat-trend.down { color: var(--gig-danger); }

/* System status — icon tile + pill badge */
.gig-status-item .gig-status-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.gig-status-icon.ok {
  background: color-mix(in srgb, var(--gig-success) 13%, var(--gig-surface));
  color: var(--gig-success);
}
.gig-status-icon.warn {
  background: color-mix(in srgb, var(--gig-warning) 13%, var(--gig-surface));
  color: var(--gig-warning);
}
.gig-status-icon.bad {
  background: color-mix(in srgb, var(--gig-danger) 13%, var(--gig-surface));
  color: var(--gig-danger);
}
.gig-status-item .gig-status-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.gig-status-item .gig-status-name {
  flex: none;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
}
.gig-status-item .gig-status-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gig-status-badge.ok {
  color: var(--gig-success);
  background: color-mix(in srgb, var(--gig-success) 13%, var(--gig-surface));
  border: 1px solid color-mix(in srgb, var(--gig-success) 30%, var(--gig-border));
}
.gig-status-badge.warn {
  color: var(--gig-warning);
  background: color-mix(in srgb, var(--gig-warning) 13%, var(--gig-surface));
  border: 1px solid color-mix(in srgb, var(--gig-warning) 30%, var(--gig-border));
}
.gig-status-badge.bad {
  color: var(--gig-danger);
  background: color-mix(in srgb, var(--gig-danger) 13%, var(--gig-surface));
  border: 1px solid color-mix(in srgb, var(--gig-danger) 30%, var(--gig-border));
}

/* Print permission pills */
.gig-pp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.gig-pp-pill.success {
  color: var(--gig-success);
  background: color-mix(in srgb, var(--gig-success) 13%, var(--gig-surface));
  border: 1px solid color-mix(in srgb, var(--gig-success) 30%, var(--gig-border));
}
.gig-pp-pill.danger {
  color: var(--gig-danger);
  background: color-mix(in srgb, var(--gig-danger) 13%, var(--gig-surface));
  border: 1px solid color-mix(in srgb, var(--gig-danger) 30%, var(--gig-border));
}
.gig-pp-muted {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gig-muted);
}

/* Today's production tiles — icon chip */
.gig-prod-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.45rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: color-mix(in srgb, var(--gig-primary) 12%, var(--gig-surface));
  color: var(--gig-primary);
}
.gig-prod-icon.ok {
  background: color-mix(in srgb, var(--gig-success) 13%, var(--gig-surface));
  color: var(--gig-success);
}
.gig-prod-icon.warn {
  background: color-mix(in srgb, var(--gig-warning) 13%, var(--gig-surface));
  color: var(--gig-warning);
}
.gig-prod-icon.bad {
  background: color-mix(in srgb, var(--gig-danger) 13%, var(--gig-surface));
  color: var(--gig-danger);
}

/* Online operators / users list */
.gig-online-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.gig-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--gig-primary) 14%, var(--gig-surface));
  color: var(--gig-primary);
  border: 1px solid color-mix(in srgb, var(--gig-primary) 30%, var(--gig-border));
}
.gig-online-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.gig-online-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gig-online-top strong { color: var(--gig-text); }
.gig-online-last { font-size: 0.74rem; color: var(--gig-muted); }
.gig-online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gig-success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gig-success) 22%, transparent);
}

/* Keyboard focus states */
.gig-quick:focus-visible {
  outline: 2px solid var(--gig-primary);
  outline-offset: 2px;
}
a:focus-visible > .gig-stat-card,
a:focus-visible > .gig-pp-panel,
a:focus-visible > .gig-quick {
  outline: 2px solid var(--gig-primary);
  outline-offset: 2px;
}

/* Responsive grid: 4 → 2 → 1 stats, 3 → 2 → 1 quick actions, 5 → 2 prod tiles */
@media (max-width: 991.98px) {
  .gig-quick-grid { grid-template-columns: repeat(2, 1fr); }
  .gig-prod-grid { grid-template-columns: repeat(3, 1fr); }
  .gig-pp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .gig-quick-grid { grid-template-columns: 1fr; }
  .gig-prod-grid { grid-template-columns: repeat(2, 1fr); }
  .gig-pp-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────
   Dashboard viewport / scroll / footer-clearance fix
   Scoped with :has(.gig-stat-card) — that class exists ONLY on
   the /dashboard page, so no other page (incl. Production Studio)
   is affected. Browsers without :has() simply keep prior behavior.

   Before: the dashboard grew the document; on short screens the
   trailing sections crowded into / slid under the bottom footer bar.
   After: the app shell fills exactly one viewport, header stays
   pinned, footer stays visible, and the dashboard content column
   scrolls vertically on its own.
   ───────────────────────────────────────────────────────────── */
body.gig-app:has(.gig-stat-card) #wrapper {
  height: 100vh;
}
body.gig-app:has(.gig-stat-card) .gig-main {
  height: 100%;
  min-height: 0; /* neutralize Bootstrap min-vh-100 inside fixed shell */
}
main.gig-content:has(.gig-stat-card) {
  overflow-y: auto;        /* vertical scroll when content exceeds space */
  overflow-x: hidden;      /* prevent a second (horizontal) scrollbar */
  padding-bottom: 2.75rem; /* proportional clearance above the app footer */
}


