:root{
  font-family:Manrope,system-ui,sans-serif;
  color:#17352c;
  background:#f4f7f5;
  font-synthesis:none;
  --bg:#f4f7f5;
  --card:#fff;
  --text:#17352c;
  --muted:#667a73;
  --line:#dfe8e3;
  --accent:#176b53;
  --accent2:#0e4e3c;
  --soft:#e5f2ec;
  --danger:#c84545;
  --shadow:0 14px 40px rgba(25,58,47,.08)
}
*{
  box-sizing:border-box
}
body{
  margin:0;
  min-width:320px;
  min-height:100vh;
  background:var(--bg);
  color:var(--text)
}
button,input,select,textarea{
  font:inherit
}
button,a{
  touch-action:manipulation
}
button{
  color:inherit
}
h1,h2,h3,p{
  margin-top:0
}
h1{
  font-size:clamp(1.75rem,4vw,2.65rem);
  letter-spacing:-.045em;
  margin-bottom:0
}
h2{
  font-size:1.18rem;
  letter-spacing:-.02em
}
h3{
  font-size:1rem
}
svg{
  width:20px;
  height:20px;
  stroke-width:1.9
}
.app-shell{
  min-height:100vh
}
.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:245px;
  background:#102e25;
  color:#d8ebe4;
  padding:28px 18px;
  z-index:5
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 8px 38px
}
.brand b,.brand span{
  display:block
}
.brand span{
  font-size:.7rem;
  color:#8fb3a6;
  margin-top:2px
}
.brand-mark{
  width:58px;
  height:58px;
  border-radius:20px;
  display:grid;
  place-items:center;
  background:linear-gradient(145deg,#2a8b6d,#12533f);
  color:white;
  font-size:1.15rem;
  font-weight:800;
  box-shadow:0 10px 25px rgba(10,47,36,.22)
}
.brand-mark.small{
  width:40px;
  height:40px;
  border-radius:13px;
  font-size:.8rem
}
.sidebar>button,.bottom button{
  border:0;
  background:none;
  display:flex;
  align-items:center;
  gap:13px;
  width:100%;
  padding:13px 14px;
  border-radius:14px;
  color:#9fc0b4;
  cursor:pointer;
  margin:4px 0
}
.sidebar>button:hover,.sidebar>button.active{
  background:#1c4739;
  color:#fff
}
.sidebar>button svg{
  width:19px
}
.content{
  margin-left:245px;
  padding:44px clamp(26px,5vw,72px) 70px;
  max-width:1500px
}
.bottom{
  display:none
}
.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:28px
}
.eyebrow{
  text-transform:uppercase;
  font-weight:800;
  font-size:.69rem;
  letter-spacing:.13em;
  color:#769288;
  display:block;
  margin-bottom:7px
}
.primary,.secondary,.ghost,.upload{
  border:0;
  border-radius:13px;
  min-height:46px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none
}
.primary{
  background:var(--accent);
  color:#fff;
  box-shadow:0 8px 18px rgba(23,107,83,.2)
}
.primary:hover{
  background:var(--accent2)
}
.secondary,.upload{
  background:var(--card);
  border:1px solid var(--line);
  color:var(--text)
}
.secondary:hover,.secondary.selected{
  border-color:#9fbeb2;
  background:var(--soft)
}
.ghost{
  background:transparent;
  color:var(--muted)
}
.icon-button{
  width:44px;
  height:44px;
  border:0;
  background:var(--soft);
  border-radius:13px;
  display:grid;
  place-items:center;
  cursor:pointer;
  padding:0
}
.hero-search{
  background:var(--card);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  display:flex;
  align-items:center;
  gap:12px;
  border-radius:18px;
  padding:8px 9px 8px 18px;
  margin-bottom:24px
}
.hero-search input,.search input{
  border:0;
  outline:0;
  background:transparent;
  min-width:0;
  flex:1;
  color:var(--text)
}
.hero-search button{
  border:0;
  background:var(--accent);
  color:white;
  border-radius:12px;
  padding:10px 18px;
  font-weight:700
}
.metrics{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-bottom:28px
}
.metric{
  border:1px solid var(--line);
  background:var(--card);
  text-align:left;
  border-radius:18px;
  padding:18px;
  display:grid;
  grid-template-columns:auto 1fr;
  column-gap:12px;
  box-shadow:0 5px 20px rgba(35,66,55,.04);
  cursor:pointer
}
.metric-icon{
  grid-row:1/3;
  width:42px;
  height:42px;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:var(--soft);
  color:var(--accent)
}
.metric strong{
  font-size:1.45rem;
  line-height:1
}
.metric>span:last-child{
  font-size:.72rem;
  color:var(--muted);
  margin-top:5px
}
.metric.amber .metric-icon{
  background:#fff3dc;
  color:#b97b13
}
.metric.blue .metric-icon{
  background:#e7f0fb;
  color:#3474a9
}
.metric.red .metric-icon{
  background:#fdeaea;
  color:#c84545
}
.dashboard-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px
}
.dashboard-grid .panel:last-child{
  grid-column:1/-1
}
.panel,.settings-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:20px;
  padding:20px;
  box-shadow:0 6px 24px rgba(22,52,42,.04)
}
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between
}
.section-head h2{
  margin-bottom:12px
}
.section-head button{
  border:0;
  background:none;
  color:var(--accent);
  font-weight:700;
  display:flex;
  align-items:center;
  cursor:pointer
}
.section-head svg{
  width:16px
}
.rows{
  display:flex;
  flex-direction:column
}
.row{
  min-height:66px;
  display:flex;
  align-items:center;
  gap:12px;
  border-top:1px solid var(--line);
  padding:11px 2px
}
.row:first-child{
  border-top:0
}
.row.person{
  border-left:0;
  border-right:0;
  border-bottom:0;
  background:transparent;
  text-align:left;
  cursor:pointer;
  color:inherit;
  width:100%
}
.grow{
  min-width:0;
  flex:1
}
.grow b,.grow small{
  display:block
}
.grow b{
  overflow:hidden;
  text-overflow:ellipsis
}
.grow small{
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-top:3px
}
.avatar{
  width:42px;
  height:42px;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:linear-gradient(145deg,#d9ede5,#ecf6f2);
  color:var(--accent);
  font-weight:800;
  font-size:.8rem
}
.date-pill,.badge{
  border-radius:99px;
  padding:6px 9px;
  background:#fff3dc;
  color:#925f0d;
  font-size:.72rem;
  font-weight:800;
  white-space:nowrap
}
.deadline{
  font-size:.74rem;
  color:var(--muted);
  white-space:nowrap
}
.priority{
  display:inline-block;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#81a397;
  flex:none
}
.priority.high{
  background:#e78b38
}
.priority.critical{
  background:#d44646
}
.priority.low{
  background:#5d91bf
}
.overdue{
  background:#fff8f8!important
}
.empty{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  color:var(--muted);
  padding:28px 12px
}
.empty svg{
  width:32px;
  height:32px;
  margin-bottom:10px
}
.empty b{
  color:var(--text)
}
.empty p{
  font-size:.84rem;
  margin:5px 0
}
.toolbar{
  display:flex;
  gap:10px;
  margin-bottom:14px
}
.search{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 14px;
  min-height:48px;
  flex:1
}
.search button{
  border:0;
  background:none;
  display:grid;
  place-items:center
}
.filters{
  display:grid;
  grid-template-columns:repeat(4,minmax(150px,1fr));
  gap:12px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:17px;
  margin-bottom:16px
}
.filters label,.form-grid label,.form-stack label,.settings-card label,.mapping label,.month-select{
  display:flex;
  flex-direction:column;
  gap:7px;
  color:var(--muted);
  font-size:.72rem;
  font-weight:700
}
.filters select,input,select,textarea{
  min-height:44px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--card);
  color:var(--text);
  padding:9px 11px;
  outline:0
}
input:focus,select:focus,textarea:focus{
  border-color:#5b9c86;
  box-shadow:0 0 0 3px rgba(45,137,106,.12)
}
textarea{
  min-height:92px;
  resize:vertical
}
.reset{
  align-self:end
}
.contact-list,.task-list,.birthday-list{
  display:flex;
  flex-direction:column;
  gap:10px
}
.contact-card,.task-card,.birthday-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:17px;
  padding:15px 17px;
  display:flex;
  align-items:center;
  gap:14px;
  box-shadow:0 3px 14px rgba(23,53,44,.035);
  cursor:pointer
}
.contact-card:hover{
  border-color:#adc8be;
  transform:translateY(-1px)
}
.contact-title{
  display:flex;
  align-items:center;
  gap:8px
}
.contact-title h3,.birthday-card h3{
  margin:0
}
.contact-card p,.birthday-card p{
  color:var(--muted);
  font-size:.8rem;
  margin:4px 0
}
.chips{
  display:flex;
  gap:6px;
  flex-wrap:wrap
}
.chips span{
  background:#eff4f2;
  color:#567069;
  font-size:.65rem;
  padding:4px 7px;
  border-radius:7px
}
.chips span.danger{
  color:#aa3434;
  background:#fdeaea
}
.birthday-mini{
  font-size:.7rem;
  font-weight:700;
  color:#a26d19;
  display:flex;
  align-items:center;
  gap:4px
}
.birthday-mini svg{
  width:15px
}
.modal-open{
  overflow:hidden
}
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(7,27,21,.54);
  backdrop-filter:blur(6px);
  z-index:30;
  padding:24px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  overflow:auto
}
.modal{
  width:min(540px,100%);
  background:var(--card);
  border-radius:24px;
  padding:23px;
  box-shadow:0 24px 80px rgba(0,0,0,.23);
  margin:auto
}
.modal.wide{
  width:min(880px,100%)
}
.modal-head{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:22px
}
.modal-head h2{
  font-size:1.55rem;
  margin:0
}
.modal-head p{
  color:var(--muted);
  font-size:.8rem;
  margin:5px 0 0
}
.modal-head .back{
  display:none
}
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:15px
}
.form-grid .span-2{
  grid-column:1/-1
}
.date-parts{
  display:grid;
  grid-template-columns:70px 70px 1fr;
  gap:7px
}
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px
}
.error{
  background:#fdeaea;
  color:#9d3333;
  border-radius:11px;
  padding:10px;
  font-size:.8rem;
  margin:14px 0
}
.contact-hero{
  background:linear-gradient(135deg,#e8f3ee,#f8f5e8);
  padding:18px;
  border-radius:18px;
  display:flex;
  align-items:center;
  gap:14px
}
.contact-hero .avatar{
  width:56px;
  height:56px
}
.contact-hero b,.contact-hero span{
  display:block
}
.contact-hero span{
  color:var(--muted);
  font-size:.75rem;
  margin-top:4px
}
.action-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:16px 0
}
.action-grid button,.action-grid a{
  border:1px solid var(--line);
  background:var(--card);
  border-radius:12px;
  min-height:48px;
  padding:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-size:.72rem;
  font-weight:700;
  text-decoration:none;
  color:inherit;
  cursor:pointer
}
.action-grid svg{
  width:17px
}
.details{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:16px 0
}
.details div{
  background:#f7f9f8;
  border-radius:13px;
  padding:12px
}
.details span{
  display:block;
  color:var(--muted);
  font-size:.68rem
}
.details p{
  white-space:pre-wrap;
  margin:4px 0 0;
  font-size:.84rem
}
.card-block{
  margin-top:20px
}
.card-block h3{
  text-transform:uppercase;
  letter-spacing:.09em;
  font-size:.72rem;
  color:var(--muted)
}
.archive{
  margin-top:20px;
  color:#9a4646
}
.segmented{
  display:flex;
  gap:5px;
  background:#e7eeeb;
  border-radius:14px;
  padding:5px;
  margin-bottom:18px;
  width:max-content;
  max-width:100%
}
.segmented button{
  border:0;
  background:transparent;
  padding:9px 13px;
  border-radius:10px;
  white-space:nowrap;
  font-size:.76rem;
  font-weight:700;
  color:#60736d;
  cursor:pointer
}
.segmented button.active{
  background:var(--card);
  color:var(--text);
  box-shadow:0 3px 9px rgba(20,49,39,.08)
}
.segmented.scroll{
  width:100%;
  overflow:auto
}
.task-card{
  display:block;
  cursor:default
}
.task-top{
  display:flex;
  align-items:center;
  gap:12px
}
.task-top h3{
  margin:0
}
.task-top p,.task-description{
  color:var(--muted);
  font-size:.78rem;
  margin:4px 0 0
}
.status{
  border-radius:99px;
  padding:5px 9px;
  font-size:.68rem;
  font-weight:800;
  background:#eef2f0
}
.status.in_progress{
  background:#e8f0fb;
  color:#346a9f
}
.status.waiting{
  background:#fff3dc;
  color:#9c6812
}
.status.completed{
  background:#e4f3ec;
  color:#267158
}
.task-bottom{
  display:flex;
  align-items:center;
  gap:16px;
  border-top:1px solid var(--line);
  padding-top:10px;
  margin-top:12px;
  font-size:.72rem;
  color:var(--muted)
}
.task-bottom span{
  display:flex;
  align-items:center;
  gap:5px
}
.task-bottom svg{
  width:15px
}
.task-bottom select{
  margin-left:auto;
  min-height:34px;
  padding:4px 8px
}
.danger-text{
  color:var(--danger)!important;
  font-weight:800
}
.form-stack{
  display:flex;
  flex-direction:column;
  gap:14px
}
.month-select{
  width:240px;
  margin:0 0 18px
}
.birthday-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px
}
.calendar-date{
  width:52px;
  height:55px;
  background:#fff3dc;
  color:#9b6411;
  border-radius:13px;
  display:grid;
  place-items:center;
  align-content:center
}
.calendar-date b{
  font-size:1.25rem;
  line-height:1
}
.calendar-date span{
  font-size:.62rem;
  text-transform:uppercase;
  margin-top:3px
}
.settings-card{
  max-width:680px;
  margin-bottom:16px;
  display:flex;
  flex-direction:column;
  gap:15px
}
.settings-card h2{
  margin:0
}
.settings-card>p{
  color:var(--muted);
  font-size:.82rem;
  margin:-7px 0 2px
}
.settings-card .primary,.settings-card .secondary{
  align-self:flex-start
}
.read-only{
  display:flex;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  padding:9px 0;
  font-size:.82rem
}
.read-only span{
  color:var(--muted)
}
.excel-actions{
  display:flex;
  gap:10px;
  margin-bottom:20px
}
.upload{
  cursor:pointer
}
.upload input{
  display:none
}
.mapping{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:9px
}
.preview-table{
  border:1px solid var(--line);
  border-radius:13px;
  overflow:hidden
}
.preview-table>div{
  display:flex;
  gap:10px;
  padding:9px 11px;
  border-top:1px solid var(--line);
  font-size:.76rem
}
.preview-table>div:first-child{
  border:0
}
.preview-table span{
  flex:1
}
.preview-table em{
  color:#9d6812
}
.preview-table .duplicate{
  background:#fff9ec
}
.auth-page,.splash{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px
}
.splash{
  align-content:center;
  gap:12px;
  color:var(--muted)
}
.splash.compact{
  min-height:160px
}
.auth-card{
  width:min(430px,100%);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:24px;
  padding:28px;
  box-shadow:var(--shadow)
}
.auth-card .brand-mark{
  margin-bottom:20px
}
.auth-card h1{
  margin-bottom:9px
}
.auth-card p{
  color:var(--muted);
  line-height:1.55
}
.auth-card label{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-size:.75rem;
  color:var(--muted);
  margin:20px 0 12px
}
.auth-card .primary{
  width:100%
}
.auth-card small{
  display:block;
  color:var(--muted);
  margin-top:14px;
  line-height:1.5
}
@media(max-width:1000px){
  .metrics{
    grid-template-columns:repeat(2,1fr)
  }
  .filters{
    grid-template-columns:repeat(2,1fr)
  }
  .sidebar{
    width:210px
  }
  .content{
    margin-left:210px;
    padding-left:28px;
    padding-right:28px
  }
}
@media(max-width:720px){
  body{
    padding-bottom:calc(74px + env(safe-area-inset-bottom))
  }
  .sidebar{
    display:none
  }
  .content{
    margin-left:0;
    padding:calc(24px + env(safe-area-inset-top)) 15px 24px
  }
  .bottom{
    position:fixed;
    display:grid;
    grid-template-columns:repeat(5,1fr);
    inset:auto 0 0 0;
    background:rgba(255,255,255,.94);
    backdrop-filter:blur(18px);
    border-top:1px solid var(--line);
    padding:6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index:20
  }
  .bottom button{
    display:flex;
    flex-direction:column;
    gap:2px;
    margin:0;
    padding:5px 1px;
    border-radius:10px;
    font-size:.58rem;
    color:#73847e
  }
  .bottom button.active{
    color:var(--accent);
    background:var(--soft)
  }
  .bottom svg{
    width:21px;
    height:21px
  }
  .page-head{
    align-items:center;
    margin-bottom:20px
  }
  .page-head .new-button{
    font-size:0;
    width:46px;
    padding:0
  }
  .page-head .new-button svg{
    margin:0
  }
  .hero-search{
    padding-left:13px
  }
  .hero-search button{
    display:none
  }
  .metrics{
    gap:9px
  }
  .metric{
    padding:13px 11px;
    column-gap:9px
  }
  .metric-icon{
    width:36px;
    height:36px
  }
  .metric strong{
    font-size:1.2rem
  }
  .dashboard-grid{
    grid-template-columns:1fr
  }
  .dashboard-grid .panel:last-child{
    grid-column:auto
  }
  .panel{
    padding:15px
  }
  .toolbar{
    display:grid;
    grid-template-columns:1fr 1fr
  }
  .toolbar .search{
    grid-column:1/-1
  }
  .toolbar .secondary{
    padding:0 10px
  }
  .filters{
    grid-template-columns:1fr 1fr;
    padding:13px;
    gap:10px
  }
  .contact-card{
    padding:12px;
    gap:10px
  }
  .contact-card>.birthday-mini,.contact-card>svg{
    display:none
  }
  .modal-backdrop{
    padding:0;
    align-items:flex-end
  }
  .modal,.modal.wide{
    width:100%;
    max-height:96dvh;
    overflow:auto;
    border-radius:24px 24px 0 0;
    padding:18px 15px calc(20px + env(safe-area-inset-bottom));
    margin:auto 0 0
  }
  .modal-head{
    position:sticky;
    top:-18px;
    background:var(--card);
    z-index:3;
    padding:10px 0
  }
  .modal-head .back{
    display:grid
  }
  .form-grid{
    grid-template-columns:1fr
  }
  .form-grid .span-2{
    grid-column:auto
  }
  .action-grid{
    grid-template-columns:repeat(2,1fr)
  }
  .details{
    grid-template-columns:1fr
  }
  .birthday-grid{
    grid-template-columns:1fr
  }
  .birthday-card{
    padding:11px;
    gap:9px
  }
  .birthday-card>.date-pill{
    display:none
  }
  .segmented{
    width:100%;
    overflow:auto
  }
  .task-bottom{
    flex-wrap:wrap
  }
  .task-bottom select{
    width:100%;
    margin:0
  }
  .mapping{
    grid-template-columns:1fr 1fr
  }
  .excel-actions{
    flex-direction:column
  }
  .row .date-pill{
    display:none
  }
}
@media(prefers-color-scheme:dark){
  :root{
    --bg:#0c1713;
    --card:#13241e;
    --text:#e8f2ee;
    --muted:#91a59e;
    --line:#294139;
    --soft:#1d372e;
    --accent:#45b58d;
    --accent2:#51c49b;
    --danger:#ff7d7d;
    --shadow:0 14px 40px rgba(0,0,0,.2)
  }
  .sidebar{
    background:#08140f
  }
  .primary{
    color:#062219
  }
  .metric.amber .metric-icon,.calendar-date{
    background:#3c301b;
    color:#f0be66
  }
  .metric.blue .metric-icon{
    background:#1d3043;
    color:#7eb5ea
  }
  .metric.red .metric-icon,.error{
    background:#402222;
    color:#ff9999
  }
  .contact-hero{
    background:linear-gradient(135deg,#19372c,#302f1f)
  }
  .details div{
    background:#102019
  }
  .chips span{
    background:#20362e;
    color:#aabdb6
  }
  .overdue{
    background:#2a1818!important
  }
  .segmented{
    background:#1b2d27
  }
  .bottom{
    background:rgba(14,27,22,.94)
  }
  input,select,textarea{
    color-scheme:dark
  }
  .preview-table .duplicate{
    background:#382e1a
  }
}
