/* ==========================================================================
   ERP vs ARS Location Analytics - Design System & Styles
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0a0f1d;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-input: #1f2937;
  --bg-input-border: #374151;
  --bg-table-header: #131d31;
  --bg-table-stripe: rgba(30, 41, 59, 0.3);
  --bg-table-hover: rgba(59, 130, 246, 0.08);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-rgb: 59, 130, 246;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #06b6d4;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  --glass-blur: blur(12px);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

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

body.theme-light {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-input-border: #d1d5db;
  --bg-table-header: #f8fafc;
  --bg-table-stripe: #f9fafb;
  --bg-table-hover: rgba(59, 130, 246, 0.06);

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(10, 15, 29, 0.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
}

body.theme-light .app-header {
  background-color: rgba(255, 255, 255, 0.85);
}

.header-container {
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
}

.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.brand-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 2px 4px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

body.theme-light .brand-icon-wrapper {
  background: rgba(15, 23, 42, 0.9);
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  display: block;
}

.brand-titles h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

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

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.status-pill--idle .status-dot { background-color: var(--text-muted); }
.status-pill--success .status-dot { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-pill--warning .status-dot { background-color: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-pill--error .status-dot { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
}

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

.btn-tertiary:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Main Layout */
.app-main {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-card {
  background-color: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}

/* Execution Control Bar */
.execution-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.execution-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.execution-left-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-group--inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-control, .form-select {
  background-color: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-with-icon .form-control {
  padding-left: 38px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.execution-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Switch */
.mismatch-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 158, 11, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input-border);
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--warning);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.switch-label {
  font-size: 0.84rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Notice Banner */
.notice-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.notice-banner.notice-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.metric-card {
  background-color: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon--blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.metric-icon--green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.metric-icon--amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.metric-icon--purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; }

.metric-content {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 2px 0;
}

.metric-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 450px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrapper input {
  width: 100%;
  padding-left: 38px;
}

.filter-dropdowns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Table */
.table-container {
  overflow-x: auto;
  max-height: 600px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.79rem;
}

.data-table th {
  background-color: var(--bg-table-header);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 8px 6px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--border-color);
  user-select: none;
  white-space: nowrap;
  font-size: 0.76rem;
}

.data-table th.sortable {
  cursor: pointer;
}

.data-table th.sortable:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.sort-indicator {
  display: inline-block;
  margin-left: 2px;
  font-size: 0.72rem;
  color: var(--primary);
}

.data-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.78rem;
}

/* Individual Column Fit & Alignment Rules */
/* 1. Company */
.data-table th:nth-child(1), .data-table td:nth-child(1) {
  text-align: center;
  width: 44px;
  padding-left: 10px;
}

/* 2. Emp Code */
.data-table th:nth-child(2), .data-table td:nth-child(2) {
  text-align: center;
  width: 68px;
}
.data-table td:nth-child(2) code {
  font-size: 0.74rem;
  padding: 1px 4px;
}

/* 3. Employee Name */
.data-table th:nth-child(3), .data-table td:nth-child(3) {
  min-width: 125px;
  max-width: 200px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  font-weight: 600;
}

/* 4. Designation */
.data-table th:nth-child(4), .data-table td:nth-child(4) {
  min-width: 110px;
  max-width: 180px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* 5. Cat */
.data-table th:nth-child(5), .data-table td:nth-child(5) {
  text-align: center;
  width: 36px;
}

/* 6. Status */
.data-table th:nth-child(6), .data-table td:nth-child(6) {
  text-align: center;
  width: 58px;
  font-size: 0.74rem;
}

/* 7. Shift */
.data-table th:nth-child(7), .data-table td:nth-child(7) {
  text-align: center;
  width: 42px;
}

/* 8. ERP Location */
.data-table th:nth-child(8), .data-table td:nth-child(8) {
  text-align: center;
  width: 78px;
}

/* 9. ARS Today */
.data-table th:nth-child(9), .data-table td:nth-child(9) {
  text-align: center;
  width: 78px;
}

/* 10. ARS Day 1 */
.data-table th:nth-child(10), .data-table td:nth-child(10) {
  text-align: center;
  width: 68px;
  font-size: 0.76rem;
}

/* 11. ARS Day 2 */
.data-table th:nth-child(11), .data-table td:nth-child(11) {
  text-align: center;
  width: 68px;
  font-size: 0.76rem;
}

/* 12. ARS Day 3 */
.data-table th:nth-child(12), .data-table td:nth-child(12) {
  text-align: center;
  width: 68px;
  font-size: 0.76rem;
}

/* 13. Variance */
.data-table th:nth-child(13), .data-table td:nth-child(13) {
  text-align: center;
  width: 82px;
  padding-right: 10px;
}

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

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

.data-table tr.row-mismatch {
  background-color: rgba(245, 158, 11, 0.05);
}

/* Cell Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-match {
  background-color: var(--success-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-mismatch {
  background-color: var(--warning-bg);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.loc-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: help;
  position: relative;
}

.loc-pill[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  pointer-events: none;
}

.diff-cell {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-weight: 600;
}

/* Empty State */
.empty-box {
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

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

/* Table Footer & Pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-select--sm {
  padding: 4px 8px;
  font-size: 0.8rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-current {
  padding: 0 8px;
  font-weight: 500;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 190px;
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-primary);
  text-align: left;
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: rgba(59, 130, 246, 0.12);
  color: var(--primary);
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-title-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-title-group p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 36px;
}

.btn-password-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.test-result-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.test-result-box.success {
  background: var(--success-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.test-result-box.error {
  background: var(--danger-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

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

/* Spinner */
.spinner {
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 900px) {
  .header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .header-left, .header-center, .header-right {
    width: 100%;
    justify-content: center;
  }
  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .execution-form {
    flex-direction: column;
    align-items: stretch;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrapper {
    max-width: 100%;
  }
}

/* ==========================================================================
   User Profile Badge & Logout (Header)
   ========================================================================== */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-role {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.badge-role--admin {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-role--user {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* ==========================================================================
   Login Modal & Overlay
   ========================================================================== */
.modal-overlay--login {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
}

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

.login-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-error {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-align: center;
}

.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 11px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 10px;
}

.login-hints {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hint-item code {
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
  padding: 2px 5px;
  border-radius: 4px;
}
