/* ==========================================================================
   AI Superintendent Dashboard — Design System
   Dark theme with gold accent
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Design Tokens (Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-primary: #0D1117;
  --bg-card: #161B22;
  --bg-tertiary: #1C2128;
  --border-color: #30363D;

  /* Accent */
  --gold: #E8A42A;
  --gold-hover: #F0B644;
  --gold-dim: #E8A42A33;

  /* Text */
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted: #6E7681;

  /* Semantic */
  --success: #3FB950;
  --error: #F85149;
  --blue: #58A6FF;

  /* Typography */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 60px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* --------------------------------------------------------------------------
   1. Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   2. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.section-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }

.section-title {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--gold);
}

.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-blue    { color: var(--blue); }

small, .text-sm {
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   3. Loading Screen
   -------------------------------------------------------------------------- */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}

.loading-screen .logo {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}

.loading-screen .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-screen .loading-text {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  transition: width 0.25s ease;
}

.main-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.25s ease;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.page-content {
  padding: 24px 32px;
}

/* --------------------------------------------------------------------------
   5. Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-logo span {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-primary);
}

.sidebar-collapsed .sidebar-logo span,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-user-info {
  display: none;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  text-decoration: none;
}

.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-dim);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.sidebar-user-info {
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-user-info .name {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.sidebar-user-info .role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-toggle {
  position: absolute;
  top: 16px;
  right: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  transition: color 0.15s;
}

.sidebar-toggle:hover {
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */
.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header .page-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-bell {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.notification-bell:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.notification-bell .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  font-size: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.user-dropdown:hover {
  background: var(--bg-tertiary);
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--gold-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   8. DataTable
   -------------------------------------------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  transition: opacity 0.15s;
}

.data-table th.sorted .sort-arrow {
  opacity: 1;
  color: var(--gold);
}

.data-table th.sorted-desc .sort-arrow {
  transform: rotate(180deg);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tbody tr:nth-child(odd) {
  background: var(--bg-card);
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg-primary);
}

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

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.table-pagination .page-buttons {
  display: flex;
  gap: 4px;
}

.table-pagination .page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.table-pagination .page-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.table-pagination .page-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-primary);
}

/* --------------------------------------------------------------------------
   9. Status Badge
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-ready {
  background: #8B949E22;
  color: var(--text-secondary);
}

.badge-pending {
  background: var(--gold-dim);
  color: var(--gold);
}

.badge-active,
.badge-in-progress {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold);
}

.badge-completed {
  background: #3FB95022;
  color: var(--success);
}

.badge-blocked {
  background: #F8514922;
  color: var(--error);
}

.badge-canceled {
  background: #6E768122;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. Forms
   -------------------------------------------------------------------------- */
label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B949E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row > * {
  flex: 1;
}

/* --------------------------------------------------------------------------
   11. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-primary);
}

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

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-secondary:hover {
  background: var(--gold-dim);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background: #e5433c;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   12. Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: var(--font-heading);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   13. Tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.tab {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  padding: 12px 20px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

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

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --------------------------------------------------------------------------
   14. Chat Widget
   -------------------------------------------------------------------------- */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
}

.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, transform 0.15s;
}

.chat-toggle:hover {
  background: var(--gold-hover);
  transform: scale(1.05);
}

.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 901;
  animation: slideIn 0.3s ease;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--gold);
  color: var(--bg-primary);
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
}

/* --------------------------------------------------------------------------
   15. Grid & Spacing Utilities
   -------------------------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.flex-row {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-wrap { flex-wrap: wrap; }

.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }

.p-16 { padding: 16px; }
.p-24 { padding: 24px; }

.w-full { width: 100%; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  .sidebar .nav-label,
  .sidebar .sidebar-user-info,
  .sidebar .sidebar-logo span {
    display: none;
  }
  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .chat-panel {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 16px;
  }

  .header {
    padding: 0 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }

  .table-pagination {
    flex-direction: column;
    gap: 12px;
  }
}

/* --------------------------------------------------------------------------
   17. Animations
   -------------------------------------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

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

/* --------------------------------------------------------------------------
   18. Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state .empty-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state .empty-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 360px;
}

/* --------------------------------------------------------------------------
   19. Login Page
   -------------------------------------------------------------------------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 0.4s ease;
}

.login-card .login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.login-card .login-logo img {
  width: 64px;
  height: 64px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 8px;
}

.login-card .login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 32px;
}

.login-card .form-group:last-of-type {
  margin-bottom: 24px;
}

.login-card .btn-primary {
  width: 100%;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Scrollbar Styling (Webkit)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Patches — alias classes used by React components
   ========================================================================== */

/* Layout aliases (components.js uses dashboard-main/dashboard-content) */
.dashboard-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.25s ease;
  display: flex;
  flex-direction: column;
}
.sidebar-collapsed ~ .dashboard-main { margin-left: var(--sidebar-collapsed-width); }
.dashboard-content { flex: 1; overflow-y: auto; }

/* Sidebar nav items (components.js uses sidebar-nav-item / sidebar-nav-icon / sidebar-nav-label) */
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text-secondary); font-size: 14px; font-weight: 500; border-left: 3px solid transparent; text-decoration: none; transition: all 0.15s; cursor: pointer; white-space: nowrap; }
.sidebar-nav-item:hover { color: var(--text-primary); background: var(--bg-tertiary); text-decoration: none; }
.sidebar-nav-item.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-dim); }
.sidebar-nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sidebar-nav-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar-badge { background: var(--error); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-left: auto; }

/* Sidebar bottom */
.sidebar-bottom { border-top: 1px solid var(--border-color); padding: 12px 16px; }
.sidebar-company { margin-bottom: 8px; }
.sidebar-company-name { font-size: 13px; color: var(--text-secondary); display: block; }
.sidebar-signout { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 0; font-family: var(--font-body); }
.sidebar-signout:hover { color: var(--gold); }
.sidebar-collapse-btn { background: none; border: 1px solid var(--border-color); color: var(--text-muted); width: 100%; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 14px; margin-top: 4px; }
.sidebar-collapse-btn:hover { color: var(--gold); border-color: var(--gold); }
.sidebar-logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 18px; letter-spacing: 2px; color: var(--text-primary); }

/* Header (components.js) */
.dashboard-header { padding: 16px 32px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; background: var(--bg-primary); }
.dashboard-header h2 { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }

/* Page header */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-family: var(--font-heading); font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.page-actions { display: flex; gap: 12px; align-items: center; }

/* Job detail extras */
.btn-back { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 14px; font-weight: 600; padding: 4px 0; margin-bottom: 16px; font-family: var(--font-body); }
.btn-back:hover { text-decoration: underline; }
.job-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.job-header-left h1 { margin-bottom: 2px; }
.job-stats-bar { display: flex; gap: 24px; margin-bottom: 16px; }
.job-stat { text-align: center; }
.job-stat-val { font-family: var(--font-heading); font-size: 24px; font-weight: 800; color: var(--gold); display: block; }
.job-stat-lbl { font-size: 12px; color: var(--text-muted); }

/* Schedule view */
.schedule-view { display: flex; flex-direction: column; gap: 16px; }
.schedule-day { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.schedule-day-today { border-color: var(--gold); }
.schedule-day-past { opacity: 0.6; }
.schedule-day-header { padding: 12px 16px; background: var(--bg-tertiary); display: flex; justify-content: space-between; align-items: center; }
.schedule-day-header h4 { font-family: var(--font-heading); font-size: 16px; margin: 0; }
.schedule-tasks { padding: 8px 16px; display: flex; flex-direction: column; gap: 6px; }
.schedule-task { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.schedule-task:last-child { border-bottom: none; }
.schedule-task-left { display: flex; align-items: center; gap: 10px; }
.schedule-task-title { font-size: 14px; }
.schedule-task-right { display: flex; align-items: center; gap: 8px; }
.badge-worker { background: var(--bg-tertiary); color: var(--text-secondary); font-size: 12px; padding: 3px 8px; border-radius: 6px; }

/* Jobs grid */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card-clickable { cursor: pointer; transition: all 0.2s; }
.card-clickable:hover { border-color: var(--gold); transform: translateY(-2px); }
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-title { font-family: var(--font-heading); font-size: 18px; margin: 0; }
.card-stats-row { display: flex; gap: 16px; }
.card-stat { text-align: center; flex: 1; }
.card-stat-value { font-family: var(--font-heading); font-size: 20px; font-weight: 800; color: var(--gold); display: block; }
.card-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

/* Quick actions */
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Table enhancements */
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--bg-tertiary) !important; }
.task-cell { display: flex; flex-direction: column; gap: 2px; }
.task-title { font-weight: 600; }

/* Button sizes */
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-success { background: var(--success); color: #fff; border: none; cursor: pointer; font-weight: 600; border-radius: 8px; padding: 8px 16px; }

/* Progress bar */
.progress-bar-container { background: var(--bg-tertiary); border-radius: 8px; height: 8px; overflow: hidden; }
.progress-bar { background: var(--gold); height: 100%; border-radius: 8px; transition: width 0.3s; min-width: 2px; }

/* Video thumb placeholder */
.video-thumb { background: var(--bg-tertiary); border-radius: 8px; height: 120px; display: flex; align-items: center; justify-content: center; }
.video-play-icon { font-size: 32px; opacity: 0.5; }

/* Billing */
.billing-plan { margin-top: 16px; }
.billing-plan-name { font-family: var(--font-heading); font-size: 24px; font-weight: 800; color: var(--gold); }
.billing-plan-price { font-size: 32px; font-weight: 700; margin-top: 4px; }

/* Updates list */
.updates-list { display: flex; flex-direction: column; gap: 12px; }

/* Login container */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); padding: 24px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo svg { color: var(--gold); margin-bottom: 8px; }
.login-logo h1 { font-family: var(--font-heading); font-size: 28px; font-weight: 900; letter-spacing: 3px; margin: 0; }
.login-logo p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.login-error { background: rgba(248,81,73,0.1); border: 1px solid var(--error); color: var(--error); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.login-tagline { color: var(--text-secondary); text-align: center; margin-bottom: 24px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.login-form input { width: 100%; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 16px; color: var(--text-primary); font-size: 15px; font-family: var(--font-body); outline: none; }
.login-form input:focus { border-color: var(--gold); }
.login-form input::placeholder { color: var(--text-muted); }
.login-submit-btn { width: 100%; background: var(--gold); color: var(--bg-primary); font-family: var(--font-heading); font-weight: 800; font-size: 16px; padding: 14px; border-radius: 10px; border: none; cursor: pointer; letter-spacing: 1px; text-transform: uppercase; margin-top: 8px; transition: all 0.2s; }
.login-submit-btn:hover { background: var(--gold-hover); }
.login-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Spacing utilities */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-secondary); }
