/* ============================================
   enxcl Workflow — Base Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #D4950C;
  --primary-hover: #B57E0A;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #2d3748;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --bg-surface: #ffffff;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg: #121212;
  --bg-surface: #1e1e1e;
  --bg-card: #1e1e1e;
  --text: #e0e0e0;
  --text-light: #9e9e9e;
  --border: #2e2e2e;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .btn-google {
  background: #334155;
  border-color: #475569;
}

[data-theme="dark"] .btn-google:hover {
  background: #475569;
}

[data-theme="dark"] .card .form-input,
[data-theme="dark"] .card .form-select,
[data-theme="dark"] .card .form-textarea {
  background: #121212;
}

input[type="date"] {
  color-scheme: dark;
}

[data-theme="dark"] .stat-card-blue .stat-label { color: #60a5fa; }
[data-theme="dark"] .stat-card-amber .stat-label { color: #fbbf24; }
[data-theme="dark"] .stat-card-green .stat-label { color: #4ade80; }
[data-theme="dark"] .stat-card-red .stat-label { color: #f87171; }

/* --- Theme Toggle --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.theme-toggle:hover {
  background: rgba(212, 149, 12, 0.1);
}

/* Logo switching for dark/light mode */
.brand-logo-dark,
.login-logo-dark { display: none; }

[data-theme="dark"] .brand-logo-light,
[data-theme="dark"] .login-logo-light { display: none; }

[data-theme="dark"] .brand-logo-dark,
[data-theme="dark"] .login-logo-dark { display: inline; }

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

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

/* --- Layout --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* --- Navbar --- */
.navbar {
  background: var(--bg-surface);
  color: var(--text);
  border-bottom: 3px solid var(--primary);
  box-shadow: var(--shadow);
  padding: 0 16px;
}

.navbar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  position: relative;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

/* DEV marker on the development project (js/app.js) */
.env-badge {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--warning, #f59e0b);
  color: #1e293b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.brand-logo {
  height: 56px;
  width: auto;
  flex-shrink: 0;
}


.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  white-space: nowrap;
  margin-left: auto;
}

#user-name {
  color: var(--text);
}

/* --- Notification Bell --- */
.notification-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.notification-bell:hover {
  background: rgba(212, 149, 12, 0.1);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Notification Panel --- */
.notification-wrap {
  position: relative;
}

.notification-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  width: 340px;
  max-height: 420px;
  z-index: 110;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notification-panel[hidden],
.notification-badge[hidden] {
  display: none;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
}
.btn-link:hover {
  text-decoration: underline;
}

.notification-list {
  overflow-y: auto;
  flex: 1;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notification-item:last-child {
  border-bottom: none;
}
.notification-item:hover {
  background: rgba(212, 149, 12, 0.06);
}
.notification-item.unread {
  background: rgba(212, 149, 12, 0.08);
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.dot-action {
  background: var(--primary);
}
.dot-approved {
  background: var(--success);
}
.dot-rejected {
  background: var(--danger);
}
.dot-fyi {
  background: var(--text-light);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.notification-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.notification-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

/* --- Menu Toggle (hamburger) --- */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.menu-toggle:hover {
  background: rgba(212, 149, 12, 0.1);
}

/* --- Dropdown Menu --- */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 220px;
  padding: 4px 0;
  z-index: 100;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  transition: background 0.15s;
}

.dropdown-item[hidden] {
  display: none;
}
.dropdown-item:hover {
  background: rgba(212, 149, 12, 0.08);
}

.dropdown-item.active {
  color: var(--primary);
  background: rgba(212, 149, 12, 0.1);
  font-weight: 600;
}

.dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.dropdown-item-danger {
  color: var(--danger);
}

.dropdown-item-danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.dropdown-divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap; /* "+ New Request" stays one line */
}

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

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

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


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

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

.btn-small {
  padding: 6px 12px;
  min-height: 32px;
  font-size: 13px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  color: #ffffff;
  border: 1px solid #475569;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg-surface);
  color: var(--text);
  min-height: 44px;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212, 149, 12, 0.15);
}

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

/* --- Status Badges --- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap; /* "IN PROGRESS" must not break over two lines */
}

.badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.badge-approved {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success);
}

.badge-rejected {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}

.badge-draft {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-light);
}

/* --- Tables --- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Avatar --- */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* --- Login Page --- */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.login-card {
  background: var(--bg-surface);
  color: var(--text);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow);
  max-width: 400px;
  width: 100%;
}

.login-logo {
  margin-bottom: 24px;
}

.login-logo-img {
  height: 100px;
  width: auto;
  margin-bottom: 24px;
}


.login-hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-light);
}

.btn-google {
  background: var(--text);
  border: 1px solid var(--text);
  color: #ffffff;
  padding: 12px 24px;
  font-size: 16px;
  gap: 8px;
  box-shadow: var(--shadow);
  width: 100%;
}

.btn-google:hover {
  background: #334155;
}

/* --- Auth Error --- */
.auth-error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: 48px 16px;
}

.card .text-light,
.card .empty-state {
  color: #e2e8f0;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* --- Loading --- */
.loading {
  text-align: center;
  padding: 32px;
  color: var(--text-light);
}

/* --- Utilities --- */
.text-light { color: var(--text-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* --- Admin Styles --- */
.template-card {
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.template-name {
  font-size: 18px;
}

.template-desc {
  margin-bottom: 8px;
}

.template-meta {
  font-size: 13px;
  color: #fff;
}

.template-actions {
  display: flex;
  gap: 8px;
}

.stage-card {
  border-left: 3px solid var(--primary);
  transition: opacity 0.15s, box-shadow 0.15s;
}

.draggable-stage {
  cursor: grab;
}

.draggable-stage:active {
  cursor: grabbing;
}

.stage-card.dragging {
  opacity: 0.3;
}


.drag-handle {
  color: #fff;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.form-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: grab;
  transition: border-color 0.15s, opacity 0.15s;
}
.form-field-row:hover {
  border-color: var(--primary);
}
.form-field-row.dragging {
  opacity: 0.3;
}
.form-field-info {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.form-field-row .text-light {
  color: #fff;
}

.stage-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.assignee-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #475569;
}

.assignee-row:last-child {
  border-bottom: none;
}

.assignee-info {
  flex: 1;
  font-size: 14px;
}

/* Workflow editor: people allowed to submit an admin-only workflow */
.submitters-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #475569;
  border-radius: 8px;
}

.submitters-editor > .text-light {
  font-size: 13px;
  margin: 0;
}

.submitters-editor[hidden] {
  display: none;
}

.submitters-editor .form-label,
.submitters-editor .form-group {
  margin: 0;
}

.search-results {
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  margin-top: 4px;
  padding: 4px 12px;
}

.search-results:empty {
  display: none;
}

.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #475569;
  font-size: 14px;
}

.search-result-row:last-child {
  border-bottom: none;
}

/* Dynamic assignee info */
.dynamic-assignee-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: rgba(212, 149, 12, 0.1);
  border: 1px solid rgba(212, 149, 12, 0.3);
  border-radius: 6px;
  font-size: 13px;
  color: #f5c542;
  line-height: 1.5;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(212, 149, 12, 0.25);
  color: #f5c542;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
}

.assignee-mode-row {
  padding-bottom: 12px;
  border-bottom: 1px solid #475569;
}

/* User profile cards */
.profile-hierarchy {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #475569;
}

.hierarchy-item {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.hierarchy-label {
  color: #fff;
  font-weight: 600;
}

.hierarchy-value {
  color: #fff;
}

.selected-user {
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
}

.selected-user-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
}

.selected-user-inline[hidden] {
  display: none;
}

.btn-clear {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}

.btn-clear:hover {
  color: var(--danger);
}

/* Profile setup page */
.profile-setup-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 16px;
}

.profile-setup-header {
  text-align: center;
  margin-bottom: 24px;
}

.profile-setup-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.profile-setup-header p {
  font-size: 14px;
  line-height: 1.5;
}

/* Navbar profile link */
.navbar-profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.navbar-profile-link:hover {
  opacity: 0.8;
}

/* My Profile page */
.profile-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  margin-bottom: 16px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-email {
  font-size: 14px;
}

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

.profile-details-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.profile-field-value {
  font-size: 15px;
  font-weight: 500;
}

@media (max-width: 480px) {
  .profile-details-grid {
    grid-template-columns: 1fr;
  }
}

/* Form inputs inside dark cards */
.card .form-input,
.card .form-select,
.card .form-textarea {
  background: #1e293b;
  color: #ffffff;
  border-color: #475569;
}

.card .form-label {
  color: #fff;
}

/* --- Workflow Overview (Admin Dashboard) --- */
.overview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card-selected {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.stat-card-blue.stat-card-selected { outline-color: #3b82f6; }
.stat-card-amber.stat-card-selected { outline-color: #f59e0b; }
.stat-card-green.stat-card-selected { outline-color: #16a34a; }
.stat-card-red.stat-card-selected { outline-color: #dc2626; }

.stat-card-blue { background: rgba(59, 130, 246, 0.1); }
.stat-card-amber { background: rgba(245, 158, 11, 0.1); }
.stat-card-green { background: rgba(22, 163, 74, 0.1); }
.stat-card-red { background: rgba(220, 38, 38, 0.1); }

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

.stat-card-blue .stat-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-card-amber .stat-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-card-green .stat-icon { background: rgba(22, 163, 74, 0.15); color: #16a34a; }
.stat-card-red .stat-icon { background: rgba(220, 38, 38, 0.15); color: #dc2626; }

.stat-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card-blue .stat-number { color: #3b82f6; }
.stat-card-amber .stat-number { color: #f59e0b; }
.stat-card-green .stat-number { color: #16a34a; }
.stat-card-red .stat-number { color: #dc2626; }

.stat-label {
  font-size: 13px;
  margin-top: 2px;
}

.stat-card-blue .stat-label { color: #2563eb; }
.stat-card-amber .stat-label { color: #d97706; }
.stat-card-green .stat-label { color: #15803d; }
.stat-card-red .stat-label { color: #b91c1c; }

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}


.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* Bar chart */
/* Overview filtered table */
.overview-table-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.8fr 0.8fr;
  gap: 8px;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #475569;
}

.overview-table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.8fr 0.8fr;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  font-size: 14px;
  color: #ffffff;
  border-bottom: 1px solid #475569;
  transition: background 0.15s;
}

.overview-table-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.overview-table-row:last-child {
  border-bottom: none;
}

.overview-table-name {
  font-weight: 500;
}

.bar-chart-wrap {
  padding: 8px 0;
}

.bar-chart-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
}

.bar-chart-area {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.bar-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 28px;
  min-width: 28px;
}

.bar-y-tick {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  flex: 1;
}

.bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bar-stack {
  display: flex;
  flex-direction: column;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  min-height: 4px;
}

.bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4px;
}

.bar-approved {
  background: #16a34a;
}

.bar-rejected {
  background: #dc2626;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.bar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-filter {
  display: flex;
  gap: 6px;
}

.btn-show-all {
  width: 100%;
  text-align: center;
  font-size: 13px;
}

.arrow-icon {
  margin-left: 4px;
}

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.activity-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.activity-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: modalFadeIn 0.15s ease;
}

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

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  animation: modalSlideUp 0.15s ease;
}

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

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-bottom: 16px;
}
.modal-icon-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.modal-icon-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-message {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 20px;
  white-space: pre-line; /* lists of problems from the server, one per line */
}

.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn {
  flex: 1;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .navbar-inner {
    height: auto;
    padding: 12px 0;
  }

  .navbar-user {
    margin-left: auto;
  }

  .overview-stats {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 8px;
  }
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-light);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* --- Scrollable List Containers --- */
.scrollable-list {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
  min-height: 200px;
  padding-right: 4px;
}

.scrollable-list::-webkit-scrollbar {
  width: 6px;
}

.scrollable-list::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.scrollable-list::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* --- Request Rows --- */
.request-row {
  padding: 16px 20px;
  margin-bottom: 8px;
  cursor: default;
}

.request-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.request-template-name {
  font-weight: 600;
  font-size: 15px;
}

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

/* --- Template Picker Grid --- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.template-pick-card {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  border: 1px solid transparent;
}

.template-pick-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* --- Currency Input --- */
.currency-input-wrap {
  display: flex;
  gap: 8px;
}

.currency-input-wrap .form-input {
  flex: 1;
}

.currency-input-wrap .form-select {
  width: 100px;
  flex-shrink: 0;
}

/* --- Asset List Field --- */
.asset-list-field {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #1e293b;
  color: #fff;
}

.asset-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.asset-row .form-input {
  flex: 1;
  min-width: 0;
}

.asset-row .form-input:first-child {
  flex: 2;
}

.asset-remove-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  color: #fff;
}

.asset-check-item:hover {
  background: rgba(212, 149, 12, 0.06);
}

.asset-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

/* --- Asset Return Summary (approval/request detail) --- */
.asset-return-summary {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.asset-summary-header {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.asset-summary-item {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  font-size: 14px;
  color: #fff;
  border-top: 1px solid var(--border);
}

.asset-summary-name {
  font-weight: 500;
  color: #fff;
}

.asset-summary-tag {
  color: #fff;
  font-size: 13px;
}

.asset-summary-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
}

.asset-summary-status.status-returning {
  color: var(--success);
}

.asset-summary-status.status-kept {
  color: var(--danger);
}

.asset-summary-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-returning .asset-summary-status-dot {
  background: var(--success);
}

.status-kept .asset-summary-status-dot {
  background: var(--danger);
}

.asset-summary-counts {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
  color: #fff;
}

.asset-summary-counts span {
  font-weight: 600;
}

.asset-count-returning span {
  color: var(--success);
}

.asset-count-kept span {
  color: var(--danger);
}

/* --- Stage Checklist (admin-defined, shown to assignees during approval) --- */
.stage-checklist {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stage-checklist-header {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.stage-checklist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 14px;
  color: #fff;
}

.stage-checklist-row:hover {
  background: rgba(212, 149, 12, 0.06);
}

.stage-checklist-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--success);
}

.stage-checklist-status {
  padding: 10px 16px;
  font-size: 13px;
  color: #fff;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.checklist-icon-done {
  color: var(--success);
  font-weight: 700;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.checklist-icon-pending {
  color: var(--danger);
  font-weight: 700;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* --- Admin checklist editor (in stage card) --- */
.stage-checklist-editor {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.checklist-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: #fff;
}

/* --- User Picker --- */
.user-picker-wrap {
  position: relative;
}

.user-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}

.user-picker-dropdown[hidden] {
  display: none;
}

.user-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-picker-item:hover {
  background: rgba(212, 149, 12, 0.08);
}

.user-picker-name {
  font-weight: 500;
  font-size: 14px;
  color: #fff;
}

.user-picker-email {
  font-size: 12px;
  color: #fff;
}

/* --- Approval Detail Page --- */
.approval-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 12px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 14px;
  font-weight: 500;
}

.form-data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #475569;
}

.form-data-row:last-of-type {
  border-bottom: none;
}

.form-data-label {
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  margin-right: 16px;
  color: #fff;
}

.form-data-value {
  font-size: 14px;
  text-align: right;
  word-break: break-word;
  color: #fff;
}

.action-history-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.action-history-item:last-child {
  border-bottom: none;
}

.action-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.dot-approved {
  background: var(--success);
}

.dot-rejected {
  background: var(--danger);
}

.dot-comment {
  background: var(--text-light);
}

.action-history-top {
  font-size: 14px;
  font-weight: 500;
}

.action-history-comment {
  font-size: 13px;
  color: #fff;
  margin-top: 4px;
  font-style: italic;
}

.action-history-checklist {
  margin-top: 6px;
  padding: 6px 0;
}

.action-history-checklist-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #fff;
  padding: 2px 0;
}

.action-history-time {
  font-size: 12px;
  color: #fff;
  margin-top: 2px;
}

.approval-action-card {
  border: 2px solid var(--primary);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.btn-success:hover {
  background: #15803d;
}

/* ============================================
   Phones and touch screens (Nov 2026 phone check)
   Approvers often act from their phone once emails arrive.
   ============================================ */

/* Touch screens: every tappable control at least 44px tall (design guideline) */
@media (pointer: coarse) {
  .btn-small,
  .filter-btn {
    min-height: 44px;
  }

  .notification-bell,
  .menu-toggle,
  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .form-input,
  .form-select {
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  /* Same 44px touch sizes on any phone-width screen */
  .btn-small,
  .filter-btn,
  .form-input,
  .form-select {
    min-height: 44px;
  }

  .notification-bell,
  .menu-toggle,
  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  /* Rows of buttons wrap instead of running off the screen */
  .flex.gap-8 {
    flex-wrap: wrap;
  }

  /* Navbar was ~60px wider than a phone screen: the name is on the profile
     page anyway, so show only the avatar, and use a smaller logo */
  #user-name {
    display: none;
  }

  .navbar-user {
    gap: 8px;
  }

  .brand-logo {
    height: 40px;
  }

  /* Page titles with buttons beside them: stack instead of squeezing the
     title into a narrow column */
  .page-header,
  .flex-between {
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-header > div:first-child,
  .flex-between > .page-header {
    flex: 1 1 100%;
  }

  /* Request details: label above value, so long answers (reasons,
     descriptions) use the full width instead of a narrow right column */
  .form-data-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .form-data-label {
    margin-right: 0;
  }

  .form-data-value {
    text-align: left;
  }
}

/* Shown while the device is offline (js/app.js watchConnection) */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--warning);
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

