:root {
  /* ============================================
     BRAND COLORS - Change these to update theme
     ============================================ */
  --brand-primary: #910521;      /* Main burgundy - change this to update entire theme */
  --brand-primary-dark: #5f0b1c; /* Darker shade */
  --brand-primary-light: #8b3745; /* Lighter shade */
  --brand-primary-gray: #DE8591; /* Grayish burgundy for gradients */
  --brand-accent: #df4156;       /* Accent color for highlights */

  /* ============================================
     FUNCTIONAL COLORS
     ============================================ */
  --primary: var(--brand-primary);
  --primary-dark: var(--brand-primary-dark);
  --primary-light: var(--brand-primary-light);
  --secondary: #10b981;
  --secondary-dark: #059669;
  --danger: #ef4444;
  --danger-dark: #dc2626;

  /* Neutrals */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Background colors derived from brand */
  --bg-primary-subtle: rgba(165, 36, 61, 0.03);
  --bg-primary-light: #f4e8ea;
  --bg-beige: #f5f0ed;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Brand-specific shadows */
  --shadow-brand: 0 12px 24px rgba(165, 36, 61, 0.08);
  --shadow-brand-lg: 0 20px 40px rgba(165, 36, 61, 0.12);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page fade-in animation */
main {
  animation: fadeIn 0.3s ease-in;
}

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

/* Typography improvements */
h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--gray-900);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--gray-800);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.logo:hover {
  transform: scale(1.02);
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  text-align: center;
  box-shadow: var(--shadow-sm);
  line-height: 1.5;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  box-shadow: var(--shadow);
}

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

.btn-danger:hover {
  background: var(--danger-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--gray-700);
}

input, select, textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
  transition: all var(--transition-base);
  font-family: inherit;
}

input:hover, select:hover, textarea:hover {
  border-color: var(--gray-400);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: white;
}

input::placeholder, textarea::placeholder {
  color: var(--gray-400);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

/* Input validation states */
input.error, select.error, textarea.error {
  border-color: var(--danger);
}

input.error:focus, select.error:focus, textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input.success, select.success, textarea.success {
  border-color: var(--secondary);
}

input.success:focus, select.success:focus, textarea.success:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Cards */
.card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.card-header h2 {
  margin-bottom: 0;
}

/* Stat cards for dashboard */
.stat-card {
  text-align: center;
  transition: all var(--transition-base);
}

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

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
}

th, td {
  padding: 1rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--gray-600);
  background: var(--gray-50);
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background: var(--gray-50);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Make table links more visible */
table a {
  font-weight: 500;
  color: var(--primary);
}

table a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* HTMX Loading Indicator */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

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

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

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

/* Loading States */
.loading {
  color: var(--gray-600);
  padding: 2rem;
  text-align: center;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-600);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.badge-primary {
  background: var(--primary);
  color: white;
}

.badge-secondary {
  background: var(--secondary);
  color: white;
}

.badge-danger {
  background: var(--danger);
  color: white;
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* Alert/Message boxes */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-info {
  background: rgba(79, 70, 229, 0.1);
  border-left-color: var(--primary);
  color: var(--primary-dark);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-left-color: var(--secondary);
  color: var(--secondary-dark);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: var(--danger);
  color: var(--danger-dark);
}

/* Profile & Info Grids */
.profile-section {
  margin-bottom: 2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.info-label {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.info-value {
  color: var(--gray-900);
}

/* Installation type cards */
.installation-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.type-item {
  background: var(--gray-50);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--gray-200);
  transition: all var(--transition-base);
}

.type-item:hover {
  background: white;
  box-shadow: var(--shadow);
}

.type-name {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.type-model {
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* ==================================
   COMMON COMPONENT STYLES
   (Extracted from inline styles)
   ================================== */

/* Tabs Component */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
  color: var(--gray-600);
  transition: all var(--transition-base);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab:hover {
  color: var(--primary);
  background: var(--gray-50);
}

.tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.tab-content {
  display: none;
}

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

/* Installation Cards */
.installation-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all var(--transition-base);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

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

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

.installation-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.5rem 0;
}

.installation-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--gray-100);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.installation-info {
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.installation-info-row {
  display: flex;
  justify-content: space-between;
}

.installation-info-label {
  font-weight: 500;
  color: var(--gray-700);
}

/* Installation Grid Layout */
.installations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Type Tags/Pills (for profile pages) */
.types-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.type-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border-radius: 8px;
  font-size: 0.875rem;
}

.type-tag button {
  margin-left: 0.5rem;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  transition: color var(--transition-fast);
}

.type-tag button:hover {
  color: var(--danger-dark);
}

/* File Display Components */
.file-list {
  list-style: none;
}

.file-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

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

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
}

.file-meta {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.file-type-badge {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  margin-right: 0.75rem;
  font-weight: 500;
}

.file-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Visibility Badges */
.visibility-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  margin-right: 0.75rem;
  font-weight: 500;
}

.visibility-badge.public {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary-dark);
}

.visibility-badge.private {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-dark);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-active {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--secondary-dark);
}

.status-inactive {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-dark);
}

.status-pending {
  background-color: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

/* Role Badges */
.role-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.installer {
  background: var(--primary);
  color: white;
}

.role-badge.client {
  background: var(--secondary);
  color: white;
}

.role-badge.public {
  background: var(--gray-600);
  color: white;
}

/* Badge Success/Warning variants (different from status badges) */
.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

/* Download Button Variant */
.download-btn {
  background: var(--secondary);
  color: white;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition-base);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.download-btn:hover {
  background: var(--secondary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: white;
}

/* Success Button Variant */
.btn-success {
  background: var(--secondary);
  color: white;
}

.btn-success:hover {
  background: var(--secondary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Link Styles */
.back-link {
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--primary-dark);
}

/* Info Rows (for detail pages) */
.info-row {
  display: flex;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-200);
}

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

/* Utility: Hidden */
.hidden {
  display: none;
}

/* Utility: No Files State */
.no-files {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-600);
}

/* Admin Actions Section */
.admin-actions {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

.admin-actions h3 {
  color: #b45309;
  margin-bottom: 0.75rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-in;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease-out;
}

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

.modal-content h3 {
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}

/* QR Code Gallery Components */
.qr-gallery {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.qr-gallery h3 {
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.qr-display {
  position: relative;
  text-align: center;
  margin-bottom: 1rem;
}

.qr-image-wrapper {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-image-wrapper img {
  max-width: 200px;
  height: auto;
  border-radius: 0.375rem;
}

.qr-code-string {
  font-size: 0.75rem;
  color: var(--gray-600);
  word-break: break-all;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--gray-50);
  border-radius: 0.375rem;
  font-family: monospace;
}

.qr-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qr-nav-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 3rem;
}

.qr-nav-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.qr-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qr-counter {
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
}

.qr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Page Layout Components */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  margin-top: 2rem;
}

.main-content {
  min-width: 0;
}

.sidebar-content {
  min-width: 0;
}

.files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* Auth Page Styles (login/register/claim) */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--gray-50);
}

.auth-card {
  max-width: 450px;
  width: 100%;
  background: white;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--gray-600);
  font-weight: 500;
  transition: all var(--transition-base);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

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

.auth-tab:hover {
  color: var(--primary);
  background: var(--gray-50);
}

.auth-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Responsive improvements */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.875rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .card {
    padding: 1rem;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .installation-types {
    grid-template-columns: 1fr;
  }

  .installations-grid {
    grid-template-columns: 1fr;
  }

  .file-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-actions {
    margin-top: 1rem;
    width: 100%;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
    padding: 0.75rem 1rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-content {
    order: -1;
  }

  .qr-gallery {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* ==========================================
   Toast Notifications
   ========================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
  pointer-events: auto;
}

.toast.success {
  border-left: 4px solid var(--secondary);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

.toast-icon {
  flex-shrink: 0;
  font-size: 20px;
}

.toast.success .toast-icon {
  color: var(--secondary);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.info .toast-icon {
  color: var(--primary);
}

.toast-message {
  flex: 1;
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  width: 20px;
  height: 20px;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--gray-900);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease-in forwards;
}

@media (max-width: 768px) {
  .toast-container {
    left: 20px;
    right: 20px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
  }
}

/* ============================================
   ROLE SWITCHER
   ============================================ */
.role-switcher-card {
  background: linear-gradient(135deg, var(--bg-primary-light) 0%, var(--bg-beige) 100%);
  border: 2px solid var(--brand-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-brand);
  animation: fadeIn 0.3s ease-in;
}

.role-switcher-card h3 {
  color: var(--brand-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.role-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.role-buttons .btn {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  transition: all var(--transition-base);
}

.role-buttons .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .role-buttons {
    flex-direction: column;
  }

  .role-buttons .btn {
    min-width: unset;
    width: 100%;
  }
}

/* ============================================
   ONBOARDING STYLES
   ============================================ */
.onboarding-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  padding: 2rem;
}

.onboarding-card {
  background: white;
  border-radius: 12px;
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.onboarding-card.onboarding-card-wide {
  max-width: 600px;
}

.onboarding-logo {
  margin-bottom: 2rem;
}

.onboarding-logo .logo {
  font-size: 2rem;
}

.onboarding-card h1 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

.onboarding-card p {
  color: var(--gray-600);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.onboarding-form {
  text-align: left;
}

.onboarding-form .form-group {
  margin-bottom: 1.25rem;
}

.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.onboarding-skip {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
  text-align: center;
}

.onboarding-skip:hover {
  color: var(--gray-700);
  text-decoration: underline;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

/* ============================================
   SHEPHERD.JS TOUR CUSTOMIZATION
   ============================================ */

/* Modal overlay - subtle darkening */
.shepherd-modal-overlay-container {
  fill: rgba(0, 0, 0, 0.3);
}

/* Highlight cutout - rounded with padding */
.shepherd-modal-overlay-container .shepherd-modal-is-visible {
  pointer-events: none;
}

.shepherd-target-click-disabled.shepherd-enabled {
  pointer-events: none;
}

/* Force rounded highlight with padding via SVG */
.shepherd-element {
  outline: none !important;
}

/* Tooltip container */
.shepherd-theme-docufix.shepherd-element {
  max-width: 320px;
  z-index: 10000;
}

.shepherd-theme-docufix .shepherd-content {
  border-radius: 8px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Hide default header - we don't need titles */
.shepherd-theme-docufix .shepherd-header {
  display: none;
}

/* Cancel icon in corner */
.shepherd-theme-docufix .shepherd-cancel-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--gray-400);
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1;
  padding: 0;
  line-height: 1;
}

.shepherd-theme-docufix .shepherd-cancel-icon:hover {
  color: var(--gray-600);
}

/* Text content */
.shepherd-theme-docufix .shepherd-text {
  padding: 1rem 1.25rem;
  padding-right: 2rem; /* Space for cancel icon */
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--gray-700);
}

/* Footer with buttons */
.shepherd-theme-docufix .shepherd-footer {
  padding: 0 1rem 1rem;
  border-top: none;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Buttons - light grey theme */
.shepherd-theme-docufix .shepherd-button {
  background: var(--gray-600);
  color: white;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.shepherd-theme-docufix .shepherd-button:hover {
  background: var(--gray-700);
}

.shepherd-theme-docufix .shepherd-button.shepherd-button-secondary {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.shepherd-theme-docufix .shepherd-button.shepherd-button-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

/* Arrow styling */
.shepherd-theme-docufix .shepherd-arrow,
.shepherd-theme-docufix .shepherd-arrow::before {
  background: var(--gray-100);
}

.shepherd-theme-docufix[data-popper-placement^='left'] > .shepherd-arrow {
  right: -8px;
}

.shepherd-theme-docufix[data-popper-placement^='right'] > .shepherd-arrow {
  left: -8px;
}

/* Tooltip offset - workaround since popperOptions offset doesn't work in v11 */
.shepherd-theme-docufix[data-popper-placement^='left'] {
  transform: translateX(-12px) !important;
}

.shepherd-theme-docufix[data-popper-placement^='bottom'] {
  transform: translateY(12px) !important;
}

/* Tour replay button */
.tour-replay-button {
  position: fixed;
  bottom: 70px;
  right: 20px;
  z-index: 999;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tour-replay-button:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.tour-replay-button svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .onboarding-card {
    padding: 2rem;
    margin: 1rem;
  }

  .onboarding-card h1 {
    font-size: 1.5rem;
  }

  .tour-replay-button {
    bottom: 80px;
    right: 10px;
    padding: 0.5rem 0.75rem;
  }

  .shepherd-theme-docufix.shepherd-element {
    max-width: 280px;
  }
}
