/* Modern Reset & Base Design System */
:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(26, 36, 57, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  
  --glass-blur: blur(12px);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Overlay & Loading Spinner */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: var(--glass-blur);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
.spinner-container {
  text-align: center;
  color: var(--text-primary);
}
.premium-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top: 3px solid transparent;
  border-image: var(--primary-gradient);
  border-image-slice: 1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Auth Cards */
.auth-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.4s ease-out;
}
.auth-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  padding: 40px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.premium-icon-gradient {
  font-size: 3rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 15px;
}
.auth-logo h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.auth-logo p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.auth-card h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.auth-card .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Form Styles */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}
.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.input-group input, .input-group select, .input-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition-fast);
}
select option {
  background-color: #0b0f19;
  color: #f3f4f6;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.input-group textarea {
  resize: vertical;
  min-height: 100px;
}
.forgot-pwd-link-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
  font-size: 0.85rem;
}
.forgot-pwd-link-container a, .auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}
.forgot-pwd-link-container a:hover, .auth-switch a:hover {
  text-decoration: underline;
  color: #a855f7;
}
.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-half {
  flex: 1;
}
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
}
.btn-success {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}
.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.4);
}
.btn-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fde68a;
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.4);
}
.btn-small {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: 8px;
}
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 8px;
  border-radius: 8px;
}
.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-header {
  background: rgba(7, 10, 19, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-image-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}
.icon-logo {
  color: white;
  font-size: 1.3rem;
}
.logo-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.logo-text h2 {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 14px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition-fast);
}
.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 10px rgba(168, 85, 247, 0.15);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px 16px 6px 6px;
}
.user-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient, var(--primary));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.2;
}
#user-email-display {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.user-profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--border-color);
  padding-left: 14px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Modal Tab Navigation Styling */
.modal-tabs button.active {
  background: var(--primary, #00A3A9) !important;
  color: white !important;
  border-color: var(--primary, #00A3A9) !important;
  box-shadow: 0 4px 10px rgba(0, 163, 169, 0.2);
}
.modal-tabs::-webkit-scrollbar {
  display: none;
}
.modal-tabs {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tenant-type-option:hover,
.tenant-type-option:focus-visible {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--primary, #00A3A9) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.tenant-type-option:focus-visible {
  outline: 3px solid var(--primary, #00A3A9);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .tenant-management-header,
  .tenant-management-actions {
    align-items: stretch !important;
    flex-direction: column;
  }

  .tenant-management-header {
    gap: 16px;
  }

  .tenant-management-actions .btn {
    justify-content: center;
    width: 100%;
  }
}
.badge.admin {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}
.badge.operator {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}
.badge.user {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* Main Content Panes */
.main-content {
  flex: 1;
  padding: 40px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}
.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}
.tab-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.tab-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.tab-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-counter {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0 16px;
  border-radius: 12px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

#cases-page-size-select {
  height: 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 0 16px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: var(--transition-fast);
}

#cases-page-size-select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Card grids & Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}
.premium-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.premium-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}
.premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--transition-normal);
}
.premium-card.active-case-card::before {
  background: var(--primary-gradient);
}
.premium-card.smartlock-card::before {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
}
.premium-card.participant-card::before {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}


.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}
.card-badge.rettung {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.card-badge.bereitschaft {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.card-details {
  margin-bottom: 20px;
  flex: 1;
}
.detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.detail-item strong {
  color: var(--text-primary);
}
.card-codes {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.code-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.code-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.code-entry:first-child {
  padding-top: 0;
}
.code-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.code-value {
  font-family: monospace;
  font-weight: 700;
  color: var(--warning);
  font-size: 1.05rem;
  letter-spacing: 1px;
}
.code-time-remaining {
  font-weight: 600;
  color: var(--success);
}
.code-time-remaining.expired {
  color: var(--danger);
}
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* Smartlock specific styles */
.smartlock-status-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.smartlock-status-circle.online {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.smartlock-status-circle.warning {
  background-color: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}
.smartlock-status-circle.info {
  background-color: var(--text-secondary);
}
.smartlock-status-circle.offline {
  background-color: var(--danger);
}
.battery-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.battery-indicator.low {
  color: var(--danger);
  animation: pulse 1.5s infinite;
}
.battery-indicator.ok {
  color: var(--success);
}
.battery-indicator.unknown {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Tables */
.table-container-wrapper {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
}
.table-controls {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
  min-width: 260px;
}
.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px 12px 44px;
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition-fast);
}
.search-box input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}
.pagination-size {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.pagination-size select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 12px;
  outline: none;
}

.table-scroll {
  overflow-x: auto;
}
.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}
.premium-table th {
  background: rgba(255, 255, 255, 0.01);
  padding: 16px 24px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.premium-table thead th:hover {
  color: var(--text-primary);
}
.premium-table thead th.sorted-asc::after {
  content: ' \25B2';
  font-size: 0.65em;
  color: var(--primary);
}
.premium-table thead th.sorted-desc::after {
  content: ' \25BC';
  font-size: 0.65em;
  color: var(--primary);
}
.premium-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.premium-table tbody tr {
  transition: var(--transition-fast);
}
.premium-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.premium-table tbody tr:last-child td {
  border-bottom: none;
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}
.text-right {
  text-align: right;
}
.table-pagination {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 10, 19, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
@keyframes modalSlide {
  from { transform: scale(0.95) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 1.3rem;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-details-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.modal-details-card p {
  margin-bottom: 8px;
}
.modal-details-card p:last-child {
  margin-bottom: 0;
}

/* Switches & Toggles */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-top: 4px;
}
.toggle-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.toggle-text.active {
  color: var(--text-primary);
  font-weight: 600;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border: 1px solid var(--border-color);
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background-color: var(--success);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--success);
}
input:checked + .slider:before {
  transform: translateX(24px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

.code-type-buttons {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.code-type-buttons .btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

/* Settings Subtab navigation */
.settings-subnav .subnav-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.settings-subnav .subnav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.settings-subnav .subnav-btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}
.settings-subpane {
  display: none;
}
.settings-subpane.active {
  display: block;
}

/* Settings and Forms info layout */
.settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 992px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
.settings-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  margin-bottom: 6px;
}
.card-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}
.info-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: rgba(99, 102, 241, 0.15);
}
.info-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.step {
  display: flex;
  gap: 16px;
}
.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.step h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.step p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Alerts */
.alert-banner {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  border-radius: 14px;
  margin-bottom: 24px;
  align-items: flex-start;
  animation: fadeIn 0.3s ease-out;
}
.alert-banner.warning {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fde68a;
}
.alert-banner.warning i {
  color: var(--warning);
  font-size: 1.3rem;
  margin-top: 2px;
}
.alert-banner h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.alert-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.alert-banner a {
  color: var(--warning);
  text-decoration: underline;
  font-weight: 600;
}

/* Loading & Empty States */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 40px;
  color: var(--text-secondary);
}
.empty-state i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.spinner-small {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  opacity: 0;
}
.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-icon {
  color: var(--success);
  font-size: 1.2rem;
}
.toast-icon.error {
  color: var(--danger);
}

/* Responsiveness overrides */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
  }
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  .user-profile {
    width: 100%;
    justify-content: space-between;
  }
  .user-profile-actions {
    border-left: none;
    padding-left: 0;
  }
  .main-content {
    padding: 20px;
  }
  .tab-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* Share Access Styles */
.share-textarea {
  background: rgba(0, 0, 0, 0.25) !important;
  border-color: var(--border-color) !important;
  font-family: var(--font-body) !important;
  transition: var(--transition-fast);
}
.share-textarea:focus {
  border-color: var(--primary) !important;
}
.btn-share-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem !important;
  padding: 10px 14px !important;
  height: 42px;
}
.btn-share-action i {
  font-size: 1rem;
}

/* Custom Combobox Dropdown for Smartlock Modal */
.combobox-dropdown {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #0f172a;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  margin-top: 4px;
}

.combobox-item {
  padding: 10px 14px;
  cursor: pointer;
  color: #f3f4f6;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.combobox-item:last-child {
  border-bottom: none;
}

.combobox-item:hover, .combobox-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.combobox-item.no-results {
  color: #9ca3af;
  font-style: italic;
  cursor: default;
  text-align: center;
  justify-content: center;
}

/* Premium Hardware Store Styles */
.hardware-shop-shell {
  width: 100%;
  padding: clamp(20px, 3vw, 32px);
  overflow: visible;
}

.hardware-shop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.hardware-shop-header h3 {
  margin: 8px 0 8px;
}

.hardware-shop-header .card-subtitle {
  max-width: 720px;
  margin: 0;
  line-height: 1.55;
}

.hardware-shop-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hardware-shop-service-note {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 12px 14px;
  background: rgba(0, 163, 169, 0.08);
  border: 1px solid rgba(0, 163, 169, 0.2);
  border-radius: 14px;
  color: var(--primary);
}

.hardware-shop-service-note > i {
  font-size: 1.2rem;
}

.hardware-shop-service-note span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hardware-shop-service-note strong {
  color: var(--text-primary);
  font-size: 0.86rem;
}

.hardware-shop-service-note small {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.hardware-shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.hardware-catalog-panel,
.hardware-checkout-card {
  min-width: 0;
}

.hardware-checkout-card {
  position: sticky;
  top: 20px;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(0, 163, 169, 0.055), rgba(255, 255, 255, 0.015)),
    rgba(6, 12, 23, 0.35);
  border: 1px solid rgba(0, 163, 169, 0.18);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
}

.hardware-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hardware-panel-heading > div {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.hardware-panel-heading h4 {
  margin: 1px 0 3px;
  color: var(--text-primary);
  font-size: 1rem;
}

.hardware-panel-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.hardware-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  background: rgba(0, 163, 169, 0.16);
  border: 1px solid rgba(0, 163, 169, 0.25);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.hardware-product-count {
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 650;
}

#shop-products-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shop-product-item {
  position: relative;
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.shop-product-visual {
  position: relative;
  width: 76px;
  height: 76px;
}

.shop-product-selected-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border: 3px solid var(--bg-card);
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-size: 0.68rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.shop-product-item.has-quantity .shop-product-selected-badge {
  opacity: 1;
  transform: scale(1);
}

.shop-product-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 163, 169, 0.45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.shop-product-item.has-quantity {
  background: rgba(0, 163, 169, 0.07);
  border-color: rgba(0, 163, 169, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 163, 169, 0.08), 0 14px 30px rgba(0, 0, 0, 0.14);
}

.shop-product-item img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease;
}

.shop-product-image-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--text-muted);
  font-size: 1.35rem;
}

.shop-product-item:hover img {
  transform: scale(1.045);
}

.shop-product-info {
  min-width: 0;
}

.shop-product-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.shop-product-details {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.45;
}

.shop-product-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 9px;
}

.shop-product-price strong {
  color: var(--text-primary);
  font-size: 1rem;
}

.shop-product-price span {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.shop-qty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 130px;
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
}

.shop-qty-stepper {
  display: grid;
  grid-template-columns: 32px 50px 32px;
  align-items: center;
  gap: 4px;
}

.shop-qty-stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.shop-qty-stepper button:hover:not(:disabled) {
  background: rgba(0, 163, 169, 0.14);
  border-color: rgba(0, 163, 169, 0.42);
  color: var(--primary);
}

.shop-qty-stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.shop-qty-status {
  min-height: 1em;
  color: var(--success);
  font-size: 0.64rem;
  font-weight: 650;
}

.shop-qty-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shop-qty-input {
  width: 54px !important;
  height: 34px !important;
  padding: 4px 6px !important;
  background: rgba(255, 255, 255, 0.065) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  text-align: center !important;
  font-weight: 700 !important;
  outline: none !important;
  margin: 0 !important;
  transition: border-color 0.2s !important;
}

.shop-qty-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

.shop-catalog-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 210px;
  padding: 28px;
  text-align: center;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.018);
  border: 1px dashed var(--border-color);
  border-radius: 16px;
}

.shop-catalog-state > i {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 1.45rem;
}

.shop-catalog-state strong {
  color: var(--text-primary);
}

.shop-catalog-state span {
  max-width: 360px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.shop-catalog-retry {
  margin-top: 7px;
}

.shop-catalog-refresh-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 13px;
  color: var(--warning);
}

.shop-catalog-refresh-warning > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shop-catalog-refresh-warning strong {
  color: var(--text-primary);
  font-size: 0.78rem;
}

.shop-catalog-refresh-warning span {
  color: var(--text-secondary);
  font-size: 0.7rem;
  line-height: 1.4;
}

.shop-catalog-refresh-warning .shop-catalog-retry {
  margin-top: 0;
  white-space: nowrap;
}

.order-address-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.order-address-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.order-address-toggle:has(input:checked) {
  background: rgba(0, 163, 169, 0.075);
  border-color: rgba(0, 163, 169, 0.35);
}

.order-address-toggle > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.order-address-toggle strong {
  color: var(--text-primary);
  font-size: 0.79rem;
}

.order-address-toggle small {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.order-address-card {
  margin-top: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}

.order-address-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.order-address-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: rgba(0, 163, 169, 0.12);
  color: var(--primary);
}

.order-address-card-heading h5 {
  margin: 0 0 2px;
  color: var(--text-primary);
  font-size: 0.84rem;
}

.order-address-source {
  display: block;
  color: var(--success);
  font-size: 0.67rem;
}

.order-address-source.is-override {
  color: var(--warning);
}

.order-address-fields {
  display: grid;
  gap: 9px;
}

.order-address-fields .input-group {
  margin: 0;
}

.order-address-fields .input-group label {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.order-address-fields input {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.order-address-fields input:disabled {
  opacity: 0.8;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.12);
  cursor: default;
}

.order-address-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.7fr) minmax(0, 1.6fr);
  gap: 9px;
}

.hardware-order-summary {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
}

.hardware-order-summary h5 {
  margin: 0 0 3px;
  color: var(--text-primary);
  font-size: 0.82rem;
}

.hardware-summary-row,
.hardware-summary-total {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hardware-summary-row {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.hardware-summary-row strong {
  color: var(--text-primary);
  text-align: right;
  font-size: 0.78rem;
}

.hardware-summary-total {
  margin-top: 3px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 700;
}

.hardware-summary-total strong {
  color: var(--success);
  text-align: right;
  font-size: 1.05rem;
}

.hardware-order-submit {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
}

.hardware-order-submit:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.hardware-order-legal {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.4;
  text-align: center;
}

/* Closed case details */
.case-detail-modal-content {
  width: min(94vw, 960px);
  max-width: 960px;
}

.case-detail-modal-content .modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(0, 163, 169, 0.08), transparent 58%);
}

.case-detail-modal-content .modal-header h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 3px 0 0;
}

.case-detail-kicker {
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.case-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 15px 17px;
  background: linear-gradient(120deg, rgba(0, 163, 169, 0.105), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(0, 163, 169, 0.2);
  border-radius: 14px;
}

.case-detail-hero > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.case-detail-hero > div span {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-detail-hero > div strong {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.case-detail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.13);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
}

.case-detail-grid,
.case-detail-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.case-detail-bottom-grid {
  margin-top: 14px;
}

.case-detail-section {
  min-width: 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}

.case-detail-section > h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 0.84rem;
}

.case-detail-section > h4 i {
  color: var(--primary);
}

.case-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 13px;
  margin: 0;
}

.case-detail-list > div {
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.case-detail-list > div:last-child,
.case-detail-list > .case-detail-wide-row {
  padding-bottom: 0;
  border-bottom: 0;
}

.case-detail-list .case-detail-wide-row {
  grid-column: 1 / -1;
}

.case-detail-list dt {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.case-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
}

.case-detail-validity-list {
  display: grid;
  gap: 4px;
}

.case-detail-validity-list span {
  display: block;
  font-weight: 500;
}

.case-detail-scroll {
  min-height: 92px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.case-detail-log-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-detail-log-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 12px;
}

.case-detail-log-item::before {
  content: '';
  position: absolute;
  top: 28px;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(0, 163, 169, 0.35), rgba(0, 163, 169, 0.04));
}

.case-detail-log-item:last-child::before {
  display: none;
}

.case-detail-log-marker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 163, 169, 0.3);
  border-radius: 9px;
  background: rgba(0, 163, 169, 0.12);
  color: var(--primary);
  font-size: 0.7rem;
}

.case-detail-log-content {
  min-width: 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 11px;
}

.case-detail-log-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.case-detail-log-time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.66rem;
  white-space: nowrap;
}

.case-detail-log-event {
  color: var(--text-primary);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.case-detail-log-details {
  display: block;
  color: var(--text-secondary);
  font-size: 0.71rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.case-detail-comment-form {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.case-detail-comment-form input {
  min-width: 0;
  flex: 1;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
}

.case-detail-history-note {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.case-detail-muted {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

.participant-demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.23);
  border-radius: 12px;
  color: #c4b5fd;
}

.participant-demo-notice > i {
  margin-top: 2px;
}

.participant-demo-notice > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.participant-demo-notice strong {
  color: var(--text-primary);
  font-size: 0.8rem;
}

.participant-demo-notice span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.45;
}

.participant-card.participant-demo-card {
  border-color: rgba(139, 92, 246, 0.25);
  background:
    linear-gradient(150deg, rgba(139, 92, 246, 0.055), transparent 48%),
    var(--bg-card);
}

.participant-demo-badge {
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.participant-demo-hint {
  color: #c4b5fd !important;
}

/* Compact participant card action menu */
.participant-card {
  overflow: visible;
}

.participant-card:has(.participant-action-menu[open]) {
  z-index: 30;
}

.participant-card-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.participant-action-menu {
  position: relative;
}

.participant-action-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.09);
  color: #c4b5fd;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.participant-action-menu summary::-webkit-details-marker {
  display: none;
}

.participant-action-menu summary:hover,
.participant-action-menu[open] summary {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.52);
  transform: rotate(10deg);
}

.participant-action-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 205px;
  padding: 7px;
  background: rgba(10, 16, 29, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.participant-menu-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.participant-menu-item i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--primary);
}

.participant-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.participant-history-logs {
  margin-top: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
}

.participant-history-log-item {
  display: grid;
  grid-template-columns: 105px minmax(90px, 0.65fr) minmax(0, 1.35fr);
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.055);
}

.participant-history-log-item:last-child {
  border-bottom: 0;
}

.participant-history-log-item > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.participant-history-log-item > span:first-child {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.69rem;
}

.participant-history-log-item strong {
  color: var(--text-primary);
  font-size: 0.73rem;
}

.participant-history-log-item > span:last-child {
  color: var(--text-secondary);
  font-size: 0.69rem;
}

/* Portal user dialogs and group membership */
.portal-user-modal-content {
  max-width: 640px;
}

.portal-user-modal-content .modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(0, 163, 169, 0.1), transparent 62%);
}

.portal-user-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-user-modal-title > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-user-modal-title > div > span {
  color: var(--primary);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-user-modal-title h3 {
  margin: 0;
}

.portal-user-modal-icon,
.feedback-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(0, 163, 169, 0.25);
  border-radius: 13px;
  background: rgba(0, 163, 169, 0.12);
  color: var(--primary);
}

.portal-user-intro {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
}

.portal-user-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-user-name-grid > .input-group {
  min-width: 0;
}

.portal-user-name-grid input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.portal-user-readonly-field {
  opacity: 0.78;
}

.portal-user-readonly-field input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.045);
  cursor: not-allowed;
}

.portal-user-select-group select,
.portal-user-group-section select {
  min-height: 46px;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
}

.portal-user-group-section {
  margin: -4px 0 15px;
  padding: 14px 14px 0;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 13px;
}

.portal-user-group-section[hidden] {
  display: none;
}

.portal-user-group-section small {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.portal-permissions-panel {
  margin: 4px 0 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.portal-permissions-panel h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
}

.portal-permissions-panel h4 i {
  color: var(--primary);
}

.portal-permission-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.portal-permission-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
}

.portal-permission-row > label:last-child {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.35;
  cursor: pointer;
}

.portal-user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.portal-user-form-actions .btn {
  min-width: 150px;
  justify-content: center;
}

.portal-user-reset-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.portal-user-reset-panel .btn {
  width: 100%;
  justify-content: center;
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--warning);
}

.group-members-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.11);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 650;
}

.portal-access-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Support and feedback workspace */
.feedback-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.18fr);
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}

.feedback-compose-card,
.feedback-history-card {
  overflow: visible;
}

.feedback-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}

.feedback-card-heading > div {
  min-width: 0;
}

.feedback-card-heading h3 {
  margin: 3px 0 4px;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.feedback-card-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.feedback-eyebrow {
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feedback-history-heading .feedback-heading-icon {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.feedback-type-picker {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.feedback-type-picker legend {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.feedback-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feedback-type-label {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.feedback-type-label:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.feedback-type-label:has(input:checked) {
  border-color: rgba(0, 163, 169, 0.42);
  background: rgba(0, 163, 169, 0.07);
}

.feedback-type-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feedback-type-label > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.feedback-type-label strong {
  color: var(--text-primary);
  font-size: 0.8rem;
}

.feedback-type-label small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.67rem;
  line-height: 1.35;
}

.feedback-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.feedback-type-bug .feedback-type-icon {
  color: var(--danger);
}

.feedback-type-feature .feedback-type-icon {
  color: var(--success);
}

.feedback-field {
  margin-bottom: 15px;
}

.feedback-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin: 2px 0 18px;
  padding: 12px;
  border: 1px dashed rgba(0, 163, 169, 0.3);
  border-radius: 12px;
  background: rgba(0, 163, 169, 0.04);
}

.feedback-upload-icon {
  color: var(--primary);
  font-size: 1.1rem;
}

.feedback-upload-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.feedback-upload-copy strong {
  color: var(--text-primary);
  font-size: 0.76rem;
}

.feedback-upload-copy small,
#file-upload-name {
  color: var(--text-muted);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

#file-upload-name {
  grid-column: 2 / -1;
}

.feedback-submit {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.feedback-table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 13px;
}

.feedback-table {
  width: 100%;
  min-width: 640px;
}

.feedback-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(12, 18, 31, 0.98);
}

.feedback-table th {
  padding: 10px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feedback-ticket-row td {
  padding: 13px 10px;
  border-bottom-color: rgba(255, 255, 255, 0.055);
}

.feedback-ticket-row:hover td {
  background: rgba(255, 255, 255, 0.018);
}

.feedback-ticket-date {
  color: var(--text-secondary);
  font-size: 0.73rem;
  white-space: nowrap;
}

.feedback-ticket-copy {
  min-width: 220px;
  max-width: 380px;
}

.feedback-ticket-copy strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.feedback-ticket-details {
  margin-top: 5px;
}

.feedback-ticket-details summary {
  width: fit-content;
  color: var(--text-secondary);
  font-size: 0.69rem;
  cursor: pointer;
}

.feedback-ticket-details summary:hover {
  color: var(--primary);
}

.feedback-ticket-details p {
  max-height: 180px;
  margin: 8px 0 0;
  overflow: auto;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary);
  font-size: 0.69rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feedback-ticket-type,
.feedback-ticket-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  white-space: nowrap;
}

.feedback-ticket-type.is-bug {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.feedback-ticket-type.is-feature {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.feedback-attachment-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 163, 169, 0.2);
  border-radius: 9px;
  background: rgba(0, 163, 169, 0.08);
  color: var(--primary);
  text-decoration: none;
}

.feedback-attachment-link:hover {
  border-color: rgba(0, 163, 169, 0.42);
  background: rgba(0, 163, 169, 0.15);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1050px) {
  .hardware-shop-layout {
    grid-template-columns: 1fr;
  }

  .hardware-checkout-card {
    position: static;
  }

  .feedback-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .hardware-shop-header {
    flex-direction: column;
  }

  .hardware-shop-service-note {
    width: 100%;
  }

  .shop-product-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 13px;
    padding: 14px;
  }

  .shop-product-item img,
  .shop-product-image-placeholder,
  .shop-product-visual {
    width: 64px;
    height: 64px;
  }

  .shop-qty-container {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .shop-catalog-refresh-warning {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .shop-catalog-refresh-warning .shop-catalog-retry {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
  }

  .case-detail-grid,
  .case-detail-bottom-grid {
    grid-template-columns: 1fr;
  }

  .case-detail-list {
    grid-template-columns: 1fr;
  }

  .case-detail-log-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
  }

  .case-detail-log-heading {
    flex-direction: column;
    gap: 2px;
  }

  .case-detail-log-time {
    white-space: normal;
  }

  .portal-user-name-grid,
  .portal-permission-list,
  .feedback-type-options {
    grid-template-columns: 1fr;
  }

  .participant-history-log-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .feedback-upload {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .feedback-upload .btn {
    grid-column: 1 / -1;
    justify-content: center;
  }

  #file-upload-name {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .hardware-shop-shell,
  .hardware-checkout-card {
    padding: 15px;
  }

  .hardware-panel-heading {
    flex-direction: column;
  }

  .order-address-row {
    grid-template-columns: 1fr;
  }

  .case-detail-modal-content .modal-header,
  .case-detail-modal-content .modal-body {
    padding: 16px;
  }

  .case-detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-user-modal-content .modal-header,
  .portal-user-modal-content .modal-body {
    padding: 16px;
  }

  .portal-user-form-actions {
    flex-direction: column-reverse;
  }

  .portal-user-form-actions .btn {
    width: 100%;
  }

  .participant-action-menu-popover {
    right: -6px;
    min-width: 190px;
  }
}

/* Custom Confirmation Modal Customizations */
#modal-custom-confirm .modal-content {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Premium Switch / Slider Toggle styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Light Mode Variables Override & Styles */
[data-theme="light"] {
  --bg-dark: #f8fafc; /* Premium Slate 50 background */
  --bg-card: #ffffff; /* Solid premium white card */
  --bg-card-hover: #ffffff;
  --border-color: #e2e8f0; /* Light slate border */
  --text-primary: #0f172a; /* Slate 900 */
  --text-secondary: #334155; /* Slate 700 */
  --text-muted: #64748b; /* Slate 500 */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Base elements in Light Mode */
[data-theme="light"] body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .premium-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] .premium-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

[data-theme="light"] input::placeholder {
  color: #94a3b8;
}

/* Header & Navigation */
[data-theme="light"] .main-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .logo-text h1,
[data-theme="light"] .logo-text .logo-title {
  color: #0f172a !important;
}

[data-theme="light"] .main-nav li {
  color: #475569;
}

[data-theme="light"] .main-nav li.active {
  color: var(--primary) !important;
  background: #e0e7ff !important; /* Soft indigo background for active tab */
}

/* UI Panels, Cards, Modals */
[data-theme="light"] .premium-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: var(--shadow-md) !important;
}

[data-theme="light"] .premium-card:hover {
  box-shadow: var(--shadow-lg) !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .modal-content {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .auth-card {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .auth-logo h2,
[data-theme="light"] .auth-card h3 {
  color: #0f172a !important;
}

[data-theme="light"] .user-profile-card,
[data-theme="light"] #session-countdown-wrapper,
[data-theme="light"] #admin-session-timer,
[data-theme="light"] .card-codes,
[data-theme="light"] .empty-state,
[data-theme="light"] .table-controls,
[data-theme="light"] .table-container-wrapper {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

[data-theme="light"] .code-entry,
[data-theme="light"] .activity-item,
[data-theme="light"] .history-item {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

/* Buttons */
[data-theme="light"] .btn-secondary,
[data-theme="light"] .btn-icon {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .btn-icon:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Badges with Tailwind-style light palette */
[data-theme="light"] .badge {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .badge.user {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
}

[data-theme="light"] .badge.warning {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

[data-theme="light"] .badge.danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
}

/* Tables */
[data-theme="light"] td, 
[data-theme="light"] th {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

[data-theme="light"] th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* SVG Overrides */
[data-theme="light"] svg path[stroke="#ffffff"],
[data-theme="light"] svg circle[fill="#ffffff"] {
  stroke: #475569;
}

[data-theme="light"] svg circle[fill="#ffffff"] {
  fill: #475569;
}

/* Specific button overrides for light mode */
[data-theme="light"] .btn-danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}
[data-theme="light"] .btn-danger:hover {
  background: #fecaca !important;
}

[data-theme="light"] .btn-success {
  background: #d1fae5 !important;
  color: #15803d !important;
  border: 1px solid #a7f3d0 !important;
}
[data-theme="light"] .btn-success:hover {
  background: #a7f3d0 !important;
}

[data-theme="light"] .btn-warning {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}
[data-theme="light"] .btn-warning:hover {
  background: #fde68a !important;
}

[data-theme="light"] .warning-banner {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

[data-theme="light"] .warning-banner strong {
  color: #991b1b !important;
}

/* Settings Subnav Override */
[data-theme="light"] .settings-subnav .subnav-btn {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}
[data-theme="light"] .settings-subnav .subnav-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
[data-theme="light"] .settings-subnav .subnav-btn.active {
  background: #e0e7ff !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* Code Type Buttons Override */
[data-theme="light"] .code-type-buttons .btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .code-type-buttons .btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
[data-theme="light"] .code-type-buttons .btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

/* Card Badges in Light Mode */
[data-theme="light"] .card-badge.rettung {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

[data-theme="light"] .card-badge.bereitschaft {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

/* Provider badge inline style overrides in Light Mode */
[data-theme="light"] .badge[style*="color: #c084fc"],
[data-theme="light"] .badge[style*="color: var(--primary)"] {
  background: #e0e7ff !important;
  color: #4f46e5 !important;
  border: 1px solid #c7d2fe !important;
}

[data-theme="light"] .badge[style*="color: var(--warning)"] {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

/* Super-Admin Light Mode Readability Fixes */
[data-theme="light"] [style*="color: white"],
[data-theme="light"] [style*="color:white"],
[data-theme="light"] [style*="color: #white"],
[data-theme="light"] [style*="color: #fff"],
[data-theme="light"] [style*="color:#fff"],
[data-theme="light"] [style*="color: #ffffff"],
[data-theme="light"] [style*="color:#ffffff"],
[data-theme="light"] [style*="color:rgb(255, 255, 255)"],
[data-theme="light"] [style*="color: rgb(255,255,255)"] {
  color: var(--text-primary) !important;
}

[data-theme="light"] [style*="background: rgba(255,255,255,0.02)"],
[data-theme="light"] [style*="background: rgba(255, 255, 255, 0.02)"],
[data-theme="light"] [style*="background:rgba(255,255,255,0.02)"],
[data-theme="light"] [style*="background: rgba(255,255,255,0.03)"],
[data-theme="light"] [style*="background: rgba(255, 255, 255, 0.03)"],
[data-theme="light"] [style*="background:rgba(255,255,255,0.03)"],
[data-theme="light"] [style*="background: rgba(255,255,255,0.05)"],
[data-theme="light"] [style*="background: rgba(255, 255, 255, 0.05)"],
[data-theme="light"] [style*="background:rgba(255,255,255,0.05)"] {
  background: #f1f5f9 !important;
}

[data-theme="light"] [style*="background: rgba(0,0,0,0.3)"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.3)"] {
  background: #ffffff !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] code {
  background: #f1f5f9 !important;
  color: #b91c1c !important;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Ensure switch labels and modal tabs scroll arrows are visible */
[data-theme="light"] #tabs-scroll-left,
[data-theme="light"] #tabs-scroll-right {
  color: var(--text-primary) !important;
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

/* Light Theme Overrides for Cases Page Size Select and Stat Counter */
[data-theme="light"] #cases-page-size-select {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] #cases-page-size-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

[data-theme="light"] .stat-counter {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.participant-action-menu summary:focus-visible,
.feedback-type-label:has(input:focus-visible),
.feedback-ticket-details summary:focus-visible {
  outline: 3px solid rgba(0, 163, 169, 0.35);
  outline-offset: 3px;
}

.optional-label {
  margin-left: 5px;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 500;
}

[data-theme="light"] .participant-action-menu-popover,
[data-theme="light"] .feedback-table thead {
  background: rgba(255, 255, 255, 0.98);
  border-color: #dbe3ec;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .participant-menu-item:hover,
[data-theme="light"] .feedback-ticket-row:hover td {
  background: #f1f5f9;
}

[data-theme="light"] .feedback-ticket-details p {
  background: #f8fafc;
  border-color: #e2e8f0;
}
