:root{
  --bg:#F5F4F0;
  --surface:#FFF;
  --surface2:#EFEFEA;
  --border:rgba(0,0,0,0.09);
  --text:#1A1A18;
  --text2:#6B6B65;
  --text3:#A0A09A;
  --green-bg:#E6F2E0;
  --green-text:#2D6A1F;
  --green-dot:#4CAF50;
  --yellow-bg:#FDF3DC;
  --yellow-text:#7A5200;
  --yellow-dot:#F5A623;
  --red-bg:#FDEAEA;
  --red-text:#8C1F1F;
  --red-dot:#E53935;
  --z1:#D4F0E6;
  --z1t:#0F5C3A;
  --z2:#D6E8FB;
  --z2t:#1A4A7A;
  --z3:#E8E0FB;
  --z3t:#3A2880;
  --z4:#FAEEDA;
  --z4t:#7A5200;
  --r:14px;
  --rsm:8px;
}

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html{
  -webkit-text-size-adjust:100%;
}

body{
  font-family:'Golos Text',sans-serif;
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
}

.top-bar{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  padding:13px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky;
  top:0;
  z-index:20;
  gap:10px;
}

.top-title{
  font-size:16px;
  font-weight:600;
  letter-spacing:-.3px;
  white-space:nowrap;
}

.top-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.user-row{
  display:flex;
  align-items:center;
  gap:6px;
}

.nav-row{
  display:flex;
  align-items:center;
  gap:6px;
}

.nav-btn,.mini-btn{
  height:30px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  cursor:pointer;
  font-size:13px;
  font-family:'Golos Text',sans-serif;
  color:var(--text2);
  transition:background .15s;
}

.nav-btn:hover,.mini-btn:hover{
  background:#E2E1DC;
}

.mini-btn{
  padding:0 8px;
  font-size:12px;
  font-weight:600;
}

.select-sm{
  height:30px;
  font-size:12px;
  font-family:'Golos Text',sans-serif;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  color:var(--text2);
  padding:0 6px;
  cursor:pointer;
  max-width:220px;
  min-width:120px;
  appearance:none;
  -webkit-appearance:none;
}

.edit-btn{
  height:30px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  cursor:pointer;
  font-size:12px;
  font-family:'Golos Text',sans-serif;
  font-weight:500;
  color:var(--text2);
  transition:background .15s;
  white-space:nowrap;
}

.edit-btn:hover{
  background:#E2E1DC;
}

.edit-btn.on{
  background:#FDF3DC;
  color:#7A5200;
  border-color:rgba(122,82,0,.3);
}

.edit-banner{
  background:#FDF3DC;
  border-bottom:1px solid rgba(122,82,0,.2);
  padding:7px 18px;
  font-size:12px;
  color:#7A5200;
  font-weight:500;
  text-align:center;
  display:none;
}

.edit-banner.show{
  display:block;
}

.day-tabs{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  padding:0 14px;
  display:flex;
  gap:2px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.day-tab{
  padding:9px 12px;
  font-size:12px;
  font-family:'Golos Text',sans-serif;
  font-weight:500;
  color:var(--text3);
  border:none;
  background:none;
  cursor:pointer;
  border-bottom:2px solid transparent;
  white-space:nowrap;
  line-height:1.4;
  transition:color .15s;
  text-align:center;
}

.day-tab:hover{
  color:var(--text2);
}

.day-tab.active{
  color:var(--text);
  border-bottom-color:var(--text);
}

.day-dot{
  display:inline-block;
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--green-dot);
  margin-left:3px;
  vertical-align:middle;
}

.content{
  padding:14px 14px 50px;
  max-width:900px;
  margin:0 auto;
}

.summary-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-bottom:14px;
}

.sum-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:10px 12px;
  min-width:0;
}

.sum-label{
  font-size:11px;
  color:var(--text2);
  margin-bottom:4px;
  display:flex;
  align-items:center;
  gap:4px;
}

.dot{
  width:6px;
  height:6px;
  border-radius:50%;
  flex-shrink:0;
}

.dot-g{background:var(--green-dot)}
.dot-y{background:var(--yellow-dot)}
.dot-r{background:var(--red-dot)}

.sum-val{
  font-size:22px;
  font-weight:600;
  letter-spacing:-1px;
}

.zone-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  margin-bottom:11px;
  overflow:hidden;
}

.zone-head{
  display:flex;
  align-items:center;
  gap:11px;
  padding:13px 15px 9px;
}

.zone-avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:600;
  flex-shrink:0;
}

.zone-title{
  font-size:14px;
  font-weight:600;
}

.lead-row{
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 15px 9px;
}

.lead-lbl{
  font-size:12px;
  color:var(--text3);
  white-space:nowrap;
}

.lead-inp{
  flex:1;
  font-size:13px;
  font-family:'Golos Text',sans-serif;
  padding:4px 8px;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  color:var(--text);
  outline:none;
}

.lead-inp:focus{
  border-color:rgba(0,0,0,.22);
}

.divider{
  height:1px;
  background:var(--border);
  margin:0 15px 10px;
}

.sec-title{
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--text3);
  padding:0 15px 6px;
}

.mlist{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:0 15px 12px;
}

.mrow{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:var(--rsm);
  border:1px solid transparent;
}

.mrow-name{
  font-size:13px;
}

.mrow-label-inp{
  flex:1;
  font-size:13px;
  font-family:'Golos Text',sans-serif;
  padding:3px 7px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:6px;
  background:var(--surface);
  color:var(--text);
  outline:none;
  display:none;
  min-width:0;
  width:100%;
}

.mrow-label-inp:focus{
  border-color:rgba(0,0,0,.28);
}

.mrow-right{
  display:flex;
  align-items:center;
  gap:6px;
}

.mnum{
  width:74px;
  font-size:13px;
  font-family:'Golos Text',sans-serif;
  padding:3px 6px;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--surface);
  color:var(--text);
  text-align:right;
  outline:none;
}

.mnum:focus{
  border-color:rgba(0,0,0,.28);
}

.stg{
  display:flex;
  gap:3px;
}

.sb{
  width:19px;
  height:19px;
  border-radius:50%;
  border:2px solid transparent;
  cursor:pointer;
  opacity:.28;
  transition:opacity .12s,transform .1s;
}

.sb:hover{
  opacity:.6;
}

.sb.on{
  opacity:1;
  border-color:rgba(0,0,0,.13);
  transform:scale(1.12);
}

.sg{background:var(--green-dot)}
.sy{background:var(--yellow-dot)}
.sr{background:var(--red-dot)}

.del-btn{
  width:20px;
  height:20px;
  border-radius:50%;
  border:1px solid var(--border);
  background:none;
  cursor:pointer;
  color:var(--text3);
  font-size:13px;
  flex-shrink:0;
  display:none;
  align-items:center;
  justify-content:center;
  line-height:1;
  transition:background .12s,color .12s;
}

.del-btn:hover{
  background:#FDEAEA;
  color:#8C1F1F;
  border-color:#F09595;
}

.add-metric-btn{
  display:none;
  margin:0 15px 12px;
  padding:7px 12px;
  font-size:12px;
  font-family:'Golos Text',sans-serif;
  font-weight:500;
  border:1px dashed var(--border);
  border-radius:var(--rsm);
  background:none;
  color:var(--text2);
  cursor:pointer;
  width:calc(100% - 30px);
  text-align:left;
  transition:background .15s;
}

.add-metric-btn:hover{
  background:var(--surface2);
  color:var(--text);
}

.editing .del-btn{display:flex}
.editing .add-metric-btn{display:block}
.editing .mrow-name{display:none}
.editing .mrow-label-inp{display:block}

.zone-name-inp{
  font-size:14px;
  font-weight:600;
  font-family:'Golos Text',sans-serif;
  padding:3px 8px;
  border:1px solid rgba(0,0,0,.15);
  border-radius:var(--rsm);
  background:var(--surface);
  color:var(--text);
  outline:none;
  display:none;
  min-width:0;
  flex:1;
}

.zone-name-inp:focus{
  border-color:rgba(0,0,0,.3);
}

.editing .zone-name-static{display:none}
.editing .zone-name-inp{display:block}

.del-zone-btn{
  padding:4px 10px;
  font-size:11px;
  font-family:'Golos Text',sans-serif;
  border:1px solid rgba(140,31,31,.3);
  border-radius:var(--rsm);
  background:var(--red-bg);
  color:var(--red-text);
  cursor:pointer;
  white-space:nowrap;
  display:none;
  transition:background .12s;
}

.del-zone-btn:hover{
  background:#f7c1c1;
}

.editing .del-zone-btn{
  display:block;
}

.add-zone-btn{
  width:100%;
  padding:12px;
  font-size:13px;
  font-family:'Golos Text',sans-serif;
  font-weight:500;
  border:1.5px dashed var(--border);
  border-radius:var(--r);
  background:none;
  color:var(--text2);
  cursor:pointer;
  transition:background .15s;
  margin-bottom:11px;
  display:none;
}

.add-zone-btn:hover{
  background:var(--surface2);
  color:var(--text);
}

.editing-zones .add-zone-btn{display:block}

.city-block{
  padding:0 15px 12px;
}

.city-sec-title{
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--text3);
  margin-bottom:6px;
}

.city-wrap{
  border:1px solid var(--border);
  border-radius:var(--rsm);
  overflow:hidden;
}

.city-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

.city-table th{
  text-align:left;
  padding:6px 10px;
  font-size:11px;
  font-weight:600;
  color:var(--text3);
  border-bottom:1px solid var(--border);
  background:var(--surface2);
}

.city-table td{
  padding:6px 10px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}

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

.city-inp{
  width:100%;
  font-size:13px;
  font-family:'Golos Text',sans-serif;
  padding:3px 6px;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--surface2);
  color:var(--text);
  outline:none;
  text-align:right;
}

.city-inp:focus{
  border-color:rgba(0,0,0,.25);
}

.note-area{
  padding:0 15px 13px;
  display:flex;
  gap:7px;
}

.note-inp{
  flex:1;
  font-size:13px;
  font-family:'Golos Text',sans-serif;
  padding:7px 9px;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  color:var(--text);
  resize:none;
  outline:none;
}

.note-inp:focus{
  border-color:rgba(0,0,0,.22);
}

.save-btn{
  padding:7px 12px;
  font-size:12px;
  font-family:'Golos Text',sans-serif;
  font-weight:500;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  color:var(--text2);
  cursor:pointer;
  white-space:nowrap;
  transition:background .15s;
}

.save-btn:hover{
  background:#E2E1DC;
}

.save-btn.saved{
  color:var(--green-text);
  background:var(--green-bg);
  border-color:rgba(45,106,31,.2);
}

.week-sum{
  margin-top:24px;
}

.ws-title{
  font-size:12px;
  font-weight:600;
  color:var(--text3);
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:.5px;
}

.ws-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  overflow:hidden;
}

.ws-table th{
  text-align:left;
  padding:8px 12px;
  font-size:11px;
  font-weight:600;
  color:var(--text3);
  text-transform:uppercase;
  letter-spacing:.4px;
  border-bottom:1px solid var(--border);
  background:var(--surface2);
}

.ws-table td{
  padding:8px 12px;
  border-bottom:1px solid var(--border);
  color:var(--text);
  cursor:pointer;
}

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

.ws-table tr:hover td{
  background:rgba(0,0,0,.02);
}

.pill{
  display:inline-flex;
  align-items:center;
  padding:2px 7px;
  border-radius:20px;
  font-size:11px;
  font-weight:600;
}

.pill-g{
  background:var(--green-bg);
  color:var(--green-text);
}

.pill-y{
  background:var(--yellow-bg);
  color:var(--yellow-text);
}

.pill-r{
  background:var(--red-bg);
  color:var(--red-text);
}

.page-tabs{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex;
  padding:0 18px;
  position:sticky;
  top:57px;
  z-index:19;
}

.page-tab{
  padding:10px 16px;
  font-size:13px;
  font-weight:500;
  color:var(--text3);
  cursor:pointer;
  border-bottom:2px solid transparent;
  transition:color .15s;
  white-space:nowrap;
  font-family:'Golos Text',sans-serif;
  border:none;
  background:none;
}

.page-tab:hover{
  color:var(--text2);
}

.page-tab.active{
  color:var(--text);
  border-bottom:2px solid var(--text);
}

.stats-page,.tasks-page{
  display:none;
  padding:14px 14px 50px;
  max-width:980px;
  margin:0 auto;
}

.stats-page.show,.tasks-page.show{
  display:block;
}

.stats-filters{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:12px;
}

.filter-inp{
  height:32px;
  padding:0 8px;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  font-size:12px;
  font-family:'Golos Text',sans-serif;
  color:var(--text2);
}

.filter-btn{
  height:32px;
  padding:0 14px;
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:var(--surface2);
  cursor:pointer;
  font-size:12px;
  font-family:'Golos Text',sans-serif;
  font-weight:500;
  color:var(--text2);
}

.filter-btn:hover{
  background:#E2E1DC;
}

.stat-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:12px;
  margin-bottom:10px;
}

.stat-title{
  font-size:13px;
  font-weight:600;
  color:var(--text2);
  margin-bottom:8px;
}

.table-wrap{
  overflow:auto;
}

.stat-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.stat-table th{
  padding:8px 10px;
  background:var(--surface2);
  font-size:11px;
  text-align:left;
  color:var(--text3);
  text-transform:uppercase;
  letter-spacing:.3px;
}

.stat-table td{
  padding:8px 10px;
  border-top:1px solid var(--border);
  vertical-align:top;
}

.stat-empty{
  padding:28px 14px;
  text-align:center;
  color:var(--text3);
  font-size:13px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
}

.tasks-wrap{
  background:transparent;
}

.tasks-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.tasks-date{
  font-size:30px;
  line-height:1.1;
  font-weight:600;
  letter-spacing:-.4px;
}

.tasks-user{
  margin-top:6px;
  font-size:13px;
  color:var(--text2);
}

.tasks-meta{
  font-size:13px;
  color:var(--text3);
  white-space:nowrap;
  padding-top:6px;
}

.tasks-sec-title{
  font-size:12px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--text3);
  margin:14px 0 8px;
}

.tasks-zone-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}

.task-zone-card{
  border-radius:var(--r);
  border:1px solid var(--border);
  background:var(--surface);
  padding:12px;
  min-width:0;
}

.task-zone-card.problem{
  background:var(--red-bg);
  border-color:rgba(229,57,53,.35);
}

.task-zone-card.warning{
  background:var(--yellow-bg);
  border-color:rgba(245,166,35,.35);
}

.task-zone-card.ok{
  background:var(--green-bg);
  border-color:rgba(76,175,80,.35);
}

.task-zone-title{
  font-size:14px;
  font-weight:600;
  margin-bottom:4px;
}

.task-zone-status{
  font-size:22px;
  font-weight:600;
  line-height:1;
}

.task-zone-status.problem{
  color:var(--red-text);
}

.task-zone-status.warning{
  color:var(--yellow-text);
}

.task-zone-status.ok{
  color:var(--green-text);
}

.task-zone-sub{
  margin-top:4px;
  font-size:14px;
  color:var(--text2);
}

.task-zone-fill{
  margin-top:2px;
  font-size:13px;
  color:var(--text3);
}

.tasks-list{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  overflow:hidden;
}

.task-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:12px 14px;
  border-top:1px solid var(--border);
}

.task-row:first-child{
  border-top:none;
}

.task-row-left{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
}

.task-row-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--red-dot);
  margin-top:6px;
  flex-shrink:0;
}

.task-row-metric{
  font-size:28px;
  font-weight:600;
  letter-spacing:-.25px;
  line-height:1.1;
}

.task-row-zone{
  font-size:14px;
  color:var(--text2);
  margin-top:4px;
}

.task-row-right{
  text-align:right;
  flex-shrink:0;
}

.task-row-value{
  font-size:34px;
  font-weight:700;
  color:var(--red-text);
  letter-spacing:-.35px;
  line-height:1.05;
}

.task-row-status{
  margin-top:4px;
  font-size:13px;
  color:var(--text3);
}

@media (max-width:1024px){
  .tasks-date{
    font-size:26px;
  }

  .task-row-metric{
    font-size:22px;
  }

  .task-row-value{
    font-size:28px;
  }
}

@media (max-width:760px){
  .top-bar{
    align-items:flex-start;
    flex-direction:column;
  }

  .top-right{
    width:100%;
    justify-content:flex-start;
  }

  .page-tabs{
    top:102px;
  }

  .content,.stats-page,.tasks-page{
    padding:10px 10px 40px;
  }

  .summary-row{
    grid-template-columns:1fr;
  }

  .tasks-head{
    flex-direction:column;
    gap:4px;
  }

  .tasks-meta{
    padding-top:0;
  }

  .tasks-zone-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:560px){
  .page-tabs{
    padding:0 10px;
  }

  .page-tab{
    padding:10px 11px;
    font-size:12px;
  }

  .zone-head{
    padding:11px 10px 8px;
  }

  .lead-row,.mlist,.city-block,.note-area{
    padding-left:10px;
    padding-right:10px;
  }

  .divider{
    margin-left:10px;
    margin-right:10px;
  }

  .sec-title{
    padding-left:10px;
    padding-right:10px;
  }

  .mrow{
    grid-template-columns:1fr;
    gap:6px;
  }

  .mrow-right{
    justify-content:flex-end;
  }

  .note-area{
    flex-direction:column;
  }

  .save-btn{
    width:100%;
  }

  .tasks-date{
    font-size:22px;
  }

  .task-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .task-row-right{
    width:100%;
    text-align:left;
  }
}

@media (max-width:420px){
  .top-title{
    font-size:15px;
  }

  .mnum{
    width:62px;
  }

  .select-sm{
    max-width:170px;
    min-width:110px;
  }
}
