/* Desenvolvimento: Jhonatan Cieslak, jhonatan.cieslak94@gmail.com, +351 935 834 214 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --navy: #0F172A;
  --navy-mid: #1E293B;
  --text: #1E293B;
  --muted: #64748B;
  --light: #F8FAFC;
  --border: #E2E8F0;
  --white: #FFFFFF;
  --green: #16A34A;
  --green-soft: #DCFCE7;
  --red: #DC2626;
  --red-soft: #FEE2E2;
  --amber: #D97706;
  --accent: #38BDF8;
  --radius: 10px;
  --radius-lg: 20px;
  --shadow: 0 2px 8px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--light);
  line-height: 1.5;
}

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

/* ── Layout autenticado ── */
.app-shell { display: flex; min-height: 100vh; position: relative; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--navy);
  color: #E2E8F0;
  padding: 1.25rem 0;
  transition: width .18s ease;
  overflow-x: hidden;
}
.sidebar-brand { display: flex; align-items: center; gap: .5rem; padding: 0 1.25rem 1.5rem; }
.sidebar-brand img.sidebar-logo-full { height: 42px; transition: opacity .15s ease; }
.sidebar-logo-mark {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.06); flex-shrink: 0;
}
.sidebar-logo-mark img { height: 30px; width: 30px; }

/* Botão de encolher/expandir: fora do <aside>, irmão dele no app-shell —
   nunca é cortado pelo overflow-x:hidden do sidebar. Segue a largura do
   sidebar (250px/72px) via left, com a mesma transição. */
.sidebar-toggle-btn {
  position: absolute; top: 1.6rem; left: 250px; transform: translate(-50%, -50%); z-index: 5;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: var(--navy); border: 2px solid var(--light); border-radius: 50%;
  color: #94A3B8; cursor: pointer; transition: left .18s ease;
}
.sidebar-toggle-btn svg { width: 14px; height: 14px; }
.sidebar-toggle-btn:hover { color: #fff; }
.sidebar.collapsed ~ .sidebar-toggle-btn { left: 72px; }
.sidebar nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar nav a, .sidebar nav summary {
  display: flex; align-items: center; padding: .65rem 1.25rem; color: #CBD5E1; cursor: pointer;
  font-size: .9rem; font-weight: 500; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav-icon { width: 22px; height: 22px; margin-right: .75rem; flex-shrink: 0; opacity: .85; transition: opacity .15s ease; }
.sidebar nav a:hover .nav-icon, .sidebar nav a.active .nav-icon, .sidebar details[open] summary .nav-icon { opacity: 1; }
.sidebar nav a:hover, .sidebar nav summary:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--blue); color: #fff; }
.sidebar details summary { list-style: none; }
.sidebar details summary::-webkit-details-marker { display: none; }
.sidebar details[open] summary { color: #fff; }
.sidebar details summary::after {
  content: ''; width: 8px; height: 8px; margin-left: auto; flex-shrink: 0;
  border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease; opacity: .6;
}
.sidebar details[open] summary::after { transform: rotate(-135deg); }

/* Submenu: expande/colapsa suavemente via grid-template-rows (sem JS) */
.sidebar details .submenu {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .22s ease;
}
.sidebar details[open] .submenu { grid-template-rows: 1fr; }
.sidebar details .submenu > ul { overflow: hidden; min-height: 0; }
.sidebar details ul a {
  padding-left: 1.25rem; font-size: .85rem; gap: .65rem;
}
.sidebar details ul a .nav-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55;
  flex-shrink: 0; margin-left: .4rem;
}
.sidebar details ul a:hover .nav-dot, .sidebar details ul a.active .nav-dot { opacity: 1; }

/* ── Sidebar encolhida ── */
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0 0 1.25rem; }
.sidebar.collapsed .sidebar-logo-full { display: none; }
.sidebar.collapsed .sidebar-logo-mark { display: flex; }
.sidebar.collapsed nav a, .sidebar.collapsed nav summary { justify-content: center; padding: .7rem 0; }
.sidebar.collapsed .nav-icon { margin-right: 0; width: 24px; height: 24px; }
.sidebar.collapsed .nav-label, .sidebar.collapsed details summary::after { display: none; }
.sidebar.collapsed details .submenu { grid-template-rows: 0fr !important; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.5rem; background: var(--white); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.topbar .user-menu { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .75rem; }

.content { padding: 1.5rem; flex: 1; }

.footer { padding: 1rem 1.5rem; font-size: .8rem; color: var(--muted); text-align: center; }

/* ── Plano e Faturação ── */
.plan-progress { height: 8px; border-radius: 999px; background: var(--light); overflow: hidden; margin: .6rem 0 .3rem; }
.plan-progress > div { height: 100%; background: var(--blue); border-radius: 999px; transition: width .3s ease; }
.plan-progress.warn > div { background: var(--amber); }
.plan-progress.danger > div { background: var(--red); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; display: flex; flex-direction: column; }
.plan-card.current { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), var(--shadow); }
.plan-card h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.plan-card .plan-price { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin: .3rem 0 .2rem; }
.plan-card .plan-alvo { color: var(--muted); font-size: .82rem; margin: 0 0 1rem; }
.plan-card ul { list-style: none; margin: 0 0 1.25rem; padding: 0; flex: 1; }
.plan-card li { display: flex; align-items: flex-start; gap: .5rem; font-size: .85rem; margin-bottom: .55rem; color: var(--text); }
.plan-card li svg { width: 15px; height: 15px; color: var(--green); flex-shrink: 0; margin-top: .1rem; }
.plan-card { position: relative; transition: transform .15s ease, box-shadow .15s ease; }
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.plan-card.popular { border-color: var(--blue); }
.plan-popular-tag {
  position: absolute; top: -11px; left: 1.25rem; background: var(--blue); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em; padding: .2rem .6rem;
  border-radius: 999px; text-transform: uppercase;
}

.plan-hero {
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--white);
  box-shadow: var(--shadow);
}
.plan-hero-icon {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.plan-hero-icon svg { width: 22px; height: 22px; }
.plan-hero-blue { border-color: rgba(37, 99, 235, .25); }
.plan-hero-blue .plan-hero-icon { background: rgba(37, 99, 235, .1); color: var(--blue); }
.plan-hero-green .plan-hero-icon { background: var(--green-soft); color: var(--green); }
.plan-hero-red .plan-hero-icon { background: var(--red-soft); color: var(--red); }
.plan-hero-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: .3rem; }
.plan-hero-text { color: var(--muted); font-size: .88rem; margin: 0; }
.plan-hero .plan-progress { max-width: 320px; }

.plan-next-charge {
  display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted);
  background: var(--light); border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: 1rem;
}
.plan-next-charge svg { width: 16px; height: 16px; color: var(--blue); flex-shrink: 0; }

.plan-empty { text-align: center; padding: 1.5rem 1rem; color: var(--muted); }
.plan-empty svg { width: 32px; height: 32px; color: var(--border); margin-bottom: .6rem; }
.plan-empty p { margin: 0; font-size: .85rem; }

.plan-trust {
  display: flex; align-items: flex-start; gap: .55rem; font-size: .78rem; color: var(--muted);
  margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--border);
}
.plan-trust svg { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; margin-top: .1rem; }

.plan-success {
  max-width: 480px; margin: 3rem auto; text-align: center; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
}
.plan-success-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem;
}
.plan-success-icon svg { width: 32px; height: 32px; }
.plan-success-mark { width: 32px; height: 32px; margin: 0 auto 1rem; display: block; opacity: .8; }
.plan-success h1 { font-size: 1.3rem; margin: 0 0 .6rem; color: var(--navy); }
.plan-success p { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }
.plan-success-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ── Dashboard ── */
.dash-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-hero h2 { margin: 0 0 .15rem; font-size: 1.35rem; color: var(--navy); }
.dash-hero p { margin: 0; color: var(--muted); font-size: .9rem; }

.dash-promo {
  position: relative; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 1px solid rgba(37, 99, 235, .18); border-radius: var(--radius-lg);
  padding: 1.1rem 3rem 1.1rem 1.25rem; margin-bottom: 1.5rem;
}
.dash-promo-icon {
  width: 42px; height: 42px; border-radius: 50%; background: var(--white); color: var(--blue);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.dash-promo-icon svg { width: 22px; height: 22px; }
.dash-promo-body { flex: 1; min-width: 220px; }
.dash-promo-body strong { display: block; color: var(--navy); font-size: .92rem; margin-bottom: .2rem; }
.dash-promo-body p { margin: 0; color: var(--muted); font-size: .82rem; }
.dash-promo-close {
  position: absolute; top: .7rem; right: .7rem; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(15, 23, 42, .06); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dash-promo-close svg { width: 14px; height: 14px; }
.dash-promo-close:hover { background: rgba(15, 23, 42, .12); }

.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }
.dash-kpi {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.15rem; position: relative; overflow: hidden;
}
.dash-kpi::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
}
.dash-kpi-blue::before { background: var(--blue); }
.dash-kpi-green::before { background: var(--green); }
.dash-kpi-amber::before { background: var(--amber); }
.dash-kpi-red::before { background: var(--red); }
.dash-kpi-icon {
  width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; margin-bottom: .6rem;
}
.dash-kpi-icon svg { width: 18px; height: 18px; }
.dash-kpi-blue .dash-kpi-icon { background: rgba(37, 99, 235, .1); color: var(--blue); }
.dash-kpi-green .dash-kpi-icon { background: var(--green-soft); color: var(--green); }
.dash-kpi-amber .dash-kpi-icon { background: rgba(217, 119, 6, .12); color: var(--amber); }
.dash-kpi-red .dash-kpi-icon { background: var(--red-soft); color: var(--red); }
.dash-kpi .kpi-value-of { font-size: 1rem; font-weight: 500; color: var(--muted); }

/* ── Header: notificações + avatar ── */
.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 8px; border: none;
  background: transparent; color: var(--muted); display: flex; align-items: center;
  justify-content: center; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--light); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-badge {
  position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: .62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: .5rem; background: transparent; border: none;
  cursor: pointer; padding: .3rem .5rem .3rem .3rem; border-radius: 999px;
}
.user-menu-trigger:hover { background: var(--light); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
}
.user-menu-trigger .user-name { font-size: .85rem; color: var(--text); font-weight: 500; }
.user-menu-trigger .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s ease; }
.user-menu.open .user-menu-trigger .chev { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute; top: calc(100% + .5rem); right: 0; min-width: 210px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15,23,42,.12); padding: .4rem; z-index: 20;
  display: none; flex-direction: column;
}
.user-menu.open .user-menu-dropdown { display: flex; }
.user-menu-dropdown a {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 6px;
  color: var(--text); font-size: .87rem; font-weight: 500;
}
.user-menu-dropdown a:hover { background: var(--light); text-decoration: none; }
.user-menu-dropdown a svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.user-menu-dropdown hr { border: none; border-top: 1px solid var(--border); margin: .35rem .2rem; }
.user-menu-dropdown a.danger { color: #991B1B; }
.user-menu-dropdown a.danger svg { color: #991B1B; }

/* ── Flash messages ── */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.flash-danger { background: var(--red-soft); color: #991B1B; }
.flash-success { background: var(--green-soft); color: #166534; }
.flash-info { background: #DBEAFE; color: #1E3A8A; }

/* ── Cards / KPIs ── */
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; } }

.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.1rem 1.25rem; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; }

.kpi-label { font-size: .8rem; color: var(--muted); margin: 0 0 .25rem; }
.kpi-value { font-size: 1.8rem; font-weight: 700; margin: 0; color: var(--navy); }

/* ── Tabela ── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: var(--light); }
table input[type="time"] {
  padding: .4rem .55rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: .85rem; color: var(--text); background: var(--white);
}
table input[type="time"]:disabled { background: var(--light); color: var(--muted); }
table input[type="time"]:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
table input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--blue); cursor: pointer; }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-green { background: var(--green-soft); color: #166534; }
.badge-red { background: var(--red-soft); color: #991B1B; }
.badge-gray { background: #F1F5F9; color: var(--muted); }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-blue { background: #DBEAFE; color: #1E3A8A; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-teal { background: #CCFBF1; color: #0F766E; }

/* ── Relatórios ── */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .report-grid { grid-template-columns: 1fr; } }
.report-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.report-card-head h3 { margin: 0; font-size: 1rem; }
.report-card p { font-size: .85rem; color: var(--muted); margin: 0 0 .8rem; min-height: 2.6em; }
.report-card-disabled { opacity: .65; }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; font-family: inherit;
  padding: .5rem 1rem; border-radius: var(--radius); border: 1px solid transparent;
  font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: var(--white); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: var(--red-soft); color: #991B1B; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-icon-only { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; }
.row-actions { display: inline-flex; gap: .35rem; }
.btn-voltar { border-color: var(--blue); color: var(--blue); font-weight: 600; }
.btn-voltar:hover { background: var(--blue); color: #fff; }

.actions-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: .9rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.field .hint-danger { color: #991B1B; font-weight: 600; }
.checkbox-field { display: flex; align-items: center; gap: .5rem; }
.checkbox-field input { width: auto; }

.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }
.breadcrumb a { color: var(--muted); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

.list-search {
  display: flex; align-items: center; gap: .6rem; height: 38px; padding: 0 .9rem; margin-bottom: 1rem;
  border: 1px solid var(--border); border-radius: 10px; color: var(--muted); max-width: 320px; box-sizing: border-box;
}
.list-search input {
  flex: 1; border: none; outline: none; font-size: .9rem; background: transparent; color: var(--text);
}
.list-icon { margin-right: .5rem; color: var(--muted); }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem;
  font-size: .85rem; color: var(--muted);
}
.pagination .disabled { pointer-events: none; opacity: .4; }

/* ── Toolbar de filtros (datatable) ── */
.list-toolbar {
  display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap;
  padding: .9rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--light);
}
.list-toolbar .field { margin-bottom: 0; min-width: 160px; max-width: 200px; flex: 1; }
.list-toolbar .field-search { flex: 1.4; min-width: 220px; max-width: 320px; }
.list-toolbar .field label { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.list-toolbar .field select {
  width: 100%; height: 38px; padding: 0 .7rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--white); font-family: inherit; font-size: .9rem;
}
.list-toolbar .field select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.list-toolbar .field-search-input {
  display: flex; align-items: center; gap: .5rem; height: 38px; padding: 0 .7rem; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--white);
}
.list-toolbar .field-search-input input { flex: 1; border: none; outline: none; background: transparent; font-size: .9rem; height: 100%; }
.list-toolbar .field-search-input i { color: var(--muted); }
.list-toolbar-actions { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.list-toolbar-actions .btn { height: 38px; }

/* ── Secções de formulário ── */
.form-section { margin-bottom: 1.5rem; }
.form-section:last-of-type { margin-bottom: 0; }
.form-section-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 0 0 .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .5rem;
}
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
.field-icon-input {
  display: flex; align-items: center; gap: .5rem;
}
.field-icon-input i { color: var(--muted); width: 1rem; text-align: center; flex-shrink: 0; }
.field-icon-input input, .field-icon-input select {
  border: 1px solid var(--border); border-radius: var(--radius); outline: none;
  padding: .55rem .7rem; flex: 1; min-width: 0; font-family: inherit; font-size: .9rem; background: var(--white);
}
.field-icon-input input:focus, .field-icon-input select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

.field-icon-input-with-action { gap: .4rem; }
.field-quick-add {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--white); color: var(--blue); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
}
.field-quick-add:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Modal de criação rápida ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 360px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal-box h3 { margin: 0 0 1rem; font-size: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }

.pwa-picagem-modal { text-align: center; }
.pwa-picagem-modal-icon {
  width: 56px; height: 56px; margin: 0 auto .9rem; border-radius: 50%;
  background: var(--green-soft); color: var(--green); font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
}
.pwa-picagem-modal-icon.erro { background: var(--red-soft); color: var(--red); }
.pwa-picagem-modal h3 { text-align: center; }
.pwa-picagem-modal p { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }

/* ── Select buscável (colaborador/local — listas longas) ── */
.searchable-select { position: relative; }
.searchable-select-hidden { display: none !important; }
.searchable-select-input {
  width: 100%; height: 38px; padding: 0 .7rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: inherit; font-size: .9rem; background: var(--white); color: var(--text);
  box-sizing: border-box;
}
.searchable-select-input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.searchable-select-list {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  max-height: 240px; overflow-y: auto; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.searchable-select.open .searchable-select-list { display: block; }
.searchable-select-item { padding: .55rem .8rem; font-size: .88rem; cursor: pointer; color: var(--text); }
.searchable-select-item:hover, .searchable-select-item.active { background: var(--light); color: var(--text); }
.searchable-select-empty { padding: .55rem .8rem; font-size: .85rem; color: var(--muted); }

/* Dentro de .field-icon-input o combobox ocupa o espaço do select nativo */
.field-icon-input .searchable-select { flex: 1; min-width: 0; }
.field-icon-input .searchable-select-input { height: auto; border: 1px solid var(--border); padding: .55rem .7rem; }
.field-icon-input .searchable-select-input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* Dentro do toolbar de filtros, mesma altura dos outros campos */
.list-toolbar .searchable-select-input { height: 38px; }

/* ── Quiosque ── */
.kiosk-wrap {
  min-height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--navy); padding: 1rem; box-sizing: border-box;
}
.kiosk-card { background: var(--white); border-radius: 20px; padding: 2.5rem 2rem; max-width: 440px; width: 100%; text-align: center; }
.kiosk-logo { height: 52px; margin-bottom: 1rem; max-width: 220px; object-fit: contain; }
.kiosk-card h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 1.5rem; color: var(--muted); }

.kiosk-pin-display { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.75rem; }
.kiosk-pin-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: transparent;
  transition: background .1s ease, border-color .1s ease;
}
.kiosk-pin-dot.filled { background: var(--kiosk-cor, var(--blue)); border-color: var(--kiosk-cor, var(--blue)); }

.kiosk-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.kiosk-key {
  font-size: 1.6rem; font-weight: 700; padding: 1.1rem 0; border-radius: 14px; border: none;
  background: var(--light); color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .1s ease, transform .05s ease;
}
.kiosk-key:active { transform: scale(.95); background: var(--border); }
.kiosk-key-action { font-size: .95rem; background: var(--red-soft); color: #991B1B; }
.kiosk-key-confirm { background: var(--kiosk-cor, var(--blue)); color: #fff; font-size: 1.8rem; }
.kiosk-key-confirm:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.kiosk-admin-wrap { min-height: 100vh; background: var(--light); padding: 1.5rem; box-sizing: border-box; }
.kiosk-admin-header { display: flex; align-items: center; justify-content: space-between; max-width: 560px; margin: 0 auto 1.25rem; }
.kiosk-admin-header h1 { font-size: 1.25rem; margin: 0; color: var(--text); }
.kiosk-back-link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.kiosk-back-link:hover { color: var(--blue); }

.kiosk-admin-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 560px; margin: 0 auto 1.25rem; padding: 1.5rem;
}
.kiosk-admin-card h2 { font-size: 1rem; margin: 0 0 .75rem; color: var(--text); }
.kiosk-admin-status { font-weight: 600; margin: 0 0 .5rem; }
.kiosk-admin-status.ok { color: var(--green); }
.kiosk-admin-status.off { color: var(--red); }
.kiosk-admin-hint { color: var(--muted); font-size: .85rem; margin: 0 0 .75rem; }

.kiosk-admin-icon {
  position: fixed; top: 1rem; right: 1rem; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff !important; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; text-decoration: none !important; z-index: 5; border: none; cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.kiosk-admin-icon:hover { background: rgba(255,255,255,.22); transform: rotate(45deg); }
.kiosk-admin-icon:active { transform: rotate(45deg) scale(.9); }

@keyframes kiosk-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.kiosk-fade-in { animation: kiosk-fade-in .35s ease both; }
.kiosk-admin-wrap .kiosk-admin-card { animation: kiosk-fade-in .4s ease both; }
.kiosk-admin-wrap .kiosk-admin-card:nth-child(2) { animation-delay: .05s; }
.kiosk-admin-wrap .kiosk-admin-card:nth-child(3) { animation-delay: .1s; }
.kiosk-admin-wrap .kiosk-admin-card:nth-child(4) { animation-delay: .15s; }

.kiosk-btn-cadastrar-facial { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .75rem; }

.toast, .kiosk-toast {
  position: fixed; left: 50%; bottom: -80px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: .8rem 1.4rem; border-radius: 10px;
  font-size: .9rem; box-shadow: var(--shadow); transition: bottom .25s ease; z-index: 200;
  max-width: 90vw;
}
.toast.show, .kiosk-toast.show { bottom: 1.5rem; }
.toast.erro, .kiosk-toast.erro { background: var(--red); }

.kiosk-facial-toggle { margin-top: 1.25rem; background: none; border: none; color: var(--muted); font-size: .85rem; text-decoration: underline; cursor: pointer; }

.kiosk-facial-block { display: none; flex-direction: column; align-items: center; }
.kiosk-facial-block.visivel { display: flex; }
.kiosk-facial-block video { width: 100%; border-radius: 14px; background: #000; margin-bottom: 1rem; }
.kiosk-facial-status { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; min-height: 1.2em; }

.kiosk-overlay {
  position: fixed; inset: 0; background: var(--navy); display: none; align-items: center; justify-content: center;
  flex-direction: column; text-align: center; padding: 2rem; box-sizing: border-box; z-index: 10;
}
.kiosk-overlay.show { display: flex; }
.kiosk-overlay img { width: 220px; max-width: 60vw; margin-bottom: 1.5rem; }
.kiosk-overlay h2 { color: #fff; font-size: 1.4rem; margin: 0 0 .5rem; }
.kiosk-overlay p { color: rgba(255,255,255,.75); font-size: 1rem; margin: 0; }
.kiosk-overlay .btn { margin-top: 1.5rem; }

/* ── Login / Registo ── */
.auth-wrap { min-height: 100vh; display: flex; background: var(--white); }
.auth-side {
  flex: 1; position: relative; overflow: hidden;
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff; display: none;
  align-items: center; justify-content: center; padding: 3.5rem;
}
.auth-side::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(155deg, rgba(0,0,0,.9) 0%, transparent 65%);
}
.auth-side::after {
  content: ''; position: absolute; left: -180px; bottom: -220px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(56,189,248,.16), transparent 72%);
}
.auth-side > div { position: relative; z-index: 1; max-width: 480px; }
.auth-side-accent {
  position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--accent, #38BDF8) 0%, var(--blue) 55%, transparent 100%);
}
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 2.75rem; }
.auth-brand img { height: 88px; }
.auth-side h2 { font-size: 1.65rem; font-weight: 700; margin: 0 0 .6rem; letter-spacing: -.01em; }
.auth-side p { color: #B9C2D9; font-size: .98rem; margin: 0; max-width: 380px; }
.auth-side-illustration { height: auto !important; width: 100%; max-width: 460px; margin: 2.5rem 0 0 !important; opacity: .95; }
.auth-trust-row { display: flex; gap: 1rem; margin-top: 2.25rem; flex-wrap: wrap; }
.auth-trust-row span {
  display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: #CBD5E1; font-weight: 600;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: .4rem .85rem;
}
.auth-trust-row svg { width: 14px; height: 14px; color: #4ADE80; flex-shrink: 0; }
@media (min-width: 900px) { .auth-side { display: flex; } }

.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form { max-width: 400px; width: 100%; }
.auth-form-logo { display: flex; align-items: center; gap: .5rem; margin-bottom: 2rem; }
.auth-form-logo img { height: 30px; }
@media (min-width: 900px) { .auth-form-logo { display: none; } }
.auth-form h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 .35rem; letter-spacing: -.02em; color: var(--navy); }
.auth-form .auth-sub { color: var(--muted); font-size: .92rem; margin: 0 0 1.75rem; }
.auth-form .field input {
  padding: .75rem .9rem; border-color: #D9E0EA; box-shadow: 0 1px 2px rgba(15,23,42,.03);
  transition: border-color .15s, box-shadow .15s;
}
.auth-form .field input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
.auth-form .btn-primary {
  padding: .8rem 1rem; font-size: .94rem; font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 8px 20px rgba(37,99,235,.25);
}
.auth-form .btn-primary:hover { box-shadow: 0 10px 24px rgba(37,99,235,.32); }
.auth-footer-link { margin-top: 1.75rem; font-size: .87rem; color: var(--muted); text-align: center; }

/* ── IA: chat ── */
.chat-shell { display: flex; gap: 1.25rem; height: calc(100vh - 220px); min-height: 480px; }
.chat-sidebar {
  width: 240px; flex-shrink: 0; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.chat-sidebar-head { padding: .9rem; border-bottom: 1px solid var(--border); }
.chat-list { flex: 1; overflow-y: auto; padding: .5rem; }
.chat-list-item {
  display: flex; align-items: center; gap: .4rem; padding: .55rem .6rem; border-radius: 8px;
  font-size: .85rem; color: var(--text); margin-bottom: .2rem;
}
.chat-list-item:hover { background: var(--light); text-decoration: none; }
.chat-list-item.active { background: var(--blue-soft, #DBEAFE); color: var(--blue-dark); font-weight: 600; }
.chat-list-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-item button { background: none; border: none; color: var(--muted); cursor: pointer; padding: .2rem; flex-shrink: 0; border-radius: 4px; }
.chat-list-item button:hover { color: var(--red); background: var(--red-soft); }
.chat-list-item button svg { width: 14px; height: 14px; display: block; }
.chat-empty-list { padding: 1rem .6rem; font-size: .82rem; color: var(--muted); }

.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.chat-bubble-row { display: flex; gap: .6rem; align-items: flex-start; }
.chat-bubble-row.user { justify-content: flex-end; }
.chat-bubble { max-width: 72%; padding: .7rem 1rem; border-radius: 14px; font-size: .9rem; white-space: pre-wrap; line-height: 1.5; }
.chat-bubble-row.user .chat-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-row.assistant .chat-bubble { background: var(--light); color: var(--text); border-bottom-left-radius: 4px; }
.chat-feedback { display: flex; gap: .3rem; margin-top: .35rem; }
.chat-feedback button {
  background: none; border: 1px solid var(--border); border-radius: 6px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
}
.chat-feedback button svg { width: 14px; height: 14px; }
.chat-feedback button.active-util { background: var(--green-soft); border-color: var(--green); color: #166534; }
.chat-feedback button.active-nao_util { background: var(--red-soft); border-color: var(--red); color: #991B1B; }
.chat-input-bar { border-top: 1px solid var(--border); padding: .9rem; display: flex; gap: .5rem; }
.chat-input-bar input { flex: 1; }
.chat-empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; color: var(--muted); }

.ia-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: linear-gradient(120deg, #0B6E75 0%, #0E4F55 100%); color: #fff;
  border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; overflow: hidden;
}
.ia-hero-text { max-width: 65%; }
.ia-hero-badge {
  display: inline-flex; align-items: center; gap: .35rem; background: rgba(255,255,255,.15);
  padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600; margin-bottom: .6rem;
}
.ia-hero-text h2 { margin: 0 0 .35rem; font-size: 1.4rem; color: #fff; }
.ia-hero-text p { margin: 0; font-size: .88rem; color: rgba(255,255,255,.85); }
.ia-hero-img { width: 150px; height: auto; flex-shrink: 0; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
@media (max-width: 700px) { .ia-hero-img { display: none; } .ia-hero-text { max-width: 100%; } }

.ia-card-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 7px; margin-right: .5rem; font-size: .85rem; color: #fff;
}
.ia-card-amber .ia-card-icon, .ia-card-amber { border-top: 3px solid #D97706; }
.ia-card-amber .ia-card-icon { background: #D97706; }
.ia-card-teal { border-top: 3px solid #0B6E75; }
.ia-card-teal .ia-card-icon { background: #0B6E75; }
.ia-card-red { border-top: 3px solid #DC2626; }
.ia-card-red .ia-card-icon { background: #DC2626; }
.ia-card-blue { border-top: 3px solid #2563EB; }
.ia-card-blue .ia-card-icon { background: #2563EB; }
.ia-card-purple { border-top: 3px solid #7C3AED; }
.ia-card-purple .ia-card-icon { background: #7C3AED; }

/* Cartões com destaque de cor no topo + ícone — mesmo sistema visual do
   dashboard IA, reusado em qualquer tela (ex.: Administração > Configurações). */
.card-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 7px; margin-right: .5rem; font-size: .85rem; color: #fff; flex-shrink: 0;
}
.card-accent-teal { border-top: 3px solid #0B6E75; }
.card-accent-teal .card-icon { background: #0B6E75; }
.card-accent-blue { border-top: 3px solid #2563EB; }
.card-accent-blue .card-icon { background: #2563EB; }
.card-accent-amber { border-top: 3px solid #D97706; }
.card-accent-amber .card-icon { background: #D97706; }
.card-accent-purple { border-top: 3px solid #7C3AED; }
.card-accent-purple .card-icon { background: #7C3AED; }
.card-accent-green { border-top: 3px solid #16A34A; }
.card-accent-green .card-icon { background: #16A34A; }
.card-accent-red { border-top: 3px solid #DC2626; }
.card-accent-red .card-icon { background: #DC2626; }
.card-section-title { display: flex; align-items: center; margin: 0 0 .3rem; font-size: .95rem; }

.mini-calendar-ano { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-top: 1rem; }
.mini-calendar-mes {
  text-align: center; padding: .6rem .3rem; border-radius: 8px; font-size: .82rem; font-weight: 600;
  background: #F1F5F9; color: var(--muted); border: 1px solid var(--border);
}
.mini-calendar-mes.tem-feriado { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
@media (max-width: 640px) { .mini-calendar-ano { grid-template-columns: repeat(4, 1fr); } }

.ia-tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.ia-tab { padding: .55rem 1rem; font-size: .88rem; color: var(--muted); border-bottom: 2px solid transparent; }
.ia-tab.active { color: var(--text); border-bottom-color: var(--primary, #2563EB); font-weight: 600; }
.ia-dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.ia-stat-big { font-size: 1.9rem; font-weight: 700; margin-bottom: .5rem; }
.ia-stat-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.ia-stat-lista li { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; border-top: 1px solid var(--border); padding-top: .4rem; }
.ia-stat-lista li:first-child { border-top: none; padding-top: 0; }
.ia-stat-row { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .9rem; }
.ia-stat-alerta { color: var(--red, #DC2626); }
@media (max-width: 900px) { .ia-dashboard-grid { grid-template-columns: 1fr; } }

.chat-shell-3col { align-items: stretch; }
.chat-main-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.chat-side-panel { width: 220px; flex-shrink: 0; overflow-y: auto; }
.chat-quick-row { display: flex; gap: .4rem; flex-wrap: wrap; padding: .75rem .9rem 0; }

.chat-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #0B6E75; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(11,110,117,.15);
}
.chat-avatar svg { width: 16px; height: 16px; }
.chat-avatar-sm { width: 24px; height: 24px; }
.chat-avatar-sm svg { width: 13px; height: 13px; }
.chat-avatar-user { background: var(--navy); color: #fff; }

.chip-quick {
  background: var(--light); border: 1px solid var(--border); border-radius: 999px;
  padding: .4rem .85rem; font-size: .8rem; color: var(--text); cursor: pointer;
}
.chip-quick:hover { background: var(--border); }
.chip-quick:disabled { color: var(--muted); cursor: not-allowed; }

.ia-capacidades { list-style: none; margin: 0; padding: 0; }
.ia-capacidades li { display: flex; align-items: flex-start; gap: .5rem; font-size: .84rem; margin-bottom: .5rem; }
.ia-capacidades li svg { width: 14px; height: 14px; color: var(--green); flex-shrink: 0; margin-top: .15rem; }

@media (max-width: 1100px) {
  .chat-shell-3col { flex-direction: column; height: auto; }
  .chat-side-panel { width: 100%; }
}
.chat-empty-state svg { width: 40px; height: 40px; color: var(--muted); opacity: .5; margin-bottom: 1rem; }

/* ── Tour guiado ── */
.tour-overlay { position: fixed; inset: 0; z-index: 1000; box-shadow: 0 0 0 9999px rgba(15,23,42,.72); pointer-events: none; }
.tour-spotlight {
  position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15,23,42,.72);
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease; pointer-events: none;
}
.tour-tooltip {
  position: fixed; width: 320px; max-width: calc(100vw - 32px); background: var(--white); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); pointer-events: auto;
  transition: top .2s ease, left .2s ease;
}
.tour-tooltip-title { font-weight: 700; font-size: 1rem; margin-bottom: .35rem; color: var(--navy); }
.tour-tooltip-text { font-size: .88rem; color: var(--muted); line-height: 1.5; margin-bottom: 1rem; }
.tour-tooltip-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tour-skip { background: none; border: none; color: var(--muted); font-size: .82rem; cursor: pointer; }
.tour-skip:hover { color: var(--text); text-decoration: underline; }
.tour-progress { font-size: .78rem; color: var(--muted); }
.tour-nao-mostrar {
  display: block; width: 100%; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border);
  background: none; border-left: none; border-right: none; border-bottom: none;
  font-size: .78rem; color: var(--muted); cursor: pointer; text-align: center;
}
.tour-nao-mostrar:hover { color: var(--red); }

/* ── Loading em botões de export ── */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px;
  margin: -7px 0 0 -7px; border: 2px solid rgba(0,0,0,.2); border-top-color: var(--blue);
  border-radius: 50%; animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Impressão ── */
@media print {
  .sidebar, .topbar, .list-toolbar, .pagination, .actions-bar, .list-toolbar-actions,
  .flash, .toast, .sidebar-toggle-btn, .footer, .breadcrumb { display: none !important; }
  .app-shell, .main, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: none !important; }
  body { background: #fff !important; }
}

/* ── Assistente IA: typing indicator + conhecimento ── */
.chat-typing { display: flex; gap: 4px; align-items: center; padding: .85rem 1rem; }
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-typing-bounce { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ia-conhecimento-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.ia-conhecimento-lista li {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .6rem; border-radius: 8px; background: var(--light); font-size: .82rem;
}
.ia-conhecimento-lista li span { flex: 1; }

/* ── PWA Colaborador: shell app-like (header + conteúdo + bottom nav) ──
   Tokens dedicados (radius-lg, shadow-sm/md) em vez de valores soltos —
   um único lugar pra ajustar a "linguagem visual" de todo o portal. */
.pwa-shell { min-height: 100vh; min-height: 100dvh; background: var(--light); display: flex; flex-direction: column; }

.pwa-header {
  background: var(--white); color: var(--text); padding: 1.1rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border); position: relative;
}
.pwa-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.pwa-header-brand { display: flex; align-items: center; gap: .5rem; }
.pwa-header-clock {
  display: inline-flex; align-items: center; gap: .4rem; color: var(--blue); font-weight: 800;
  font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.pwa-header-clock i { font-size: .85rem; }
.pwa-header-logo-mark { height: 40px; width: auto; }
.pwa-header-icon-btn {
  border: none; background: var(--light); color: var(--blue); width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: .95rem;
}
.pwa-header-icon-btn:active { transform: scale(.94); }

.pwa-banner {
  display: flex; align-items: center; gap: .7rem; background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; padding: .8rem .95rem; margin: 0 0 .85rem; box-shadow: var(--shadow-sm);
}
.pwa-banner i { font-size: 1.1rem; color: var(--blue); flex-shrink: 0; }
.pwa-banner p { flex: 1; margin: 0; font-size: .85rem; font-weight: 600; color: var(--text); }
.pwa-banner .btn { flex-shrink: 0; padding: .5rem .9rem; font-size: .82rem; }
.pwa-banner.update { border-color: rgba(37,99,235,.3); background: #EFF6FF; }
.pwa-header-actions { display: flex; align-items: center; gap: .6rem; }
.pwa-weather-chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700;
  color: var(--muted); background: var(--light); border-radius: 999px; padding: .3rem .6rem;
}
.pwa-header-logout {
  width: 34px; height: 34px; border-radius: 50%; background: var(--light); color: var(--muted);
  display: flex; align-items: center; justify-content: center; text-decoration: none !important;
  border: none; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.pwa-header-logout:hover { background: var(--red-soft); color: var(--red); }

.pwa-greeting-row { display: flex; align-items: center; gap: .75rem; }
.pwa-greeting { font-size: 1.15rem; font-weight: 800; margin: 0; color: var(--text); letter-spacing: -.01em; }
.pwa-greeting-sub { color: var(--muted); font-size: .82rem; margin: .1rem 0 0; }

.pwa-content { flex: 1; padding: 1.1rem 1.1rem 6.75rem; }

.pwa-card {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); padding: 1.35rem; margin-bottom: 1rem;
}
.pwa-card h2 { font-size: .95rem; font-weight: 700; margin: 0 0 .9rem; color: var(--text); }

.pwa-punch-hero {
  text-align: center;
  background: linear-gradient(180deg, var(--white) 0%, var(--light) 130%);
}

.pwa-status-pill {
  display: inline-flex; align-items: center; gap: .45rem; margin: 0 auto .3rem;
  padding: .35rem .75rem; border-radius: 999px; background: var(--light); color: var(--muted);
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.pwa-status-pill.working { background: var(--green-soft); color: #166534; }
.pwa-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pwa-status-pill.working .pwa-status-dot { animation: pwa-pulse 1.8s ease-in-out infinite; }
@keyframes pwa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); }
  50% { box-shadow: 0 0 0 5px rgba(22,163,74,0); }
}
.pwa-status-sub { font-size: .82rem; color: var(--muted); margin: 0 0 1.1rem; }

.pwa-punch-row { display: flex; gap: .6rem; }
.pwa-punch-row .pwa-punch-btn { width: auto; flex: 1; }

.pwa-punch-btn {
  width: 100%; border: none; border-radius: 16px; padding: 1.15rem; font-size: 1rem; font-weight: 700;
  font-family: inherit; color: #fff; background: var(--green); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  box-shadow: 0 6px 16px rgba(22,163,74,.22);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.pwa-punch-btn:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(22,163,74,.18); }
.pwa-punch-btn:disabled { background: var(--light); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.pwa-punch-btn.saida { background: var(--red); box-shadow: 0 6px 16px rgba(220,38,38,.22); }
.pwa-punch-btn.saida:active { box-shadow: 0 2px 8px rgba(220,38,38,.18); }
.pwa-punch-status { text-align: center; font-size: .85rem; color: var(--muted); margin: .85rem 0 0; min-height: 1.2em; }

.pwa-stat-row { display: flex; gap: .75rem; }
.pwa-stat { flex: 1; background: var(--light); border-radius: 14px; padding: 1rem .85rem; text-align: center; }
.pwa-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text); display: block; letter-spacing: -.02em; }
.pwa-stat-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

.pwa-list { list-style: none; margin: 0; padding: 0; }
.pwa-list li { display: flex; align-items: center; gap: .75rem; padding: .7rem .1rem; border-bottom: 1px solid var(--border); }
.pwa-list li:last-child { border-bottom: none; }
.pwa-list-icon {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--light); color: var(--muted); flex-shrink: 0; font-size: .9rem;
}
.pwa-list-body { flex: 1; min-width: 0; }
.pwa-list-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.pwa-list-sub { font-size: .78rem; color: var(--muted); }
.pwa-list-time { font-size: .82rem; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.pwa-empty { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem 0; }

.pwa-badge { font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; }
.pwa-badge.pendente { background: #FEF3C7; color: #92400E; }
.pwa-badge.aprovada { background: var(--green-soft); color: #166534; }
.pwa-badge.rejeitada { background: var(--red-soft); color: #991B1B; }

.pwa-navbar {
  position: fixed; left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom));
  background: var(--white); border-radius: 20px; border: 1px solid var(--border);
  display: flex; padding: .5rem; box-shadow: var(--shadow-md); z-index: 10;
}
.pwa-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .45rem 0; color: var(--muted); text-decoration: none !important; font-size: .68rem; font-weight: 600;
  border-radius: 14px; transition: color .15s ease, background .15s ease;
}
.pwa-nav-item i { font-size: 1.1rem; }
.pwa-nav-item.active { color: var(--blue); background: rgba(37,99,235,.08); }
.pwa-nav-item:hover { text-decoration: none; }

/* ── PWA Colaborador: login premium (hero gradiente + sheet flutuante) ── */
.pwa-login-hero {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 3rem 1.5rem 4.5rem; text-align: center; position: relative; overflow: hidden;
}
.pwa-login-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.10), transparent 55%),
              radial-gradient(circle at 85% 85%, rgba(255,255,255,.08), transparent 50%);
  pointer-events: none;
}
.pwa-login-wordmark { height: 38px; margin: 0 auto .65rem; display: block; position: relative; filter: brightness(0) invert(1); opacity: .97; }
.pwa-login-tagline { color: rgba(255,255,255,.85); font-size: .85rem; font-weight: 600; margin: 0; position: relative; letter-spacing: .01em; }

.pwa-login-sheet { flex: 1; margin-top: -3rem; padding: 0 1.1rem 2rem; position: relative; }
.pwa-login-card { border-radius: 24px; box-shadow: var(--shadow-md); padding: 1.75rem 1.5rem; }
.pwa-login-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 .25rem; color: var(--text); letter-spacing: -.01em; }
.pwa-login-sub { font-size: .85rem; color: var(--muted); margin: 0 0 1.4rem; }
.pwa-login-input input { padding: .75rem .8rem; font-size: 1rem; border-radius: 12px; }
.pwa-login-submit { border-radius: 14px; }
.pwa-login-footer { text-align: center; color: var(--muted); font-size: .74rem; margin: 1.5rem 0 0; }

.pwa-pin-group { display: flex; gap: .6rem; }
.pwa-pin-box {
  flex: 1; aspect-ratio: 1; text-align: center; font-size: 1.4rem; font-weight: 800;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--light); color: var(--text);
  font-family: inherit; -webkit-text-security: disc; outline: none;
  transition: border-color .12s ease, background .12s ease;
}
.pwa-pin-box:focus { border-color: var(--blue); background: var(--white); }

@media (min-width: 480px) {
  .pwa-shell { max-width: 480px; margin: 0 auto; box-shadow: 0 0 0 1px var(--border); min-height: 100vh; }
  .pwa-navbar { max-width: 428px; margin: 0 auto; left: 0; right: 0; }
}
