/* =============================================
   assets/style.css — Databel Intranet
   ============================================= */

:root {
  --azul:        #185FA5;
  --azul-dark:   #0C447C;
  --azul-light:  #E6F1FB;
  --verde:       #3B6D11;
  --verde-light: #EAF3DE;
  --warn:        #854F0B;
  --warn-light:  #FAEEDA;
  --erro:        #A32D2D;
  --erro-light:  #FCEBEB;
  --text:        #1a1a1a;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --border:      #e5e7eb;
  --border-md:   #d1d5db;
  --bg:          #f5f6f8;
  --bg-card:     #ffffff;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ---- LOGIN ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }

.login-wrap { width: 100%; max-width: 400px; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 2rem; }
.logo-icon {
  width: 40px; height: 40px; background: var(--azul);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-name { font-size: 16px; font-weight: 600; color: var(--text); }
.logo-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.login-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.login-desc  { font-size: 13px; color: var(--text-muted); margin-bottom: 1.5rem; }
.login-footer { font-size: 12px; color: var(--text-light); text-align: center; margin-top: 1rem; }

/* ---- TOPBAR ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-icon-sm {
  width: 30px; height: 30px; background: var(--azul);
  border-radius: 6px; flex-shrink: 0;
}
.topbar-titulo { font-size: 15px; font-weight: 600; }
.topbar-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--warn-light); color: var(--warn); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-usuario { font-size: 13px; color: var(--text-muted); }
.btn-logout {
  font-size: 12px; padding: 5px 12px;
  background: none; border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
}
.btn-logout:hover { background: var(--bg); }

/* ---- LAYOUT ---- */
.layout { display: flex; min-height: calc(100vh - 52px); }

.sidebar {
  width: 210px; min-width: 210px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
}
.nav-section { font-size: 11px; color: var(--text-light); padding: 0 1rem; margin: 1rem 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 1rem; font-size: 13px;
  color: var(--text-muted); text-decoration: none;
  border-left: 2px solid transparent; cursor: pointer;
  transition: background 0.1s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { color: var(--azul); border-left-color: var(--azul); background: var(--azul-light); font-weight: 500; }

.main { flex: 1; padding: 1.5rem; overflow-y: auto; }

/* ---- PAGE HEADER ---- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.page-header h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-header p  { font-size: 13px; color: var(--text-muted); }

/* ---- FIELDS ---- */
.field { margin-bottom: 1rem; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--border-md); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--bg-card); color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.field input:focus, .field select:focus { border-color: var(--azul); }

.input-pass { position: relative; }
.input-pass input { padding-right: 38px; }
.toggle-pass { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); }

.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media(max-width:640px) { .form-row-3, .form-row-2 { grid-template-columns: 1fr; } }

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: var(--azul); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--azul-dark); }
.btn-primary:disabled { background: var(--border-md); color: var(--text-light); cursor: not-allowed; }
.btn-primary.btn-block { width: 100%; justify-content: center; padding: 10px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; background: none;
  border: 1px solid var(--border-md); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-muted); cursor: pointer;
}
.btn-secondary:hover { background: var(--bg); }

.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn-download {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; background: var(--azul); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; margin-top: 10px;
}
.btn-download:hover { background: var(--azul-dark); }

.btn-tabela {
  font-size: 12px; padding: 4px 10px;
  background: none; border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
  margin-right: 4px;
}
.btn-tabela:hover { background: var(--bg); }
.btn-tabela-del:hover { background: var(--erro-light); color: var(--erro); border-color: #f7c1c1; }

/* ---- ALERTS ---- */
.alert { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 1rem; }
.alert-ok   { background: var(--verde-light); color: var(--verde); }
.alert-erro { background: var(--erro-light);  color: var(--erro); }

/* ---- CARDS / SECTIONS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 1rem; }

/* ---- METRICS ---- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.25rem; }
@media(max-width:720px){ .metrics { grid-template-columns: repeat(2,1fr); } }
.metric { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.metric-value { font-size: 24px; font-weight: 700; color: var(--text); }
.metric-value.success { color: var(--verde); }
.metric-value.warn    { color: var(--warn); }
.metric-value.sm      { font-size: 15px; margin-top: 4px; }

/* ---- INFO BOX ---- */
.info-box {
  display: flex; align-items: flex-start; gap: 8px;
  background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: #1d4ed8; margin-bottom: 1.25rem;
}

/* ---- FILTER BAR ---- */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 1.25rem; font-size: 13px; color: var(--text-muted); }
.filter-bar select { padding: 6px 10px; border: 1px solid var(--border-md); border-radius: var(--radius-sm); font-size: 13px; }

/* ---- DROP ZONE ---- */
.drop-zone {
  border: 2px dashed var(--border-md); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 1rem;
}
.drop-zone:hover { background: var(--bg); }
.drop-zone.has-file { border-color: var(--verde); background: var(--verde-light); }
.drop-zone p { font-size: 13px; color: var(--text-muted); margin: 8px 0 4px; }
.drop-zone.has-file p { color: var(--verde); font-weight: 500; }
.drop-zone span { font-size: 12px; color: var(--text-light); }
.drop-zone.has-file span { color: var(--verde); }

/* ---- PAYSLIP GRID ---- */
.payslip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.payslip-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow); transition: border-color 0.15s;
}
.payslip-card:hover { border-color: var(--border-md); }
.payslip-periodo { font-size: 11px; color: var(--text-light); margin-bottom: 3px; }
.payslip-mes     { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.payslip-tipo    { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.payslip-data    { font-size: 11px; color: var(--text-light); margin-top: 6px; }

/* ---- BADGES ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 20px; }
.badge-ok      { background: var(--verde-light); color: var(--verde); }
.badge-warn    { background: var(--warn-light);  color: var(--warn); }
.badge-erro    { background: var(--erro-light);  color: var(--erro); }
.badge-neutral { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ---- TABLE ---- */
.table-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 10px;
}
.table-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.table-filters input, .table-filters select {
  padding: 6px 10px; border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); font-size: 13px;
  background: var(--bg-card); color: var(--text);
}

.tabela { width: 100%; border-collapse: collapse; }
.tabela thead tr { border-bottom: 1px solid var(--border); }
.tabela th { padding: 9px 12px; font-size: 11px; color: var(--text-muted); font-weight: 600; text-align: left; text-transform: uppercase; letter-spacing: 0.04em; }
.tabela tbody tr { border-bottom: 1px solid var(--border); }
.tabela tbody tr:last-child { border-bottom: none; }
.tabela tbody tr:hover { background: var(--bg); }
.tabela td { padding: 10px 12px; font-size: 13px; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 1.5rem; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-lg { max-width: 580px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-muted); padding: 2px 6px; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1.25rem; }

/* ---- STATES ---- */
.loading-state { text-align: center; padding: 2.5rem; color: var(--text-muted); font-size: 13px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 3rem; color: var(--text-light); font-size: 13px; }
