:root {
  --bg: #f3f5f8;
  --ink: #1c2430;
  --muted: #5c6774;
  --line: #e1e6ee;
  --card: #ffffff;
  --blue: #183c60;
  --blue-ink: #102844;
  --orange: #e07a32;
  --danger: #8d2e2e;
  --danger-bg: #f8ecec;
  --ok-bg: #e7eef6;
  --shadow: 0 18px 50px rgba(24, 60, 96, 0.1);
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1000px 420px at 0% -10%, rgba(24, 60, 96, 0.08), transparent 55%) no-repeat,
    var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

p { margin: 0; }

a { color: var(--blue); }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
}

.logo {
  display: block;
  width: auto;
  max-width: 250px;
  max-height: 174px;
  margin: 0 auto 18px;
  object-fit: contain;
}

.login-card h1,
.login-kicker { text-align: center; }

.login-kicker {
  color: var(--muted);
  margin: 6px 0 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 68px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 72px;
}

.brand img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav a.is-active {
  color: var(--ink);
  background: #e7eef5;
}

.who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.who-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: right;
}

.who-name small { color: var(--muted); }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.lede {
  color: var(--muted);
  margin-top: 8px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  gap: 16px;
  margin-top: 28px;
}

.module,
.note,
.form-card,
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.module {
  display: block;
  padding: 18px 18px 16px;
  color: inherit;
  text-decoration: none;
}

.module:hover { border-color: #b9cbe0; }

.module span { font-weight: 700; }

.module strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
  letter-spacing: -0.04em;
  color: var(--blue);
}

.module p,
.note p { color: var(--muted); }

.note { padding: 18px; margin-top: 24px; }

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #e8edf3;
  vertical-align: middle;
}

th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td { border-bottom: 0; }

tbody tr:hover { background: #f7f9fb; }

.actions {
  text-align: right;
  white-space: nowrap;
}

.actions a {
  font-weight: 700;
  text-decoration: none;
  margin-left: 14px;
}

.actions a.danger { color: var(--danger); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge-manager { background: #e6eef6; color: var(--blue); }
.badge-usuario { background: #fdeede; color: #9a4e16; }

.you {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
}

.empty { color: var(--muted); }

.form-card {
  max-width: 560px;
  padding: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label { font-size: 14px; font-weight: 700; }

.hint,
.field-error { font-size: 13px; }

.hint { color: var(--muted); }

.field-error { color: var(--danger); }

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid #cfd6e0;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid rgba(24, 60, 96, 0.28);
  border-color: var(--blue);
}

input.is-invalid,
select.is-invalid { border-color: #d7a3a3; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-ink); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; height: 46px; }

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.alert-ok { background: var(--ok-bg); color: var(--blue-ink); }
.alert-error { background: var(--danger-bg); color: var(--danger); }

@media (max-width: 720px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px 16px;
  }

  .who { width: 100%; justify-content: flex-end; }
  .page { padding: 22px 16px 56px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .login-card { padding: 28px 20px 22px; }
}
