@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #eef3f7;
  --card: #fff;
  --ink: #0b1f3a;
  --mut: #5b6b7c;
  --line: #d5e1ea;
  --brand: #02de9c;
  --brand-d: #00b57f;
  --accent: #0b1f3a;
  --accent-2: #5eefc4;
  --ok: #00b57f;
  --warn: #b7791f;
  --err: #b42318;
  --r: 16px;
  --shadow: 0 10px 30px rgba(11, 31, 58, 0.08);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14.5px/1.5 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 110% -10%, rgba(2, 222, 156, 0.14), transparent 50%),
    radial-gradient(900px 420px at -10% 0, rgba(11, 31, 58, 0.10), transparent 46%),
    var(--bg);
}

a { color: var(--brand-d); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-lockup:hover { text-decoration: none; }
.brand-lockup img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(2, 222, 156, 0.35);
}
.brand-lockup b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-lockup small {
  display: block;
  color: var(--mut);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.userbox {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--mut);
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.nav { padding: 14px 12px; }
.nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
}
.nav a:hover, .nav a.active {
  background: linear-gradient(105deg, var(--brand), var(--brand-d));
  color: #0b1f3a;
  text-decoration: none;
}

.main { padding: 0; overflow: hidden; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}
.toolbar-meta { color: var(--mut); font-size: 0.95rem; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.toolbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.icon-form { display: inline; margin: 0; }
.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
}
a.icon-btn { color: var(--ink); }
.icon-btn:hover { background: #f6f7fb; text-decoration: none; }
.icon-btn.danger { color: var(--err); border-color: #f0c4c0; }
.icon-btn.danger:hover {
  background: #fde7e5;
  border-color: #e8a39d;
  color: #8f1a14;
}
.icon-btn svg { flex-shrink: 0; display: block; }

.search {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1 1 220px;
  max-width: 360px;
  margin: 0;
}
.search input[type="search"] {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: linear-gradient(#fff, #f5f8fb);
  box-shadow: inset 0 0 0 1px #d7e1ea;
  color: var(--ink);
}
.search input[type="search"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(2, 222, 156, 0.22), inset 0 0 0 1.5px var(--brand);
  background: #fff;
}

.bulkbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
}
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.check-all {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.nav a { position: relative; }
.nav a .badge {
  display: inline-flex;
  min-width: 1.4em;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(105deg, var(--brand), var(--brand-d));
  color: #0b1f3a;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}
.mut { color: var(--mut); font-size: 0.9rem; }
.attach-list ul { margin: 8px 0 0; padding-left: 18px; }
.attach-list li { margin: 6px 0; }

@media (max-width: 640px) {
  .bulk-actions .icon-btn span { display: none; }
  .search { max-width: none; flex: 1 1 100%; }
}

.btn, button.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background: #f6f7fb; text-decoration: none; }
.btn.p {
  background: linear-gradient(105deg, var(--brand), var(--brand-d));
  border-color: transparent;
  color: #0b1f3a;
  box-shadow: 0 8px 16px rgba(2, 222, 156, 0.28);
}
.btn.p:hover {
  background: linear-gradient(105deg, var(--brand-d), var(--brand));
  color: #fff;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
}

table.msgs { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; line-height: 1.35; }
table.msgs th, table.msgs td {
  text-align: left;
  padding: 9px 12px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.msgs th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mut);
  background: #f7fafc;
}
table.msgs tr:hover td { background: #f6fbfa; }
table.msgs tr.unseen td { font-weight: 700; }
table.msgs .subj { color: var(--ink); }
table.msgs th:nth-child(2), table.msgs .from { width: 36%; }
table.msgs th:nth-child(4), table.msgs .date { width: 118px; }
table.msgs .from b { display: block; font-weight: inherit; }
table.msgs .from small { display: block; font-size: 11px; font-weight: 400; color: var(--mut); }
table.msgs .subj { display: block; }
table.msgs .date { color: var(--mut); font-size: 12px; }
table.msgs .col-check { width: 40px; text-align: center; }
table.msgs .col-act {
  width: 60px;
  text-align: right;
  padding-right: 12px;
}
table.msgs .col-act .icon-btn { padding: 7px; }

.empty, .flash, .err { padding: 18px; margin: 0; }
.flash { color: var(--ok); background: #d9f6ec; }
.err { color: var(--err); background: #fde7e5; }

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  color: var(--mut);
  font-size: 0.92rem;
}

.msg-head {
  padding: 18px 20px 8px;
  border-bottom: 1px solid var(--line);
}
.msg-head h1 {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.meta { color: var(--mut); font-size: 0.95rem; line-height: 1.55; }
.meta strong { color: var(--ink); font-weight: 700; }
.msg-body {
  padding: 20px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.msg-body img { max-width: 100%; height: auto; }

/* —— Login (espelha o portão do painel) —— */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: #07111f;
  padding: 24px;
}
.login:before,
.login:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  animation: orb 10s ease-in-out infinite;
}
.login:before {
  width: 420px;
  height: 420px;
  left: -80px;
  top: -60px;
  background: radial-gradient(circle, rgba(2, 222, 156, 0.55), transparent 68%);
}
.login:after {
  width: 380px;
  height: 380px;
  right: -60px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(11, 31, 58, 0.5), transparent 68%);
  animation-delay: -4s;
}
@keyframes orb {
  50% { transform: translate3d(20px, 16px, 0) scale(1.08); }
}

.login .box {
  position: relative;
  z-index: 1;
  width: min(400px, 92vw);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.login .brand {
  display: block;
  margin: 0 auto 14px;
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(2, 222, 156, 0.4);
}

.login h1 {
  text-align: center;
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.login .sub {
  text-align: center;
  color: var(--mut);
  margin: 0 0 22px;
}

.login label {
  display: block;
  font-weight: 700;
  margin: 14px 0 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4b5d6e;
}
.login label:first-of-type { margin-top: 0; }

.login input[type="text"],
.login input[type="email"],
.login input[type="password"] {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  font-weight: 500;
  background: linear-gradient(#fff, #f5f8fb);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #d7e1ea;
  box-sizing: border-box;
}
.login input:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(2, 222, 156, 0.22), inset 0 0 0 1.5px var(--brand);
}

.login .btn.p {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
}

.login .hint {
  margin: 14px 0 0;
  text-align: center;
  color: var(--mut);
  font-size: 12px;
}

.login .err {
  border-radius: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
}

.form-pad { padding: 18px 20px 24px; }
.form-pad label {
  display: block;
  font-weight: 700;
  margin: 14px 0 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4b5d6e;
}
.form-pad input,
.form-pad textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  font-weight: 500;
  background: linear-gradient(#fff, #f5f8fb);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #d7e1ea;
}
.form-pad textarea { min-height: 220px; resize: vertical; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
