/* ═══════════════════════════════════════════════════════════════
   ParkWell Auto-Validator — Premium Light Theme
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --border-glass: rgba(0, 0, 0, 0.08);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-success: linear-gradient(135deg, #10b981, #3b82f6);
  --gradient-danger: linear-gradient(135deg, #ef4444, #f59e0b);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-input-focus: 0 0 0 3px rgba(59, 130, 246, 0.15);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139, 92, 246, 0.04), transparent);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ─── Scrollbar Styling ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════
   Header
   ═══════════════════════════════════════════ */
#app-header {
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.header-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  margin-top: 0.125rem;
}

/* Connection badge */
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition-base);
}
.connection-badge.connected {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.connection-badge.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.connection-badge.reconnecting {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.connection-badge.connected .connection-dot {
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════════
   Main Content
   ═══════════════════════════════════════════ */
#app-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ─── Glass Card ─── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-base);
}
.glass-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
}

/* ─── Section Title ─── */
.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.section-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.cars-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--gradient-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  min-width: 22px;
  text-align: center;
}

/* ═══════════════════════════════════════════
   Add Car Form
   ═══════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

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

.form-input {
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  outline: none;
  transition: all var(--transition-fast);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-input:focus {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-input-focus);
  background: #ffffff;
}
.form-input.plate-input {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Select arrow */
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.937 10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
  background-color: #ffffff;
}

/* ─── Duration Button Group ─── */
.duration-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.duration-btn {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition-fast);
}
.duration-btn:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.05);
  color: var(--text-primary);
}
.duration-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

.duration-time {
  font-size: 0.875rem;
  font-weight: 600;
}
.duration-detail {
  font-size: 0.65rem;
  opacity: 0.75;
}

/* ─── Buttons ─── */
.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--shadow-glow);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.12);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.04);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

/* Spinner */
.btn-spinner {
  display: inline-flex;
  align-items: center;
}
.spinner-svg {
  width: 18px;
  height: 18px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   Active Cars Dashboard
   ═══════════════════════════════════════════ */
#cars-section {
  padding: 0;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}
.empty-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.empty-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ─── Car Card ─── */
.car-card {
  background: #ffffff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  animation: fadeIn var(--transition-slow) ease-out;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}
.car-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
}
.car-card.validating {
  animation: pulse 2.5s ease-in-out infinite;
  border-color: rgba(59, 130, 246, 0.3);
}

.car-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.car-id-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Status Badges */
.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.status-badge.validated {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-badge.waiting {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.status-badge.validating {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.status-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.status-badge.completed {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.car-plate {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Countdown Ring */
.countdown-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.countdown-ring {
  position: relative;
  width: 120px;
  height: 120px;
}
.countdown-ring svg {
  transform: rotate(-90deg);
  width: 120px;
  height: 120px;
}
.countdown-ring .ring-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.06);
  stroke-width: 4;
}
.countdown-ring .ring-progress {
  fill: none;
  stroke: url(#ring-gradient);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.countdown-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.countdown-time {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.countdown-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Progress Bar */
.progress-section {
  margin-bottom: 0.75rem;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}
.progress-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.progress-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.progress-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-success);
  border-radius: var(--radius-pill);
  transition: width var(--transition-base);
}

.car-next-validation {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}
.car-next-validation strong {
  color: var(--text-secondary);
}

.car-card-footer {
  display: flex;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   Activity Log
   ═══════════════════════════════════════════ */
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.log-header .section-title {
  margin-bottom: 0;
}

.log-actions {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.collapse-icon {
  display: inline-block;
  font-size: 0.7rem;
  transition: transform var(--transition-fast);
}
.collapse-icon.collapsed {
  transform: rotate(-90deg);
}

.log-container {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  transition: max-height var(--transition-slow), opacity var(--transition-base);
}
.log-container.collapsed {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  opacity: 0;
}

.log-entries {
  display: flex;
  flex-direction: column;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  animation: slideUp var(--transition-base) ease-out;
  transition: background var(--transition-fast);
}
.log-entry:nth-child(odd) {
  background: rgba(0, 0, 0, 0.02);
}
.log-entry:hover {
  background: rgba(0, 0, 0, 0.04);
}

.log-timestamp {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.log-car-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.log-icon {
  font-size: 0.875rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 1px;
}

.log-message {
  color: var(--text-secondary);
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */
#app-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.footer-sep {
  opacity: 0.3;
}

/* ═══════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 2rem);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: #ffffff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  animation: toastIn var(--transition-base) ease-out;
  pointer-events: all;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.toast:hover {
  transform: translateX(-2px);
}
.toast.removing {
  animation: toastOut var(--transition-fast) ease-in forwards;
}

.toast-icon {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-message {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error   { border-left: 3px solid var(--accent-red); }
.toast.info    { border-left: 3px solid var(--accent-blue); }
.toast.warning { border-left: 3px solid var(--accent-yellow); }

/* ═══════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% {
    box-shadow: var(--shadow-card);
    border-color: rgba(59, 130, 246, 0.15);
  }
  50% {
    box-shadow: var(--shadow-card), 0 0 24px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.35);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  #app-main {
    padding: 1rem;
  }
  .glass-card {
    padding: 1.125rem;
  }
  .header-content {
    padding: 1rem;
  }
  .header-title {
    font-size: 1.25rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .cars-grid {
    grid-template-columns: 1fr;
  }
  .duration-group {
    flex-direction: column;
  }
  .duration-btn {
    min-width: unset;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn {
    width: 100%;
  }
  #toast-container {
    right: 0.5rem;
    top: 0.5rem;
    max-width: calc(100% - 1rem);
  }
}

@media (max-width: 480px) {
  .header-title-row {
    gap: 0.375rem;
  }
  .connection-badge {
    margin-left: 0;
    margin-top: 0.25rem;
  }
  .header-title-row {
    flex-wrap: wrap;
  }
  .car-plate {
    font-size: 1.25rem;
  }
}

/* ═══════════════════════════════════════════
   Login Screen
   ═══════════════════════════════════════════ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139, 92, 246, 0.06), transparent);
}

.login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  padding: 2.5rem 2rem;
  animation: fadeIn var(--transition-slow) ease-out;
}

.login-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.375rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.pin-input {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.75em;
  padding: 0.75rem 1rem;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  margin-bottom: 1.25rem;
}
.pin-input:focus {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-input-focus);
  background: #ffffff;
}
.pin-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.5em;
}

.btn-login {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
}

.login-error {
  color: var(--accent-red);
  font-size: 0.8125rem;
  margin-top: 1rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   Welcome Bar
   ═══════════════════════════════════════════ */
.user-welcome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.welcome-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   Admin Panel
   ═══════════════════════════════════════════ */
.subsection-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.users-table-wrapper {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.users-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.users-table td {
  padding: 0.625rem 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.users-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.users-table .plate-cell {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.admin-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--gradient-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-plate-input {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   Car Card — Ownership Styles
   ═══════════════════════════════════════════ */
.car-card.own-car {
  border-color: rgba(59, 130, 246, 0.25);
}

.car-card:not(.own-car) {
  opacity: 0.7;
}

.owner-badge {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* ═══════════════════════════════════════════
   Responsive — Login & Admin
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .login-card {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
  .user-welcome {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .pin-input {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
  }
  .users-table {
    font-size: 0.75rem;
  }
}

/* ═══════════════════════════════════════════
   Confirm Modal
   ═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn var(--transition-fast) ease-out;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 1.75rem;
  text-align: center;
  animation: slideIn var(--transition-base) ease-out;
}

.modal-message {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 100px;
}

/* ─── Utility ─── */
[hidden] {
  display: none !important;
}
