:root {
  --bg: #eef3f8;
  --card: #ffffff;
  --primary: #0a4c78;
  --secondary: #7db241;
  --warning: #f0ad00;
  --muted: #6b7280;
  --danger: #d9534f;
  --border: #d9e0ea;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: #1f2937;
}

/* ── TOPBAR ── */
.topbar {
  background: linear-gradient(90deg, #003a63, #0a4c78);
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-logos {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-amazon {
  height: 44px;
  width: auto;
  background: white;
  border-radius: 8px;
  padding: 4px 8px;
  object-fit: contain;
}
.logo-id {
  height: 44px;
  width: auto;
  background: white;
  border-radius: 8px;
  padding: 4px 8px;
  object-fit: contain;
}
.logo-lion {
  height: 52px;
  width: auto;
  object-fit: contain;
}
.topbar-title { flex: 1; }
.topbar h1 { margin: 0 0 4px; font-size: 28px; }
.topbar p { margin: 0; font-size: 14px; opacity: .9; }
.topbar nav { display: flex; gap: 8px; flex-shrink: 0; }
.topbar a {
  color: white; text-decoration: none; font-weight: bold; padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 8px;
  transition: background .2s;
}
.topbar a:hover, .topbar a.active {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.6);
}

/* ── CONTAINER ── */
.container { padding: 18px; }

/* ── HOME PAGE ── */
.home-hero {
  text-align: center;
  padding: 32px 0 16px;
  color: var(--primary);
}
.home-hero h2 { margin: 0 0 8px; font-size: 26px; }
.home-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.home-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 16px;
}
.home-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 36px 20px;
  text-decoration: none;
  color: #1f2937;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.home-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  border-color: var(--primary);
}
.home-btn-icon {
  font-size: 42px;
  margin-bottom: 14px;
  color: var(--primary);
  font-weight: bold;
}
.home-btn-label {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 8px;
  text-align: center;
}
.home-btn-desc {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.page-title { margin: 0; color: var(--primary); font-size: 22px; }
.back-btn {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
  font-weight: bold;
}

/* ── FORM CARD ── */
.form-card { max-width: 760px; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

/* ── CARDS / GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; align-items: start; }
.card {
  background: var(--card); border-radius: 12px; padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07); border: 1px solid var(--border);
}
.card h2 { margin-top: 0; color: var(--primary); font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid input, .form-grid select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 14px;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ── TOOLBAR ── */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input {
  flex: 1; min-width: 220px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
}

/* ── BUTTONS ── */
.btn {
  background: #dce6f2; color: #123; border: none; border-radius: 8px; padding: 10px 14px;
  cursor: pointer; font-weight: bold; font-size: 14px; text-decoration: none;
  display: inline-block;
}
.btn.primary { background: var(--secondary); color: white; }
.btn.danger { background: var(--danger); color: white; }
.btn:hover { opacity: .88; }
.file-btn input { display: none; }

/* ── TABLE ── */
.table-wrap { max-height: 540px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { position: sticky; top: 0; background: var(--primary); color: white; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
tbody tr:hover { background: #f0f6ff; }
.total-registros {
  text-align: right; font-size: 13px; color: var(--muted); padding: 8px 4px 0;
}

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: bold;
}
.badge.off        { background: #fde2e2; color: #a11; }
.badge.operacional{ background: #dcfce7; color: #166534; }
.badge.licenca    { background: #fef3c7; color: #92400e; }
.badge.ferias     { background: #e0f2fe; color: #0277bd; }
.badge.desligado  { background: #f3e8ff; color: #6a1b9a; }

/* ── BOTÃO PEQUENO ── */
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ── COLUNA COMENTÁRIO ── */
.td-comment { max-width: 200px; }
.comment-cell {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 190px; font-size: 12px; color: #374151; cursor: help;
}
.comment-empty { color: #9ca3af; font-size: 13px; }

/* ── MODAL DINÂMICO DE STATUS ── */
.status-block { margin-top: 14px; border-radius: 10px; padding: 14px; }
.status-block.hidden { display: none; }
.status-block { background: #f8fafc; border: 1px solid #e2e8f0; }
.status-block-title {
  font-weight: bold; font-size: 13px; color: #0277bd;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px;
}
.status-block-title.deslig { color: #c62828; }
.op-info { margin: 0; color: #166534; font-weight: bold; font-size: 14px; }
.field-label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; font-weight: bold; }
.textarea-full {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #d1d5db;
  font-size: 14px; resize: vertical; font-family: inherit;
}
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }

/* ── MENSAGEM ── */
.mensagem { min-height: 24px; margin-bottom: 8px; font-weight: bold; }

/* ── MODAL ── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex;
  align-items: center; justify-content: center; z-index: 999;
}
.modal.hidden { display: none; }
.modal-content { width: min(760px, 92vw); }
.modal-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }

/* ── DASHBOARD LAYOUT ── */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}
.dash-filters {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  padding: 14px;
  position: sticky;
  top: 16px;
}
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: bold;
  color: var(--primary);
  font-size: 14px;
}
.btn-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.btn-clear:hover { border-color: var(--primary); color: var(--primary); }
.filter-group { margin-bottom: 14px; }
.filter-group label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-pill {
  background: #f0f4f8;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  color: #374151;
}
.filter-pill:hover  { border-color: var(--primary); color: var(--primary); }
.filter-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── DASHBOARD CARDS ── */
.cards-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: white; border-radius: 12px; border-top: 6px solid var(--primary); padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.stat-card.card-blue   { border-top-color: #1565c0; }
.stat-card.card-green  { border-top-color: #2e7d32; }
.stat-card.card-orange { border-top-color: #e65100; }
.stat-card.card-teal   { border-top-color: #00897b; }
.stat-card.card-purple { border-top-color: #6a1b9a; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; font-weight: bold; letter-spacing: .4px; }
.stat-card strong { font-size: 34px; color: #111827; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.chart-card { min-height: 320px; }
.chart-card canvas { cursor: pointer; }
.chart-card h2 { font-size: 15px; margin: 0 0 12px; color: var(--primary); font-weight: bold; }

/* ── FILTROS NA LISTA (atualizar) ── */
.filter-select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: white;
  color: #1f2937;
  min-width: 140px;
}

/* ── TOPBAR USER ── */
.topbar-user {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.user-greeting {
  color: rgba(255,255,255,.9); font-size: 13px; font-weight: bold;
}
.user-level-badge {
  background: var(--warning); color: #000; font-size: 11px; font-weight: bold;
  padding: 2px 8px; border-radius: 999px;
}
.logout-btn {
  color: white; text-decoration: none; font-size: 13px; font-weight: bold;
  padding: 6px 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 6px;
  transition: background .2s;
}
.logout-btn:hover { background: rgba(255,255,255,.15); }

/* ── LOGIN PAGE ── */
.login-body { background: linear-gradient(135deg, #003a63 0%, #0a4c78 60%, #7db241 100%); min-height: 100vh; }
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: white; border-radius: 20px; padding: 40px 48px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 420px;
}
.login-logos {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px;
}
.login-logos .logo-amazon,
.login-logos .logo-id { height: 40px; }
.login-logos .logo-lion { height: 48px; }
.login-title { text-align: center; margin-bottom: 28px; }
.login-title h1 { margin: 0 0 4px; font-size: 20px; color: var(--primary); }
.login-title p  { margin: 0; font-size: 13px; color: var(--muted); }
.login-field { margin-bottom: 16px; }
.login-field label {
  display: block; font-size: 12px; font-weight: bold; color: var(--muted);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px;
}
.login-field input {
  width: 100%; padding: 11px 14px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 14px; outline: none;
  transition: border-color .2s;
}
.login-field input:focus { border-color: var(--primary); }
.login-submit { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }
.login-version { text-align: center; font-size: 11px; color: var(--muted); margin: 16px 0 0; }

/* ── ALERT ── */
.alert {
  padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
}
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ── PENDÊNCIA BANNER ── */
.pendencia-banner {
  display: flex; align-items: center; gap: 12px;
  background: #fff7ed; border: 2px solid #fb923c; border-radius: 12px;
  padding: 14px 20px; margin-bottom: 16px; text-decoration: none; color: #9a3412;
  transition: background .2s;
}
.pendencia-banner:hover { background: #ffedd5; }
.pendencia-icon { font-size: 22px; flex-shrink: 0; }
.pendencia-text { flex: 1; font-size: 14px; }
.pendencia-arrow { font-size: 20px; flex-shrink: 0; }

/* ── HOME BUTTONS (5 cards) ── */
.home-buttons { grid-template-columns: repeat(3, 1fr); }
.home-btn-alert { border-color: #fb923c !important; }
.home-btn-alert .home-btn-icon { color: #ea580c; }

/* ── PENDÊNCIA INFO CARD ── */
.pendencia-info-card { padding: 16px 20px; }
.pend-label { display: block; font-size: 11px; font-weight: bold; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.pend-total { font-size: 28px; font-weight: bold; color: var(--primary); display: block; }
.pend-prazo  { font-size: 20px; font-weight: bold; color: #92400e; display: block; }

/* ── HISTORY TABS ── */
.hist-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.hist-tab {
  background: none; border: none; padding: 10px 20px; font-size: 14px; font-weight: bold;
  color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0; margin-bottom: -2px;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.hist-tab:hover { color: var(--primary); background: #f0f6ff; }
.hist-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: white; }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-filters { position: static; }
  .filter-pills { flex-direction: row; }
}
@media (max-width: 1100px) {
  .grid-2, .dashboard-grid, .cards-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .home-buttons { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .home-buttons { grid-template-columns: 1fr; }
  .topbar-user { display: none; }
}
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; }
  .topbar-title h1 { font-size: 20px; }
  .topbar nav { width: 100%; justify-content: center; }
}
