:root {
  --navy: #0f1b3c;
  --navy-2: #16234d;
  --orange: #f4772c;
  --orange-light: #fdece1;
  --text-primary: #101828;
  --text-secondary: #667085;
  --border: #e4e7ec;
  --bg-page: #f7f8fa;
  --red: #c00000;
  --yellow: #f4b400;
  --green: #12875a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
}

a { text-decoration: none; color: inherit; }

.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.brand-badge {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--orange); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: #aab3cc; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  padding: 11px 14px; border-radius: 8px; font-size: 14px; color: #cdd3e6;
  display: flex; align-items: center; gap: 10px;
}
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: var(--orange); color: #fff; font-weight: 600; }

.user-box {
  border-top: 1px solid rgba(255,255,255,0.12); padding-top: 16px; margin-top: 16px;
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--orange);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
}
.logout-link { display: block; margin-top: 12px; text-align: center; padding: 8px; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; font-size: 13px; }

/* ---------- Main content ---------- */
.content { flex: 1; padding: 28px 34px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar p { margin: 2px 0 0; color: var(--text-secondary); font-size: 13px; }

.hero {
  background: linear-gradient(120deg, var(--navy), var(--navy-2));
  color: #fff; border-radius: 14px; padding: 26px 30px; margin-bottom: 24px;
}
.hero .eyebrow { color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.hero h2 { margin: 6px 0 4px; font-size: 26px; }
.hero p { margin: 0; color: #cdd3e6; font-size: 14px; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 26px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px;
}
.card .num { font-size: 28px; font-weight: 700; margin: 6px 0 2px; }
.card .label { font-size: 13px; color: var(--text-secondary); }
.card.vencido .num { color: var(--red); }
.card.critico .num { color: #ff3b3b; }
.card.atencao .num { color: #c98b00; }
.card.ok .num { color: var(--green); }

.panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-secondary); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--border); }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
tr:hover td { background: #fafbfc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; }
.badge.VENCIDO { background: var(--red); }
.badge.CRITICO, .badge.CRÍTICO { background: #ff3b3b; }
.badge.ATENCAO, .badge.ATENÇÃO { background: var(--yellow); color: #3a2c00; }
.badge.OK { background: var(--green); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 5px; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
button, .btn {
  background: var(--orange); color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn.small { padding: 6px 12px; font-size: 12px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.flash.success { background: #e6f6ef; color: var(--green); }
.flash.error { background: #fdecec; color: var(--red); }
.flash.info { background: var(--orange-light); color: #8a4a1f; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-page); }
.login-card { background: #fff; border-radius: 14px; padding: 36px; width: 360px; box-shadow: 0 6px 24px rgba(16,24,40,0.08); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
