:root{
  --sidebar:#0E1526;
  --sidebar-hover:#171F35;
  --sidebar-active:#1B2544;
  --bg:#F7F8FC;
  --card:#FFFFFF;
  --border:#E7E9F2;
  --text:#1A2036;
  --text-dim:#6B7280;
  --text-faint:#9CA3AF;
  --primary:#4F46E5;
  --primary-dark:#4338CA;
  --primary-soft:#EEF0FF;
  --amber:#F59E0B;
  --amber-soft:#FEF3E2;
  --green:#10B981;
  --green-soft:#E8FBF3;
  --purple:#8B5CF6;
  --purple-soft:#F2EEFE;
  --pink:#EC4899;
  --pink-soft:#FCE9F2;
  --gray-block:#9CA3AF;
  --red:#EF4444;
  --red-soft:#FDECEC;
  --radius:12px;
  --radius-lg:16px;
  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}
*{box-sizing:border-box;}
html,body{height:100%;}

:root[data-theme="dark"]{
  --bg:#0B1120;
  --card:#141B2E;
  --border:#232C44;
  --text:#E7E9F5;
  --text-dim:#9098B5;
  --text-faint:#6B7390;
  --primary-soft:#232144;
  --amber-soft:#3A2D14;
  --green-soft:#0F2B22;
  --purple-soft:#241A3D;
  --pink-soft:#341226;
  --red-soft:#3A1616;
}
:root[data-theme="dark"] .btn-ghost{ background:var(--card); }
:root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .field textarea{
  background:var(--card); border-color:var(--border); color:var(--text);
}
:root[data-theme="dark"] .day-slot.blocked, :root[data-theme="dark"] .week-grid .cell.blocked-cell{
  background:repeating-linear-gradient(135deg, var(--bg), var(--bg) 6px, var(--card) 6px, var(--card) 12px);
}

/* ---------- Scrollbar discreta em todo lugar (resolve a barra branca grossa no mobile) ---------- */
*{ scrollbar-width:thin; scrollbar-color:rgba(120,120,140,0.35) transparent; }
::-webkit-scrollbar{ width:6px; height:6px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:rgba(120,120,140,0.35); border-radius:10px; }
::-webkit-scrollbar-thumb:hover{ background:rgba(120,120,140,0.55); }

body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--font); -webkit-tap-highlight-color:transparent;
  -webkit-font-smoothing:antialiased;
  transition:background .15s ease, color .15s ease;
}
button,input,select,textarea{font-family:inherit;}
h1,h2,h3{ font-family:var(--font); }

/* ---------- Auth ---------- */
.auth-screen{
  position:fixed; inset:0; z-index:100; background:var(--sidebar);
  display:flex; align-items:center; justify-content:center; padding:24px; overflow-y:auto;
}
.auth-screen.hidden{display:none;}
.auth-card{ width:100%; max-width:400px; color:#fff; }
.auth-mark{
  width:52px; height:52px; margin:0 auto 18px; border-radius:14px;
  background:linear-gradient(135deg, var(--primary), #7C74F0);
  display:flex; align-items:center; justify-content:center; font-size:22px; color:#fff; font-weight:700;
}
.auth-mark-logo{ width:84px !important; height:auto !important; background:none; border-radius:0; }
.mark-logo{ width:34px; height:34px; object-fit:contain; flex:none; }
.auth-card h1{ font-size:24px; font-weight:800; text-align:center; margin:0 0 6px; letter-spacing:-0.02em; }
.auth-sub{ font-size:13.5px; color:rgba(255,255,255,0.55); text-align:center; margin:0 0 24px; line-height:1.5; }
.auth-toggle{ display:flex; background:var(--sidebar-hover); border-radius:10px; padding:4px; margin-bottom:18px; gap:4px; }
.auth-toggle-btn{ flex:1; background:none; border:none; color:rgba(255,255,255,0.55); font-size:13px; font-weight:600; padding:9px 0; border-radius:7px; cursor:pointer; }
.auth-toggle-btn.active{ background:var(--primary); color:#fff; }
.demo-banner{
  background:rgba(245,158,11,0.15); color:var(--amber); font-family:var(--font-mono); font-size:10.5px;
  text-transform:uppercase; letter-spacing:.05em; border-radius:20px; padding:5px 12px; display:inline-block; margin-bottom:14px;
}
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:12px; font-weight:600; color:var(--text-dim); margin-bottom:6px; }
.auth-card .field label{ color:rgba(255,255,255,0.5); }
.field input, .field select, .field textarea{
  width:100%; border:1px solid var(--border); border-radius:9px; padding:11px 12px; font-size:14.5px; background:var(--card); color:var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus{ outline:2px solid var(--primary); outline-offset:1px; border-color:var(--primary); }
.auth-card .field input, .auth-card .field select{ background:var(--sidebar-hover); border-color:rgba(255,255,255,0.12); color:#fff; }
.pw-field-wrap{ position:relative; }
.pw-field-wrap input{ padding-right:42px; }
.pw-toggle-btn{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  background:none; border:none; font-size:15px; cursor:pointer; padding:6px; line-height:1; opacity:.65;
}
.pw-toggle-btn:hover{ opacity:1; }

.field-row{ display:flex; gap:10px; }
.field-row .field{ flex:1; }
.auth-error{ color:#F87171; background:rgba(239,68,68,0.15); border-radius:8px; font-size:12.5px; padding:0; margin-bottom:0; overflow:hidden; transition:all .15s ease; }
.auth-error.show{ padding:9px 12px; margin-bottom:14px; }
.auth-link{ background:none; border:none; color:rgba(255,255,255,0.5); font-size:12.5px; margin-top:16px; cursor:pointer; text-decoration:underline; display:block; width:100%; text-align:center; }

/* ---------- Buttons ---------- */
.btn{ border:none; border-radius:9px; padding:11px 16px; font-weight:600; font-size:13.5px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; justify-content:center; }
.btn-primary{ background:var(--primary); color:#fff; }
.btn-primary:hover{ background:var(--primary-dark); }
.btn-ghost{ background:transparent; color:var(--text-dim); border:1px solid var(--border); }
.btn-ghost:hover{ background:var(--bg); }
.btn-danger{ background:var(--red-soft); color:var(--red); }
.btn-block{ width:100%; }
.btn-sm{ padding:7px 12px; font-size:12.5px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* ---------- App shell ---------- */
.app{ display:flex; min-height:100vh; }
.app.hidden{ display:none; }
.sidebar{
  width:252px; background:var(--sidebar); color:#fff; flex:none; display:flex; flex-direction:column;
  padding:18px 12px; position:sticky; top:0; height:100vh; overflow-y:auto;
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; padding:6px 8px 22px; }
.sidebar-brand .mark{ width:34px; height:34px; border-radius:9px; background:linear-gradient(135deg,var(--primary),#7C74F0); display:flex; align-items:center; justify-content:center; font-weight:800; color:#fff; font-size:15px; flex:none; }
.sidebar-brand span{ font-weight:800; font-size:17px; letter-spacing:-0.02em; }
.nav-group-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; font-weight:700; color:rgba(255,255,255,0.3); padding:16px 12px 6px; }
.nav-item{
  display:flex; align-items:center; gap:11px; padding:9px 12px; border-radius:9px; color:rgba(255,255,255,0.65);
  font-size:13.5px; font-weight:500; cursor:pointer; margin-bottom:1px;
}
.nav-item .glyph{ font-size:15px; width:18px; text-align:center; flex:none; }
.nav-item:hover{ background:var(--sidebar-hover); color:#fff; }
.nav-item.active{ background:var(--primary); color:#fff; }
.nav-item .badge{ margin-left:auto; background:var(--red); color:#fff; font-size:10.5px; font-weight:700; border-radius:10px; padding:1px 7px; min-width:18px; text-align:center; }
.nav-item.active .badge{ background:rgba(255,255,255,0.25); }
.sidebar-plan{ margin:14px 4px; padding:12px; background:var(--sidebar-hover); border-radius:10px; }
.sidebar-plan .label{ font-size:11.5px; font-weight:600; color:rgba(255,255,255,0.8); margin-bottom:6px; }
.sidebar-plan .bar{ height:5px; border-radius:3px; background:rgba(255,255,255,0.12); overflow:hidden; }
.sidebar-plan .bar-fill{ height:100%; background:var(--primary); }
.sidebar-footer{ margin-top:auto; padding-top:12px; border-top:1px solid rgba(255,255,255,0.08); }
.sidebar-user{ display:flex; align-items:center; gap:9px; padding:8px 6px; font-size:12.5px; }
.avatar{ width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px; flex:none; color:#fff; }
.sidebar-user .name{ font-weight:700; color:#fff; }
.sidebar-user .role{ color:rgba(255,255,255,0.45); font-size:11px; }

.main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  display:flex; align-items:center; justify-content:space-between; padding:18px 28px;
  background:var(--card); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:20; gap:14px; flex-wrap:wrap;
}
.topbar-titles h2{ font-size:20px; font-weight:800; margin:0; letter-spacing:-0.02em; }
.topbar-titles p{ font-size:12.5px; color:var(--text-dim); margin:2px 0 0; }
.topbar-actions{ display:flex; align-items:center; gap:16px; }
.bell{ position:relative; cursor:pointer; font-size:18px; color:var(--text-dim); }
.bell .dot{ position:absolute; top:-4px; right:-6px; background:var(--red); color:#fff; font-size:9.5px; font-weight:700; border-radius:8px; padding:1px 4px; min-width:15px; text-align:center; }

.view{ display:none; padding:24px 28px 60px; flex:1; }
.view.active{ display:block; }

/* ---------- Cards / grid ---------- */
.grid{ display:grid; gap:16px; }
.grid-cols-4{ grid-template-columns:repeat(4,1fr); }
.grid-cols-3{ grid-template-columns:repeat(3,1fr); }
.grid-cols-2{ grid-template-columns:repeat(2,1fr); }
.stat-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); padding:18px; }
.stat-card .label{ font-size:12px; color:var(--text-dim); font-weight:600; }
.stat-card .value{ font-size:26px; font-weight:800; margin-top:6px; letter-spacing:-0.02em; }
.card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); padding:18px; }
.section-title{ font-size:17px; font-weight:800; margin:0 0 14px; display:flex; align-items:center; justify-content:space-between; letter-spacing:-0.01em; }
.empty-state{ border:1px dashed var(--border); border-radius:var(--radius-lg); padding:32px 18px; text-align:center; color:var(--text-dim); font-size:13.5px; }
.empty-state strong{ display:block; color:var(--text); font-size:15px; font-weight:700; margin-bottom:4px; }

/* ---------- Person cards ---------- */
.person-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; display:flex; gap:12px; align-items:flex-start; margin-bottom:10px; }
.person-card .avatar{ width:42px; height:42px; font-size:15px; }
.person-info{ flex:1; min-width:0; }
.person-name{ font-weight:700; font-size:14.5px; }
.person-sub{ font-size:12.5px; color:var(--text-dim); margin-top:1px; }
.person-meta{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.tag{ font-size:11px; padding:3px 9px; border-radius:20px; background:var(--bg); color:var(--text-dim); font-weight:600; }
.tag.status-active{ background:var(--green-soft); color:var(--green); }
.tag.status-pending{ background:var(--amber-soft); color:var(--amber); }
.tag.status-rejected, .tag.status-suspended, .tag.status-deactivated{ background:var(--red-soft); color:var(--red); }
.person-actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }

/* ---------- Client list (search + tabs) ---------- */
.client-toolbar{ display:flex; gap:10px; margin-bottom:14px; }
.client-search{ flex:1; border:1px solid var(--border); border-radius:9px; padding:10px 14px; font-size:13.5px; background:var(--card); }
.client-tabs{ display:flex; gap:6px; margin-bottom:16px; }
.client-tabs button{ background:var(--card); border:1px solid var(--border); border-radius:8px; padding:7px 14px; font-size:12.5px; font-weight:600; color:var(--text-dim); cursor:pointer; }
.client-tabs button.active{ background:var(--primary); color:#fff; border-color:var(--primary); }
.client-row{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:13px 14px; display:flex; gap:12px; align-items:center; margin-bottom:9px; cursor:pointer; }
.client-row:hover{ border-color:var(--primary); }
.client-row .info{ flex:1; min-width:0; }
.client-row .name{ font-weight:700; font-size:13.5px; }
.client-row .sub{ font-size:12px; color:var(--text-dim); margin-top:2px; }

/* ---------- Status pills ---------- */
.status-pill{ display:inline-block; padding:6px 16px; border-radius:8px; font-size:12.5px; font-weight:700; text-align:center; }
.status-pill.scheduled{ background:var(--amber); color:#fff; }
.status-pill.confirmed{ background:var(--primary); color:#fff; }
.status-pill.completed{ background:var(--green); color:#fff; }
.status-pill.cancelled{ background:var(--text-faint); color:#fff; }
.status-pill.no_show{ background:var(--red); color:#fff; }

/* ---------- Agenda ---------- */
.agenda-toolbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:10px; }
.agenda-nav{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.agenda-nav button.icon-nav{ background:var(--card); border:1px solid var(--border); border-radius:8px; width:32px; height:32px; cursor:pointer; font-size:14px; }
.agenda-nav .label{ font-weight:700; font-size:14px; min-width:170px; text-align:center; }
.view-toggle{ display:flex; background:var(--bg); border-radius:8px; padding:3px; border:1px solid var(--border); }
.view-toggle button{ background:none; border:none; padding:7px 14px; font-size:12.5px; font-weight:600; border-radius:6px; cursor:pointer; color:var(--text-dim); }
.view-toggle button.active{ background:var(--primary); color:#fff; }
.owner-select{ border:1px solid var(--border); border-radius:8px; padding:8px 12px; font-size:13px; background:var(--card); font-weight:600; }

.legend{ display:flex; gap:16px; flex-wrap:wrap; margin-top:14px; padding-top:14px; border-top:1px solid var(--border); font-size:12px; color:var(--text-dim); }
.legend .dot{ width:9px; height:9px; border-radius:3px; display:inline-block; margin-right:6px; vertical-align:middle; }

.day-column{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
.day-slot{ display:flex; align-items:center; gap:12px; padding:10px 14px; border-bottom:1px solid var(--border); min-height:52px; cursor:pointer; }
.day-slot:last-child{ border-bottom:none; }
.day-slot:hover{ background:var(--bg); }
.day-slot .time{ font-family:var(--font-mono); font-size:12px; color:var(--text-dim); width:52px; flex:none; }
.day-slot.free .status-label{ color:var(--text-faint); font-size:12.5px; }
.day-slot.booked{ cursor:pointer; }
.day-slot .appt-chip{ border-radius:8px; padding:8px 12px; font-size:12.5px; flex:1; border-left:3px solid transparent; }
.day-slot .appt-chip .t{ font-weight:700; }
.day-slot .appt-chip .s{ opacity:.85; font-size:11.5px; margin-top:1px; }
.day-slot.blocked{ background:repeating-linear-gradient(135deg, var(--bg), var(--bg) 6px, var(--card) 6px, var(--card) 12px); cursor:default; }
.day-slot.blocked .status-label{ color:var(--text-dim); font-size:12px; font-style:italic; }
.day-slot.cancelled .appt-chip{ background:var(--bg) !important; color:var(--text-faint); text-decoration:line-through; border-left-color:var(--border) !important; }

.appt-development{ background:var(--primary-soft); color:var(--primary-dark); border-left-color:var(--primary); }
.appt-resale{ background:var(--green-soft); color:#067A55; border-left-color:var(--green); }
.appt-meeting{ background:var(--purple-soft); color:#6D3FD1; border-left-color:var(--purple); }
.appt-other{ background:var(--pink-soft); color:#C2277A; border-left-color:var(--pink); }

.week-grid-wrap{ overflow-x:auto; }
.week-grid{ display:grid; grid-template-columns:56px repeat(5,minmax(140px,1fr)); background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; min-width:760px; }
.week-grid .head{ background:var(--card); padding:10px 4px; text-align:center; font-size:12px; font-weight:700; border-bottom:1px solid var(--border); border-left:1px solid var(--border); position:sticky; top:0; }
.week-grid .head:first-child{ border-left:none; }
.week-grid .hour-label{ font-family:var(--font-mono); font-size:10px; color:var(--text-dim); padding:4px 6px 0 0; text-align:right; border-top:1px solid var(--border); }
.week-grid .cell{ min-height:44px; position:relative; cursor:pointer; border-top:1px solid var(--border); border-left:1px solid var(--border); }
.week-grid .cell:hover{ background:var(--bg); }
.week-grid .cell .block{ position:absolute; inset:2px; border-radius:6px; padding:4px 6px; font-size:10.5px; overflow:hidden; border-left:3px solid transparent; cursor:pointer; }
.week-grid .cell.blocked-cell{ background:repeating-linear-gradient(135deg, var(--bg), var(--bg) 5px, var(--card) 5px, var(--card) 10px); cursor:default; }

.month-grid{ display:grid; grid-template-columns:repeat(7,1fr); background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
.month-grid .head{ padding:10px 4px; text-align:center; font-size:11.5px; font-weight:700; color:var(--text-dim); border-bottom:1px solid var(--border); }
.month-cell{ min-height:88px; padding:7px; cursor:pointer; border-top:1px solid var(--border); border-left:1px solid var(--border); }
.month-grid .head:first-child, .month-cell:nth-child(7n+1){ border-left:none; }
.month-cell:hover{ background:var(--bg); }
.month-cell.other-month{ opacity:.4; }
.month-cell.is-today .num{ background:var(--primary); color:#fff; border-radius:50%; width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; }
.month-cell .num{ font-size:12px; color:var(--text-dim); font-weight:600; }
.month-cell .dot-row{ display:flex; gap:3px; margin-top:6px; flex-wrap:wrap; }
.month-cell .dot{ width:6px; height:6px; border-radius:50%; }

/* ---------- Slide-over panel (detalhes / formulários) ---------- */
.panel-backdrop{ position:fixed; inset:0; background:rgba(14,21,38,0.35); display:none; z-index:150; }
.panel-backdrop.open{ display:block; }
.slide-panel{
  position:fixed; top:0; right:0; height:100%; width:420px; max-width:92vw; background:var(--card);
  box-shadow:-16px 0 40px rgba(14,21,38,.18); z-index:160; transform:translateX(100%); transition:transform .25s ease;
  display:flex; flex-direction:column;
}
.panel-backdrop.open .slide-panel{ transform:translateX(0); }
.panel-header{ display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border); flex:none; }
.panel-header h2{ font-size:16.5px; font-weight:800; margin:0; }
.panel-close{ background:var(--bg); border:none; width:30px; height:30px; border-radius:8px; cursor:pointer; font-size:15px; color:var(--text-dim); }
.panel-body{ padding:20px 22px; overflow-y:auto; flex:1; }
.panel-actions{ display:flex; gap:10px; padding:16px 22px; border-top:1px solid var(--border); flex:none; }
.panel-actions .btn{ flex:1; }
.detail-row{ margin-bottom:16px; }
.detail-row .k{ font-size:11.5px; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:.03em; margin-bottom:4px; }
.detail-row .v{ font-size:14px; font-weight:600; }
.detail-row .v.small{ font-weight:400; font-size:13px; color:var(--text-dim); }
.collapse-header{ display:flex; align-items:center; justify-content:space-between; font-size:13px; font-weight:700; padding:10px 0; cursor:pointer; border-bottom:1px solid var(--border); margin-bottom:14px; }
.type-toggle{ display:flex; gap:8px; margin-bottom:14px; }
.type-toggle button{ flex:1; padding:10px; border-radius:9px; border:1px solid var(--border); background:var(--card); font-size:13px; font-weight:700; cursor:pointer; color:var(--text-dim); }
.type-toggle button.active{ background:var(--primary); color:#fff; border-color:var(--primary); }

/* legacy centered sheet, still used on mobile full-screen forms */
/* Garante que o dropdown de sugestões do Google Maps sempre apareça por
   cima de qualquer formulário/modal — sem isso, ele pode renderizar
   escondido atrás da tela, parecendo que "não funciona" */
.pac-container{ z-index:9999 !important; }

.sheet-backdrop{ position:fixed; inset:0; background:rgba(14,21,38,0.4); display:none; align-items:center; justify-content:center; z-index:150; padding:20px; }
.sheet-backdrop.open{ display:flex; }
.sheet{ background:var(--card); width:100%; max-width:480px; border-radius:16px; padding:22px; max-height:90vh; overflow-y:auto; }
.sheet h2{ font-size:18px; font-weight:800; margin:0 0 16px; }
.sheet-actions{ display:flex; gap:10px; margin-top:6px; }
.sheet-actions .btn{ flex:1; }

/* ---------- Tables ---------- */
/* ---------- Quadro da Diretoria ---------- */
.board-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:18px; align-items:start; }
.board-card{ padding:18px; }
.board-card-header{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.board-card-title{ font-size:15px; font-weight:800; display:flex; align-items:center; gap:8px; }
.board-card-icon{ font-size:16px; }
.board-item{ background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:12px 14px; margin-bottom:10px; }
.board-item:last-child{ margin-bottom:0; }
.board-item-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.board-item-date{ font-family:var(--font-mono); font-size:11px; font-weight:700; color:var(--primary-dark); background:var(--primary-soft); padding:2px 8px; border-radius:6px; }
.board-item-delete{ flex:none; width:22px; height:22px; border-radius:6px; border:none; background:var(--card); color:var(--text-faint); font-size:12px; cursor:pointer; line-height:1; }
.board-item-delete:hover{ background:var(--red-soft); color:var(--red); }
.board-item-title{ font-size:13.5px; font-weight:700; line-height:1.4; word-break:break-word; }
.board-item-desc{ font-size:12.5px; color:var(--text-dim); line-height:1.5; margin-top:4px; word-break:break-word; }
.board-item-location{ font-size:12px; color:var(--text-dim); margin-top:8px; word-break:break-word; }
.board-item-maps{ display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.board-map-link{
  font-size:11.5px; font-weight:700; color:var(--primary-dark); background:var(--primary-soft);
  padding:5px 10px; border-radius:7px; text-decoration:none; display:inline-block;
}
.board-map-link:hover{ background:var(--primary); color:#fff; }

@media (max-width:900px){
  .board-grid{ grid-template-columns:1fr; }
}

/* ---------- Métricas ---------- */
.metrics-filters{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.metrics-filters select{ border:1px solid var(--border); border-radius:8px; padding:9px 12px; font-size:13px; background:var(--card); color:var(--text); flex:1; min-width:150px; max-width:220px; }
.metrics-top{ display:grid; grid-template-columns:1fr auto; gap:20px; align-items:center; }
.metrics-cards{ display:grid; grid-template-columns:repeat(auto-fill, minmax(160px,1fr)); gap:10px; }
.metric-team-card{ background:var(--card); border:1px solid var(--border); border-radius:12px; padding:14px; display:flex; gap:10px; align-items:center; min-width:0; }
.metric-team-card .dot{ width:12px; height:12px; border-radius:50%; flex:none; }
.metric-team-name{ font-size:12.5px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.metric-team-total{ font-size:18px; font-weight:800; margin-top:2px; }
.metrics-donut-wrap{ display:flex; justify-content:center; }

table.data-table{ width:100%; border-collapse:collapse; font-size:13px; }
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.data-table th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.03em; color:var(--text-dim); font-weight:700; padding:8px 10px; border-bottom:1px solid var(--border); }
.data-table td{ padding:10px; border-bottom:1px solid var(--border); }

/* ---------- Toast ---------- */
.toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:var(--sidebar); color:#fff; padding:11px 18px; border-radius:30px; font-size:13.5px; z-index:200; opacity:0; pointer-events:none; transition:opacity .25s ease, transform .25s ease; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(-6px); }

/* ---------- Notification dropdown ---------- */
.notif-panel{ position:absolute; top:56px; right:24px; width:340px; max-height:420px; overflow-y:auto; background:var(--card); border:1px solid var(--border); border-radius:12px; box-shadow:0 12px 30px rgba(14,21,38,.15); z-index:120; display:none; }
.notif-panel.open{ display:block; }
.notif-close-btn{ width:24px; height:24px; border-radius:6px; border:none; background:var(--bg); color:var(--text-dim); font-size:13px; cursor:pointer; line-height:1; flex:none; }
.notif-close-btn:hover{ background:var(--red-soft); color:var(--red); }
.notif-backdrop{ position:fixed; inset:0; background:transparent; z-index:110; display:none; }
.notif-backdrop.open{ display:block; }
.notif-item{ padding:12px 16px; border-bottom:1px solid var(--border); font-size:12.5px; }
.notif-item.unread{ background:var(--primary-soft); }
.notif-item .title{ font-weight:700; }
.notif-item .time{ color:var(--text-faint); font-family:var(--font-mono); font-size:10.5px; margin-top:4px; }

/* ---------- Mobile ---------- */
.mobile-topbar{ display:none; }
.bottom-nav{ display:none; }

@media (max-width:900px){
  .sidebar{
    position:fixed; top:0; left:0; height:100%; z-index:70; width:272px;
    transform:translateX(-100%); transition:transform .25s ease; box-shadow:0 0 0 rgba(0,0,0,0);
  }
  .sidebar.open{ transform:translateX(0); box-shadow:16px 0 40px rgba(14,21,38,.25); }
  .drawer-backdrop{ position:fixed; inset:0; background:rgba(14,21,38,0.45); z-index:65; display:none; }
  .drawer-backdrop.open{ display:block; }
  .mobile-topbar{
    display:flex; align-items:center; justify-content:space-between; padding:calc(12px + env(safe-area-inset-top)) 10px 12px;
    background:var(--sidebar); color:#fff; position:sticky; top:0; z-index:30;
  }
  .mobile-topbar .brand{ display:flex; align-items:center; gap:8px; font-weight:800; font-size:15px; }
  .mobile-topbar .brand .mark{ width:26px; height:26px; border-radius:7px; background:linear-gradient(135deg,var(--primary),#7C74F0); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; }
  .topbar{ padding:8px 16px; min-height:0; }
  .topbar-titles{ display:none; }
  .topbar-actions{ margin-left:auto; }
  .notif-panel{ width:calc(100vw - 24px); right:12px; left:12px; max-width:none; top:96px; }
  .view{ padding:16px 16px 96px; }
  .grid-cols-4,.grid-cols-3,.grid-cols-2{ grid-template-columns:1fr 1fr; }
  .slide-panel{ width:100%; max-width:100%; }
  .agenda-toolbar{ flex-direction:column; align-items:stretch; }
  .agenda-nav{ justify-content:space-between; }
  .agenda-nav .label{ min-width:0; flex:1; }
  .owner-select{ width:100%; }
  .view-toggle{ width:100%; }
  .view-toggle button{ flex:1; }
  .bottom-nav{
    display:flex; position:fixed; bottom:0; left:0; right:0; background:var(--card);
    padding:8px 4px calc(8px + env(safe-area-inset-bottom)); z-index:40; border-top:1px solid var(--border);
    align-items:center; justify-content:space-around;
    /* Corrige o bug conhecido do Safari/iOS onde elementos fixed "descolam"
       da tela durante o gesto de rolar — forçar uma camada de renderização
       própria mantém ele grudado no lugar certo o tempo todo. */
    transform:translateZ(0); -webkit-transform:translateZ(0); will-change:transform;
  }
  .bottom-nav .nav-item{ flex:1; flex-direction:column; gap:3px; text-align:center; font-size:9.5px; margin:0; border-radius:8px; color:var(--text-dim); padding:6px 2px; }
  .bottom-nav .nav-item.active{ background:none; color:var(--primary); }
  .bottom-nav .nav-item .glyph{ font-size:17px; }
  .bottom-nav .fab{
    flex:none; width:48px; height:48px; border-radius:50%; background:var(--primary); color:#fff;
    display:flex; align-items:center; justify-content:center; font-size:22px; margin-top:-22px;
    box-shadow:0 8px 18px rgba(79,70,229,.4); cursor:pointer;
  }
  .field-row{ flex-direction:column; gap:0; }
  .field-row .field{ width:100%; }
  .sheet{ max-width:100%; width:100%; border-radius:16px 16px 0 0; margin-top:auto; }
  .sheet-backdrop{ align-items:flex-end; padding:0; }
  /* iOS aumenta o zoom sozinho quando o campo tem fonte menor que 16px — trava isso */
  input[type="text"], input[type="email"], input[type="password"], input[type="date"],
  input[type="time"], input[type="number"], input[type="search"], input:not([type]),
  select, textarea{ font-size:16px !important; }
  .grid-cols-2{ grid-template-columns:1fr; }
  .metrics-top{ grid-template-columns:1fr; }
  .metrics-donut-wrap{ order:-1; margin-bottom:4px; }
  .metrics-filters select{ max-width:none; width:100%; }
  .btn{ padding:10px 14px; font-size:13px; }
  .btn-sm{ padding:6px 11px; font-size:12px; }
  body{ overflow-x:hidden; }
}


