/* La Vie — Sistema de Gestão · estilo derivado do protótipo */

:root {
  --bg: #f4f2ed;
  --ink: #2a3340;
  --ink-soft: #5b6470;
  --muted: #9aa0aa;
  --line: #e9e5dc;
  --card: #ffffff;
  --topbar: #fffdfa;

  --navy-1: #1a2738;
  --navy-2: #13202f;
  --navy-3: #101b29;
  --nav-label: #5f6f82;
  --nav-ink: #cfd6de;

  --gold: #c69a5b;
  --gold-light: #e7c887;
  --gold-dark: #9b6f43;
  --green: #3f9b6d;
  --green-wa: #25d366;
  --red: #c25b54;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 39, 56, .04), 0 6px 20px rgba(26, 39, 56, .05);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Open Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Jost', sans-serif; font-weight: 500; margin: 0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d7d2c7; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; width: 100%; }

.sidebar {
  width: 250px; flex: none;
  background: linear-gradient(185deg, var(--navy-1) 0%, var(--navy-2) 60%, var(--navy-3) 100%);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { padding: 26px 22px 20px; border-bottom: 1px solid rgba(198, 154, 91, .16); }
.sidebar__brand img { height: 30px; display: block; }
.sidebar__brandsub {
  font-family: 'Jost', sans-serif; font-weight: 300; font-size: 9.5px;
  letter-spacing: 5px; color: var(--gold); margin-top: 8px;
}
.sidebar__nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10px; letter-spacing: 1.5px; color: var(--nav-label); padding: 14px 12px 6px; font-weight: 600; }
.nav-label:first-child { padding-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  color: var(--nav-ink); font-size: 13.5px; transition: background .15s;
}
.nav-item:hover { background: rgba(198, 154, 91, .10); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item.is-active { background: rgba(198, 154, 91, .16); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.nav-item .badge { margin-left: auto; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 9px; color: #fff; }
.badge--green { background: var(--green-wa); }
.badge--red { background: var(--red); }

.sidebar__foot { padding: 13px 14px; border-top: 1px solid rgba(198, 154, 91, .16); }
.sidebar__foot .cap { font-size: 9px; color: var(--nav-label); font-weight: 600; letter-spacing: 1px; margin-bottom: 7px; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: var(--navy-1); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user__name { font-size: 12.5px; font-weight: 600; color: #eef1f4; line-height: 1.3; }
.user__role { font-size: 10.5px; color: #7d8b9c; }
.perm-pill {
  display: flex; align-items: center; gap: 8px; margin-top: 11px;
  background: rgba(198, 154, 91, .10); border: 1px solid rgba(198, 154, 91, .22);
  border-radius: 8px; padding: 8px 10px;
}
.perm-pill .lbl { font-size: 9px; color: #8190a1; font-weight: 600; letter-spacing: .5px; }
.perm-pill .val { font-size: 11.5px; color: var(--gold-light); font-weight: 700; }
.logout-btn {
  margin-top: 10px; width: 100%; background: none; border: 1px solid rgba(198,154,91,.22);
  color: #9aa7b6; border-radius: 8px; padding: 7px; font-size: 11.5px; cursor: pointer; font-family: inherit;
}
.logout-btn:hover { color: #fff; border-color: rgba(198,154,91,.5); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 70px; flex: none; background: var(--topbar); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 21px; color: var(--navy-1); letter-spacing: .3px; white-space: nowrap; }
.topbar .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar .spacer { margin-left: auto; }
.topbar .date {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: #7b818b;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; white-space: nowrap;
}
.content { padding: 24px 26px; flex: 1; }

/* busca no topo */
.topsearch { display: flex; align-items: center; gap: 8px; margin-left: 18px; background: #f4f2ec; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; width: 300px; max-width: 32vw; }
.topsearch input { border: none; background: none; outline: none; font-family: inherit; font-size: 13px; width: 100%; color: var(--ink); }
.topsearch input::placeholder { color: #a39b8c; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.card__title { font-size: 16px; color: var(--navy-1); }
.card__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.grid { display: grid; gap: 18px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-family: 'Jost', sans-serif; color: var(--navy-1); margin-top: 6px; }
.kpi .v.green { color: var(--green); }

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; border-radius: 9px;
  padding: 10px 16px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.btn:hover { border-color: #d8d2c5; }
.btn--gold { background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: #2a2410; border: none; }
.btn--gold:hover { filter: brightness(1.03); }
.btn--ghost { background: none; }
.btn--sm { padding: 7px 12px; font-size: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 8px 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
}
.chip.is-active { border-color: var(--green); color: var(--green); background: rgba(63,155,109,.06); }
.tabs { display: inline-flex; gap: 6px; background: #efece4; border-radius: 10px; padding: 4px; }
.tab { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 7px 14px; border-radius: 7px; }
.tab.is-active { background: #fff; color: var(--navy-1); box-shadow: var(--shadow); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--ink-soft); text-transform: uppercase; }
.input, .select, .textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; background: #fff; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,154,91,.12); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.error { color: var(--red); font-size: 12px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid #f1eee7; color: var(--ink); }
.table tr:hover td { background: #faf8f3; }
.table .right { text-align: right; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 13.5px; }

/* ---------- Status pills ---------- */
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.pill--ok { background: rgba(63,155,109,.12); color: var(--green); }
.pill--wait { background: rgba(198,154,91,.14); color: var(--gold-dark); }
.pill--gray { background: #eee; color: #777; }
.pill--red { background: rgba(194,91,84,.12); color: var(--red); }
.pill--blue { background: rgba(91,134,184,.14); color: #4d6fa0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  background: var(--navy-1); color: #fff; padding: 13px 18px; border-radius: 10px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px;
}
.toast--ok { border-left: 3px solid var(--green); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(185deg, var(--navy-1), var(--navy-3));
  padding: 24px;
}
.login__card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login__brand { text-align: center; margin-bottom: 26px; }
.login__brand img { height: 38px; }
.login__brand .sub { font-family: 'Jost', sans-serif; font-weight: 300; font-size: 10px; letter-spacing: 5px; color: var(--gold); margin-top: 8px; }
.login__card h1 { font-size: 18px; color: var(--navy-1); text-align: center; margin-bottom: 4px; }
.login__card .hint { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.login .field + .field { margin-top: 14px; }
.login .btn--gold { width: 100%; justify-content: center; margin-top: 20px; padding: 12px; }

@media (max-width: 900px) {
  .sidebar { width: 66px; }
  .sidebar__brandsub, .nav-item span:not(.badge), .nav-label, .sidebar__foot .user__name,
  .sidebar__foot .user__role, .perm-pill, .sidebar__foot .cap, .logout-btn { display: none; }
}
