:root {
  --navy-950: #061a38;
  --navy-900: #092755;
  --navy-800: #0e3977;
  --navy-700: #16498f;
  --blue-700: #175ccf;
  --blue-600: #246ff2;
  --blue-500: #3b82f6;
  --cyan-500: #22d3ee;
  --orange-500: #ff8a00;
  --green-600: #0f9f8f;
  --green-100: #dff8f4;
  --yellow-500: #e6a700;
  --red-500: #e5484d;
  --purple-600: #7c3aed;
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --line: #dbe7f5;
  --line-strong: #c9d8eb;
  --bg: #eff5fc;
  --bg-2: #f7fbff;
  --surface: #ffffff;
  --surface-blue: #eaf3ff;
  --shadow-sm: 0 8px 20px rgba(6, 26, 56, .08);
  --shadow-md: 0 18px 45px rgba(6, 26, 56, .14);
  --shadow-lg: 0 24px 70px rgba(6, 26, 56, .22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 34px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--slate-900);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, .16), transparent 28%),
    linear-gradient(135deg, #edf5ff 0%, #f8fbff 48%, #eaf2fb 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
[hidden] { display: none !important; }
code { padding: 2px 6px; border-radius: 7px; background: #eaf3ff; color: var(--navy-900); }

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #061a38, #0e3977 62%, #123f7d);
  color: #fff;
}
.boot-card {
  width: min(92vw, 430px);
  padding: 34px;
  text-align: center;
  border-radius: 30px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 34px 90px rgba(0,0,0,.25);
  backdrop-filter: blur(18px);
}
.boot-card h1 { margin: 14px 0 4px; font-size: 32px; letter-spacing: -.05em; }
.boot-card p { margin: 0; color: rgba(255,255,255,.75); }
.loading-bar { height: 8px; margin-top: 24px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; }
.loading-bar span { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-500), #fff); animation: load 1.4s infinite ease-in-out; }
@keyframes load { 0%{transform: translateX(-120%)} 100%{transform: translateX(260%)} }

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(380px, 1.05fr);
  background:
    radial-gradient(circle at 90% 8%, rgba(34, 211, 238, .16), transparent 27%),
    linear-gradient(135deg, #f4f8ff, #eaf2fb);
}
.auth-art {
  min-height: 100vh;
  color: #fff;
  padding: clamp(26px, 4vw, 62px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(145deg, rgba(6,26,56,.96), rgba(14,57,119,.9)),
    radial-gradient(circle at 28% 12%, rgba(34, 211, 238, .24), transparent 36%);
  position: relative;
  overflow: hidden;
}
.auth-art::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(34,211,238,.16);
  filter: blur(8px);
}
.auth-brand, .brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-brand strong, .brand strong { display: block; font-size: 19px; letter-spacing: -.04em; }
.auth-brand span, .brand span { display: block; color: rgba(255,255,255,.7); font-size: 12px; margin-top: 2px; }
.auth-copy { position: relative; z-index: 1; max-width: 600px; }
.auth-copy h1 { margin: 8px 0 14px; font-size: clamp(38px, 5vw, 66px); line-height: .96; letter-spacing: -.075em; }
.auth-copy p { margin: 0; max-width: 520px; color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.65; }
.auth-mini-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.auth-mini-grid div { padding: 18px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.1); border-radius: 18px; backdrop-filter: blur(18px); }
.auth-mini-grid strong { display: block; font-size: 14px; }
.auth-mini-grid span { display: block; margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.72); line-height: 1.45; }
.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-box { width: min(100%, 480px); background: #fff; border: 1px solid var(--line); border-radius: 34px; box-shadow: var(--shadow-lg); padding: 34px; }
.auth-box h2 { margin: 8px 0 6px; font-size: 30px; letter-spacing: -.05em; }
.auth-form { display: grid; gap: 12px; margin-top: 22px; }
.auth-form.compact { margin-top: 14px; }
.auth-form label, .field { display: grid; gap: 7px; font-size: 12px; font-weight: 800; color: var(--slate-700); text-transform: none; }
.auth-form input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--slate-900);
  border-radius: 14px;
  min-height: 44px;
  padding: 0 14px;
  outline: none;
  transition: .16s ease;
}
.field textarea { min-height: 110px; padding-top: 12px; resize: vertical; }
.field select[multiple] { min-height: 112px; padding: 8px; }
.auth-form input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(36,111,242,.12); background: #fff; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; color: var(--slate-400); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content:""; height: 1px; background: var(--line); flex: 1; }
.setup-warning { margin: 16px 0; padding: 14px; border: 1px solid #ffd793; background: #fff8e8; border-radius: 16px; color: #8a5a00; display: grid; gap: 5px; font-size: 13px; line-height: 1.45; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 16px;
  background:
    linear-gradient(180deg, rgba(9, 39, 85, .98), rgba(14, 57, 119, .94)),
    radial-gradient(circle at 20% 0, rgba(34, 211, 238, .25), transparent 35%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 14px 0 36px rgba(6, 26, 56, .18);
  z-index: 10;
}
.brand { min-height: 46px; padding: 5px 4px 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 12px 24px rgba(34, 211, 238, .22);
}
.brand-mark.large { margin: 0 auto; width: 66px; height: 66px; border-radius: 22px; font-size: 34px; }
.side-nav { display: grid; gap: 8px; }
.nav-link {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: .18s ease;
  text-align: left;
  font-weight: 800;
  letter-spacing: -.01em;
}
.nav-link:hover { background: rgba(255,255,255,.13); color: #fff; transform: translateX(2px); }
.nav-link.active { color: var(--navy-900); background: #fff; box-shadow: 0 12px 26px rgba(0,0,0,.16); }
.nav-icon { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.nav-link.active .nav-icon { background: var(--surface-blue); color: var(--blue-700); }
.sidebar-card { padding: 16px; border-radius: 20px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); margin-top: auto; }
.sidebar-card.ghost { margin-top: 0; background: rgba(255,255,255,.07); }
.sidebar-card h3 { margin: 3px 0 6px; letter-spacing: -.04em; }
.sidebar-card p:last-child { margin: 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.5; }
.sidebar-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.main-area { min-width: 0; }
.topbar {
  height: 76px;
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(247, 251, 255, .82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(219,231,245,.78);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.search-box {
  width: min(48vw, 520px);
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  box-shadow: var(--shadow-sm);
}
.search-box span { color: var(--slate-400); font-size: 20px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--slate-900); }
.workspace { padding: 26px clamp(18px, 3vw, 36px) 96px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 22px; }
.eyebrow { margin: 0; color: var(--blue-700); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow.light { color: rgba(255,255,255,.72); }
.page-head h1 { margin: 4px 0 4px; font-size: clamp(28px, 3.2vw, 44px); letter-spacing: -.065em; line-height: 1.05; color: var(--navy-950); }
.page-subtitle, .muted { margin: 0; color: var(--slate-500); line-height: 1.55; }
.head-actions { display: flex; align-items: center; gap: 10px; }

.primary-button, .secondary-button, .danger-button, .ghost-button, .ghost-line, .icon-button, .profile-pill {
  border-radius: 14px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 900;
  letter-spacing: -.01em;
  transition: .16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.primary-button { color: #fff; background: linear-gradient(135deg, var(--blue-700), var(--blue-600) 55%, var(--cyan-500)); box-shadow: 0 14px 28px rgba(36, 111, 242, .27); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(36, 111, 242, .34); }
.secondary-button { color: var(--navy-900); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.secondary-button:hover { border-color: var(--blue-500); transform: translateY(-1px); }
.danger-button { color: #fff; background: var(--red-500); }
.ghost-button { color: rgba(255,255,255,.86); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); min-height: 38px; padding: 0 10px; }
.ghost-button:hover { background: rgba(255,255,255,.16); }
.danger-soft { color: #ffd7d7; }
.ghost-line { color: var(--blue-700); background: #fff; border: 1px solid var(--line); }
.full { width: 100%; }
.icon-button { width: 42px; padding: 0; color: var(--navy-900); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.notify { color: var(--blue-600); }
.profile-pill { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--navy-950); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--navy-900), var(--blue-600)); color: #fff; font-size: 11px; font-weight: 900; }
.profile-text { display: grid; text-align: left; line-height: 1.1; }
.profile-text small { color: var(--slate-500); font-size: 10px; font-weight: 800; margin-top: 2px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-card, .panel-card { background: rgba(255,255,255,.86); border: 1px solid rgba(219,231,245,.92); border-radius: 24px; box-shadow: var(--shadow-sm); }
.kpi-card { padding: 20px; position: relative; overflow: hidden; }
.kpi-card::after { content:""; position:absolute; width:110px; height:110px; right:-40px; top:-40px; border-radius:50%; background: rgba(36,111,242,.08); }
.kpi-card span { display: block; color: var(--slate-500); font-size: 12px; font-weight: 800; }
.kpi-card strong { display: block; margin-top: 10px; font-size: 32px; letter-spacing: -.06em; color: var(--navy-950); }
.kpi-card small { display: block; color: var(--green-600); font-weight: 800; margin-top: 5px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr); gap: 18px; }
.panel-card { padding: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-title h2 { margin: 0; font-size: 18px; letter-spacing: -.04em; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface-blue); color: var(--blue-700); font-size: 11px; font-weight: 900; }
.event-list { display: grid; gap: 10px; }
.event-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; background: #f8fbff; border: 1px solid var(--line); }
.event-row strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row span { color: var(--slate-500); font-size: 12px; }
.time-badge { color: var(--navy-900); font-size: 12px; font-weight: 900; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; text-align: center; }
.type-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; background: var(--blue-600); }

.filters-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; background: rgba(255,255,255,.76); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.filters-bar select, .filters-bar input { min-height: 40px; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 0 12px; color: var(--slate-700); outline: 0; font-weight: 700; }
.view-tabs { display: inline-flex; padding: 4px; background: #eef5ff; border: 1px solid var(--line); border-radius: 15px; }
.view-tabs button { min-height: 34px; padding: 0 12px; border-radius: 11px; color: var(--slate-500); background: transparent; font-weight: 900; }
.view-tabs button.active { color: var(--navy-900); background: #fff; box-shadow: var(--shadow-sm); }
.calendar-shell { background: #fff; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-md); overflow: hidden; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f8fbff); }
.calendar-head h2 { margin: 0; font-size: 18px; letter-spacing: -.04em; color: var(--navy-950); }
.calendar-actions { display: flex; gap: 8px; align-items: center; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-height: 610px; overflow-x: auto; overflow-y: visible; align-items: stretch; }
.day-column { border-right: 1px solid var(--line); min-width: 150px; background: #fbfdff; display: grid; grid-template-rows: auto 1fr; }
.day-column:last-child { border-right: 0; }
.day-header { padding: 15px 12px; position: relative; z-index: 1; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.day-header strong { display: block; font-size: 22px; color: var(--navy-950); letter-spacing: -.05em; }
.day-header span { color: var(--slate-500); font-size: 11px; font-weight: 800; text-transform: capitalize; }
.day-header.today strong { color: #fff; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-700), var(--cyan-500)); box-shadow: 0 12px 22px rgba(36,111,242,.24); }
.day-body { padding: 14px 12px; display: grid; align-content: start; gap: 10px; position: relative; z-index: 2; }
.calendar-event { width: 100%; padding: 12px 12px 12px 16px; min-height: 82px; border-radius: 16px; background: #eef5ff; border: 1px solid #d8e8ff; cursor: pointer; transition: .14s ease; position: relative; overflow: hidden; box-shadow: 0 8px 18px rgba(6, 26, 56, .06); }
.calendar-event::before { content:""; position:absolute; inset:0 auto 0 0; width: 4px; background: var(--event-color, var(--blue-600)); }
.calendar-event:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.calendar-event strong { display: block; font-size: 13px; line-height: 1.28; color: var(--navy-950); margin-top: 6px; word-break: break-word; }
.calendar-event span { display: block; color: var(--slate-500); font-size: 11px; line-height: 1.35; word-break: break-word; }
.calendar-event .event-meta { color: var(--navy-900); font-weight: 900; }
.calendar-event.masked { background: #f1f5f9; border-color: #e2e8f0; opacity: .86; }
.calendar-event.cancelado { opacity: .58; text-decoration: line-through; }
.calendar-event.concluído { background: #edfdf9; border-color: #c9f4eb; }
.calendar-event.pendente, .calendar-event.reagendar { background: #fff8e8; border-color: #ffe0a3; }
.empty-slot { min-height: 44px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--slate-400); display: grid; place-items: center; font-size: 11px; font-weight: 900; background: rgba(255,255,255,.68); cursor: pointer; position: relative; z-index: 1; }
.empty-slot:hover { border-color: var(--blue-500); color: var(--blue-700); background: #fff; }

.day-view-grid { grid-template-columns: minmax(280px, 1fr); min-height: auto; }
.day-view-grid .day-column { min-height: 520px; border-right: 0; background: linear-gradient(180deg, #fbfdff, #fff); }
.day-view-grid .day-header { display: flex; align-items: center; gap: 14px; min-height: 96px; }
.day-view-grid .day-header strong { flex: 0 0 auto; }
.day-view-grid .day-header span { font-size: 14px; }
.day-view-grid .day-body { padding: 18px; gap: 12px; }
.day-view-grid .calendar-event { max-width: 760px; min-height: 96px; padding: 16px 16px 16px 20px; }
.day-view-grid .calendar-event strong { font-size: 18px; }
.day-view-grid .calendar-event span { font-size: 13px; }
.day-view-grid .calendar-event .event-meta { font-size: 13px; }

.month-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); border-top: 1px solid var(--line); overflow-x: auto; }
.month-day { min-height: 126px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day.muted { background: #f8fbff; color: var(--slate-400); }
.month-date { font-weight: 900; color: var(--navy-950); margin-bottom: 6px; }
.month-chip { display: block; width: 100%; padding: 6px 8px; margin-bottom: 5px; border-radius: 10px; font-size: 11px; font-weight: 800; color: var(--navy-900); background: var(--surface-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.team-card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm); }
.team-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-head .avatar { width: 42px; height: 42px; }
.team-head strong { display:block; }
.team-head span { display:block; color: var(--slate-500); font-size: 12px; margin-top: 2px; }
.user-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.user-table th { text-align: left; color: var(--slate-500); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; padding: 0 12px; }
.user-table td { padding: 14px 12px; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.user-table td:first-child { border-left: 1px solid var(--line); border-radius: 15px 0 0 15px; font-weight: 900; }
.user-table td:last-child { border-right: 1px solid var(--line); border-radius: 0 15px 15px 0; }
.table-wrap { overflow-x:auto; }
.empty-state { padding: 34px; border: 1px dashed var(--line-strong); border-radius: 22px; text-align: center; color: var(--slate-500); background: #fff; }

.modal-backdrop { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 22px; z-index: 60; background: rgba(2,6,23,.55); backdrop-filter: blur(12px); }
.modal-backdrop.open { display: flex; }
.modal-card { width: min(100%, 950px); max-height: 92vh; overflow: auto; background: #fff; border-radius: 30px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.3); }
.modal-header { position: sticky; top: 0; z-index: 2; background: rgba(255,255,255,.92); backdrop-filter: blur(18px); display: flex; align-items: center; justify-content: space-between; padding: 22px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 4px 0 0; letter-spacing: -.055em; font-size: 27px; }
.event-form { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field.span-2 { grid-column: span 2; }
.field small { color: var(--slate-400); font-size: 11px; font-weight: 600; }
.conflict-box { margin-top: 16px; border: 1px solid #ffd793; background: #fff8e8; color: #8a5a00; border-radius: 16px; padding: 14px; font-size: 13px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
.spacer { flex: 1; }
.toast { position: fixed; z-index: 80; right: 22px; bottom: 22px; min-width: 260px; max-width: 420px; padding: 15px 16px; border-radius: 18px; background: var(--navy-950); color: #fff; box-shadow: var(--shadow-lg); transform: translateY(24px); opacity: 0; pointer-events: none; transition: .2s ease; font-weight: 800; }
.toast.show { transform: translateY(0); opacity: 1; }
.mobile-nav, .mobile-fab { display: none; }

@media (max-width: 1060px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(7, minmax(190px, 1fr)); }
  .day-view-grid { grid-template-columns: minmax(280px, 1fr); }
}
@media (max-width: 860px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-art { min-height: 48vh; padding-bottom: 28px; }
  .auth-mini-grid { grid-template-columns: 1fr; }
  .auth-panel { min-height: auto; padding: 18px 14px 32px; }
  .auth-box { border-radius: 26px; padding: 24px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; transform: translateX(-105%); transition: .2s ease; width: 270px; }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 12px 14px; height: 68px; }
  .search-box { width: auto; flex: 1; min-width: 0; }
  .profile-text { display: none; }
  .workspace { padding: 18px 14px 110px; }
  .page-head { display: grid; }
  .head-actions { width: 100%; }
  .head-actions button { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; padding: 8px; background: rgba(255,255,255,.92); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); }
  .mobile-link { min-height: 48px; border-radius: 16px; background: transparent; color: var(--slate-500); font-size: 11px; font-weight: 900; display: grid; place-items: center; gap: 2px; }
  .mobile-link span { font-size: 18px; }
  .mobile-link.active { background: linear-gradient(135deg, var(--blue-700), var(--blue-600)); color: #fff; }
  .mobile-fab { position: fixed; right: 22px; bottom: 88px; z-index: 51; width: 56px; height: 56px; border-radius: 21px; display: grid; place-items: center; color: #fff; font-size: 28px; background: linear-gradient(135deg, var(--blue-700), var(--cyan-500)); box-shadow: var(--shadow-lg); }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions button { flex: 1; }
  .toast { left: 14px; right: 14px; bottom: 98px; }
}
@media (max-width: 540px) {
  .calendar-shell { border-radius: 22px; }
  .week-grid { grid-template-columns: repeat(7, minmax(210px, 1fr)); }
  .day-view-grid { grid-template-columns: minmax(0, 1fr); }
  .day-column { min-width: 210px; }
  .day-view-grid .day-column { min-width: 0; }
  .day-body { padding: 12px; }
  .calendar-event { min-height: 86px; }
  .calendar-head, .filters-bar { align-items: stretch; flex-direction: column; }
  .calendar-actions, .view-tabs { width: 100%; }
  .view-tabs button { flex: 1; }
  .filters-bar select, .filters-bar input { width: 100%; }
  .event-row { grid-template-columns: 1fr; }
  .auth-copy h1 { font-size: 36px; }
  .page-head h1 { font-size: 30px; }
}

/* v4 - disponibilidade e privacidade */
.block-button {
  color: #8a5a00;
  background: #fff8e8;
  border-color: #ffd793;
}
.availability-list { display: grid; gap: 10px; }
.availability-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
.availability-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}
.availability-chip i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(255,255,255,.55);
}
.availability-chip.available { color: #047857; background: #ecfdf5; border-color: #bbf7d0; }
.availability-chip.available i { background: #10b981; }
.availability-chip.busy { color: #b91c1c; background: #fff1f2; border-color: #fecdd3; }
.availability-chip.busy i { background: #ef4444; }
.availability-chip.away { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.availability-chip.away i { background: #f59e0b; }
.team-head .availability-chip { margin-left: auto; }
.event-row.masked { background: #f8fafc; border-style: dashed; }
.calendar-event.block-event { background: #fffbeb; border-color: #fde68a; }
.calendar-event.block-event::before { background: #e6a700; }
.calendar-event.masked { border-style: dashed; }
.user-table .availability-chip { justify-content: center; }

@media (max-width: 860px) {
  .head-actions { flex-wrap: wrap; }
  .head-actions .block-button { order: 3; width: 100%; }
  .team-head { align-items: flex-start; flex-wrap: wrap; }
  .team-head .availability-chip { margin-left: 54px; }
}
