:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #193047;
  background: #f2f6f9;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
.hidden { display: none !important; }
.loading-screen { display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 12px; min-height: 100vh; color: #5a6c7d; }
.spinner { height: 36px; width: 36px; border: 3px solid #d2e9e4; border-top-color: #139c7f; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tela de acesso */
.login-page { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(360px, 1fr); min-height: 100vh; }
.login-art { background: radial-gradient(circle at 15% 15%, #235c64 0, transparent 34%), linear-gradient(143deg, #07182d 10%, #0e2c45 62%, #0b514f 100%); color: white; display: flex; flex-direction: column; padding: clamp(30px, 6vw, 85px); justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; height: 540px; width: 540px; border-radius: 50%; border: 80px solid #ffffff0a; position: absolute; right: -260px; bottom: -250px; }
.login-visual { z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 850; letter-spacing: .05em; font-size: 19px; }
.brand-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #43d7b2; color: #0b2a3e; font-size: 15px; font-weight: 900; }
.brand-sub { font-size: 11px; letter-spacing: .09em; font-weight: 600; color: #a5c5c8; margin-top: 3px; }
.login-art h1 { line-height: 1.08; font-size: clamp(36px, 4.2vw, 62px); max-width: 550px; margin: 70px 0 24px; letter-spacing: -.045em; }
.login-art p { color: #bdd2d8; max-width: 500px; font-size: 18px; line-height: 1.7; }
.login-art small { color: #7da5ac; }
.login-panel { display: grid; align-items: center; justify-items: center; padding: 35px 22px; }
.login-card { max-width: 420px; width: 100%; }
.eyebrow { color: #0a8f78; font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.login-card h2 { font-size: 34px; margin: 12px 0; letter-spacing: -.04em; }
.login-card p { color: #687d90; line-height: 1.6; margin-bottom: 28px; }
.login-foot { color: #97a8b6; font-size: 12px; margin-top: 26px; }

/* Componentes */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { color: #475d70; font-weight: 730; font-size: 13px; }
.field small, .muted { color: #7a8a99; }
input, select, textarea { outline: none; background: white; color: #1d354b; border: 1px solid #d7e1e8; border-radius: 10px; padding: 12px 13px; width: 100%; min-height: 44px; transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 85px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #22a98b; box-shadow: 0 0 0 3px #25b99522; }
.btn { display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 16px; min-height: 42px; border: 1px solid transparent; border-radius: 10px; font-weight: 760; white-space: nowrap; transition: transform .15s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(.96); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary { background: #0f9a7d; color: white; }
.btn-dark { background: #142b42; color: white; }
.btn-light { background: white; color: #3a546a; border-color: #dce5eb; }
.btn-secondary { background: #e5f6f1; color: #078267; }
.btn-danger { background: #fff0ee; color: #b63c3c; }
.btn-plain { border: 0; color: #527084; background: transparent; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 10px; min-height: 33px; font-size: 12px; }

/* Aplicação */
.layout { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #0c2035; color: white; padding: 24px 17px; display: flex; flex-direction: column; position: sticky; height: 100vh; top: 0; }
.sidebar .brand { margin: 4px 6px 34px; }
.sidebar-label { text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .17em; color: #7394aa; margin: 10px 12px 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn { display: flex; align-items: center; gap: 12px; background: transparent; color: #a8c2d3; padding: 13px 15px; text-align: left; font-size: 14px; font-weight: 650; border: 0; border-radius: 9px; }
.nav-btn:hover, .nav-btn.active { color: white; background: #1b3d51; }
.nav-btn.active { box-shadow: inset 3px 0 #43d7b2; }
.nav-emoji { font-size: 17px; width: 24px; text-align: center; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #294052; padding-top: 19px; }
.profile { display: flex; align-items: center; gap: 12px; padding: 6px; }
.avatar { width: 37px; height: 37px; border-radius: 50%; background: #305c6c; color: white; display: grid; place-items: center; font-weight: 850; }
.profile-name { font-size: 13px; font-weight: 760; }
.profile-role { font-size: 11px; color: #9bb5c5; margin-top: 3px; }
.sidebar .logout { width: 100%; margin-top: 14px; background: #1c374b; border: none; color: #c4d6df; }
.main { min-width: 0; padding: 0 clamp(16px, 3vw, 48px) 48px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #e1e8ed; }
.topbar small { color: #8194a2; display: block; font-size: 12px; margin-bottom: 5px; }
.topbar h2 { font-size: 22px; margin: 0; letter-spacing: -.025em; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.top-date { color: #668093; font-size: 12px; }
.content { padding-top: 26px; }
.welcome { margin: 0 0 19px; color: #6e8494; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 23px; }
.stat { background: white; border: 1px solid #e7eef1; box-shadow: 0 4px 16px #17334908; border-radius: 14px; padding: 19px 22px; position: relative; overflow: hidden; }
.stat:before { content: ""; width: 3px; height: 39px; position: absolute; top: 23px; left: 0; background: #0f9a7d; }
.stat.blue:before { background: #4f83d3; }.stat.orange:before { background: #eaaa46; }.stat.purple:before { background: #957bd7; }
.stat-label { color: #758799; font-size: 12px; font-weight: 680; }
.stat-value { font-size: 30px; font-weight: 850; letter-spacing: -.05em; margin-top: 7px; color: #183249; }
.panel { background: white; border: 1px solid #e5ecef; border-radius: 16px; box-shadow: 0 6px 26px #17334908; overflow: hidden; }
.panel-padding { padding: 23px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 20px; }
.toolbar-title { font-size: 20px; font-weight: 830; text-transform: capitalize; letter-spacing: -.03em; }
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.segment { display: inline-flex; background: #eef3f6; padding: 4px; border-radius: 10px; }
.segment button { border: none; padding: 8px 13px; font-size: 12px; background: transparent; color: #6d8191; border-radius: 7px; font-weight: 770; }
.segment button.selected { background: white; color: #1b4054; box-shadow: 0 2px 5px #23394c17; }
.filterbar { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2,minmax(140px,1fr)); gap: 12px; margin-bottom: 20px; }
.filterbar input, .filterbar select { background: #f7fafb; font-size: 13px; }
.section-title { font-size: 19px; font-weight: 830; margin: 0; letter-spacing: -.02em; }
.section-caption { color: #80929f; font-size: 13px; margin: 6px 0 0; }

/* Calendário */
.calendar { border: 1px solid #e4ecf0; border-radius: 12px; overflow: hidden; }
.calendar-head { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); background: #f6f9fa; border-bottom: 1px solid #e4ecf0; }
.calendar-head div { padding: 13px 8px; text-align: center; font-weight: 800; font-size: 11px; color: #728899; text-transform: uppercase; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.day { min-height: 120px; border-right: 1px solid #e6edf1; border-bottom: 1px solid #e6edf1; padding: 8px; overflow: hidden; }
.day:nth-child(7n) { border-right: none; }
.day.muted-day { background: #fafcfd; }
.day.muted-day .day-number { color: #c4cdd4; }
.day.today-day { background: #f1fbf8; }
.day-top { display: flex; justify-content: space-between; margin-bottom: 7px; }
.day-number { background: none; border: none; padding: 0; font-size: 12px; width: 27px; height: 27px; color: #536e82; border-radius: 50%; font-weight: 770; }
.day-number:hover { background: #edf5f5; }
.today-day .day-number { background: #0e9b7e; color: white; }
.app-chip { font-size: 10px; font-weight: 690; border-radius: 5px; border: 0; padding: 6px 6px; display: block; text-align: left; width: 100%; margin-bottom: 4px; background: #e5f4f0; color: #177c69; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-chip.status-em_andamento { background: #e5f0ff; color: #426dae; }
.app-chip.status-concluido { background: #e8ebf5; color: #646a98; }
.app-chip.status-cancelado { background: #f3eff0; color: #8c8185; text-decoration: line-through; }
.app-chip.status-reagendado { background: #fff0da; color: #aa742b; }
.more { font-size: 10px; color: #7a96a2; padding: 2px 4px; }
.week-grid { display: grid; grid-template-columns: repeat(7,minmax(150px,1fr)); gap: 9px; overflow-x: auto; }
.week-day { background: #f7fafb; border: 1px solid #e6eef1; border-radius: 10px; padding: 11px; min-height: 240px; }
.week-title { font-size: 12px; font-weight: 830; color: #37536a; margin-bottom: 12px; }
.week-day.today-day { border-color: #39b79e; background: #f3fcf8; }
.day-list { display: grid; gap: 12px; }
.booking-card { background: white; padding: 14px; border-radius: 10px; border: 1px solid #e2eaef; text-align: left; width: 100%; display: flex; gap: 11px; flex-direction: column; transition: border-color .2s; }
.booking-card:hover { border-color: #21a589; }
.booking-time { font-weight: 850; font-size: 14px; color: #127f6c; }
.booking-name { font-weight: 770; font-size: 13px; color: #244154; overflow-wrap: anywhere; }
.booking-details { color: #7990a0; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.pill { display: inline-block; border-radius: 100px; padding: 5px 10px; font-size: 10px; font-weight: 830; background: #e5f4f0; color: #157e68; white-space: nowrap; }
.pill.status-em_andamento { background: #e5f0ff; color: #426dae; }
.pill.status-concluido { background: #ebeafa; color: #6a5da9; }
.pill.status-cancelado { background: #f8eaea; color: #ae5b62; }
.pill.status-reagendado { background: #fff2db; color: #a97932; }
.empty { padding: 54px 20px; text-align: center; color: #8598a6; }
.empty-icon { font-size: 30px; margin-bottom: 11px; }

/* Tabelas e listas */
.list-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 11px; color: #8ba0ac; background: #f8fafb; text-transform: uppercase; letter-spacing: .06em; font-weight: 830; }
th, td { padding: 15px; border-bottom: 1px solid #edf2f4; }
td { font-size: 13px; color: #597083; }
td strong { color: #264257; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.table-avatar { width: 32px; height: 32px; border-radius: 9px; background: #e5f5f0; color: #158a73; display: grid; place-items: center; font-weight: 900; }
.table-actions { display: flex; gap: 8px; }
.inline-note { border-radius: 10px; padding: 12px 15px; background: #f0f7f5; font-size: 12px; color: #41756b; margin-bottom: 16px; }

/* Diálogos */
.modal-backdrop { position: fixed; z-index: 50; inset: 0; background: #091c2db8; display: grid; place-items: center; padding: 18px; }
.modal { background: white; border-radius: 17px; box-shadow: 0 30px 100px #00172950; width: min(95vw, 650px); max-height: min(93vh, 850px); display: flex; flex-direction: column; }
.modal-header { padding: 23px 27px 18px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid #ebf0f2; }
.modal-header h3 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.modal-header p { margin: 6px 0 0; color: #81939e; font-size: 12px; }
.modal-content { padding: 23px 27px 25px; overflow: auto; }
.modal-foot { padding: 17px 27px; border-top: 1px solid #ebf0f2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field .field-help { font-size: 11px; line-height: 1.5; }
.divider { height: 1px; background: #e6eef1; margin: 8px 0 20px; }
.small-heading { font-size: 13px; font-weight: 850; color: #425d6c; margin: 12px 0 15px; }
.event { border-left: 2px solid #27ac8e; padding: 4px 0 10px 12px; margin-bottom: 11px; }
.event strong { display: block; font-size: 12px; color: #425e6f; }
.event small { color: #7e93a0; }
.toast { z-index: 90; position: fixed; right: 20px; bottom: 20px; max-width: min(430px, calc(100vw - 40px)); padding: 13px 19px; background: #16364d; color: white; border-radius: 11px; box-shadow: 0 15px 42px #17334945; font-size: 13px; line-height: 1.5; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.error { background: #ae4141; }

@media (max-width: 1050px) {
  .layout { grid-template-columns: 204px minmax(0,1fr); }
  .sidebar { padding: 19px 10px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .day { min-height: 93px; padding: 5px; }
  .app-chip { padding: 5px 4px; }
}
@media (max-width: 760px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; padding: 26px; }
  .login-art h1 { margin: 24px 0 8px; font-size: 33px; }
  .login-art p, .login-art small { display: none; }
  .login-panel { align-items: start; padding: 33px 25px; }
  .login-card h2 { font-size: 28px; }
  .layout { display: block; }
  .sidebar { height: auto; position: sticky; top: 0; z-index: 25; padding: 8px 14px; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .sidebar .brand { margin: 0; font-size: 13px; }
  .sidebar .brand-icon { height: 34px; width: 34px; border-radius: 9px; font-size: 12px; }
  .sidebar-label, .sidebar-bottom, .brand-sub { display: none; }
  .nav { flex-direction: row; gap: 1px; }
  .nav-btn { font-size: 0; padding: 8px; }
  .nav-emoji { font-size: 20px; }
  .nav-btn.active { box-shadow: inset 0 -3px #43d7b2; }
  .main { padding: 0 13px 25px; }
  .topbar { height: 78px; }
  .topbar h2 { font-size: 19px; }
  .top-date { display: none; }
  .topbar .btn { font-size: 12px; padding: 9px 11px; }
  .content { padding-top: 19px; }
  .stats { gap: 9px; }
  .stat { padding: 13px 15px; }
  .stat-value { font-size: 25px; }
  .panel-padding { padding: 14px; }
  .filterbar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .filterbar input { grid-column: 1 / -1; }
  .toolbar { align-items: start; }
  .toolbar-group { width: 100%; }
  .toolbar .segment { margin-left: auto; }
  .calendar-head div { font-size: 9px; padding: 8px 0; }
  .calendar { overflow-x: auto; }
  .calendar-grid, .calendar-head { min-width: 575px; }
  .day { min-height: 97px; }
  .week-grid { grid-template-columns: repeat(7,minmax(165px,1fr)); }
  .modal-header, .modal-content, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .grid-two { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .sidebar { gap: 2px; padding: 8px; }
  .sidebar .brand { gap: 5px; }
  .sidebar .brand-icon { width: 30px; }
  .nav-btn { padding: 6px; }
  .nav-emoji { width: 19px; }
  .topbar h2 { font-size: 17px; }
}

.day-list-columns { grid-template-columns: repeat(auto-fit, minmax(min(100%,270px),1fr)); }

/* Identidade visual oficial: logotipo no acesso e na agenda. */
.brand-icon {
  width: 80px; height: 80px; flex: 0 0 auto;
  padding: 4px; background: #fff; border-radius: 50%;
  box-shadow: 0 3px 13px #07182d27;
  overflow: hidden;
}
.brand-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { min-width: 0; }
.login-art .brand { gap: 19px; position: relative; z-index: 1; }
.login-art .brand-icon { width: 114px; height: 114px; padding: 5px; }
.sidebar .brand { flex-direction: column; text-align: center; gap: 11px; margin: 0 5px 26px; font-size: 17px; }
.sidebar .brand-icon { width: 112px; height: 112px; border-radius: 50%; padding: 4px; }
.sidebar .brand-sub { font-size: 10px; }
@media(max-width: 760px) {
  .login-art .brand-icon { width: 80px; height: 80px; }
  .login-art .brand { gap: 12px; font-size: 16px; }
  .sidebar .brand { flex-direction: row; text-align: left; margin: 0; gap: 7px; font-size: 12px; }
  .sidebar .brand-icon { width: 43px; height: 43px; padding: 2px; }
  .sidebar .brand-sub { display: none; }
}
@media(max-width: 380px) {
  .sidebar .brand-icon { width: 35px; height: 35px; }
  .sidebar .brand { font-size: 11px; }
}
