/* ShiftTally — shared stylesheet for all tools */
:root {
  --blue: #1d4ed8;
  --blue-dark: #1e40af;
  --blue-light: #eff6ff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --green: #15803d;
  --green-light: #f0fdf4;
  --amber: #b45309;
  --red: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--slate-900);
  background: var(--slate-50);
  line-height: 1.6;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--slate-100);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--slate-900);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand span { color: var(--blue); }
.header-note { font-size: 0.85rem; color: var(--slate-500); }

/* Hero */
.hero { text-align: center; padding: 36px 0 8px; }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero p.sub {
  max-width: 720px;
  margin: 0 auto;
  color: var(--slate-700);
  font-size: 1.05rem;
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.badge {
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
}

/* Cards / sections */
.card {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 18px 0;
}
.card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .step {
  background: var(--blue);
  color: #fff;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex: 0 0 24px;
}
.card p.hint { margin: 2px 0 14px; color: var(--slate-500); font-size: 0.9rem; }

/* Forms */
input, select, button {
  font: inherit;
  color: inherit;
}
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select {
  border: 1px solid var(--slate-300);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input[type="text"] { flex: 1 1 180px; }
.inline-form input[type="number"] { width: 110px; }

.btn {
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  transition: background 0.15s;
}
.btn:hover { background: var(--blue-dark); }
.btn.secondary { background: var(--slate-100); color: var(--slate-700); }
.btn.secondary:hover { background: var(--slate-300); }
.btn.ghost { background: transparent; color: var(--blue); padding: 6px 10px; }
.btn.danger-ghost { background: transparent; color: var(--red); padding: 6px 10px; }
.btn.small { padding: 5px 10px; font-size: 0.85rem; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--slate-100);
  border-radius: 999px;
  padding: 5px 6px 5px 14px;
  font-size: 0.9rem;
  font-weight: 500;
}
.chip .meta { color: var(--slate-500); font-weight: 400; }
.chip button {
  background: var(--slate-300);
  border: none;
  color: var(--slate-700);
  border-radius: 50%;
  width: 20px; height: 20px;
  line-height: 1;
  cursor: pointer;
  font-size: 0.8rem;
}
.chip button:hover { background: var(--red); color: #fff; }
.empty-note { color: var(--slate-500); font-size: 0.9rem; font-style: italic; margin-top: 10px; }

/* Shifts table */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table.shifts, table.results {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
table.shifts th, table.results th {
  text-align: left;
  color: var(--slate-500);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 8px;
  border-bottom: 2px solid var(--slate-100);
  white-space: nowrap;
}
table.shifts td { padding: 6px 6px; border-bottom: 1px solid var(--slate-100); }
table.shifts td input, table.shifts td select { width: 100%; }
table.shifts td.break-col input { width: 76px; }
table.shifts td .row-del {
  background: transparent; border: none; color: var(--slate-500);
  cursor: pointer; font-size: 1rem; padding: 4px;
}
table.shifts td .row-del:hover { color: var(--red); }
.shift-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.setting label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--slate-700); margin-bottom: 4px; }
.setting select, .setting input { width: 100%; }
.setting .subnote { font-size: 0.75rem; color: var(--slate-500); margin-top: 3px; }

/* Results */
#results { scroll-margin-top: 20px; }
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0 6px;
}
.summary-card {
  background: var(--blue-light);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.summary-card.money { background: var(--green-light); }
.summary-card .num { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.summary-card.money .num { color: var(--green); }
.summary-card .lbl { font-size: 0.78rem; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.04em; }

table.results td { padding: 9px 8px; border-bottom: 1px solid var(--slate-100); }
table.results tr.total-row td { font-weight: 700; border-top: 2px solid var(--slate-300); }
table.results td.num, table.results th.num { text-align: right; font-variant-numeric: tabular-nums; }
.results-block h3 { margin: 22px 0 6px; font-size: 1rem; }
.warn { color: var(--amber); font-size: 0.88rem; margin-top: 10px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Content sections */
.content h2 { font-size: 1.35rem; margin-top: 34px; }
.content h3 { font-size: 1.05rem; }
.content { max-width: 780px; margin: 0 auto; padding-bottom: 20px; }
.content ol li, .content ul li { margin-bottom: 6px; }

/* FAQ */
details.faq {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
}
details.faq summary { font-weight: 600; cursor: pointer; }
details.faq p { color: var(--slate-700); margin-bottom: 4px; }

.disclaimer {
  font-size: 0.8rem;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-100);
  margin-top: 30px;
  padding-top: 14px;
}

/* Footer */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-300);
  margin-top: 40px;
  padding: 28px 0;
  font-size: 0.88rem;
}
.site-footer a { color: #fff; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }

/* Header nav */
.header-nav { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.88rem; }
.header-nav a { color: var(--slate-500); text-decoration: none; font-weight: 600; }
.header-nav a:hover, .header-nav a.active { color: var(--blue); }

/* Two-column calculator layout */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .calc-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--slate-700); margin-bottom: 4px; }
.field input, .field select { width: 100%; }
.field .subnote { font-size: 0.75rem; color: var(--slate-500); margin-top: 3px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; border: 1px solid var(--slate-300); border-radius: 7px; overflow: hidden; margin-bottom: 14px; }
.seg button { flex: 1; border: none; background: #fff; padding: 9px; font-weight: 600; cursor: pointer; color: var(--slate-500); }
.seg button.active { background: var(--blue); color: #fff; }

/* Result highlight */
.big-result { background: var(--blue-light); border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 14px; }
.big-result .num { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--blue-dark); }
.big-result .lbl { font-size: 0.82rem; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.04em; }
.big-result.green { background: var(--green-light); }
.big-result.green .num { color: var(--green); }

/* Invoice generator */
.invoice-items th, .invoice-items td { padding: 6px; }
.invoice-paper {
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  padding: 28px;
  font-size: 0.9rem;
  min-height: 500px;
}
.invoice-paper h2 { font-size: 1.6rem; margin: 0 0 2px; letter-spacing: 0.06em; }
.invoice-paper .inv-meta { color: var(--slate-500); }
.invoice-paper .inv-parties { display: flex; justify-content: space-between; gap: 20px; margin: 22px 0; flex-wrap: wrap; }
.invoice-paper .inv-parties .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-500); margin-bottom: 3px; }
.invoice-paper table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.invoice-paper table th { text-align: left; border-bottom: 2px solid var(--slate-900); padding: 6px 4px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.invoice-paper table td { padding: 7px 4px; border-bottom: 1px solid var(--slate-100); vertical-align: top; }
.invoice-paper .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice-paper .totals { margin-left: auto; max-width: 280px; }
.invoice-paper .totals td { border: none; padding: 4px; }
.invoice-paper .totals tr.grand td { border-top: 2px solid var(--slate-900); font-weight: 800; font-size: 1.05rem; }
.invoice-paper .inv-notes { margin-top: 24px; color: var(--slate-700); font-size: 0.85rem; white-space: pre-wrap; }

/* Ad slots (inactive until AdSense approval) */
.ad-slot { display: none; }

/* Print: results only */
@media print {
  body { background: #fff; }
  .site-header, .hero .badges, .card:not(#results), .shift-actions, .export-actions,
  .content, .site-footer, .btn { display: none !important; }
  #results { box-shadow: none; border: none; }
  .print-title { display: block !important; font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
}
.print-title { display: none; }

@media (max-width: 640px) {
  .card { padding: 14px; }
  .hero { padding-top: 22px; }
}
