:root {
  --primary: #0f766e;
  --primary-dark: #0c5a54;
  --bg: #f4f6f5;
  --card: #ffffff;
  --border: #dde3e1;
  --text: #1f2937;
  --muted: #6b7280;
  --cheapest: #dcfce7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 2rem;
}
header {
  background: var(--primary);
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { font-size: 1.2rem; margin: 0; }
.icon-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: white;
}
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.panel h2 { margin-top: 0; font-size: 1.05rem; }
.hidden { display: none !important; }
form { display: flex; flex-direction: column; gap: 0.6rem; }
fieldset { border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 0.5rem; }
legend { color: var(--muted); font-size: 0.85rem; padding: 0 0.3rem; }
label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 0.2rem; color: var(--muted); }
label.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
input[type="text"], input[type="number"] {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}
button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}
button:hover { background: var(--primary-dark); }
button.secondary { background: #9ca3af; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.file-btn {
  background: var(--primary);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-block;
}
.file-btn:hover { background: var(--primary-dark); }
.table-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { padding: 0.5rem; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tr.cheapest { background: var(--cheapest); }
td button { padding: 0.3rem 0.6rem; font-size: 0.8rem; margin-left: 0.25rem; }
#backupList { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.4rem; }
#backupList li { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
#emptyState { color: var(--muted); text-align: center; }
.checkbox.inline { margin-left: 1rem; font-size: 0.8rem; margin-top: -0.4rem; }
td.clickable { cursor: pointer; color: var(--primary); text-decoration: underline dotted; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.modal-content { background: var(--card); border-radius: 10px; padding: 1.25rem; max-width: 420px; width: 100%; position: relative; max-height: 85vh; overflow-y: auto; }
.modal-content h3 { margin-top: 0; }
.modal-content #closeModal { position: absolute; top: 0.5rem; right: 0.5rem; color: var(--text); }
#modalLines { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
#modalLines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
#modalLines li span:first-child { color: var(--muted); }
#modalTotal { font-weight: bold; text-align: right; margin-top: 0.5rem; font-size: 1.05rem; }
