@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --dark: #0f172a;
  --dark-100: #1e293b;
  --dark-200: #334155;
  --light: #f8fafc;
  --gray: #94a3b8;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(99, 102, 241, 0.2);
  --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  color: var(--light);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -250px;
  right: -250px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  bottom: -200px;
  left: -200px;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 3rem;
  width: 90%;
  max-width: 450px;
  box-shadow: var(--card-shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}

.login-card h2 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--gray);
  font-size: 0.875rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  pointer-events: none;
  z-index: 1;
}

input, select {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid var(--dark-200);
  border-radius: 16px;
  color: var(--light);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input.valid {
  border-color: var(--success);
}

input.invalid {
  border-color: var(--error);
}

.validation-message {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  padding-left: 3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.validation-message.valid {
  color: var(--success);
}

.validation-message.invalid {
  color: var(--error);
}

.validation-message .icon {
  font-size: 0.875rem;
}

.password-input-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--gray);
  user-select: none;
  z-index: 10;
}

.login-btn, .btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.login-btn:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.login-btn:disabled, .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  background: rgba(239, 68, 68, 0.2);
  border-left: 3px solid var(--error);
  padding: 0.75rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #fca5a5;
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dark-200);
  font-size: 0.75rem;
  color: var(--gray);
}

.logout-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(239, 68, 68, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  color: #fca5a5;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 100;
  display: none;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

.admin-panel {
  position: fixed;
  top: 1rem;
  left: 1rem;
  background: rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  color: var(--primary-light);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 100;
  display: none;
}

.admin-panel:hover {
  background: rgba(99, 102, 241, 0.3);
}

.stats-badge {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 185, 129, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  color: var(--success);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 100;
  display: none;
}

.main-content {
  display: none;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--gray);
  font-size: 1.125rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 2rem;
  transition: all 0.4s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  flex-direction: column;
  gap: 1rem;
}

.modern-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 24px;
  border: 1px solid var(--glass-border);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--dark-200);
}

.result-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--dark-200);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 500;
  color: var(--gray);
}

.result-value {
  font-weight: 600;
  color: var(--primary-light);
}

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background: var(--dark-100);
  border-left: 4px solid;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--primary); }

.vin-validation {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  padding-left: 3rem;
}

.vin-valid { color: var(--success); }
.vin-invalid { color: var(--error); }

.success-message {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  border-radius: 16px;
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-message p {
  margin: 0.5rem 0;
}

.success-message .checkmark {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1500;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 2rem;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--dark-200);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.close-modal {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--gray);
}

.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--dark-200);
}

.user-table th {
  color: var(--gray);
  font-weight: 600;
}

.delete-user-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--error);
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  color: #fca5a5;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.delete-user-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.edit-user-btn {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  color: var(--primary-light);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.edit-user-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.view-vins-btn {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  color: var(--primary-light);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.view-vins-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

#historyMonthFilter {
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid var(--dark-200);
  border-radius: 8px;
  color: var(--light);
  padding: 0.5rem;
  font-family: inherit;
  cursor: pointer;
}

#historyMonthFilter:focus {
  outline: none;
  border-color: var(--primary);
}

.report-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .container { padding: 1rem; }
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .card { padding: 1.5rem; }
  .login-card { padding: 2rem; margin: 1rem; }
}