/* ============================================================
   components.css — Botões, Cards, Inputs, Formulários
   ============================================================ */

/* ── Botões ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer;
  font-family: 'Sora', sans-serif; font-weight: 600;
  border-radius: var(--r-sm); transition: var(--transition);
  padding: 9px 16px; font-size: 13px; line-height: 1;
  white-space: nowrap; text-decoration: none; color: inherit;
  -webkit-user-select: none; user-select: none;
}
.btn:hover  { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; filter: none !important; }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.btn-primary   { background: var(--amber); color: #0b0d14; }
.btn-secondary { background: var(--bg7); color: var(--t4); border: 1px solid var(--bd2); }
.btn-danger    { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }
.btn-success   { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); }
.btn-blue      { background: var(--blue); color: white; }
.btn-ghost     { background: transparent; color: var(--t4); }
.btn-ghost:hover { background: var(--bg7); color: var(--t2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; border-radius: var(--r-sm); }
.btn-full { width: 100%; }

/* ── Inputs ─────────────────────────────────────────────── */
.input, .select, .textarea {
  background: var(--inp); border: 1.5px solid var(--bd2);
  color: var(--t2); font-family: 'Sora', sans-serif;
  padding: 10px 14px; border-radius: var(--r-sm);
  font-size: 14px; outline: none; width: 100%;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--amber); background: var(--inp-f);
}
.input::placeholder { color: var(--t6); }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input option { background: var(--bg4); }
.textarea { resize: vertical; min-height: 72px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f59e0b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 34px;
}

.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid   { display: grid; gap: 14px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg4); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 20px;
}
.card-sm { padding: 14px 16px; border-radius: var(--r-md); }
.card:hover { border-color: var(--bd2); }

.stat-card {
  background: var(--bg4); border: 1px solid var(--bd2);
  border-radius: var(--r-lg); padding: 16px 18px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ── Avatar ─────────────────────────────────────────────── */
.av {
  flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 10px;
  font-weight: 700; color: white; letter-spacing: -.5px;
}
.av-m { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.av-f { background: linear-gradient(135deg, #ec4899, #a855f7); }

/* ── Sidebar item ────────────────────────────────────────── */
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--t4);
  transition: var(--transition); margin-bottom: 2px;
  border: 1px solid transparent;
  text-decoration: none;
}
.sidebar-item:hover { background: var(--bg7); color: var(--t2); }
.sidebar-item.active {
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 25%, transparent);
}
.sidebar-item .badge-count {
  margin-left: auto; background: var(--red);
  color: white; font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 6px; min-width: 18px;
  text-align: center;
}

/* ── Theme toggle ────────────────────────────────────────── */
.theme-toggle {
  background: none; border: 1.5px solid var(--bd2);
  border-radius: 20px; padding: 4px 10px; cursor: pointer;
  font-size: 14px; color: var(--t4); transition: var(--transition);
  display: flex; align-items: center; gap: 5px;
}
.theme-toggle:hover { border-color: var(--amber); color: var(--amber); }

/* ── Section header ──────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 18px;
}
.section-title { font-size: 21px; font-weight: 700; color: var(--t1); letter-spacing: -.5px; }
.section-sub   { font-size: 12px; color: var(--t5); margin-top: 3px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn {
  padding: 7px 14px; background: var(--bg7); color: var(--t4);
  border: 1px solid var(--bd2); border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.tab-btn.active { background: var(--amber); color: #0b0d14; border-color: var(--amber); }
.tab-btn:hover:not(.active) { background: var(--bg8); color: var(--t2); }

/* ── Info box fds/feriado ────────────────────────────────── */
.sched-box {
  border-radius: var(--r-md); padding: 13px 14px;
  display: grid; gap: 4px;
}
.sched-box-normal { background: color-mix(in srgb, var(--blue) 8%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent); }
.sched-box-fds    { background: color-mix(in srgb, var(--amber) 8%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 20%, transparent); }
.sched-box-feriado{ background: color-mix(in srgb, var(--pink) 8%, transparent); border: 1px solid color-mix(in srgb, var(--pink) 20%, transparent); }

/* ── Banco de horas pill ─────────────────────────────────── */
.banco-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 700;
}
.banco-pos { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.banco-neg { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.banco-zero{ background: var(--bg7); color: var(--t5); }

/* ── Filtros bar ─────────────────────────────────────────── */
.filter-bar {
  background: var(--bg4); border: 1px solid var(--bd2);
  border-radius: var(--r-md); padding: 12px 16px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 18px;
}
.filter-bar .input, .filter-bar .select { max-width: 180px; }

/* ── Footer ──────────────────────────────────────────────── */
.pg-footer {
  text-align: center; padding: 18px 0 10px;
  font-size: 11px; color: var(--t6);
  border-top: 1px solid var(--bd); margin-top: 24px; letter-spacing: .3px;
}
.pg-footer span { color: var(--amber); font-weight: 600; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--t6);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--bd2); border-top-color: var(--amber);
  animation: spin .7s linear infinite; flex-shrink: 0;
}

/* ── Info row (label + value) ───────────────────────────── */
.info-row { display: flex; gap: 16px; flex-wrap: wrap; }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 10px; color: var(--t6); text-transform: uppercase; letter-spacing: .4px; }
.info-value { font-size: 15px; font-weight: 700; color: var(--t1); }
.info-value.mono { font-family: 'JetBrains Mono', monospace; }

/* ── Mobile menu overlay ─────────────────────────────────── */
.mobile-overlay {
  position: fixed; inset: 0; background: #000c; backdrop-filter: blur(4px);
  z-index: 1000; animation: fadeIn .2s ease;
}
.mobile-panel {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px;
  background: var(--bg2); border-right: 1px solid var(--bd);
  display: flex; flex-direction: column; padding: 22px 12px;
  z-index: 1001; animation: slideIn .2s ease; overflow-y: auto;
}
