:root{
  --bg:#f7f7f7;
  --bg2:#ffffff;
  --muted:#667085;
  --text:#101828;
  --border:#E4E7EC;
  --btn:#221D25;
  --btn2:#2C2631;
  --chip:#F2F4F7;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
  background:var(--bg);
  color:var(--text);
}
a{color:inherit}
.container{max-width:100%;margin:0 auto;padding:18px}
.layout{display:flex;min-height:100vh}
.sidebar{
  width:260px;flex:0 0 260px;
  background:#fff;border-right:1px solid var(--border);
  padding:14px 12px;position:sticky;top:0;height:100vh;
}
.brand{display:flex;align-items:center;gap:10px;padding:10px 12px;margin-bottom:12px}
.brand .logo{
  width:34px;height:34px;border:1px solid var(--border);
  border-radius:1px;background:linear-gradient(135deg,#fff,#f2f2f2);
  display:flex;align-items:center;justify-content:center;font-weight:700;
}
.brand .name{font-weight:600;letter-spacing:.2px}
.nav{display:flex;flex-direction:column;gap:6px}
.nav a{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:10px;text-decoration:none;
  color:#344054;font-weight:600;
}
.nav a:hover{background:#f3f4f6}
.nav a.active{background:#f3f4f6;color:#111827}
.nav svg{width:24px;height:24px;opacity:.85}
.main{flex:1;min-width:0}
.topline{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px 18px;border-bottom:1px solid var(--border);
  background:#fff;
}
.topline .title{font-size:18px;font-weight:600}
.topline .right{display:flex;align-items:center;gap:10px}
.btn{
  height:38px;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:0 14px;border-radius:1px;border:1px solid var(--border);
  background:var(--btn);color:#fff;font-weight:600;cursor:pointer;text-decoration:none;
}
.btn:hover{background:var(--btn2)}
.btn.ghost{background:#fff;color:#111827}
.btn.ghost:hover{background:#f3f4f6}
.btn-mini{
  height:34px;padding:0 12px;border-radius:1px;border:1px solid var(--border);
  background:#fff;color:#111827;font-weight:600;cursor:pointer;text-decoration:none;
  display:inline-flex;align-items:center;gap:8px;
}
.btn-mini:hover{background:#f3f4f6}
.badge{
  display:inline-flex;align-items:center;justify-content:center;
  padding:6px 10px;border-radius:999px;font-size:12px;font-weight:600;background:var(--chip);color:#344054;border:1px solid var(--border);
}
.badge.agendado{background:#EEF2FF;color:#3730A3;border-color:#C7D2FE}
.badge.confirmada{background:#E6F5FA;color:#0B6B88;border-color:#B6E3F2}
.badge.pago{background:#ECFDF3;color:#027A48;border-color:#ABEFC6}
.badge.concluida{background:#ECFDF3;color:#027A48;border-color:#ABEFC6}
.badge.cancelada{background:#FEF3F2;color:#B42318;border-color:#FECACA}
.badge.remarcada{background:#FFF4E5;color:#B54708;border-color:#FED7AA}

.card{
  background:#fff;border:1px solid var(--border);border-radius:1px;
}
.card-hd{
  padding:12px 14px;border-bottom:1px solid var(--border);
  font-weight:600;color:#111827;display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.card-bd{padding:12px 14px}
.grid{display:grid;gap:10px}
.grid.cols-2{grid-template-columns:1fr}
@media(min-width:980px){.grid.cols-2{grid-template-columns:1fr 1fr}}
.field{display:flex;flex-direction:column;gap:6px}
.label{font-size:12px;text-transform:uppercase;letter-spacing:.02em;color:var(--muted);font-weight:600}
.input, .select, .textarea{
  height:38px;border:1px solid var(--border);border-radius:1px;padding:0 10px;background:#fff;
  outline:none;
}
.textarea{height:auto;min-height:92px;padding:10px}
.table-wrap{overflow:auto}
.table{width:100%;border-collapse:separate;border-spacing:0}
.table thead th{
  text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.02em;color:var(--muted);
  font-weight:600;padding:10px 12px;border-bottom:1px solid var(--border);background:#fff;white-space:nowrap;
}
.table tbody td{padding:12px;border-bottom:1px solid #F2F4F7;vertical-align:middle}
.table tbody tr:hover td{background:#fafafa}
.table tbody tr:last-child td{border-bottom:none}
.actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.kpis{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:980px){.kpis{grid-template-columns:repeat(4,1fr)}}
.kpi{background:#fff;border:1px solid var(--border);border-radius:1px;padding:12px 14px}
.kpi .k{font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.02em}
.kpi .v{font-size:24px;font-weight:600;margin-top:6px}
.hr{height:1px;background:var(--border);margin:12px 0}

/* Drawer */
.drawer-mask{position:fixed;inset:0;background:rgba(16,24,40,.42);display:none;z-index:1050;}
.drawer{
  position:fixed;top:0;right:-520px;width:520px;height:100vh;background:#fff;
  border-left:1px solid var(--border);box-shadow:-10px 0 30px rgba(16,24,40,.12);
  z-index:1051;transition:right .25s ease;display:flex;flex-direction:column;
}
.drawer.open{right:0;}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border);}
.drawer-title{font-weight:600;color:#111827}
.drawer-body{padding:16px;overflow:auto}
.btn-x{width:34px;height:34px;border:1px solid var(--border);border-radius:1px;background:#fff;color:#111827;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;}
.btn-x:hover{background:#f3f4f6}
.box{background:#fff;border:1px solid var(--border);border-radius:1px;}
.box-hd{padding:12px 14px;border-bottom:1px solid var(--border);font-weight:600;color:#111827;}
.box-bd{padding:12px 14px}
.rowitem{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid #F2F4F7}
.rowitem:last-child{border-bottom:none}
.rowlabel{min-width:42%;color:var(--muted);font-weight:600;font-size:13px}
.rowvalue{font-weight:600;word-break:break-word}

/* Toast + loader */
.loader-mask{position:fixed;inset:0;background:rgba(34,29,37,.12);backdrop-filter: blur(2px);display:none;z-index:2000;}
.spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:56px;height:56px;border-radius:50%;border:4px solid rgba(34,29,37,.18);border-top-color:var(--btn);animation:spin .9s linear infinite;}
@keyframes spin{to{transform:translate(-50%,-50%) rotate(360deg)}}
.toast-wrap{position:fixed;left:18px;bottom:18px;display:flex;flex-direction:column;gap:10px;z-index:2002;}
.toast{background:#fff;border:1px solid var(--border);border-left-width:6px;border-radius:1px;box-shadow:0 18px 36px rgba(16,24,40,.16);padding:12px 14px;min-width:280px;max-width:92vw;animation:in .18s ease-out;}
.toast .t-title{font-weight:600;margin-bottom:4px}
.toast .t-msg{color:#111827;line-height:1.45}
@keyframes in{from{transform:translateY(6px);opacity:0}to{transform:translateY(0);opacity:1}}
