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

:root {
  --primary: <%= theme.primary_color %>;
}

body {
  font-family: 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at top, #1a1a2e, #0d0d15 70%);
  color: #f1f1f1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.auth-logo img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-subtitle {
  text-align: center;
  color: #a0a0b0;
  font-size: 14px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #c0c0cc;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 6px;
}

.btn-primary:hover { opacity: 0.9; }

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: #808090;
  font-size: 13px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider span { padding: 0 12px; }

.btn-google {
  width: 100%;
  padding: 12px;
  background: #fff;
  border: none;
  border-radius: 8px;
  color: #333;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.btn-google img { width: 18px; height: 18px; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #a0a0b0;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

/* Dashboard */
.dash-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.badge-admin {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 8px;
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-box .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.stat-box .label {
  font-size: 12px;
  color: #a0a0b0;
  margin-top: 4px;
}

.btn-logout {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #f1f1f1;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.color-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-input-row input[type="color"] {
  width: 48px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

/* ===== Sécurité globale images ===== */
img {
  max-width: 100%;
  display: block;
}

.sidebar-brand img {
  width: 36px !important;
  height: 36px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  flex-shrink: 0;
}

.avatar {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  flex-shrink: 0;
}

.auth-logo img {
  width: 72px !important;
  height: 72px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  flex-shrink: 0;
}

/* ===== Sidebar v2 (style Untitled UI) ===== */
.sidebar-v2 {
  width: 260px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.025);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-v2 .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin-bottom: 28px;
}

.sidebar-nav-v2 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-item-v2:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.nav-item-v2.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
}

.nav-item-v2.active .nav-icon {
  color: var(--primary);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-item-v2:hover .nav-icon,
.nav-item-v2.active .nav-icon {
  color: var(--primary);
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 10px 8px;
}

.nav-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 2px 8px;
  border-radius: 20px;
}

.nav-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
}

.sidebar-logout-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 8px;
  padding-top: 16px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-logout-v2:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

@media (max-width: 800px) {
  .sidebar-v2 {
    display: none;
  }
}
