:root {
  --bg: #0b1020;
  --panel: #121938;
  --border: #1f2a52;
  --accent: #2f4998;
  --text: #e9eef8;
  --muted: #a7b3d5;
  --ok: #28e07c;
  --err: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.container { max-width: 1200px; margin: 0 auto; padding: 14px 20px; }

.brand { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.brand h1 { 
  margin: 0; 
  font-size: 24px; 
  font-weight: 700;
  color: var(--accent);
}

.brand span {
  font-size: 14px;
  color: var(--muted);
}

nav.nav { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
  padding: 8px 0;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav a:hover {
  border-color: var(--accent);
  background: rgba(47, 73, 152, 0.1);
  transform: translateY(-1px);
}

.nav a.active { 
  border-color: var(--accent); 
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(47, 73, 152, 0.3);
}

.health { font-size: 12px; color: var(--muted); }
.ok { color: var(--ok); }
.err { color: var(--err); }

main .container { padding-top: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #4a90e2, var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.panel:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(47, 73, 152, 0.2);
  transform: translateY(-2px);
}

.panel:hover::before {
  opacity: 1;
}

.panel h2 { 
  margin: 0 0 24px; 
  font-size: 22px; 
  color: var(--text);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  position: relative;
}

.panel h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.panel h2 span:first-child {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

/* Form sections */
.form-section {
  margin-bottom: 20px;
  padding: 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.form-section:hover { border-color: var(--accent); }

.form-section h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  margin-bottom: 24px;
}

/* Full width field */
.field.full-width {
  min-width: 100%;
  grid-column: 1 / -1;
}

/* Form actions */
.form-actions {
  text-align: center;
  margin-top: 16px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px 20px;
  margin-bottom: 8px;
}
.field { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  min-width: 250px; 
  margin-bottom: 0;
}
label { 
  font-size: 14px; 
  color: var(--text); 
  font-weight: 500;
  margin-bottom: 4px;
}
input, select, textarea, button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 73, 152, 0.1);
}

button { 
  cursor: pointer; 
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 500;
  transition: all 0.2s ease;
}

button:hover { 
  background: #3a5bb8; 
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:disabled { 
  cursor: not-allowed; 
  background: #2a2a2a; 
  opacity: 0.6; 
  transform: none;
  box-shadow: none;
}

table { 
  width: 100%; 
  border-collapse: collapse; 
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
}

th, td { 
  text-align: left; 
  border-bottom: 1px solid var(--border); 
  padding: 12px 16px; 
  font-size: 14px; 
}

th {
  background: var(--bg);
  font-weight: 600;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

tr:hover {
  background: rgba(47, 73, 152, 0.05);
}

tr:last-child td {
  border-bottom: none;
}
code { background: var(--bg); border: 1px solid var(--accent); border-radius: 6px; padding: 2px 6px; }
.muted { 
  color: var(--muted); 
  font-size: 13px; 
  line-height: 1.4;
}

.muted.small {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
  margin-top: 4px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  text-decoration: none;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-block;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary:hover {
  background: #3a5bb8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.footer-note { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

/* Avatar styles */
.avatar-cell {
  text-align: center;
  vertical-align: middle;
}

.avatar-cell img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.avatar-cell img:hover {
  border-color: var(--accent);
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* File input styling */
input[type="file"] {
  padding: 8px;
  background: var(--bg);
  border: 1px dashed var(--accent);
}

input[type="file"]:hover {
  border-color: var(--text);
  background: #1a2340;
}

/* Avatar preview */
.avatar-preview {
  margin-top: 8px;
  text-align: center;
}

.avatar-preview img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Avatar input group */
.avatar-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.clear-btn {
  padding: 8px 12px;
  font-size: 12px;
  background: var(--err);
  border-color: var(--err);
  white-space: nowrap;
}

.clear-btn:hover {
  background: #d63031;
}

/* Radio button styles - removed, now using select dropdown */

/* Small text helper */
.small {
  font-size: 11px;
}

/* SMTP temp email UI - moved to /smtp-email page */

/* Modal styles */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 720px;
  width: 92%;
  padding: 16px 18px;
  position: relative;
}
.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

/* Specific tweaks for the count input */
#count {
  width: 100%;
  max-width: none;
  text-align: left;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

#count-field label {
  display: block;
  margin-bottom: 6px;
}

#count-field {
  min-width: 260px;
}

/* Make browser spin buttons visible but subtle on dark theme */
#count::-webkit-outer-spin-button,
#count::-webkit-inner-spin-button {
  opacity: 0.8;
  background: var(--panel);
}

#count::-webkit-inner-spin-button:hover {
  background: rgba(255, 255, 255, 0.06);
}
