/* ===== Base ===== */
:root{
  --pink:#ffe4ec;
  --pink-dark:#f8bcd0;
  --blue:#0288d1;
  --blue-dark:#0277bd;
  --accent:#ec407a;
  --accent-dark:#d81b60;
  --ink:#000;
}

*{box-sizing:border-box}
html,body{height:100%}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, #fff 0, var(--pink) 60%, #ffd3e3 100%);
}

/* Subtle floating bubbles */
.bg-bubbles:before,
.bg-bubbles:after{
  content:"";
  position:fixed;
  inset:auto auto 10% 5%;
  width:220px;height:220px;border-radius:50%;
  background: rgba(79,195,247,.25);
  filter: blur(30px);
  z-index:0;
}
.bg-bubbles:after{
  left:auto; right:6%; bottom:15%;
  width:180px;height:180px;background:rgba(236,64,122,.20);
}

.app-shell{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:24px 16px 40px;
  gap:16px;
}

/* ===== Top bar ===== */
.top-bar {
  width: min(1100px, 94vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap:12px;
}

.date-stat { font-size: 14px; font-weight: 700; }

.top-right-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active{ transform: translateY(1px); }

.stats-link,.home-link{ background-color: var(--blue); }
.stats-link:hover,.home-link:hover{ background-color: var(--blue-dark); }

.reset{ background: #ff5252; }
.reset:hover{ background:#e53935; }
.delete{ background:#c62828; }
.delete:hover{ background:#b71c1c; }

/* ===== Card ===== */
.card{
  width:min(1100px, 94vw);
  background:#fff;
  border-radius:16px;
  padding:22px 18px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  text-align:center;
}

h1{ margin: 6px 0 4px; font-size: 28px; font-weight: 800; }
.subheading{ margin:0 0 14px; font-size:14px; color:#333; font-weight:600; }

/* ===== Glasses ===== */
.glass-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 18px 0 10px;
}
.glass-container { display:flex; justify-content:center; }
.glass {
  position: relative;
  width: 80px;
  height: 220px;
  border: 3px solid var(--blue);
  border-radius: 10px 10px 25px 25px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.fill { position: absolute; bottom: 0; width: 100%; background: #4fc3f7; transition: height 0.3s ease-in-out; z-index: 1; }
.glass-label { position: absolute; width: 100%; bottom: 10px; font-size: 12px; font-weight: 800; color: #000000; z-index: 2; text-align: center; }

/* ===== Totals & Controls ===== */
.total-water-text{ font-size: 16px; margin: 4px 0 10px; font-weight: 800; }

.predefined-buttons{ display:flex; flex-wrap:wrap; justify-content:center; gap:12px; margin:14px 0 10px; }
.predefined-buttons button{
  padding:14px 18px; font-size:16px; background-color: var(--accent);
  border: none; color: white; border-radius: 10px; font-weight: 800; cursor: pointer;
  min-width: 110px; transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.predefined-buttons button:hover{ background: var(--accent-dark); }
.predefined-buttons button:active{ transform: translateY(1px); }

.custom-add{ display:flex; justify-content:center; gap:10px; margin: 10px 0 6px; }
.custom-add input{
  width: 180px; padding: 12px; border-radius: 8px; border: 1px solid var(--accent);
  font-size: 14px; color: #000; background: var(--pink-dark);
}
.custom-add input::placeholder{ color:#444; }
.custom-add button{ padding: 12px 16px; background: var(--accent); border: none; color: #fff; border-radius: 8px; font-weight: 800; cursor: pointer; }
.custom-add button:hover{ background: var(--accent-dark); }

/* ===== Footer ===== */
.footer-note{ color:#333; font-size:12px; opacity:.9; margin-top:2px; }

/* ===== Users page ===== */
.center-title { display: flex; justify-content: center; }
.users-title { font-size: 28px; font-weight: 800; margin: 6px 0 20px; text-align: center; }

.users-container { position: relative; z-index: 1; max-width: 980px; width: 100%; padding: 20px; margin: 0 auto; }

.user-form { display: flex; gap: 8px; margin: 12px 0 18px; justify-content:center; flex-wrap:wrap; }
.user-form input{
  padding: 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--pink-dark);
  font-size: 14px; width: 200px; color: #000;
}
.user-form .btn.add { background: var(--blue); color: #fff; border: none; border-radius: 6px; font-weight: 700; padding: 10px 14px; cursor: pointer; }

.users-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.user-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.user-name { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.user-age { color: #333; font-size: 13px; margin-bottom: 10px; }

/* Wrapped, neat button grid: 2 per row */
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.user-actions .btn { flex: 1 1 calc(50% - 6px); min-width: 110px; font-size: 14px; padding: 8px 10px; border-radius: 8px; }

.btn.select { background: #4caf50; }
.btn.rename { background: #ff9800; }
.btn.delete { background: #c62828; }

/* ===== Stats page ===== */
.stats-container { max-width: 980px; width: 100%; padding: 20px; margin: 0 auto; }
.stats-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stats-title { margin: 0; font-size: 24px; font-weight: 800; }

.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.stat-card { background: #ffffff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); text-align: left; }
.stat-card h3 { margin: 0 0 6px 0; font-size: 15px; color: #333; }
.stat-value { font-size: 20px; font-weight: 800; color: #000; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart-block { background: #ffffff; border-radius: 12px; padding: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); margin-bottom: 12px; max-width: 480px; height: 220px; }
.chart-title { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.chart-block canvas { width: 100% !important; height: calc(100% - 24px) !important; }

/* ===== Responsive ===== */
@media (max-width: 760px){
  .top-bar{ width: 100%; padding: 0 4px; }
  .card{ width: 100%; padding:18px 12px; }
  .stat-cards{ grid-template-columns:1fr; }
  .charts-grid{ grid-template-columns:1fr; }
  .chart-block{ max-width: 100%; }
}