:root {
  /* Backgrounds */
  --bg: #0b1020;
  /* deep midnight */
  --card-bg: rgba(255, 255, 255, .06);
  --card-bg-solid: #111a33;
  /* fallback / solid surfaces */
  --header-bg: rgba(7, 15, 40, 0.72);

  /* Text */
  --text-main: #eaf0ff;
  --text-muted: rgba(234, 240, 255, .72);

  /* Accent + supporting */
  --accent: #22c55e;
  /* fresh green */
  --accent-2: #38bdf8;
  /* sky blue for subtle highlights */
  --border-subtle: rgba(255, 255, 255, .12);

  /* Shadows */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .35);
}


* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: #0b1020; /* solid fallback */
}


body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(56, 189, 248, .22), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(34, 197, 94, .18), transparent 55%),
    var(--bg);
}

header {
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
  color: var(--text-main)
}

.card,
.chart-wrapper,
.table-wrapper,
#main-login form {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

a {
  color: var(--accent-2);
}

button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071019;
}

th {
  background: var(--border-subtle);
  color: var(--text-main);
}

td,
th {
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}


#settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

h1 {
  margin: 0;
  font-size: 1.2rem;
}

.header-links {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  /* <- THIS is the key */
  font-size: 0.85rem;
}

/* Normalise typography so <a> and <button> share metrics */
.header-links a,
.header-links button {
  font: inherit;
  /* kills Safari/Chrome button font weirdness */
  line-height: 1.2;
  /* consistent baseline box */
  margin: 0;
  padding: 0;
  /* we'll control padding explicitly */
}

/* Keep the link looking like a link, but make its baseline predictable */
.header-links a {
  display: inline-block;
  padding: 0.4rem 0;
  /* gives it similar vertical rhythm */
}

/* Keep the button as a pill, but baseline-aligned */
.header-links button {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  /* same top/bottom as link */
  border: 0;
  border-radius: 999px;
}


.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  line-height: 1.4rem;
  justify-content: space-between;
}

.controls .label {
  align-items: center;
}

.controls .element {
  min-width: 150px;
  display: flex;
}

.controls .value {
  margin-left: 5px;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

select,
input {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  background: #fff;
}

button {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

button:active {
  transform: scale(0.98);
}

button:active {
  transform: scale(0.98);
}

.error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

main {
  padding: 0.75rem 0;
  height: 100%;
}

#settings-main {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/*#main-login {
  width: min(100%, 360px);
}*/

/*#body-login {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
}*/

#body-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#main-login form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.2rem;

  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  min-width: 300px;
}



.panel-container {
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  min-height: 85%;
}

.panels {
  display: flex;
  transition: transform 0.25s ease-out;
  will-change: transform;
}

.panel {
  min-width: 100%;
  flex-shrink: 0;
  padding: 0 1rem 1rem;
}

.panel-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 0.7rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
  min-height: 80px;
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.card-value,
.card-sub-value {
  display: inline-block;
  vertical-align: baseline;
  /* or middle, depending on desired alignment */
}

.card-value {
  font-size: 0.95rem;
  font-weight: 600;
  margin-right: 0.3em;
}

.card-sub-value {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-small {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.chart-wrapper {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 0.7rem 0.7rem 2.2rem 0.7rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
  width: 100% !important;
  display: block;
  position: relative;
  overflow: hidden;
  height: 180px;
}

.chart-wrapper canvas{
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
}


.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.table-wrapper {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th,
td {
  padding: 0.35rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid #f0f0f3;
}

th:first-child,
td:first-child {
  text-align: left;
}

tr:last-child td {
  border-bottom: none;
}

.nav-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.3rem 0 0.2rem;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d1d5db;
  transition: all 0.2s ease-out;
}

.nav-dot.active {
  width: 18px;
  background: var(--accent);
}

.section-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

input[type="number"] {
  width: 5rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

input[type="checkbox"] {
  transform: scale(1.1);
}

button {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

button:active {
  transform: scale(0.98);
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.status {
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.status.ok {
  color: #15803d;
}

.status.error {
  color: #b91c1c;
}

h2 {
  margin-top: 0.2rem;
  font-size: 1.4rem;
  font-weight: 00;
}

#settings-main .card {
  margin-bottom: 30px;
}

@media (min-width: 900px) {
  main {
    padding: 1rem 1.5rem 1.5rem;
  }

  .panel-container {
    overflow: visible;
  }

  .panels {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    transform: none !important;
  }

  .panel {
    min-width: 0;
    padding: 0.5rem;
  }

  .panel[data-panel="summary"] {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
  }

  .panel[data-panel="feeding"] {
    grid-column: 2 / 4;
    grid-row: 1 / 2;
  }

  .panel[data-panel="sleep"] {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }

  .panel[data-panel="diapers"] {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
  }

  .nav-dots {
    display: none;
  }
}