:root{
  --bg:#050916;
  --panel:#0b1330;
  --panel2:#0a1026;
  --line:rgba(255,255,255,.10);
  --text:#f2f5ff;
  --muted:rgba(242,245,255,.68);
  --royal:#2b4cff;
  --gold:#f2c14e;
  --good:#37e0a2;
  --warn:#ffb24a;
  --bad:#ff4d6d;

  --r:18px;
  --shadow: 0 20px 55px rgba(0,0,0,.45);
  --shadow2: 0 14px 28px rgba(0,0,0,.35);

  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color:var(--text);
  background: radial-gradient(1000px 800px at 15% 10%, rgba(43,76,255,.20), transparent 60%),
              radial-gradient(900px 700px at 80% 20%, rgba(242,193,78,.14), transparent 62%),
              radial-gradient(1100px 900px at 50% 85%, rgba(55,224,162,.10), transparent 65%),
              var(--bg);
  overflow-x:hidden;
}

.bgAnim{
  position:fixed;
  inset:-35vh -25vw;
  z-index:-1;
  background:
    radial-gradient(900px 700px at 20% 15%, rgba(43,76,255,.45), transparent 62%),
    radial-gradient(820px 620px at 80% 20%, rgba(242,193,78,.30), transparent 64%),
    radial-gradient(900px 650px at 55% 80%, rgba(55,224,162,.18), transparent 66%),
    radial-gradient(700px 540px at 85% 78%, rgba(255,77,109,.12), transparent 66%);
  filter: blur(24px) saturate(120%);
  opacity:.95;
  animation: floaty 14s ease-in-out infinite alternate;
}
@keyframes floaty{
  0%{ transform: translate3d(-2%, -1%, 0) scale(1.02); }
  100%{ transform: translate3d(2%, 1%, 0) scale(1.06); }
}

a{ color:inherit; text-decoration:none; }

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:#fff;
  padding:12px 14px;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing:.2px;
  cursor:pointer;
  user-select:none;
  touch-action: manipulation;
  box-shadow: var(--shadow2);
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btnSmall{ padding:10px 12px; border-radius:12px; font-size:13px; }
.btnGhost{ background: rgba(255,255,255,.04); }
.btnPrimary{
  background: linear-gradient(180deg, rgba(43,76,255,.92), rgba(242,193,78,.86));
  border-color: rgba(242,193,78,.35);
}
.btnDanger{
  background: rgba(255,77,109,.14);
  border-color: rgba(255,77,109,.35);
}

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 6px);
  box-shadow: var(--shadow);
  overflow:hidden;
  backdrop-filter: blur(6px);
}

.modalBack{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index:900;
}
.modal{
  position:fixed;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  width:min(1020px, calc(100vw - 24px));
  background: linear-gradient(180deg, rgba(12,18,44,.98), rgba(6,10,24,.98));
  border:1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.60);
  z-index:950;
  overflow:hidden;
  max-height: calc(100vh - 40px);
}
.modalBody{ max-height: calc(100vh - 220px); overflow:auto; }

.modalHead{
  padding:14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.modalTitle{ font-weight: 1000; font-size: 18px; }
.modalMeta{ color: var(--muted); font-weight: 850; font-size: 12px; margin-top:4px; }
.modalBody{ padding:14px 16px; }
.modalFoot{
  padding:14px 16px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  border-top:1px solid rgba(255,255,255,.10);
}

.formGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 720px){
  .formGrid{ grid-template-columns: 1fr; }
}
.field label{
  display:block;
  font-weight: 950;
  color: var(--muted);
  font-size: 12px;
  margin-bottom:8px;
}

.inp, .sel, .txt{
  width:100%;
  background: rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.12);
  color: var(--text);
  padding:12px 12px;
  border-radius: 14px;
  outline:none;
}
.sel{ appearance:none; }
.inp:focus, .sel:focus, .txt:focus{
  border-color: rgba(242,193,78,.40);
  box-shadow: 0 0 0 4px rgba(242,193,78,.14);
}


/* --- v2 tweaks --- */
.btnPrimary{
  background: linear-gradient(180deg, rgba(242,193,78,.98), rgba(242,193,78,.78));
  border-color: rgba(242,193,78,.55);
  color:#fff;
}
.btnPrimary:hover{ filter: brightness(1.03); }

.btnPlus{
  width:46px; height:46px;
  border-radius: 18px;
  display:flex; align-items:center; justify-content:center;
  font-size:26px;
  padding:0;
}

/* Centered modals */
.modal{
  top:50%;
  left:50%;
  bottom:auto;
  transform: translate(-50%, -50%);
  max-height: calc(100vh - 28px);
  overflow:auto;
  width:min(1180px, calc(100vw - 24px));
}

/* --- v4 header spacing --- */
.headerTools{
  display:flex;
  align-items:center;
  gap: 16px;
  flex-wrap: nowrap;
}
.weekNav{ gap: 10px; }
.weekLabel{ min-width: 180px; text-align:center; font-weight: 1000; }
.nav{ display:flex; gap: 10px; flex-wrap: nowrap; }
.menuWrap{ margin-left: 12px; }

.toast{
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  padding: 10px 14px; border-radius: 14px;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  opacity: 0; pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  font-weight: 900;
  z-index: 999;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(-6px); }

body[data-weather="rain"] .bgAnim:before{ opacity: .9; }
body[data-weather="snow"] .bgAnim:before{ opacity: .75; }
body[data-weather="storm"] .bgAnim:before{ opacity: .95; filter: saturate(1.2) contrast(1.05); }
body[data-weather="clear"] .bgAnim:before{ opacity: .55; }
