:root{
  --bg: #f5f7fb;
  --card: #ffffff;
  --muted: #7a879a;
  --text: #1e2a3a;
  --line: rgba(30,42,58,.10);
  --shadow: 0 10px 30px rgba(30,42,58,.08);
  --radius: 18px;

  --blue: #9db8d4;
  --blue-2: #cfe0f0;
  --yellow: #f2d46f;
  --red: #e76b6b;
  --green: #62c58f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b;
    --card: #1c232e;
    --muted: #8b9fb6;
    --text: #e2e8f0;
    --line: rgba(255,255,255,.10);
    --shadow: 0 10px 30px rgba(0,0,0,.3);
    
    --blue: #4a6886;
    --blue-2: #2d4157;
    --yellow: #b49b4c;
    --red: #bd4848;
    --green: #3d8f63;
  }
  
  .icon-btn {
    background: rgba(40,55,75,.8);
    color: var(--text);
  }
  
  .ghost-btn {
    background: rgba(40,55,75,.5);
    color: var(--text);
  }
  
  .primary-btn {
    background: linear-gradient(180deg, #4a6886, #2d4157);
    border: 1px solid rgba(255,255,255,.1);
    color: #ffffff;
  }
  
  .fab {
    background: linear-gradient(180deg, #b49b4c, #8c773a);
    border: 1px solid rgba(255,255,255,.1);
    color: #ffffff;
  }
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 20% 0%, #eef4ff 0%, var(--bg) 45%, #f7f9fd 100%);
  color: var(--text);
}

.app{
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar{
  max-width: 1080px;
  width: 100%;
  margin: 22px auto 10px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}
.title{
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 18px;
  text-align: center;
}
.subtitle{
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
}
.icon-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  box-shadow: 0 4px 14px rgba(30,42,58,.06);
  cursor: pointer;
  font-size: 18px;
  color: rgba(30,42,58,.75);
}
.icon-btn:hover{ filter: brightness(.98); }

.content{
  max-width: 1080px;
  width: 100%;
  margin: 10px auto 90px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

.panel{
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel__header{
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 14px 14px 10px;
  gap: 10px;
}
.panel__header--list{
  grid-template-columns: 1fr auto;
}
.panel__title{
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel__subtitle{
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(245,247,251,.7);
  font-weight: 600;
  color: rgba(30,42,58,.85);
  font-size: 13px;
}

.nav-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(245,247,251,.75);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: rgba(30,42,58,.75);
}
.nav-btn:hover{ filter: brightness(.98); }

.dow{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 14px 10px;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.dow > div{ text-align: center; }

.calendar{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  padding: 0 14px 14px;
}

.day{
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(245,247,251,.75);
  min-height: 86px;
  padding: 10px;
  cursor: pointer;
  position: relative;
  transition: transform .08s ease, box-shadow .08s ease;
}
.day:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(30,42,58,.08);
}
.day--muted{
  opacity: .55;
}
.day--today{
  border-color: rgba(99, 148, 198, .55);
  box-shadow: 0 10px 22px rgba(99,148,198,.18);
}
.day--selected{
  outline: 2px solid rgba(231, 107, 107, .30);
  border-color: rgba(231, 107, 107, .55);
  background: rgba(255, 246, 246, .92);
}
.day__num{
  font-weight: 700;
  font-size: 13px;
  color: rgba(30,42,58,.85);
}
.dots{
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  opacity: .95;
}
.dot--red{ background: var(--red); }
.dot--yellow{ background: var(--yellow); }
.dot--green{ background: var(--green); }
.dot--blue{ background: var(--blue); }

.list{
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card{
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(245,247,251,.6);
}
.card__top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card__title{
  font-weight: 800;
  letter-spacing: -0.02em;
}
.card__meta{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(30,42,58,.70);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  font-weight: 600;
  font-size: 12px;
  color: rgba(30,42,58,.78);
}

.verify{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.verify-btn{
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  color: rgba(30,42,58,.78);
}
.verify-btn[data-state="on"]{
  border-color: rgba(98, 197, 143, .55);
  background: rgba(227, 248, 238, .95);
  color: rgba(29, 115, 64, .92);
}
.count{
  font-weight: 800;
  font-size: 12px;
  color: rgba(30,42,58,.65);
}

.danger-btn{
  border-radius: 999px;
  border: 1px solid rgba(231,107,107,.45);
  background: rgba(255, 235, 235, .85);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  color: rgba(131, 35, 35, .95);
}
.danger-btn:hover{ filter: brightness(.98); }

.empty{
  padding: 14px;
  color: var(--muted);
  font-weight: 600;
}

.ghost-btn{
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(245,247,251,.75);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
  color: rgba(30,42,58,.78);
}
.ghost-btn:hover{ filter: brightness(.98); }

.primary-btn{
  border-radius: 14px;
  border: 1px solid rgba(99,148,198,.55);
  background: linear-gradient(180deg, rgba(157,184,212,.95), rgba(207,224,240,.92));
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 900;
  color: rgba(30,42,58,.86);
}
.primary-btn:hover{ filter: brightness(.98); }

.fab{
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: 62px;
  height: 62px;
  border-radius: 22px;
  border: 1px solid rgba(30,42,58,.10);
  background: linear-gradient(180deg, rgba(242,212,111,.98), rgba(246,226,158,.92));
  box-shadow: 0 18px 40px rgba(30,42,58,.18);
  cursor: pointer;
  font-size: 28px;
  font-weight: 900;
  color: rgba(30,42,58,.80);
}
.fab:hover{ filter: brightness(.98); }

.modal{
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 16px;
}
.modal[data-open="true"]{ display: grid; }
.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 40, .38);
  backdrop-filter: blur(6px);
}
.modal__card{
  position: relative;
  width: min(520px, 100%);
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 25px 60px rgba(20,28,40,.25);
  border-radius: 22px;
  overflow: hidden;
}
.modal__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.modal__title{
  font-weight: 900;
  letter-spacing: -0.02em;
}

.form{
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field{
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field__label{
  font-weight: 800;
  font-size: 12px;
  color: rgba(30,42,58,.72);
}
.input{
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(245,247,251,.75);
  padding: 11px 12px;
  font: inherit;
  color: rgba(30,42,58,.88);
  outline: none;
}
.input:focus{
  border-color: rgba(99,148,198,.55);
  box-shadow: 0 0 0 4px rgba(157,184,212,.25);
}
.input--textarea{ resize: vertical; }
.form__actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}
.form__error{
  border-radius: 14px;
  border: 1px solid rgba(231,107,107,.40);
  background: rgba(255, 235, 235, .85);
  padding: 10px 12px;
  color: rgba(131, 35, 35, .95);
  font-weight: 700;
  font-size: 13px;
}

@media (max-width: 980px){
  .content{
    grid-template-columns: 1fr;
    margin-bottom: 110px;
  }
}

@media (max-width: 520px){
  .day{ min-height: 74px; }
  .row{ grid-template-columns: 1fr; }
}

