/* =====================================================================
   Produtividade — estilos
   ===================================================================== */

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f6;
  --border: #e5e7ef;
  --border-strong: #d4d8e3;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8a94a7;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --on-accent: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef1f1;
  --danger-text: #b91c1c;
  --warning: #d97706;
  --warning-soft: #fff8eb;
  --warning-text: #b45309;
  --success: #059669;
  --success-soft: #ecfdf5;
  --success-text: #047857;
  --info: #0284c7;
  --info-soft: #eff8ff;
  --info-text: #0369a1;
  --prio-high: #ef4444;
  --prio-medium: #f59e0b;
  --prio-low: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --sidebar-w: 252px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0f1a;
  --surface: #121826;
  --surface-2: #161d2d;
  --surface-3: #1e2638;
  --border: #232c40;
  --border-strong: #303b54;
  --text: #e8ecf4;
  --text-2: #a6b0c4;
  --text-3: #6d7891;
  --accent: #6c66f5;
  --accent-hover: #807bff;
  --accent-soft: rgba(108, 102, 245, .16);
  --accent-text: #aaa6ff;
  --danger: #f05252;
  --danger-soft: rgba(240, 82, 82, .13);
  --danger-text: #fca5a5;
  --warning: #f2a33a;
  --warning-soft: rgba(242, 163, 58, .13);
  --warning-text: #fcd34d;
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, .12);
  --success-text: #86efac;
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .12);
  --info-text: #7dd3fc;
  --prio-low: #64748b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0b0f1a;
    --surface: #121826;
    --surface-2: #161d2d;
    --surface-3: #1e2638;
    --border: #232c40;
    --border-strong: #303b54;
    --text: #e8ecf4;
    --text-2: #a6b0c4;
    --text-3: #6d7891;
    --accent: #6c66f5;
    --accent-hover: #807bff;
    --accent-soft: rgba(108, 102, 245, .16);
    --accent-text: #aaa6ff;
    --danger: #f05252;
    --danger-soft: rgba(240, 82, 82, .13);
    --danger-text: #fca5a5;
    --warning: #f2a33a;
    --warning-soft: rgba(242, 163, 58, .13);
    --warning-text: #fcd34d;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, .12);
    --success-text: #86efac;
    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, .12);
    --info-text: #7dd3fc;
    --prio-low: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open { overflow: hidden; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }

p { margin: 0; }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--surface-3);
  padding: .1em .4em;
  border-radius: 5px;
}

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

.muted { color: var(--text-2); }
.text-danger { color: var(--danger-text); font-weight: 500; }
.text-warning { color: var(--warning-text); display: inline-flex; align-items: center; gap: 4px; }
.text-warning .icon { width: 13px; height: 13px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sep { color: var(--text-3); }

/* ---------- Layout ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 18px;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-item .icon { width: 19px; height: 19px; }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.user-chip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.user-chip-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 30px 36px 56px;
  outline: none;
}

.page { max-width: 1360px; margin: 0 auto; animation: fade-in .25s ease; }

@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.topbar, .tabbar { display: none; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 26px; font-weight: 700; }
.page-subtitle { color: var(--text-2); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 17px; height: 17px; }

.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(79, 70, 229, .25); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-soft:hover { filter: brightness(.97); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: var(--radius-xs); gap: 5px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { height: 46px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }

.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-color: var(--text-2) transparent var(--text-2) transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary.loading::after, .btn-danger.loading::after { border-color: #fff transparent #fff transparent; }

@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger-text); }
.icon-btn.loading .icon { animation: spin .8s linear infinite; }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
}
.link-more .icon { width: 15px; height: 15px; }

/* ---------- Cartões ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}
.card-title, .section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 650;
}
.card-title .icon, .section-title .icon { color: var(--text-3); }
.card-body { padding: 4px 18px 18px; }

.section { margin-top: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ---------- KPIs ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  min-width: 0;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.kpi:hover, .kpi[role="button"]:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); cursor: pointer; }

.kpi-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
}
.kpi-icon .icon { width: 20px; height: 20px; }
.tone-indigo { background: var(--accent-soft); color: var(--accent-text); }
.tone-sky { background: var(--info-soft); color: var(--info-text); }
.tone-amber { background: var(--warning-soft); color: var(--warning-text); }
.tone-emerald { background: var(--success-soft); color: var(--success-text); }

.kpi-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi-value-sm { font-size: 16px; font-weight: 650; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-join { align-self: center; flex-shrink: 0; }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: pulse 1.8s infinite;
  margin-right: 6px;
  flex-shrink: 0;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- Dashboard ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 10px;
  flex-shrink: 0;
}
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .count { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.agenda-day { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; margin: 14px 0 6px; }
.agenda-day:first-child { margin-top: 2px; }

.agenda-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.agenda-item:hover { background: var(--surface-2); }
.agenda-item.is-past { opacity: .5; }
.agenda-item.is-live { background: var(--success-soft); }

.agenda-time { display: flex; flex-direction: column; width: 46px; flex-shrink: 0; line-height: 1.25; font-variant-numeric: tabular-nums; }
.agenda-time strong { font-size: 14px; font-weight: 650; }
.agenda-time small { font-size: 12px; color: var(--text-3); }

.agenda-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); flex-shrink: 0; min-height: 34px; }

.agenda-body { flex: 1; min-width: 0; }
.agenda-title { font-weight: 600; display: flex; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); min-width: 0; margin-top: 1px; }

.agenda-conflict { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--warning-text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-conflict .icon { width: 13px; height: 13px; }

.conflict-box { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-xs); background: var(--warning-soft); }
.conflict-box > strong { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--warning-text); margin-bottom: 6px; }
.conflict-box > strong .icon { width: 15px; height: 15px; }
.conflict-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.conflict-box li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.conflict-box li small { margin-left: auto; flex-shrink: 0; }

.quick-add { display: flex; gap: 8px; padding: 0 18px 10px; }
.quick-add .input { flex: 1; }

.mini-todos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-todo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  transition: opacity .3s;
}
.mini-todo:last-child { border-bottom: 0; }
.mini-todo.is-done { opacity: .4; }
.mini-todo.is-done .mini-todo-title { text-decoration: line-through; }
.mini-todo-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.mini-todo-title { font-weight: 550; overflow-wrap: anywhere; }
.mini-todo-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.mail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

.mail-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow: hidden;
}
.mail-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c, transparent); }
.mail-card-header { display: flex; align-items: center; gap: 11px; }
.mail-card-title { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.mail-card-title small { color: var(--text-3); font-size: 12.5px; }

.unread-pill {
  min-width: 30px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.unread-pill.is-zero { background: var(--surface-3); color: var(--text-3); }

.mail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mail-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-xs);
  color: var(--text);
  min-width: 0;
}
a.mail-item:hover { background: var(--surface-2); text-decoration: none; }
.mail-item-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.mail-item-top time { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.mail-subject { font-size: 13px; color: var(--text-2); }
.mail-empty { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 0; }
.mail-empty .icon { color: var(--success); width: 16px; height: 16px; }
.mail-open { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; margin-top: auto; }
.mail-open .icon { width: 14px; height: 14px; }

.provider-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.provider-badge-lg { width: 42px; height: 42px; border-radius: 12px; }
.logo-generic { display: inline-grid; place-items: center; color: var(--accent-text); }
.logo-generic .icon { width: 100%; height: 100%; }

.onboarding {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  margin-bottom: 20px;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%);
}
.onboarding h2 { font-size: 17px; margin-bottom: 4px; }
.onboarding > div:nth-child(2) { flex: 1; }
.onboarding-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: #fff; flex-shrink: 0; }
.onboarding-icon .icon { width: 24px; height: 24px; }

/* ---------- Badges e status ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge-high { background: var(--danger-soft); color: var(--danger-text); }
.badge-medium { background: var(--warning-soft); color: var(--warning-text); }
.badge-low { background: var(--surface-3); color: var(--text-2); }

.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.due .icon { width: 13px; height: 13px; }
.due-danger { color: var(--danger-text); }
.due-warning { color: var(--warning-text); }
.due-info { color: var(--info-text); }
.due-muted { color: var(--text-2); }

.status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-success { background: var(--success-soft); color: var(--success-text); }
.status-warning { background: var(--warning-soft); color: var(--warning-text); }
.status-danger { background: var(--danger-soft); color: var(--danger-text); }
.status-info { background: var(--info-soft); color: var(--info-text); }

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-xs);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 13px;
  line-height: 1.45;
}
.inline-alert .icon { width: 16px; height: 16px; margin-top: 1px; }
.inline-alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.inline-alert-warning { background: var(--warning-soft); color: var(--warning-text); }
.inline-alert-info { background: var(--info-soft); color: var(--info-text); }
.inline-alert-success { background: var(--success-soft); color: var(--success-text); }

.alert { padding: 12px 14px; border-radius: var(--radius-xs); font-size: 14px; margin-bottom: 16px; }
.alert-danger { background: var(--danger-soft); color: var(--danger-text); }

/* ---------- Formulários ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.form-section { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; margin: 8px 0 -2px; color: var(--text); }
.form-section .icon { color: var(--text-3); width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field-help { font-size: 12px; color: var(--text-3); line-height: 1.45; }

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { background: var(--surface-2); color: var(--text-3); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-sm { height: 34px; font-size: 13.5px; width: auto; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.checkbox { position: relative; display: inline-grid; cursor: pointer; flex-shrink: 0; margin-top: 1px; }
.checkbox input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.checkbox-box {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 2px solid var(--border-strong);
  border-radius: 7px;
  color: transparent;
  transition: all .15s;
}
.checkbox-box .icon { width: 13px; height: 13px; stroke-width: 3; }
.checkbox:hover .checkbox-box { border-color: var(--accent); }
.checkbox input:checked + .checkbox-box { background: var(--success); border-color: var(--success); color: #fff; }
.checkbox input:focus-visible + .checkbox-box { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch-row > span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.switch-row .icon { width: 16px; height: 16px; color: var(--text-3); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .2s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-3);
  min-width: 240px;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { border: 0; outline: none; background: none; color: var(--text); font: inherit; flex: 1; min-width: 0; }

.color-picker { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); transition: transform .15s; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); transform: scale(1.05); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }

.feature-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feature-pick { position: relative; cursor: pointer; }
.feature-pick input { position: absolute; opacity: 0; }
.feature-pick > span {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.feature-pick .icon { grid-row: span 2; color: var(--text-3); width: 22px; height: 22px; }
.feature-pick small { color: var(--text-3); font-size: 12px; }
.feature-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.feature-pick input:checked + span .icon { color: var(--accent-text); }
.feature-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Tarefas ---------- */

.todo-composer { padding: 6px; margin-bottom: 18px; }
.composer-main { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.composer-icon { color: var(--accent-text); display: grid; }
.composer-input { flex: 1; border: 0; outline: none; background: none; font: inherit; font-size: 16px; color: var(--text); min-width: 0; padding: 4px 0; }
.composer-input::placeholder { color: var(--text-3); }
.composer-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px 6px; border-top: 1px solid var(--border); }
.composer-options .btn { margin-left: auto; }

.prio-picker { display: inline-flex; gap: 4px; }
.prio-option { cursor: pointer; }
.prio-option input { position: absolute; opacity: 0; }
.prio-option span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all .15s;
}
.prio-option .icon { width: 14px; height: 14px; }
.prio-option.prio-high .icon { color: var(--prio-high); }
.prio-option.prio-medium .icon { color: var(--prio-medium); }
.prio-option.prio-low .icon { color: var(--prio-low); }
.prio-option input:checked + span { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.prio-option input:focus-visible + span { outline: 2px solid var(--accent); }

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

.hint { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin: 0 0 10px; }
.hint .icon { width: 14px; height: 14px; }

.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.todo {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 12px 13px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, opacity .3s, transform .3s;
}
.todo::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; }
.todo.prio-high::before { background: var(--prio-high); }
.todo.prio-medium::before { background: var(--prio-medium); }
.todo.prio-low::before { background: var(--prio-low); }
.todo:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.todo.is-done { background: var(--surface-2); box-shadow: none; }
.todo.is-done::before { display: none; }
.todo.is-done .todo-title { text-decoration: line-through; color: var(--text-3); }
.todo.is-completing { opacity: .35; transform: translateX(8px); }

.todo-handle { color: var(--text-3); cursor: grab; display: grid; padding: 2px 0; opacity: .5; touch-action: none; }
.todo-handle:hover { opacity: 1; }
.todo-handle:active { cursor: grabbing; }
.no-drag .todo-handle { display: none; }

.todo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.todo-title { font-weight: 550; overflow-wrap: anywhere; }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.todo-meta:empty { display: none; }
.todo-account { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.todo-notes { display: inline-grid; color: var(--text-3); }
.todo-notes .icon { width: 14px; height: 14px; }

.todo-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.todo:hover .todo-actions, .todo:focus-within .todo-actions { opacity: 1; }
.todo-actions .icon-btn { width: 30px; height: 30px; }
.todo-actions .icon { width: 16px; height: 16px; }

.todo-ghost { opacity: .4; background: var(--accent-soft); border-style: dashed; }
.todo-chosen { box-shadow: var(--shadow-lg); }

.done-section { margin-top: 26px; }
.done-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.done-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font-weight: 650; color: var(--text-2); cursor: pointer; padding: 4px 0; }
.done-toggle .icon { transition: transform .2s; transform: rotate(-90deg); }
.done-section.is-open .done-toggle .icon { transform: none; }
.done-toggle .count { color: var(--text-3); font-weight: 600; }
.todo-list-done .todo { padding-left: 12px; }

/* ---------- Calendário ---------- */

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--border-strong); }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); transition: all .15s; }
.chip.is-off { color: var(--text-3); background: var(--surface-2); }
.chip.is-off .chip-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }

.calendar-card { padding: 16px; overflow: hidden; }

.fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--surface-2);
  --fc-list-event-hover-bg-color: var(--surface-2);
  --fc-today-bg-color: var(--accent-soft);
  --fc-now-indicator-color: var(--danger);
  --fc-button-bg-color: var(--surface);
  --fc-button-border-color: var(--border);
  --fc-button-text-color: var(--text);
  --fc-button-hover-bg-color: var(--surface-3);
  --fc-button-hover-border-color: var(--border-strong);
  --fc-button-active-bg-color: var(--accent);
  --fc-button-active-border-color: var(--accent);
  --fc-event-border-color: transparent;
  font-size: 13px;
}
.fc .fc-toolbar { gap: 10px; flex-wrap: wrap; }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 700; }
.fc .fc-toolbar-title::first-letter { text-transform: uppercase; }
.fc .fc-button { font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 9px; box-shadow: none !important; text-transform: capitalize; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { color: #fff; }
.fc .fc-button-group > .fc-button:not(:first-child) { margin-left: -1px; }
.fc .fc-button:focus { box-shadow: 0 0 0 3px var(--accent-soft) !important; }
.fc .fc-col-header-cell-cushion { text-transform: capitalize; color: var(--text-2); font-weight: 600; padding: 8px 4px; }
.fc .fc-daygrid-day-number { color: var(--text-2); font-weight: 500; padding: 6px 8px; }
.fc .fc-day-today .fc-daygrid-day-number { color: var(--accent-text); font-weight: 700; }
.fc .fc-timegrid-slot-label-cushion, .fc .fc-timegrid-axis-cushion { color: var(--text-3); font-size: 12px; }
.fc .fc-timegrid-slot { height: 3em; }
.fc .fc-event { cursor: pointer; }
.fc .fc-timeGridDay-view .fc-day-today { background: none; }

/* Eventos: cor sólida da conta (como no Google Agenda) com texto em contraste automático.
   O contorno na cor do fundo separa reuniões que se sobrepõem. */
.fc .fc-event.ev { --c: var(--accent); --on-c: #fff; }
.fc .fc-timegrid-event.ev,
.fc .fc-daygrid-block-event.ev {
  background: var(--c) !important;
  border: 0 !important;
  border-radius: 6px;
  box-shadow: 0 0 0 1.5px var(--surface);
}
.fc .fc-timegrid-event.ev:hover,
.fc .fc-daygrid-block-event.ev:hover { filter: brightness(1.08); z-index: 10 !important; box-shadow: 0 0 0 1.5px var(--surface), var(--shadow); }
.fc .fc-timegrid-event.ev .fc-event-main,
.fc .fc-daygrid-block-event.ev .fc-event-main { color: var(--on-c); padding: 3px 6px; }
.fc .fc-timegrid-event.ev { container-type: inline-size; }
.fc .fc-timegrid-event.ev .ev-time,
.fc .fc-timegrid-event.ev .ev-account { color: inherit; opacity: .85; }
.fc .fc-timegrid-event.ev .ev-dot { display: none; }
.fc .ev-past { opacity: .5; }
.fc .fc-timegrid-more-link { background: var(--surface-3); color: var(--text); border-radius: 6px; font-weight: 600; box-shadow: 0 0 0 1.5px var(--surface); }

.ev-inner { display: flex; flex-direction: column; gap: 1px; height: 100%; overflow: hidden; line-height: 1.25; }
.ev-title {
  font-weight: 600;
  font-size: 12.5px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: normal;
}
.ev-time { font-size: 11.5px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-account { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }

/* Eventos curtos (30 min ou menos): tudo em uma linha. */
.fc .fc-timegrid-event-short .ev-inner { flex-direction: row; align-items: center; gap: 6px; }
.fc .fc-timegrid-event-short .ev-title { -webkit-line-clamp: 1; }
.fc .fc-timegrid-event-short .ev-account { display: none; }

/* Colunas estreitas quando há muitas reuniões ao mesmo tempo. */
@container (max-width: 150px) {
  .fc-timegrid-event-short .ev-time { display: none; }
}
@container (max-width: 90px) {
  .ev-account, .ev-time { display: none; }
  .ev-title { font-size: 11px; -webkit-line-clamp: 4; }
}

.fc .fc-daygrid-dot-event.ev { display: flex; align-items: center; gap: 5px; padding: 2px 5px; border-radius: 6px; color: var(--text); overflow: hidden; }
.fc .fc-daygrid-dot-event.ev:hover { background: var(--surface-3); }
.fc .fc-daygrid-dot-event.ev .ev-title { -webkit-line-clamp: 1; font-weight: 550; font-size: 12px; }
.fc .fc-daygrid-block-event.ev .ev-account { display: none; }

.fc .fc-list-event.ev .ev-title { display: inline; font-size: 13.5px; }
.fc .fc-list-event.ev .ev-account { display: inline; margin-left: 10px; font-size: 12.5px; }
.fc .fc-list-event-dot { border-width: 6px; }

.fc .fc-list-day-cushion { background: var(--surface-2); text-transform: capitalize; }
.fc .fc-list-event td { border-color: var(--border); }
.fc .fc-popover { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-lg); border-radius: 12px; overflow: hidden; }
.fc .fc-popover-header { background: var(--surface-2); color: var(--text); }
.fc .fc-more-link { color: var(--accent-text); font-weight: 600; }
.fc .fc-scrollgrid { border-radius: 10px; overflow: hidden; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border); }
.fc a { color: inherit; text-decoration: none; }

/* ---------- Detalhe do evento ---------- */

.event-detail-head { display: flex; gap: 14px; margin-bottom: 16px; }
.event-detail-head h3 { font-size: 18px; margin-bottom: 4px; overflow-wrap: anywhere; }
.event-swatch { width: 14px; height: 14px; border-radius: 4px; margin-top: 5px; flex-shrink: 0; }
.event-meta { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.event-meta > div { display: flex; gap: 12px; align-items: flex-start; }
.event-meta dt { color: var(--text-3); display: grid; margin-top: 2px; }
.event-meta dt .icon { width: 16px; height: 16px; }
.event-meta dd { margin: 0; overflow-wrap: anywhere; }
.event-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  max-height: 260px;
  overflow: auto;
}

/* ---------- Configurações ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-text); border-color: var(--accent); }
.tab .icon { width: 16px; height: 16px; }

.panel-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-header h2 { font-size: 18px; margin-bottom: 3px; }

.account-list { display: flex; flex-direction: column; gap: 12px; }
.account-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.account-head { display: flex; align-items: center; gap: 12px; }
.account-handle { color: var(--text-3); cursor: grab; display: grid; opacity: .5; margin-left: -6px; touch-action: none; }
.account-handle:hover { opacity: 1; }
.account-title { flex: 1; min-width: 0; }
.account-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-name strong { font-size: 15px; }
.account-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.account-card .inline-alert { margin: 0; }
.account-features { display: flex; flex-wrap: wrap; gap: 22px; padding-top: 2px; }
.account-calendars { border-top: 1px solid var(--border); padding-top: 12px; }
.account-calendars-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.calendar-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }

.cal-check { display: flex; align-items: center; gap: 9px; padding: 5px 0; cursor: pointer; font-size: 13.5px; min-width: 0; position: relative; }
.cal-check input { position: absolute; opacity: 0; }
.cal-check-box { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--c); color: transparent; flex-shrink: 0; transition: all .15s; }
.cal-check-box .icon { width: 11px; height: 11px; stroke-width: 3.5; }
.cal-check input:checked + .cal-check-box { background: var(--c); color: #fff; }
.cal-check input:focus-visible + .cal-check-box { outline: 2px solid var(--accent); outline-offset: 2px; }

.provider-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.provider-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.provider-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.provider-option > .icon { color: var(--text-3); }
.provider-option-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.provider-option-text small { color: var(--text-2); font-size: 12.5px; }

.settings-form { display: flex; flex-direction: column; gap: 16px; }
.settings-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.settings-card h2 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.settings-card h2 > .icon { color: var(--text-3); }
.settings-card .inline-alert { margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 5px; }

.steps-lg { gap: 9px; font-size: 14px; line-height: 1.55; }
.steps-lg li::marker { font-weight: 700; color: var(--accent-text); }
.steps-lg strong { color: var(--text); }

.advanced { border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 10px 14px; }
.advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.advanced[open] summary { margin-bottom: 12px; }
.advanced .check { margin-top: 10px; }

.copy-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}
.copy-field code { flex: 1; background: none; padding: 0; overflow-wrap: anywhere; font-size: 13px; }

.table-card { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 650; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-actions { text-align: right; white-space: nowrap; }

.req-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.req-list li { display: flex; align-items: center; gap: 9px; color: var(--text-2); }
.req-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.req-list .fail .req-dot { background: var(--danger); }
.req-list .fail { color: var(--danger-text); }
.req-list .warn .req-dot { background: var(--warning); }

/* ---------- Estados vazios e skeleton ---------- */

.empty { text-align: center; padding: 44px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty h3 { font-size: 16px; }
.empty .btn { margin-top: 10px; }
.empty-sm { padding: 26px 12px; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--surface-3); color: var(--text-3); margin-bottom: 6px; }
.empty-icon .icon { width: 22px; height: 22px; }
.mail-grid > .empty { grid-column: 1 / -1; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-text { display: block; height: 12px; margin: 4px 0; }
.skeleton-title { display: block; height: 26px; width: 60px; margin-top: 4px; }
.skeleton-row { height: 46px; margin-bottom: 8px; }
.skeleton-list { padding-top: 4px; }
.skeleton-block { height: 260px; border-radius: var(--radius); }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 12, 24, .5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .2s;
}
.modal-backdrop.show { opacity: 1; }

.modal {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.98);
  transition: transform .2s;
}
.modal-backdrop.show .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 720px; }
.modal-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-header h2 { font-size: 17px; }
.modal-body { padding: 12px 20px 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.confirm-text { color: var(--text-2); }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 11px 15px;
  border-radius: 12px;
  background: #111827;
  color: #f9fafb;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: auto;
}
:root[data-theme="dark"] .toast { background: #273046; }
.toast.show { opacity: 1; transform: none; }
.toast .icon { width: 17px; height: 17px; }
.toast-success .icon { color: #4ade80; }
.toast-error .icon { color: #f87171; }

/* ---------- Login / instalação ---------- */

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(139, 92, 246, .16), transparent 60%),
    var(--bg);
}
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.auth-wide .auth-card { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; margin-bottom: 26px; }
.auth-brand img { border-radius: 11px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 22px; }
.auth-card .form { gap: 16px; }
.auth-card .req-list { margin-bottom: 20px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius-sm); }
.auth-card .form-section { margin-top: 10px; font-size: 15px; }
.auth-foot { margin-top: 22px; color: var(--text-3); font-size: 12.5px; }

/* ---------- Responsivo ---------- */

@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .sidebar { display: none; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: calc(58px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0 16px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .brand { padding: 0; font-size: 15.5px; min-width: 0; }
  .topbar-actions { display: flex; gap: 2px; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-top: 1px solid var(--border);
  }
  .tabbar .nav-item { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11px; text-align: center; justify-content: center; }
  .tabbar .nav-item.active { background: none; }
  .tabbar .nav-item.active .icon { background: var(--accent-soft); border-radius: 999px; padding: 3px 14px; width: 50px; height: 26px; box-sizing: border-box; }
  .tabbar .nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

  .main { margin-left: 0; padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); }
  .dash-grid { grid-template-columns: 1fr; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); right: 16px; left: 16px; align-items: center; }
}

@media (max-width: 767px) {
  body { font-size: 14px; }
  .page-header { align-items: flex-start; margin-bottom: 18px; }
  .page-header h1 { font-size: 22px; }
  .hide-sm { display: none !important; }
  .page-actions .btn { width: 38px; padding: 0; }

  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .kpi { flex-direction: column; gap: 8px; padding: 12px; }
  .kpi-icon { width: 32px; height: 32px; border-radius: 9px; }
  .kpi-icon .icon { width: 17px; height: 17px; }
  .kpi-label { font-size: 10.5px; letter-spacing: .02em; line-height: 1.3; }
  .kpi-value { font-size: 22px; }
  .kpi-sub { font-size: 11.5px; flex-wrap: wrap; gap: 2px 6px; }
  .kpi-next { grid-column: 1 / -1; order: -1; flex-direction: row; align-items: center; gap: 12px; }
  .kpi-next .kpi-icon { width: 38px; height: 38px; }
  .kpi-next .kpi-sub { flex-wrap: nowrap; }

  .card-header { flex-wrap: wrap; padding: 14px 14px 10px; }
  .card-body { padding: 4px 12px 14px; }
  .quick-add { padding: 0 14px 10px; }
  .agenda-item { padding: 9px 6px; gap: 10px; }
  .mail-grid { grid-template-columns: 1fr; }

  .composer-options { gap: 6px; }
  .composer-options .input-sm { flex: 1 1 140px; }
  .composer-options .btn { width: 100%; margin-left: 0; }
  .prio-picker { width: 100%; }
  .prio-option { flex: 1; }
  .prio-option span { justify-content: center; width: 100%; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .segmented { overflow-x: auto; }
  .toolbar .segmented button { flex: 1; justify-content: center; }
  .search { min-width: 0; }
  .todo-actions { opacity: 1; }
  .todo-actions [data-action="priority"] { display: none; }

  .grid-2, .grid-3, .feature-picks { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }

  .panel-header { flex-direction: column; align-items: stretch; }
  .account-card { padding: 14px; }
  .account-head { flex-wrap: wrap; }
  .account-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
  .account-handle { display: none; }

  .settings-card { padding: 16px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }

  .calendar-card { padding: 10px; border-radius: 14px; }
  .fc .fc-toolbar-title { font-size: 15px; }
  .fc .fc-button { padding: 6px 9px; font-size: 12.5px; }
  .fc .fc-header-toolbar { margin-bottom: 10px !important; }

  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-footer .btn { flex: 1; }

  .onboarding { flex-direction: column; align-items: flex-start; }
  .onboarding .btn { width: 100%; }
  .auth-card { padding: 24px 20px; border-radius: 18px; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
