:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --painel: #ffffff;
  --borda: #e2e8f0;
  --texto: #0f172a;
  --texto-suave: #64748b;
  --acento: #0ea5a4;
  --acento-escuro: #0f766e;
  --destaque: #f59e0b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--texto);
  background: linear-gradient(160deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
  min-height: 100vh;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.marca { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--acento), #22d3ee);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(14, 165, 164, .45);
}

.marca-texto h1 { margin: 0; font-size: 26px; color: #fff; letter-spacing: .5px; }
.marca-texto p { margin: 3px 0 0; font-size: 14px; color: #cbd5e1; }

.salvo {
  font-size: 12px;
  color: #99f6e4;
  background: rgba(15, 118, 110, .35);
  border: 1px solid rgba(153, 246, 228, .3);
  padding: 6px 12px;
  border-radius: 999px;
  opacity: .85;
}

.grade {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}

.painel, .resultados {
  background: var(--painel);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.campo { margin-bottom: 16px; }

.campo label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-suave);
  margin-bottom: 7px;
}

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--texto);
  background: #f8fafc;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type="number"]:focus, input[type="text"]:focus, select:focus {
  border-color: var(--acento);
  box-shadow: 0 0 0 4px rgba(14, 165, 164, .15);
  background: #fff;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b'><path d='M4 6l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  font-weight: 600;
  padding-right: 40px;
  cursor: pointer;
}

.bloco {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1.5px dashed var(--borda);
}

.bloco h2 { margin: 0 0 6px; font-size: 17px; }

.subtitulo {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--texto-suave);
  line-height: 1.5;
}

.campos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.ajuda {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--texto-suave);
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 10px;
}

.ajuda strong { color: var(--acento-escuro); }

.linha-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  background: linear-gradient(135deg, var(--acento), #14b8a6);
  color: #fff;
  border: none;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(14, 165, 164, .35); }

.btn-ghost {
  background: #fff;
  color: var(--texto-suave);
  border: 1.5px solid var(--borda);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
}

.btn-ghost:hover { border-color: #cbd5e1; color: var(--texto); }
.btn-ghost.largo { width: 100%; margin-top: 4px; }

.btn-link {
  background: none;
  border: none;
  color: var(--acento-escuro);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
}

.btn-link:hover { color: var(--acento); }

.cabecalho-lista,
.plantao {
  display: grid;
  grid-template-columns: 1.25fr 132px 104px 152px 34px;
  gap: 10px;
  align-items: center;
}

.cabecalho-lista {
  padding: 0 14px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #94a3b8;
}

.lista-plantoes { display: flex; flex-direction: column; gap: 10px; }

.plantao {
  background: #f8fafc;
  border: 1.5px solid var(--borda);
  border-radius: 14px;
  padding: 12px 14px;
}

.p-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.p-nome {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.p-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: var(--acento-escuro);
  background: #ccfbf1;
  border-radius: 999px;
  padding: 2px 9px;
}

.p-campo { display: flex; flex-direction: column; gap: 5px; }

.p-campo span {
  font-size: 11px;
  font-weight: 600;
  color: var(--texto-suave);
}

.p-campo input {
  padding: 9px 10px;
  font-size: 15px;
  text-align: center;
}

.p-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.p-bruto { font-size: 12px; color: var(--texto-suave); }
.p-liq { font-size: 16px; font-weight: 800; color: var(--acento-escuro); }

.remover {
  background: #fff;
  border: 1.5px solid var(--borda);
  color: #ef4444;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.remover:hover { background: #fef2f2; border-color: #fecaca; }

.vazio {
  text-align: center;
  color: var(--texto-suave);
  font-size: 14px;
  background: #f8fafc;
  border: 1.5px dashed var(--borda);
  border-radius: 14px;
  padding: 22px 16px;
}

.form-plantao {
  background: #f8fafc;
  border: 1.5px solid var(--borda);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-plantao .campo { margin: 0; }

.acoes {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.acoes-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--borda);
}

.resultados { display: flex; flex-direction: column; gap: 14px; }

.card-destaque {
  background: linear-gradient(135deg, var(--acento-escuro), var(--acento));
  color: #fff;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-destaque span {
  font-size: 13px;
  opacity: .9;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.card-destaque strong { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.card-destaque small { font-size: 12.5px; opacity: .88; }

.linha-imposto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f1f5f9;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  padding: 10px 14px;
}

.linha-imposto label {
  font-size: 13px;
  font-weight: 700;
  color: var(--texto-suave);
}

.mini { display: flex; align-items: center; gap: 6px; }

.mini input {
  width: 92px;
  padding: 8px 10px;
  font-size: 15px;
  text-align: center;
}

.mini span { font-size: 14px; font-weight: 700; color: var(--texto-suave); }

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  background: #f8fafc;
  border: 1.5px solid var(--borda);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.card span { font-size: 12px; color: var(--texto-suave); font-weight: 600; }
.card span em { font-style: normal; font-weight: 800; color: var(--texto); }
.card strong { font-size: 19px; font-weight: 800; }

.nota {
  font-size: 10.5px !important;
  font-weight: 500 !important;
  color: #b45309 !important;
  line-height: 1.35;
}

.card-anual {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1.5px solid #fcd34d;
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-anual span {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.card-anual strong { font-size: 31px; font-weight: 800; color: #78350f; letter-spacing: -.5px; }
.card-anual small { font-size: 12px; color: #a16207; }

.rodape-resultado { font-size: 12.5px; color: var(--texto-suave); margin: 2px 0 0; line-height: 1.5; }

.rodape {
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
  margin-top: 26px;
}

@media (max-width: 980px) {
  .grade { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .cabecalho-lista { display: none; }

  .plantao {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .p-info { grid-column: 1 / -1; }
  .p-total { grid-column: 1 / 2; align-items: flex-start; text-align: left; }
  .remover { grid-column: 2 / 3; justify-self: end; align-self: center; }

  .topo { flex-direction: column; align-items: flex-start; }
  .card-destaque strong { font-size: 32px; }
}
