/* Firmas Email — estilos */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f6f8;
  color: #222;
  line-height: 1.5;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.topbar {
  background: #1a1f2b;
  color: #fff;
  padding: .85rem 0;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; }
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.topbar nav a { color: #d5dae3; margin-left: 1rem; text-decoration: none; font-size: .95rem; }
.topbar nav a:hover { color: #fff; }
.topbar nav a.logout { color: #ff9a9a; }

/* Main */
main { padding: 1.5rem 0 3rem; }

/* Footer */
.foot { padding: 1rem 0; color: #8a8f9b; border-top: 1px solid #e5e7eb; margin-top: 2rem; }
.foot small { font-size: .8rem; }

/* Cards */
.card {
  background: #fff;
  padding: 1.75rem;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  margin-bottom: 1.5rem;
}
.card.narrow { max-width: 520px; margin: 2rem auto; }

h1 { margin: 0 0 1rem; font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
h1 code { background: #eef2f6; padding: .1em .4em; border-radius: 4px; font-size: .85em; }

/* Forms */
form.stack label { display: block; margin-bottom: 1rem; font-weight: 500; font-size: .9rem; }
form.stack input, form.stack textarea, form.stack select {
  display: block;
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid #cfd4dc;
  border-radius: 6px;
  font: inherit;
  margin-top: .25rem;
  background: #fff;
}
form.stack input:focus, form.stack textarea:focus {
  outline: 2px solid #4c7bf7;
  outline-offset: 1px;
  border-color: #4c7bf7;
}
form.stack textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem; }
small { display: block; margin-top: .35rem; color: #666; font-size: .8rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .55rem 1rem;
  border-radius: 6px;
  border: 1px solid #cfd4dc;
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  color: #222;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f2f4f7; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Flashes */
.flash {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .95rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* Dashboard */
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.searchform { display: flex; gap: .5rem; }
.searchform input { padding: .5rem .7rem; border: 1px solid #cfd4dc; border-radius: 6px; min-width: 220px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stats > div {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stats strong { display: block; font-size: 1.8rem; color: #2563eb; }
.stats span { font-size: .85rem; color: #666; }

.domain-group {
  background: #fff;
  border-radius: 8px;
  padding: .85rem 1.25rem;
  margin-bottom: .75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.domain-group summary {
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  padding: .3rem 0;
  font-weight: 600;
}
.domain-group summary .count { color: #888; font-weight: 400; font-size: .85rem; }
.mailbox-list { list-style: none; padding: .5rem 0 0; margin: 0; }
.mailbox-list li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: .75rem;
  align-items: center;
  padding: .5rem 0;
  border-top: 1px solid #eee;
}
.mailbox-list .email { font-family: ui-monospace, monospace; font-size: .9rem; }
.status { font-size: .8rem; }
.status-ok { color: #16a34a; }
.status-off { color: #9ca3af; }

/* Edit */
.edit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.edit-form textarea { min-height: 320px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.actions { display: flex; gap: .5rem; margin-top: 1rem; }

/* Setup / QR */
.qr-box { display: flex; justify-content: center; margin: 1rem 0; background: #fff; padding: 1rem; border-radius: 6px; }
pre.secret {
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  padding: .75rem;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: .95rem;
  text-align: center;
  letter-spacing: .05em;
  word-break: break-all;
}
