:root{
  --ink:#132A22;
  --paper:#F6F4EE;
  --paper2:#EDEAE0;
  --forest:#0E4432;
  --forest2:#146349;
  --amber:#D98E32;
  --line:#D8D3C4;
  --white:#FFFFFF;
  --danger:#B4442E;
  --muted:#6B7A72;
  --shadow:0 1px 2px rgba(19,42,34,.08),0 4px 14px rgba(19,42,34,.06);
}

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

body{
  background:var(--paper);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}

button,input,select,textarea{font:inherit}
button{cursor:pointer}

.brandbar{
  background:var(--forest);
  color:#fff;
  position:sticky;
  top:0;
  z-index:50;
  box-shadow:var(--shadow);
}

.brand-inner{
  max-width:1120px;
  margin:auto;
  padding:13px 14px 0;
}

.brand-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  gap:9px;
  align-items:flex-start;
  min-width:0;
}

.brand-mark{
  width:11px;
  height:11px;
  background:var(--amber);
  transform:rotate(45deg);
  border-radius:2px;
  margin-top:5px;
  flex:none;
}

.brand h1{
  font-size:17px;
  line-height:1.15;
  margin:0;
  font-weight:760;
}

.brand small{
  display:block;
  font-size:11px;
  color:#BFE0D2;
  margin-top:4px;
}

.admin-link{
  color:#fff;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08);
  border-radius:20px;
  padding:8px 12px;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.tabs{
  display:flex;
  gap:6px;
  margin-top:12px;
  overflow-x:auto;
}

.tab{
  border:0;
  background:rgba(255,255,255,.08);
  color:#CFE6DA;
  padding:9px 14px;
  border-radius:8px 8px 0 0;
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
}

.tab.active{
  background:var(--paper);
  color:var(--forest);
}

main{
  max-width:1120px;
  margin:auto;
  padding:22px 10px 50px;
}

.panel{display:none}
.panel.active{display:block}

.status{
  min-height:22px;
  color:var(--muted);
  font-size:12px;
  margin-bottom:7px;
}

.status.error{color:var(--danger)}
.status.ok{color:#2E7D3F}

.toolbar-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.refresh-note{
  font-size:11px;
  color:var(--muted);
}

.legend{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:5px 2px 12px;
  font-size:11px;
}

.legend span{
  display:inline-flex;
  align-items:center;
  gap:5px;
  background:#fff;
  border:1px solid var(--line);
  padding:4px 8px 4px 5px;
  border-radius:20px;
}

.swatch{
  width:11px;
  height:11px;
  border-radius:3px;
  border:1px solid rgba(0,0,0,.12);
}

.table-wrap{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:auto;
  box-shadow:var(--shadow);
}

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

thead th{
  background:var(--forest);
  color:#fff;
  padding:10px 7px;
  text-align:center;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.35px;
  white-space:nowrap;
}

th.turma-A{background:#2E7D3F}
th.turma-B{background:#1E7FA0}
th.turma-C{background:#A23D6D}
th.turma-D{background:#5A5F58}
th.turma-E{background:#B5721E}

tbody tr{border-bottom:1px solid var(--line)}
tbody tr:nth-child(even){background:#FBFAF6}

td{
  padding:8px 7px;
  text-align:center;
}

td.datacell{
  position:sticky;
  left:0;
  z-index:2;
  background:var(--paper2);
  text-align:left;
  min-width:135px;
  font-weight:750;
  border-right:1px solid var(--line);
}

.datacell .wd{
  display:block;
  margin-top:2px;
  font-size:10px;
  color:var(--muted);
  font-weight:600;
  text-transform:uppercase;
}

.shift-chip{
  display:inline-block;
  min-width:66px;
  padding:6px 9px;
  border-radius:7px;
  color:#1c1c17;
  font-size:11px;
  font-weight:800;
}

.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:14px;
  margin-bottom:14px;
}

.card-title{
  margin:0 0 10px;
  font-size:14px;
  color:var(--forest);
}

.controls{
  display:flex;
  gap:9px;
  align-items:end;
  flex-wrap:wrap;
  margin-bottom:13px;
}

.control{
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size:11px;
  font-weight:700;
  color:#4E5A54;
}

.control select,.search-input{
  border:1px solid var(--line);
  background:#fff;
  border-radius:8px;
  padding:9px 11px;
  font-size:14px;
  color:var(--ink);
  min-height:42px;
}

.search-input{width:100%}

.equipe-grid th:first-child,.equipe-grid td:first-child{
  text-align:left;
  min-width:170px;
}

.equipe-grid td{
  text-align:left;
  vertical-align:top;
  min-width:160px;
  line-height:1.55;
}

.person{padding:1px 0}
.role{font-weight:750;color:var(--forest)}

.search-results{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-top:9px;
}

.search-hit{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  background:var(--paper2);
  border-radius:8px;
  padding:9px 11px;
}

.search-hit button{
  border:0;
  background:var(--forest);
  color:#fff;
  border-radius:20px;
  padding:7px 10px;
  font-size:11px;
  font-weight:750;
}

.search-role{
  color:var(--muted);
  font-size:11px;
  display:block;
  margin-top:2px;
}

.my-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.my-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  padding:10px 12px;
}

.my-date{
  font-size:13px;
  font-weight:750;
}

.my-date small{
  color:var(--muted);
  margin-left:5px;
  font-weight:600;
  text-transform:uppercase;
}

.empty{
  text-align:center;
  padding:28px 12px;
  color:#8A8377;
  font-size:13px;
}

.footer{
  text-align:center;
  color:#8A8377;
  font-size:11px;
  margin-top:18px;
}

.mobile-turma{display:none}

@media(max-width:680px){
  .brand-inner{padding-left:10px;padding-right:10px}
  .brand h1{font-size:15px}
  .brand small{font-size:10px}
  .admin-link{padding:7px 9px}
  main{padding-top:14px}
  .desktop-table{display:none}
  .mobile-turma{display:block}

  .mobile-day{
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    padding:10px;
    margin-bottom:8px;
  }

  .mobile-day-head{
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center;
    margin-bottom:8px;
  }

  .mobile-date{
    font-weight:800;
    font-size:13px;
  }

  .mobile-date small{
    font-size:10px;
    color:var(--muted);
    text-transform:uppercase;
    margin-left:4px;
  }

  .mobile-shifts{
    display:grid;
    grid-template-columns:1fr;
    gap:7px;
  }

  .mobile-shift{
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:var(--paper2);
    border-radius:8px;
    padding:7px 8px;
    font-size:11px;
  }

  .equipe-grid td,.equipe-grid th{min-width:135px}
}


/* ===== v1.1 refinements ===== */
.today-row{
  background:#FFF8E8 !important;
  box-shadow:inset 3px 0 0 var(--amber);
}
.today-badge{
  display:inline-block;
  margin-left:6px;
  padding:2px 6px;
  border-radius:10px;
  background:var(--amber);
  color:#2A1B04;
  font-size:9px;
  font-weight:800;
  vertical-align:middle;
}
.section-title{
  margin:0 0 10px;
  font-size:16px;
  color:var(--forest);
  font-weight:800;
}
.section-subtitle{
  margin:-4px 0 14px;
  color:var(--muted);
  font-size:12px;
}
.hero-strip{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.hero-strip strong{
  color:var(--forest);
  font-size:13px;
}
.hero-strip span{
  color:var(--muted);
  font-size:11px;
}
.mobile-day.today{
  border-color:#E4B15B;
  box-shadow:0 0 0 1px rgba(217,142,50,.18),var(--shadow);
}
.mobile-day.today .mobile-day-head::after{
  content:"HOJE";
  font-size:9px;
  font-weight:900;
  background:var(--amber);
  color:#2A1B04;
  border-radius:10px;
  padding:3px 7px;
}
.turma-select-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.turma-pill-btn{
  border:1.5px solid var(--line);
  background:#fff;
  color:var(--ink);
  border-radius:20px;
  padding:7px 13px;
  font-size:12px;
  font-weight:800;
}
.turma-pill-btn.active{
  background:var(--forest);
  color:#fff;
  border-color:var(--forest);
}
@media(max-width:680px){
  .legend{gap:5px}
  .legend span{font-size:10px;padding-right:7px}
  .brand-top{align-items:flex-start}
  .admin-link{font-size:11px}
}


/* ===== V2.0 — visual corporativo ===== */
:root{
  --surface:#FFFFFF;
  --surface-soft:#FBFAF6;
  --success:#2E7D3F;
  --warning:#B5721E;
}

body{
  background:
    radial-gradient(circle at 10% 0%, rgba(217,142,50,.07), transparent 24%),
    var(--paper);
}

.brandbar{
  backdrop-filter:saturate(1.15);
}

.brand-inner{
  max-width:1240px;
}

.brand h1{
  font-size:18px;
}

main{
  max-width:1240px;
}

.page-shell{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:14px;
}

.public-hero{
  display:grid;
  grid-template-columns:1.4fr .6fr;
  gap:14px;
  margin-bottom:16px;
}

.hero-card{
  background:linear-gradient(135deg,var(--forest),var(--forest2));
  color:#fff;
  border-radius:16px;
  padding:18px;
  box-shadow:var(--shadow);
  min-height:118px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.hero-card h2{
  margin:0;
  font-size:20px;
}

.hero-card p{
  margin:7px 0 0;
  font-size:12px;
  color:#DCEBE5;
}

.hero-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
}

.hero-meta span{
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.15);
  border-radius:20px;
  padding:5px 9px;
  font-size:10px;
  font-weight:750;
}

.today-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  box-shadow:var(--shadow);
}

.today-card span{
  color:var(--muted);
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.today-card strong{
  display:block;
  color:var(--forest);
  font-size:22px;
  margin-top:4px;
}

.today-card small{
  color:var(--muted);
}

.data-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:0 0 10px;
}

.data-toolbar h2{
  margin:0;
  font-size:16px;
  color:var(--forest);
}

.data-toolbar p{
  margin:3px 0 0;
  font-size:11px;
  color:var(--muted);
}

.table-wrap{
  border-radius:14px;
}

thead th{
  padding:11px 8px;
}

.shift-chip{
  min-width:72px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);
}

.section-shell{
  background:rgba(255,255,255,.3);
  border-radius:16px;
}

.lookup-grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:14px;
}

.quick-team-card{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.quick-team-btn{
  border:1px solid var(--line);
  background:#fff;
  color:var(--forest);
  border-radius:10px;
  padding:10px 13px;
  font-size:12px;
  font-weight:800;
  min-width:86px;
}

.quick-team-btn:hover,
.quick-team-btn.active{
  background:var(--forest);
  color:#fff;
  border-color:var(--forest);
}

.loading-bar{
  height:3px;
  background:linear-gradient(90deg,var(--amber),var(--forest2),var(--amber));
  background-size:200% 100%;
  animation:loadingMove 1.2s linear infinite;
  border-radius:10px;
  margin-bottom:8px;
}

.loading-bar[hidden]{display:none}

@keyframes loadingMove{
  from{background-position:0 0}
  to{background-position:200% 0}
}

@media(max-width:780px){
  .public-hero{grid-template-columns:1fr}
  .lookup-grid{grid-template-columns:1fr}
}


/* ===== V3.0 ===== */
.calendar-card{
  background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);
  padding:14px;margin-bottom:14px
}
.calendar-head{
  display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px
}
.calendar-head h3{margin:0;color:var(--forest);font-size:15px}
.calendar-nav{display:flex;gap:6px}
.calendar-nav button{
  border:1px solid var(--line);background:#fff;color:var(--forest);border-radius:8px;padding:7px 10px;font-weight:800
}
.calendar-grid{
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px
}
.calendar-weekday{
  text-align:center;font-size:9px;font-weight:850;color:var(--muted);text-transform:uppercase;padding:4px
}
.calendar-day{
  min-height:74px;border:1px solid var(--line);background:var(--surface-soft);border-radius:9px;padding:6px;
  display:flex;flex-direction:column;gap:4px
}
.calendar-day.muted{opacity:.35}
.calendar-day.today{border-color:var(--amber);box-shadow:inset 0 0 0 1px rgba(217,142,50,.25)}
.calendar-day strong{font-size:11px;color:var(--forest)}
.calendar-day .cal-count{font-size:9px;color:var(--muted)}
.calendar-mini-shifts{display:flex;gap:3px;flex-wrap:wrap;margin-top:auto}
.calendar-dot{width:8px;height:8px;border-radius:50%;border:1px solid rgba(0,0,0,.12)}
.smart-result{
  background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;margin-top:10px
}
.smart-result h4{margin:0 0 5px;color:var(--forest);font-size:14px}
.smart-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:9px
}
.smart-stat{background:var(--paper2);border-radius:8px;padding:8px}
.smart-stat span{display:block;font-size:9px;color:var(--muted);text-transform:uppercase;font-weight:800}
.smart-stat b{display:block;margin-top:3px;font-size:13px}
@media(max-width:700px){
  .calendar-grid{gap:3px}
  .calendar-day{min-height:62px;padding:4px}
  .calendar-day .cal-count{display:none}
  .smart-grid{grid-template-columns:1fr 1fr}
}
