/* ============================================================
   AF_CALENDARIO :: ESTILOS
   Identidade visual AFRONTT
   Laranja #DA703C · Verde #336C66 · Azul #4A6FA5
   Preto #121615 · Off-white #EDECF1
   Montserrat (títulos/números) · Lato (textos)
   ============================================================ */

:root {
  --laranja:  #DA703C;
  --laranja-d:#B85C2E;
  --verde:    #336C66;
  --verde-d:  #275450;
  --azul:     #4A6FA5;
  --azul-d:   #3A5A8C;
  --preto:    #121615;
  --offwhite: #EDECF1;
  --amarelo:  #E6A817;
  --vermelho: #C0392B;
  --cinza:    #8A9391;

  --bg:        #EDECF1;
  --surface:   #ffffff;
  --surface-2: #F7F6F9;
  --border:    #e0dfe6;
  --text:      #121615;
  --text-2:    #5a6360;
  --shadow:    0 1px 3px rgba(18,22,21,.06), 0 6px 20px rgba(18,22,21,.05);
  --shadow-lg: 0 10px 40px rgba(18,22,21,.15);
  --radius:    14px;
  --radius-sm: 9px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 74px;
  --header-h:  72px;

  --font-title: 'Montserrat', system-ui, sans-serif;
  --font-body:  'Lato', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-title); margin: 0; font-weight: 700; color: var(--preto); }
button { font-family: var(--font-body); cursor: pointer; }
a { color: var(--azul); }
:focus-visible { outline: 3px solid rgba(74,111,165,.45); outline-offset: 2px; border-radius: 6px; }

/* ---------- SPLASH ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #121615 0%, #275450 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo { width: 260px; max-width: 70vw; filter: brightness(0) invert(1); animation: pulse 1.8s ease-in-out infinite; }
.splash-bar { width: 220px; max-width: 60vw; height: 5px; background: rgba(255,255,255,.15); border-radius: 99px; margin: 26px auto 14px; overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 40%; background: var(--laranja); border-radius: 99px; animation: load 1.2s ease-in-out infinite; }
.splash-text { color: rgba(255,255,255,.8); font-size: 14px; letter-spacing: .3px; }
@keyframes load { 0%{transform:translateX(-120%)} 100%{transform:translateX(320%)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

/* ---------- LAYOUT ---------- */
.app { display: flex; min-height: 100vh; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--preto);
  color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: width .25s ease, transform .25s ease;
}
.sidebar-top { display: flex; align-items: center; gap: 8px; padding: 18px 16px; position: relative; min-height: var(--header-h); }
.sidebar-logo-full { width: 150px; filter: brightness(0) invert(1); }
.sidebar-logo-mini { width: 40px; display: none; }
.btn-collapse {
  margin-left: auto; background: rgba(255,255,255,.08); color: #fff; border: none;
  width: 30px; height: 30px; border-radius: 8px; font-size: 14px; display: grid; place-items: center;
  transition: background .2s;
}
.btn-collapse:hover { background: rgba(255,255,255,.18); }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 11px 13px; border: none;
  background: transparent; color: rgba(255,255,255,.72); border-radius: var(--radius-sm);
  font-size: 14.5px; text-align: left; width: 100%; transition: background .18s, color .18s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--verde); color: #fff; font-weight: 600; }
.nav-ic { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-slogan { color: rgba(255,255,255,.4); font-size: 12px; font-style: italic; }

/* Sidebar recolhida */
.app.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app.collapsed .sidebar-logo-full { display: none; }
.app.collapsed .sidebar-logo-mini { display: block; margin: 0 auto; }
.app.collapsed .btn-collapse { position: absolute; top: 8px; right: 8px; }
.app.collapsed .nav-tx { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 12px; }
.app.collapsed .sidebar-foot { display: none; }
.app.collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* ---------- MAIN ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); transition: margin-left .25s ease; min-width: 0; }

/* ---------- HEADER ---------- */
.header {
  height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  position: sticky; top: 0; z-index: 60;
}
.header-title h1 { font-size: 18px; font-weight: 700; }
.header-title .brand { color: var(--laranja); }
.header-date { font-size: 12.5px; color: var(--text-2); margin-top: 1px; text-transform: capitalize; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-ic { position: absolute; left: 12px; font-size: 13px; opacity: .6; pointer-events: none; }
.search-wrap input {
  width: 260px; max-width: 30vw; padding: 9px 12px 9px 34px; border: 1px solid var(--border);
  border-radius: 99px; background: var(--surface-2); font-size: 14px; font-family: var(--font-body);
  transition: border .2s, box-shadow .2s;
}
.search-wrap input:focus { border-color: var(--azul); background: #fff; box-shadow: 0 0 0 3px rgba(74,111,165,.12); outline: none; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface); width: 40px; height: 40px;
  border-radius: 11px; font-size: 17px; display: grid; place-items: center; color: var(--text);
  transition: background .18s, border .18s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--cinza); }
.notif-wrap { position: relative; }
.badge {
  position: absolute; top: -4px; right: -4px; background: var(--laranja); color: #fff;
  font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 99px;
  display: grid; place-items: center; padding: 0 4px; font-family: var(--font-title);
}
.notif-panel {
  position: absolute; right: 0; top: 48px; width: 340px; max-width: 88vw; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 200; max-height: 440px; overflow-y: auto; padding: 6px;
}
.notif-item { padding: 11px 12px; border-radius: 10px; display: flex; gap: 10px; align-items: flex-start; }
.notif-item:hover { background: var(--surface-2); cursor: pointer; }
.notif-item .dot { width: 9px; height: 9px; border-radius: 99px; margin-top: 5px; flex-shrink: 0; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-2); }

.sync-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--text-2); font-family: var(--font-title); }
.sync-badge:hover { border-color: var(--cinza); }
.sync-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--cinza); flex-shrink: 0; }
.sync-badge.on .sync-dot { background: var(--verde); box-shadow: 0 0 0 3px rgba(51,108,102,.18); }
.sync-badge.on { color: var(--verde); }
.sync-badge.busy .sync-dot { background: var(--amarelo); animation: pulse 1s infinite; }
.sync-badge.busy { color: #a9791a; }
.sync-badge.err .sync-dot { background: var(--vermelho); }
.sync-badge.err { color: var(--vermelho); }
.sync-badge.login .sync-dot { background: var(--azul); }
.sync-badge.login { color: var(--azul); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.user-avatar { width: 32px; height: 32px; border-radius: 99px; background: var(--verde); color: #fff; display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; font-size: 13px; }
.user-name { font-size: 14px; font-weight: 600; }

/* ---------- BOTÕES ---------- */
.btn { border: 1px solid transparent; border-radius: 11px; padding: 10px 16px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; transition: filter .18s, background .18s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--laranja); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--cinza); }
.btn-danger { background: var(--vermelho); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-success { background: var(--verde); color: #fff; }
.btn-success:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.only-mobile { display: none; }

/* ---------- CONTENT / VIEWS ---------- */
.content { padding: 26px; max-width: 1500px; margin: 0 auto; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from{opacity:0; transform: translateY(6px)} to{opacity:1; transform:none} }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h2 { font-size: 24px; }
.head-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.greeting-row { margin-bottom: 20px; }
.greeting { font-size: 26px; }
.greeting-sub { color: var(--text-2); margin-top: 3px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi-grid.small { grid-template-columns: repeat(4, 1fr); }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 15px; box-shadow: var(--shadow); cursor: pointer; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s; text-align: left;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi::before { content:''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--azul)); }
.kpi-ic { font-size: 20px; }
.kpi-num { font-family: var(--font-title); font-size: 30px; font-weight: 800; line-height: 1; margin: 8px 0 4px; color: var(--preto); }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kpi.active { outline: 2px solid var(--accent, var(--azul)); }

/* ---------- PANELS ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.panel-head h3 { font-size: 16px; }
.pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 3px 11px; font-size: 12.5px; font-weight: 700; color: var(--text-2); font-family: var(--font-title); }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
.mini-select { border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; font-family: var(--font-body); font-size: 13px; background: var(--surface); color: var(--text); }

/* ---------- ATENÇÃO DE HOJE ---------- */
.attention { border-left: 5px solid var(--laranja); }
.attention-list { display: flex; flex-direction: column; gap: 12px; }
.att-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 15px; background: var(--surface-2); }
.att-card.pri-urgente { border-left: 4px solid var(--vermelho); }
.att-card.pri-alta { border-left: 4px solid var(--laranja); }
.att-card.pri-media { border-left: 4px solid var(--azul); }
.att-card.pri-baixa { border-left: 4px solid var(--cinza); }
.att-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.att-title { font-family: var(--font-title); font-weight: 700; font-size: 15.5px; }
.att-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin: 6px 0; }
.att-orient { font-size: 14px; margin: 8px 0; }
.att-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.empty-state { text-align: center; padding: 30px 16px; color: var(--text-2); }
.empty-state .em-ic { font-size: 34px; display: block; margin-bottom: 8px; }

/* ---------- BADGES / TAGS ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; font-family: var(--font-title); white-space: nowrap; }
.tag .tg-ic { font-size: 11px; }
.tag-cat { background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); }
.status-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.due { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; font-family: var(--font-title); }
.due-atrasado { background: #fbeae8; color: var(--vermelho); }
.due-hoje { background: #fbeadf; color: var(--laranja-d); }
.due-amanha { background: #fdf3e0; color: #a9791a; }
.due-breve { background: #fdf6e3; color: #a9791a; }
.due-futuro { background: #eaf0f7; color: var(--azul); }
.due-concluido { background: #e5efec; color: var(--verde); }
.due-neutro { background: #eef0ef; color: var(--cinza); }

/* ---------- PRÓXIMAS DATAS ---------- */
.proximas-list { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; }
.prox-card { display: flex; gap: 13px; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; transition: border .15s, box-shadow .15s; cursor: pointer; background: var(--surface); }
.prox-card:hover { border-color: var(--cinza); box-shadow: var(--shadow); }
.prox-date { flex-shrink: 0; width: 58px; text-align: center; border-right: 1px solid var(--border); padding-right: 12px; }
.prox-date .d { font-family: var(--font-title); font-size: 22px; font-weight: 800; color: var(--azul); line-height: 1; }
.prox-date .m { font-size: 11px; text-transform: uppercase; color: var(--text-2); font-weight: 700; }
.prox-date .w { font-size: 10.5px; color: var(--text-2); text-transform: capitalize; }
.prox-main { flex: 1; min-width: 0; }
.prox-title { font-family: var(--font-title); font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.prox-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

/* ---------- NF BOX ---------- */
.nf-box { display: flex; flex-direction: column; gap: 12px; }
.nf-highlight { background: linear-gradient(135deg, var(--verde) 0%, var(--verde-d) 100%); color: #fff; border-radius: var(--radius-sm); padding: 15px; }
.nf-highlight .nf-lbl { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: .5px; }
.nf-highlight .nf-date { font-family: var(--font-title); font-size: 20px; font-weight: 800; margin: 3px 0 2px; }
.nf-msg { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px; font-size: 13.5px; color: var(--text); }
.nf-colabs { display: flex; flex-direction: column; gap: 7px; }
.nf-colab { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; }
.nf-colab .nm { flex: 1; font-weight: 600; font-size: 14px; }
.nf-colab.done { background: #e5efec; border-color: #bfd8d1; }
.chk { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--cinza); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; background: #fff; }
.chk.on { background: var(--verde); border-color: var(--verde); color: #fff; }
.nf-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- TABELA ---------- */
.table-filters, .cal-filters, .table-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.flt { display: flex; flex-direction: column; gap: 3px; }
.flt label { font-size: 11px; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.flt select, .flt input { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-family: var(--font-body); font-size: 13px; background: var(--surface); min-width: 140px; color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 900px; }
.data-table thead th { background: var(--surface-2); text-align: left; padding: 12px 12px; font-family: var(--font-title); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-2); border-bottom: 2px solid var(--border); cursor: pointer; white-space: nowrap; position: sticky; top: 0; }
.data-table thead th:hover { color: var(--azul); }
.data-table thead th .sort-ar { opacity: .5; font-size: 10px; }
.data-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr.done td { opacity: .62; }
.cell-title { font-weight: 600; max-width: 260px; }
.cell-actions { display: flex; gap: 5px; white-space: nowrap; }
.row-btn { border: 1px solid var(--border); background: var(--surface); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.row-btn:hover { background: var(--surface-2); border-color: var(--cinza); }
.table-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--text-2); font-size: 13px; }
.pager { display: flex; gap: 5px; }
.pager button { border: 1px solid var(--border); background: var(--surface); min-width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
.pager button.active { background: var(--azul); color: #fff; border-color: var(--azul); }
.pager button:disabled { opacity: .4; cursor: default; }

/* editable inline select */
.inline-status { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-family: var(--font-body); font-weight: 700; background: var(--surface); }

/* ---------- CALENDÁRIO ---------- */
.cal-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; }
.seg-btn { border: none; background: transparent; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg-btn.active { background: var(--surface); color: var(--preto); box-shadow: var(--shadow); }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { font-family: var(--font-title); font-weight: 700; font-size: 16px; text-transform: capitalize; min-width: 150px; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.leg-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.leg-dot { width: 11px; height: 11px; border-radius: 4px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-family: var(--font-title); font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; padding: 6px 0; }
.cal-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-height: 108px; padding: 7px; cursor: pointer; transition: border .15s, box-shadow .15s; position: relative; overflow: hidden; }
.cal-cell:hover { border-color: var(--azul); box-shadow: var(--shadow); }
.cal-cell.other { opacity: .45; }
.cal-cell.weekend { background: var(--surface-2); }
.cal-cell.holiday { background: #f0efe6; }
.cal-cell.today { border: 2px solid var(--laranja); }
.cal-daynum { font-family: var(--font-title); font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.cal-daynum .cnt { background: var(--azul); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 6px; height: 16px; display: grid; place-items: center; }
.cal-hol { font-size: 10px; color: var(--laranja-d); font-weight: 700; margin-top: 2px; }
.cal-ev { font-size: 11px; margin-top: 3px; padding: 2px 5px; border-radius: 5px; background: var(--c, var(--azul)); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 10.5px; color: var(--text-2); margin-top: 3px; font-weight: 700; }
.cal-cell.drop-target { border: 2px dashed var(--laranja); background: #fbeadf; }

/* semana/dia */
.cal-list-day { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.cal-list-head { background: var(--surface-2); padding: 10px 15px; font-family: var(--font-title); font-weight: 700; display: flex; justify-content: space-between; text-transform: capitalize; }
.cal-list-body { padding: 6px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- CHIPS (feriados) ---------- */
.chips-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; }
.chip-row { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px; }
.chip-row .cd { font-family: var(--font-title); font-weight: 800; color: var(--azul); font-size: 15px; min-width: 92px; }
.chip-row .cn { font-weight: 600; }
.chip-row .cw { margin-left: auto; font-size: 12px; color: var(--text-2); text-transform: capitalize; }

/* ---------- RESPONSÁVEIS ---------- */
.resp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.resp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.resp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.resp-top { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.resp-avatar { width: 46px; height: 46px; border-radius: 12px; background: var(--verde); color: #fff; display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; font-size: 17px; flex-shrink: 0; }
.resp-name { font-family: var(--font-title); font-weight: 700; font-size: 16px; }
.resp-role { font-size: 12.5px; color: var(--text-2); }
.resp-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; text-align: center; }
.resp-stat { background: var(--surface-2); border-radius: 9px; padding: 9px 4px; }
.resp-stat .n { font-family: var(--font-title); font-weight: 800; font-size: 19px; }
.resp-stat .l { font-size: 10.5px; color: var(--text-2); }
.resp-next { margin-top: 12px; font-size: 12.5px; color: var(--text-2); }

/* ---------- CHARTS ---------- */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.charts-grid .wide { grid-column: 1 / -1; }
.chart { min-height: 220px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-label { width: 140px; font-size: 12.5px; text-align: right; color: var(--text-2); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: var(--surface-2); border-radius: 99px; height: 22px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 99px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font-title); min-width: 24px; transition: width .5s ease; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; border-radius: 99px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; }
.dl-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dl-item .sw { width: 12px; height: 12px; border-radius: 4px; }
.dl-item .vv { margin-left: auto; font-weight: 700; font-family: var(--font-title); }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.mb-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.mb-stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; }
.mb-seg { width: 100%; }
.mb-lbl { font-size: 10.5px; color: var(--text-2); font-family: var(--font-title); }

/* ---------- CONFIG ---------- */
.cfg-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.cfg-section h3 { margin-bottom: 6px; }
.cfg-section p.hint { color: var(--text-2); font-size: 13px; margin: 0 0 14px; }
.cfg-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cfg-row label { font-weight: 600; min-width: 220px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-del { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 6px 8px 6px 13px; font-size: 13px; }
.tag-del button { border: none; background: var(--vermelho); color: #fff; width: 20px; height: 20px; border-radius: 99px; font-size: 12px; }

/* ---------- COLABORADORES / DADOS BANCÁRIOS ---------- */
.bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bank-card { border: 1px solid var(--border); border-left: 4px solid var(--bc, var(--azul)); border-radius: var(--radius-sm); padding: 14px; background: var(--surface-2); }
.bank-h { font-family: var(--font-title); font-weight: 700; font-size: 13.5px; color: var(--bc, var(--azul)); margin-bottom: 8px; }
.bank-line { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.bank-line:last-of-type { border-bottom: none; }
.bank-line .bk { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.bank-line .bv { text-align: right; font-weight: 600; word-break: break-word; }
.bank-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.colab-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #8A5A3C10; cursor: pointer; margin-top: 6px; transition: background .15s, border .15s; }
.colab-link:hover { background: #8A5A3C1f; border-color: #8A5A3C; }

/* ---------- MODAL ---------- */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(18,22,21,.5); backdrop-filter: blur(2px); }
.modal-card { position: relative; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 640px; max-width: 100%; z-index: 1; animation: pop .2s ease; margin: auto; }
.modal-card.small { width: 420px; }
.modal-card.wide { width: 820px; }
@keyframes pop { from{opacity:0; transform: scale(.97) translateY(8px)} to{opacity:1; transform:none} }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- FORM ---------- */
.form-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.fstep { flex: 1; text-align: center; padding: 8px; border-radius: 9px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--text-2); font-family: var(--font-title); border: 1px solid var(--border); }
.fstep.active { background: var(--azul); color: #fff; border-color: var(--azul); }
.fstep.done { background: var(--verde); color: #fff; border-color: var(--verde); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; }
.field label .req { color: var(--vermelho); }
.field input, .field select, .field textarea { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: var(--font-body); font-size: 14px; background: var(--surface); color: var(--text); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(74,111,165,.12); outline: none; }
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 11.5px; color: var(--text-2); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--vermelho); }
.fstep-page { display: none; }
.fstep-page.active { display: block; }
.switch-row { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; width: 46px; height: 26px; background: var(--cinza); border-radius: 99px; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch.on { background: var(--verde); }
.switch::after { content:''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 99px; transition: left .2s; }
.switch.on::after { left: 23px; }

/* detail view */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 8px 0 16px; }
.detail-item .k { font-size: 11.5px; text-transform: uppercase; color: var(--text-2); font-weight: 700; letter-spacing: .3px; }
.detail-item .v { font-size: 14.5px; margin-top: 2px; }
.detail-full { grid-column: 1 / -1; }
.hist-list { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.hist-item { font-size: 12.5px; color: var(--text-2); padding: 4px 0; display: flex; gap: 8px; }
.hist-item .ht { font-family: var(--font-title); font-weight: 700; color: var(--text); }

/* ---------- TOASTS ---------- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 900; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--verde); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 13px 16px; min-width: 260px; max-width: 360px; display: flex; gap: 10px; align-items: flex-start; animation: slidein .25s ease; }
.toast.err { border-left-color: var(--vermelho); }
.toast.warn { border-left-color: var(--amarelo); }
.toast.info { border-left-color: var(--azul); }
.toast .tt-ic { font-size: 17px; }
.toast .tt-msg { font-size: 13.5px; }
@keyframes slidein { from{opacity:0; transform: translateX(30px)} to{opacity:1; transform:none} }

/* ---------- TOOLTIP ---------- */
.tooltip { position: fixed; z-index: 950; background: var(--preto); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; max-width: 240px; pointer-events: none; box-shadow: var(--shadow-lg); }

/* ---------- RESPONSIVO ---------- */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
  .kpi-grid.small { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 240px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app.mobile-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .app.collapsed .main { margin-left: 0 !important; }
  .only-mobile { display: grid; }
  .btn-collapse { display: none; }
  .search-wrap input { width: 150px; }
  .header-title h1 { font-size: 15px; }
  .btn-nova .lbl-full { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .user-name { display: none; }
}
@media (max-width: 560px) {
  .kpi-grid, .kpi-grid.small { grid-template-columns: 1fr 1fr; }
  .cal-cell { min-height: 74px; }
  .cal-ev { display: none; }
  .header-actions { gap: 8px; }
  .search-wrap { display: none; }
}

/* impressão / PDF fallback */
@media print {
  .sidebar, .header, .head-tools, .table-filters, .pager { display: none !important; }
  .main { margin: 0 !important; }
  .panel, .kpi { box-shadow: none; }
}
