/* Demo interativa do Metal Tech — replica o visual do sistema real (Tailwind) em CSS puro. */

:root {
  --bg: #1E1E1E;
  --card: #2A2A2A;
  --card-active: #333333;
  --border: #374151;
  --border-input: #4B5563;
  --yellow: #FACC15;
  --yellow-btn: #EAB308;
  --yellow-btn-hover: #FDE047;
  --orange: #FB923C;
  --green: #4ADE80;
  --green-btn: #16A34A;
  --red: #EF4444;
  --red-btn: #B91C1C;
  --gray: #9CA3AF;
  --gray-dim: #6B7280;
  --white: #FFFFFF;
}

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

body {
  background: var(--bg);
  color: var(--white);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== Barra de demo (não faz parte do sistema original) ===== */
.demo-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #111827;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}
.demo-bar__label { color: var(--gray); display: flex; align-items: center; gap: 8px; }
.demo-bar__pill {
  background: rgba(250, 204, 21, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.demo-bar__actions { display: flex; gap: 8px; }
.demo-bar__btn {
  background: transparent;
  border: 1px solid var(--border-input);
  color: var(--white);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}
.demo-bar__btn:hover { border-color: var(--yellow); color: var(--yellow); }

/* ===== Header do sistema ===== */
.mt-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 37px;
  z-index: 40;
}
.mt-header__inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.mt-logo { color: var(--yellow); font-weight: 900; font-size: 1.25rem; letter-spacing: -0.03em; }
.mt-header__title {
  font-weight: 700;
  font-size: 1rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.mt-header__user { text-align: right; font-size: 0.75rem; }
.mt-header__user span { color: var(--gray); display: block; }

/* ===== Layout ===== */
main { max-width: 42rem; margin: 0 auto; padding: 24px 16px 100px; }

.card { background: var(--card); border-radius: 1rem; }
.card--pad { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stack > * + * { margin-top: 12px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }

.muted { color: var(--gray); font-size: 0.75rem; }
.title-sm { font-weight: 700; font-size: 1rem; }
.label-yellow { color: var(--yellow); font-weight: 700; font-size: 0.875rem; margin-bottom: 16px; }

/* ===== Cards de métrica ===== */
.metric__label { color: var(--gray); font-size: 0.75rem; margin-bottom: 8px; }
.metric__value { font-size: 1.875rem; font-weight: 700; line-height: 1.1; }
.metric__value--sm { font-size: 1.5rem; }
.metric__foot { font-size: 0.75rem; margin-top: 4px; }
.is-yellow { color: var(--yellow); }
.is-orange { color: var(--orange); }
.is-green { color: var(--green); }
.is-red { color: var(--red); }

/* ===== Barras de distribuição ===== */
.bar__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.bar__track { width: 100%; background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; }
.bar__fill { height: 8px; border-radius: 999px; transition: width 0.5s ease; }
.bar__fill--normal { background: #22C55E; }
.bar__fill--sabado { background: var(--yellow-btn); }
.bar__fill--domingo { background: #F97316; }

/* ===== Listas ===== */
.list-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-head a { color: var(--yellow); font-size: 0.75rem; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-empty { padding: 40px 20px; text-align: center; }

/* ===== Avatar ===== */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}
.avatar--ativo { background: rgba(250, 204, 21, 0.2); color: var(--yellow); }
.avatar--inativo { background: var(--border); color: var(--gray); }

/* ===== Badges ===== */
.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--normal { background: rgba(74, 222, 128, 0.2); color: var(--green); border: 1px solid rgba(74, 222, 128, 0.3); }
.badge--sabado { background: rgba(250, 204, 21, 0.2); color: var(--yellow); border: 1px solid rgba(250, 204, 21, 0.3); }
.badge--domingo { background: rgba(251, 146, 60, 0.2); color: var(--orange); border: 1px solid rgba(251, 146, 60, 0.3); }
.badge--ativo { background: rgba(34, 197, 94, 0.2); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.badge--inativo { background: rgba(239, 68, 68, 0.2); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ===== Formulários ===== */
.field { display: block; }
.field + .field { margin-top: 16px; }
.field__label { font-size: 0.875rem; font-weight: 500; display: block; margin-bottom: 8px; }
.field__label .req { color: #F87171; }
.input, .select {
  width: 100%;
  padding: 12px;
  border-radius: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border-input);
  color: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.input::placeholder { color: var(--gray-dim); }
.input:focus, .select:focus { border-color: var(--yellow-btn); }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }

/* Ícones nativos dos campos de data/hora ficam escuros no tema dark */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.5); cursor: pointer; }

.info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 12px 16px;
  margin-top: 16px;
}
.info-box__label { color: var(--gray); font-size: 0.75rem; margin-bottom: 4px; }
.info-box__value { font-weight: 600; font-size: 0.875rem; }

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 16px;
  transition: background 0.2s, border-color 0.2s;
}
.btn--yellow { background: var(--yellow-btn); color: #fff; }
.btn--yellow:hover { background: var(--yellow-btn-hover); color: #1E1E1E; }
.btn--ghost { background: var(--bg); border: 1px solid var(--border-input); color: var(--white); }
.btn--ghost:hover { border-color: var(--gray); }
.btn--green { background: var(--green-btn); color: #fff; }
.btn--green:hover { background: #22C55E; }
.btn--red { background: var(--red-btn); color: #fff; }
.btn--red:hover { background: #DC2626; }
.btn--block { width: 100%; }
.btn--lg { padding: 16px; font-size: 1rem; font-weight: 700; }
.btn--sm { padding: 8px 16px; font-size: 0.875rem; }

.btn-link {
  background: none;
  border: none;
  color: var(--yellow);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 12px;
}
.btn-danger-sm {
  background: none;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
}
.btn-danger-sm:hover { color: #F87171; border-color: var(--red); }

/* ===== Alertas ===== */
.alert { padding: 16px; border-radius: 1rem; margin-bottom: 20px; font-size: 0.875rem; }
.alert--ok { background: var(--green-btn); text-align: center; font-weight: 500; }
.alert--erro { background: var(--red-btn); }
.alert--erro ul { margin: 8px 0 0 20px; list-style: disc; }
.alert--erro li + li { margin-top: 4px; }
.alert--aviso { background: rgba(234, 179, 8, 0.15); border: 1px solid var(--yellow-btn); }

/* ===== Filtros de status ===== */
.filter-row { display: flex; gap: 8px; margin-top: 12px; }
.filter-btn {
  flex: 1;
  padding: 8px;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border-input);
  color: var(--white);
}
.filter-btn.is-active { background: var(--yellow-btn); border-color: var(--yellow-btn); color: #fff; }

/* ===== Célula de horário (entrada/saída/intervalo) ===== */
.time-cell { background: var(--bg); border-radius: 0.75rem; padding: 8px; text-align: center; }
.time-cell__label { color: var(--gray); font-size: 0.75rem; }
.time-cell__value { font-size: 0.875rem; font-weight: 600; }

/* ===== Destaque de total ===== */
.total-box {
  background: var(--card);
  border: 1px solid var(--yellow-btn);
  border-radius: 1rem;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ===== Navegação inferior ===== */
.mt-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.mt-nav__inner { display: flex; align-items: center; justify-content: space-around; max-width: 32rem; margin: 0 auto; }
.mt-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray);
  transition: color 0.2s;
}
.mt-nav__item:hover { color: var(--white); }
.mt-nav__item.is-active { color: var(--yellow); }
.mt-nav__item--sair:hover { color: #F87171; }
.mt-nav__item svg { width: 24px; height: 24px; }
.mt-nav__item span { font-size: 0.75rem; font-weight: 500; }

/* ===== Login ===== */
.login-wrap {
  min-height: calc(100vh - 37px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card { width: 100%; max-width: 24rem; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo strong { color: var(--yellow); font-size: 3rem; font-weight: 900; letter-spacing: -0.05em; display: block; }
.login-logo span { color: var(--gray); font-size: 0.875rem; }
.login-hint {
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 0.75rem;
  padding: 12px 16px;
  font-size: 0.75rem;
  color: var(--yellow);
  margin-bottom: 20px;
  text-align: center;
}

/* ===== Paginação ===== */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; }
.pager button {
  padding: 8px 16px;
  border-radius: 0.75rem;
  background: var(--card);
  border: none;
  color: var(--white);
  font-size: 0.875rem;
  cursor: pointer;
}
.pager button:hover { background: var(--card-active); }
.pager span { font-size: 0.875rem; padding: 0 12px; }

/* ===== Logs ===== */
.log-row { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: 0; }
.log-row__acao { color: var(--yellow); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.log-row__desc { font-size: 0.875rem; margin-top: 2px; }

/* ===== Utilidades ===== */
.hidden { display: none !important; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-1 { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.bold { font-weight: 700; }
.semibold { font-weight: 600; }

@media (max-width: 420px) {
  .mt-header__title { display: none; }
  .mt-nav__item span { font-size: 0.625rem; }
  .metric__value { font-size: 1.5rem; }
}
