:root {
  --bg: #0e1014;
  --card: #151823;
  --panel: #1e2230;
  --muted: #9aa3b2;
  --accent: #3b79ff;
  --err: #ff4e6a;
  --ok: #27c693;
  --border: #2c2f3a;
  --font: 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: white;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

h1, h2 {
  margin-bottom: 0.5em;
  color: white;
}

h1 {
  font-size: 1.6rem;
  font-weight: 600;
}

h2 {
  font-size: 1.2rem;
  margin-top: 1.8em;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

input, textarea, select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 14px;
  color: white;
  font-size: 0.95rem;
  transition: 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 121, 255, 0.3);
}

textarea {
  resize: vertical;
}

.form-section {
  padding: 10px;
  background-color: var(--panel);
  margin-bottom: 20px;
  border-radius: 10px;
}

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .btn {
  margin-right: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

button.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: 0.3s ease;
}

button.btn:hover {
  background: #2d5fd1;
}

button.btn.ghost {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

button.btn.ghost:hover {
  background: rgba(59, 121, 255, 0.1);
}

footer.foot-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 40px;
  padding-bottom: 40px;
}

/* Saved Emails Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--panel);
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.email-entry {
  background: var(--card);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: white;
}

.email-entry button {
  margin-top: 8px;
  font-size: 0.85rem;
  background: var(--accent);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: white;
}

.email-entry button:hover {
  background: #2d5fd1;
}

/* Mobile */
@media (max-width: 768px) {
  .actions {
    flex-direction: column;
  }

  header.topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 1.1rem;
  }
}

/* === SmartWerk Unified Buttons === */
.btn, button.btn, a.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  min-width: 160px;
  box-sizing: border-box;
}

.btn:hover {
  background: #2d5fd1;
  transform: translateY(-1px);
}

/* Ghost version (Back to Templates, etc.) */
.btn.ghost {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.ghost:hover {
  background: rgba(59, 121, 255, 0.1);
}

/* Responsive + spacing */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  margin: 16px 0;
}

@media (max-width: 768px) {
  .btn {
    width: 100%;
    min-width: unset;
    text-align: center;
  }
  .actions {
    flex-direction: column;
  }
}

.topbar {
  display: flex;
  justify-content: flex-start;
  margin: 20px 0;
  padding: 0 20px;
}

.topbar nav a.btn {
  background-color: #3b79ff;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 10px;
  margin-right: 10px;
  display: inline-block;
  transition: background-color 0.2s ease-in-out;
}

.topbar nav a.btn:hover {
  background-color: #2a66db;
  color: white;
}
