/* VoltCare Design System - Dark Mode Glassmorphism */

:root {
  --bg-primary: #0b0f19;
  --bg-card: rgba(22, 29, 49, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #4f46e5;
  --primary-hover: #6366f1;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --accent: #00f2fe;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 2rem;
}

/* Ambient glow backgrounds */
.glow-bg {
  position: fixed;
  top: -10%;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, rgba(0, 242, 254, 0.05) 50%, transparent 100%);
  border-radius: 50%;
  z-index: -1;
  filter: blur(60px);
  pointer-events: none;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.logo {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.logo span {
  font-weight: 300;
  color: var(--text-muted);
}

.accent-dot {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 15px var(--primary);
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* Glassmorphism Card styling */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: 16px;
}

.card {
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  color: var(--text-main);
  background: var(--primary);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

/* Form Styles */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Google Sign-In wrapper */
#dealer-login-form {
  text-align: center;
}
#dealer-login-form .g_id_signin {
  display: inline-block;
}

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

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.25);
}

/* Buttons */
.btn {
  display: inline-block;
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  width: auto;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

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

.danger-btn:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

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

.success-btn:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.sm-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Dashboard Panels */
.dashboard-panel {
  padding: 2rem;
  margin-bottom: 2rem;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dealer-badge {
  background: rgba(79, 70, 229, 0.2);
  color: #818cf8;
  border: 1px solid rgba(79, 70, 229, 0.4);
}

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

.sub-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.code-span {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
}

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

.dash-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.dash-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.full-width {
  grid-column: 1 / -1;
}

/* Tokens and Raw Payloads */
.token-container {
  margin-bottom: 1.5rem;
}

.token-item {
  margin-bottom: 1rem;
}

.token-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.token-val {
  background: #05070c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: #34d399;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
}

/* Console Logs */
.logs-box {
  background: #05070c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  height: 180px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.log-line {
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.log-line.info { color: #60a5fa; }
.log-line.success { color: #34d399; }
.log-line.error { color: #f87171; }
.log-line.warn { color: #fbbf24; }

.clear-logs-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
}

.clear-logs-btn:hover {
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

/* Employee List Table */
.emp-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.emp-list-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}
.emp-table {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.emp-row {
  display: grid;
  grid-template-columns: 40px 1.5fr 2fr 100px 1.5fr;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  align-items: center;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}
.emp-row:last-child {
  border-bottom: none;
}
.emp-row-header {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.15);
}
.emp-row-revoked {
  opacity: 0.5;
}
.emp-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.emp-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}
.emp-col-check {
  display: flex;
  align-items: center;
  justify-content: center;
}
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.status-revoked {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .dash-header {
    flex-direction: column;
    gap: 1rem;
  }
  .dash-header button {
    width: 100%;
  }
}
