/* =============================================================================
 * pierre.css — identidade visual inspirada no Pierre (assistente financeiro)
 * Substitui main/components/calendar/dashboard.css. Nenhuma classe do JS foi
 * renomeada. Tema por [data-theme="dark"|"light"] no <html>.
 * ========================================================================== */

:root {
  --font: 'Geist', 'Inter Tight', 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --lime: #d4ff1a;
  --lime-ink: #11140a;

  --bg: #f4f4ef;
  --surface: #ffffff;
  --surface-2: #ecece6;
  --line: rgba(10, 10, 12, .12);
  --line-strong: rgba(10, 10, 12, .28);
  --ink: #0b0b0c;
  --ink-2: #55564f;
  --accent-text: #3f5200;          /* verde-oliva legível no claro */
  --accent-soft: rgba(176, 214, 0, .22);
  --pill-bg: #0b0b0c;              /* botão primário no claro */
  --pill-ink: #ffffff;
  --shadow: 0 18px 50px rgba(10, 10, 12, .08);

  --green: #17a34a; --red: #e5484d; --yellow: #e5a000; --orange: #ea6a1a; --blue: #2f6fed;
  --amber-soft: rgba(229, 160, 0, .18); --green-soft: rgba(23, 163, 74, .15); --red-soft: rgba(229, 72, 77, .14);

  /* aliases usados pelo JS e por estilos inline */
  --primary-bg: var(--bg); --card-bg: var(--surface); --primary-text: var(--ink);
  --secondary-text: var(--ink-2); --muted: var(--ink-2); --border-color: var(--line);
  --surface-1: var(--surface); --glass-shadow: var(--shadow); --shadow-color: rgba(0,0,0,.1);
  --space-xs: .25rem; --space-sm: .5rem; --space-md: 1rem; --space-lg: 1.5rem; --space-xl: 2rem;
  --radius-sm: 12px; --radius-md: 20px; --radius-lg: 28px; --radius-xl: 36px;
  --transition-fast: .15s ease-out; --transition-normal: .25s ease-out;
  --icon-color: var(--ink); --primary-text-color: var(--ink);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #08080a;
  --surface: #121214;
  --surface-2: #1a1a1d;
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(255, 255, 255, .28);
  --ink: #f6f6f1;
  --ink-2: #a2a39b;
  --accent-text: var(--lime);
  --accent-soft: rgba(212, 255, 26, .12);
  --pill-bg: #ffffff;
  --pill-ink: #0b0b0c;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  --green: #3ddc84; --red: #ff6b70; --yellow: #ffc233; --orange: #ff8a3d; --blue: #6c9bff;
  --amber-soft: rgba(255, 194, 51, .14); --green-soft: rgba(61, 220, 132, .14); --red-soft: rgba(255, 107, 112, .14);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  line-height: 1.5; min-height: 100vh; min-height: 100dvh;
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
[data-theme="light"] :focus-visible, :root:not([data-theme="dark"]) :focus-visible { outline-color: var(--ink); }
.hidden { display: none !important; }
.text-center { text-align: center; } .text-left { text-align: left; } .text-right { text-align: right; }
.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:1rem}.mt-4{margin-top:1.5rem}.mt-5{margin-top:3rem}.mt-0{margin-top:0}
.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:1rem}.mb-4{margin-bottom:1.5rem}.mb-5{margin-bottom:3rem}.mb-0{margin-bottom:0}
.fade-in { animation: fade .3s ease both; } .slide-up { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Carregamento ---------- */
.loading-screen { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--bg); }
.loading-animation { position: relative; width: 72px; height: 72px; }
.pulse-ring { position: absolute; inset: 0; border: 2px solid var(--lime); border-radius: 50%; opacity: 0; animation: ring 1.8s ease-out infinite; }
.pulse-ring:nth-child(2) { animation-delay: .5s; } .pulse-ring:nth-child(3) { animation-delay: 1s; }
@keyframes ring { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.1); opacity: 0; } }
.loading::after { content: ''; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-md); }
.login-container { width: 100%; max-width: 440px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.5rem, 6vw, 2.5rem); box-shadow: var(--shadow); }
.login-title { font-size: clamp(2rem, 8vw, 2.8rem); margin-bottom: .6rem; }
.login-subtitle { color: var(--ink-2); margin-bottom: 1.75rem; }
.login-form { display: grid; gap: .75rem; }
.input-group input, .form-control, .form-select, .schedule-cell input {
  width: 100%; min-height: 52px; padding: 0 1.2rem; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; transition: border-color .15s, box-shadow .15s;
}
.input-group input:focus, .form-control:focus, .form-select:focus, .schedule-cell input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.form-control { border-radius: var(--radius-sm); padding: .9rem 1.2rem; min-height: 110px; resize: vertical; }
.form-control:disabled { opacity: .5; }
.login-btn, .btn-primary, .action-btn.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: 0 1.6rem;
  background: var(--lime); color: var(--lime-ink); font-weight: 600; border-radius: 999px; transition: transform .15s, filter .15s;
}
.login-btn { width: 100%; margin-top: .5rem; position: relative; }
.login-btn:hover, .btn-primary:hover:not(:disabled), .action-btn.primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.login-btn:active, .action-btn.primary:active { transform: none; }
.btn-loading { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.login-btn.loading .btn-loading { display: block; } .login-btn.loading span { display: none; }
.demo-accounts { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; }
.demo-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.demo-btn { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; }
.demo-btn:hover { border-color: var(--ink); }

/* ---------- Estrutura do app ---------- */
.main-app { flex-direction: column; width: 100%; min-height: 100dvh; padding: 0 clamp(.75rem, 3vw, 2rem) 6rem; }
.app-header { position: sticky; top: 0; z-index: 50; padding-top: max(.75rem, env(safe-area-inset-top)); padding-bottom: .5rem; }
.header-content {
  width: 100%; max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .5rem .5rem 1.4rem; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.app-title { font-size: 1.15rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.theme-toggle { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; transition: border-color .15s; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-icon { width: 20px; height: 20px; }
.theme-icon.sun { display: none; } .theme-icon.moon { display: block; }
[data-theme="dark"] .theme-icon.sun { display: block; } [data-theme="dark"] .theme-icon.moon { display: none; }
.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 1.1rem 0 .4rem; background: var(--pill-bg); color: var(--pill-ink); border-radius: 999px; font-weight: 500; }
.user-menu-btn #currentUserName, .user-menu-btn span { color: var(--pill-ink); max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar, .user-avatar-admin { width: 32px; height: 32px; border-radius: 50%; background: var(--lime) center/cover; color: var(--lime-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 190px; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); display: none; z-index: 60; }
.user-dropdown.show { display: block; }
.dropdown-item { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 10px; cursor: pointer; }
.dropdown-item:hover { background: var(--surface-2); } .dropdown-item svg { width: 18px; height: 18px; }

/* Navegação: pílulas no desktop, barra inferior no mobile */
.app-nav { width: 100%; max-width: 1180px; margin: .5rem auto 1.5rem; }
.nav-content { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.nav-content::-webkit-scrollbar { display: none; }
.nav-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.2rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-weight: 500; white-space: nowrap; transition: all .15s; }
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.nav-btn.active { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.app-main { width: 100%; min-width: 0; max-width: 1180px; margin: 0 auto; }
.tab-content { display: none; } .tab-content.active { display: block; animation: fade .3s ease both; }

/* ---------- Cartões e blocos ---------- */
.card, .calendar-container, .timetracking-container, .timetracking-log, .schedule-container, .exchanges-container, .admin-container, .clock-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1rem, 3.5vw, 2rem); margin-bottom: var(--space-md);
}
.timetracking-container { background: transparent; border: 0; padding: 0; display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.timetracking-container > * { margin: 0; }
.schedule-container h3, .exchanges-container h3, .timetracking-log h3, .admin-header h3 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin-bottom: 1.25rem; }
.admin-section h4 { font-size: 1.25rem; margin: 1.5rem 0 .9rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.card-title { font-size: 1.25rem; } .card-subtitle { color: var(--ink-2); font-size: .9rem; }
.card-footer { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------- Botões ---------- */
.btn, .action-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: 0 1.3rem; border-radius: 999px; font-weight: 500; transition: all .15s; }
.btn svg, .action-btn svg { width: 18px; height: 18px; }
.btn-secondary { border: 1px solid var(--line-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink); }
.btn-success { background: var(--green-soft); color: var(--green); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-warning { background: var(--amber-soft); color: var(--yellow); }
.btn-success:hover:not(:disabled), .btn-danger:hover:not(:disabled), .btn-warning:hover:not(:disabled) { filter: brightness(1.15); }
.btn-sm { min-height: 36px; padding: 0 1rem; font-size: .85rem; } .btn-lg { min-height: 58px; padding: 0 2rem; font-size: 1.05rem; }
.btn:disabled, .action-btn:disabled { opacity: .45; cursor: not-allowed; }
.calendar-actions, .exchange-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: var(--space-md) 0; }

/* ---------- Badges e alertas ---------- */
.badge { display: inline-flex; padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); }
.badge-primary { background: var(--accent-soft); color: var(--accent-text); } .badge-success { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--amber-soft); color: var(--yellow); } .badge-danger { background: var(--red-soft); color: var(--red); }
.alert { display: flex; gap: .75rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: .92rem; }
.alert svg { width: 18px; height: 18px; margin-top: 2px; }
.alert-info { background: var(--accent-soft); } .alert-success { background: var(--green-soft); } .alert-warning { background: var(--amber-soft); } .alert-danger { background: var(--red-soft); }

/* ---------- Calendário ---------- */
.calendar-container { padding: clamp(.75rem, 3vw, 2rem); }
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.month-title { font-size: clamp(1.5rem, 5vw, 2.4rem); text-transform: capitalize; text-align: center; flex: 1; }
.month-nav { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.month-nav:hover { border-color: var(--ink); } .month-nav svg { width: 20px; height: 20px; stroke: currentColor; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin-bottom: 1rem; color: var(--ink-2); font-size: .85rem; }
.legend-item { display: flex; align-items: center; gap: .45rem; }
.legend-color { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.legend-color.holiday { background: var(--red); } .legend-color.approved { background: var(--yellow); } .legend-color.taken { background: var(--green); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, 1vw, 8px); }
.calendar-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 104px; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; transition: border-color .15s, transform .15s; overflow: hidden; }
.calendar-day:hover { border-color: var(--ink); transform: translateY(-2px); }
.calendar-day.day-header { min-height: 0; padding: .3rem 0 .6rem; align-items: center; background: none; border: 0; cursor: default; color: var(--ink-2); font-size: .8rem; font-weight: 500; transform: none; }
.calendar-day.other-month { background: transparent; border-color: transparent; opacity: .35; }
.day-number { font-size: 1.05rem; font-weight: 600; }
.calendar-day.today { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.calendar-day.today .day-number { background: var(--lime); color: var(--lime-ink); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 .4rem; }
.calendar-day.holiday { background: var(--red-soft); } .calendar-day.approved, .calendar-day.pending { background: var(--amber-soft); }
.day-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.calendar-day.holiday .day-indicator, .day-indicator.holiday { background: var(--red); }
.calendar-day.approved .day-indicator, .calendar-day.pending .day-indicator, .day-indicator.approved { background: var(--yellow); }
.day-indicator.taken { background: var(--green); } .day-indicator.rejected { background: var(--red); }
.day-info { font-size: .74rem; line-height: 1.25; color: var(--ink-2); overflow-wrap: anywhere; }
.day-detail h4 { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; margin-bottom: 1rem; }
.day-detail h4 .day-indicator { width: 12px; height: 12px; }
.detail-section { margin-bottom: 1.25rem; } .detail-section h5 { font-size: 1rem; margin-bottom: .6rem; }
.detail-info, .info-row, .detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.detail-info { flex-direction: column; border: 0; padding: 0; } .detail-info .info-row:last-child, .detail-row:last-child, .info-row:last-child { border-bottom: 0; }
.info-label, .detail-label { color: var(--ink-2); } .info-value, .detail-value { font-weight: 500; text-align: right; }

/* ---------- Ponto ---------- */
.clock-card { text-align: center; display: grid; align-content: center; gap: .4rem; background: var(--pill-bg); color: var(--pill-ink); border-color: transparent; }
.current-time { font-size: clamp(3rem, 12vw, 5.5rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.current-date { opacity: .65; text-transform: capitalize; }
.punch-controls { display: grid; gap: .75rem; align-content: center; }
.punch-btn { display: flex; align-items: center; justify-content: center; gap: .7rem; min-height: 68px; padding: 0 1.5rem; border-radius: 999px; font-size: 1.05rem; font-weight: 600; transition: all .15s; }
.punch-btn svg { width: 22px; height: 22px; }
.punch-btn.in { background: var(--lime); color: var(--lime-ink); } .punch-btn.out { border: 1px solid var(--line-strong); }
.punch-btn.out:hover:not(:disabled) { border-color: var(--red); color: var(--red); } .punch-btn.in:hover:not(:disabled) { filter: brightness(1.06); }
.punch-btn:disabled { opacity: .4; cursor: not-allowed; }
.time-status { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .5rem 1.5rem; }
.status-item { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.status-item:last-child { border: 0; } .status-item label { color: var(--ink-2); } .status-item span { font-weight: 600; text-align: right; }
.time-log { display: grid; gap: .6rem; }
.time-entry, .time-item { padding: 1rem 1.25rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.time-item.running { border-color: var(--lime); } .time-item.holiday { background: var(--red-soft); }
.time-row { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.entry-date { font-weight: 600; } .entry-duration { color: var(--accent-text); font-weight: 600; } .entry-times { color: var(--ink-2); font-size: .9rem; }

/* ---------- Escala ---------- */
.schedule-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); }
.schedule-grid { display: grid; grid-template-columns: 100px repeat(7, minmax(88px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; min-width: 720px; }
.schedule-cell { background: var(--surface); padding: .7rem; min-height: 56px; display: flex; align-items: center; justify-content: center; text-align: center; }
.schedule-cell.header { background: var(--surface-2); font-weight: 600; font-size: .85rem; } .schedule-cell.time-slot { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.schedule-cell input { min-height: 40px; padding: 0 .6rem; border-radius: 12px; text-align: center; }

/* ---------- Trocas e solicitações ---------- */
.exchanges-list, .pending-requests, .users-list { display: grid; gap: .75rem; }
.exchange-item, .request-item, .user-item { padding: 1.1rem 1.25rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md); transition: border-color .15s; }
.exchange-item:hover, .request-item:hover, .user-item:hover { border-color: var(--line-strong); }
.exchange-header, .request-header, .user-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.exchange-info h5, .request-info h5, .user-details h5 { font-size: 1.1rem; margin-bottom: .25rem; }
.exchange-details, .request-date, .date-range, .user-role, .ex-log-row { color: var(--ink-2); font-size: .9rem; }
.exchange-status, .request-status { padding: .3rem .85rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.exchange-status.pending, .request-status.pending { background: var(--amber-soft); color: var(--yellow); }
.exchange-status.accepted, .request-status.approved { background: var(--green-soft); color: var(--green); }
.exchange-status.rejected, .request-status.rejected { background: var(--red-soft); color: var(--red); }
.request-item.pending { border-left: 3px solid var(--yellow); } .request-item.approved { border-left: 3px solid var(--green); } .request-item.rejected { border-left: 3px solid var(--red); }
.request-details { margin-top: .75rem; } .exchange-logs { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); } .ex-log-title { font-weight: 600; margin-bottom: .4rem; }
.exchange-actions-list, .request-actions, .user-actions, .modal-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.user-info { display: flex; align-items: center; gap: .9rem; } .user-stats { display: flex; gap: 1.25rem; }
.stat-item { text-align: center; } .stat-value { font-size: 1.5rem; font-weight: 600; } .stat-label { color: var(--ink-2); font-size: .8rem; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
.admin-content { display: grid; gap: var(--space-md); }

/* ---------- Tabelas e formulários ---------- */
.table { width: 100%; border-collapse: collapse; } .table th { text-align: left; padding: .8rem 1rem; color: var(--ink-2); font-weight: 500; border-bottom: 1px solid var(--line-strong); }
.table td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); } .table tbody tr:hover { background: var(--surface-2); } .table tbody tr:last-child td { border: 0; }
.form-group { margin-bottom: 1rem; } .form-label { display: block; margin-bottom: .4rem; font-weight: 500; font-size: .9rem; }
.form-checkbox { display: flex; align-items: center; gap: .6rem; cursor: pointer; } .form-checkbox input { width: 20px; height: 20px; accent-color: var(--lime); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
.modal.show { display: flex; }
.modal-content { width: 100%; max-width: 560px; max-height: calc(100dvh - 2rem); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: fade .25s ease both; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.5rem 1.5rem 0; }
.modal-header h3 { font-size: 1.6rem; }
.modal-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; font-size: 1.4rem; line-height: 1; } .modal-close:hover { border-color: var(--ink); }
.modal-body { padding: 1.25rem 1.5rem 1.5rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .timetracking-container { grid-template-columns: 1fr; }
  .calendar-day { min-height: 82px; padding: 8px; }
}
@media (max-width: 720px) {
  .main-app { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
  .header-content { padding-left: 1.1rem; }
  .user-menu-btn { padding: 0 .4rem; } .user-menu-btn #currentUserName { display: none; }
  /* abas viram barra fixa inferior */
  .app-nav { width: auto; position: fixed; z-index: 60; left: .75rem; right: .75rem; bottom: max(.75rem, env(safe-area-inset-bottom)); margin: 0; padding: .4rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); }
  .nav-content { justify-content: space-around; gap: .15rem; }
  .nav-btn { flex: 1; flex-direction: column; gap: .15rem; padding: .5rem .25rem; border: 0; font-size: .68rem; border-radius: 24px; }
  .nav-btn svg { width: 20px; height: 20px; }
  .calendar-container, .schedule-container, .exchanges-container, .admin-container { border-radius: var(--radius-md); }
  /* dias do calendário: número + marcador, detalhes ficam no modal */
  .calendar-day { min-height: 54px; padding: 6px 4px; align-items: center; border-radius: 12px; }
  .day-number { font-size: .9rem; } .calendar-day.today .day-number { min-width: 24px; height: 24px; }
  .day-info { display: none; } .calendar-day.day-header { font-size: .7rem; }
  .user-header, .exchange-header, .request-header { flex-direction: column; }
  .user-stats { width: 100%; justify-content: space-between; }
  .exchange-actions-list .btn, .request-actions .btn, .modal-actions .btn, .calendar-actions .action-btn, .exchange-actions .action-btn { flex: 1 1 100%; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-content { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 380px) { .app-title { font-size: 1rem; } .nav-btn { font-size: .62rem; } }
@media (hover: none) { .calendar-day:hover { transform: none; } }

/* ---------- Sino de alertas (estilo injetado pelo alertas.js) ---------- */
#alertsBell { background: var(--surface) !important; color: var(--ink); border: 1px solid var(--line-strong) !important; box-shadow: var(--shadow) !important; }
#alertsBell:hover { border-color: var(--ink) !important; }
#alertsBadge { box-shadow: 0 0 0 2px var(--surface) !important; }
@media (max-width: 720px) {
  #alertsBell { width: 48px !important; height: 48px !important; right: 14px !important; bottom: calc(5.6rem + env(safe-area-inset-bottom)) !important; }
}

/* ---------- Modal em tela cheia (Notificações e Comunicados) ---------- */
.modal.modal-full { padding: 0; align-items: stretch; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal-full .modal-content { max-width: none; width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: transparent; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; animation: fade .25s ease both; }
.modal-full .modal-header { flex: none; width: 100%; max-width: 880px; margin: 0 auto; padding: max(1.25rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 2rem) 1rem; }
.modal-full .modal-header h3 { font-size: clamp(1.7rem, 5vw, 2.6rem); }
.modal-full .modal-close { width: 48px; height: 48px; }
.modal-full .modal-body { flex: 1; min-height: 0; width: 100%; max-width: 880px; margin: 0 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: .5rem clamp(1rem, 4vw, 2rem) max(2rem, env(safe-area-inset-bottom)); }
.modal-full .alerts-panel { max-height: none !important; }
body:has(.modal.show) #alertsBell { display: none !important; }
@media (max-width: 720px) {
  .modal.modal-full { align-items: stretch; }
  .modal-full .modal-content { border-radius: 0; max-height: none; }
  .alerts-head { flex-direction: column; align-items: stretch; }
  .alerts-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .alerts-tab { justify-content: center; padding: 0 10px; }
  .alerts-actions { display: grid; grid-template-columns: 1fr; }
  .alerts-btn { width: 100%; }
  .modal-full .modal-actions .btn { flex: 1 1 100%; }
}

/* ---------- Notificações (banner estilo iOS) ---------- */
#toastStack { position: fixed; z-index: 10000; top: max(.75rem, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(calc(100vw - 1.5rem), 380px); display: grid; gap: .5rem; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem .7rem .7rem; border-radius: 26px; touch-action: pan-x;
  background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, .22), 0 1px 0 rgba(255, 255, 255, .06) inset;
  opacity: 0; transform: translateY(-140%) scale(.96); transition: transform .5s cubic-bezier(.2, .9, .25, 1.15), opacity .3s ease; user-select: none; }
.toast.in { opacity: 1; transform: none; } .toast.out { opacity: 0; transform: translateY(-120%) scale(.96); transition: transform .35s ease-in, opacity .25s ease; }
.toast.clickable { cursor: pointer; }
.toast-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--blue); color: #fff; }
.toast-icon svg { width: 22px; height: 22px; stroke-width: 2.4; }
.toast-success .toast-icon { background: #30d158; } .toast-error .toast-icon { background: #ff453a; } .toast-warning .toast-icon { background: #ff9f0a; } .toast-info .toast-icon { background: #0a84ff; }
.toast-text { flex: 1; min-width: 0; line-height: 1.3; }
.toast-title { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.toast-body { font-size: .88rem; color: var(--ink-2); margin-top: 1px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.toast-time { flex: none; align-self: flex-start; margin-top: .15rem; font-size: .75rem; color: var(--ink-2); }
.toast-close { flex: none; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.toast-close svg { width: 12px; height: 12px; stroke-width: 2.6; }
@media (hover: hover) { .toast:hover .toast-time { display: none; } .toast:hover .toast-close { display: grid; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.out { transform: none; } }

/* ---------- Ajustes: abas centralizadas, Ponto e Escala ---------- */
.nav-content { justify-content: center; flex-wrap: wrap; }
@media (max-width: 720px) { .nav-content { flex-wrap: nowrap; } }

/* Ponto: coluna única centralizada */
#timetrackingTab { max-width: 620px; margin: 0 auto; }
.timetracking-container { grid-template-columns: 1fr !important; gap: 1rem; }
.clock-card { position: relative; padding: clamp(2rem, 7vw, 3.25rem) 1.5rem; border-radius: var(--radius-xl); gap: .6rem; justify-items: center; }
.clock-card::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 6px rgba(212, 255, 26, .18); animation: livedot 2s ease-in-out infinite; }
@keyframes livedot { 50% { box-shadow: 0 0 0 10px rgba(212, 255, 26, 0); } }
.current-time { font-size: clamp(3.6rem, 16vw, 6.5rem); }
.current-date { font-size: 1.05rem; }
.punch-controls { grid-template-columns: 1fr 1fr; gap: .75rem; }
.punch-btn { min-height: 64px; padding: 0 1rem; font-size: 1rem; }
.time-status { padding: .25rem 1.5rem; }
.timetracking-log { text-align: center; }
.timetracking-log h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.timetracking-log .time-log { text-align: left; }
@media (max-width: 480px) { .punch-controls { grid-template-columns: 1fr; } }

/* Escala: nomes como texto, sem caixa de botão */
.schedule-wrapper h3 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin-bottom: 1.25rem; }
.schedule-cell { padding: .35rem; }
.schedule-cell span { font-weight: 500; padding: .5rem; overflow-wrap: anywhere; }
.schedule-cell input { min-height: 44px; padding: 0 .5rem; background: transparent; border: 1px solid transparent; border-radius: 12px; text-align: center; font-weight: 500; }
.schedule-cell input:hover { background: var(--surface-2); }
.schedule-cell input:focus { background: var(--bg); border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Ponto: mesma largura da navbar */
#timetrackingTab { max-width: none; margin: 0; }
.timetracking-container { max-width: none; }
@media (min-width: 900px) {
  .timetracking-container { grid-template-columns: 1.1fr 1fr !important; grid-template-rows: auto 1fr; align-items: stretch; }
  .timetracking-container .clock-card { grid-column: 1; grid-row: 1 / span 2; }
  .timetracking-container .punch-controls { grid-column: 2; grid-row: 1; }
  .timetracking-container .time-status { grid-column: 2; grid-row: 2; display: grid; align-content: center; }
  .current-time { font-size: clamp(5rem, 9vw, 8rem); }
}
/* Registro de pontos: linhas alinhadas */
.timetracking-log { text-align: left; }
.timetracking-log h3 { text-align: center; }
.time-item, .time-entry { display: grid; gap: .5rem; text-align: left; padding: 1rem 1.25rem; }
.time-item .time-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; text-align: left; }
.time-item .time-row:first-child { font-weight: 600; }

/* Legenda do calendário centralizada */
.calendar-legend { justify-content: center; }

/* ---------- Registro de pontos (cartões) ---------- */
.timetracking-log .time-log { gap: .75rem; }
.time-log .time-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.25rem; padding: 1rem 1.25rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md); text-align: left; }
.time-log .time-item.running { border-color: var(--lime); box-shadow: 0 0 0 3px var(--accent-soft); }
.te-date { width: 64px; height: 72px; border-radius: 18px; background: var(--surface-2); display: grid; place-content: center; text-align: center; line-height: 1; }
.time-item.running .te-date { background: var(--lime); color: var(--lime-ink); }
.te-day { font-size: 1.7rem; font-weight: 600; letter-spacing: -.04em; }
.te-mon { margin-top: .3rem; font-size: .75rem; color: var(--ink-2); text-transform: capitalize; }
.time-item.running .te-mon { color: var(--lime-ink); opacity: .7; }
.te-body { min-width: 0; display: grid; gap: .55rem; }
.te-when { font-size: .85rem; color: var(--ink-2); text-transform: capitalize; }
.te-times { display: flex; align-items: center; gap: .9rem; }
.te-slot { display: grid; gap: .1rem; }
.te-slot small { font-size: .75rem; color: var(--ink-2); }
.te-slot b { font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.te-arrow { width: 22px; height: 22px; color: var(--ink-2); opacity: .7; }
.te-detail { font-size: .8rem; color: var(--ink-2); font-style: italic; }
.te-side { display: grid; justify-items: end; gap: .45rem; }
.te-dur { padding: .35rem .9rem; border-radius: 999px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.te-chip { font-size: .75rem; font-weight: 600; padding: .2rem .65rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.te-chip.is-running { background: var(--lime); color: var(--lime-ink); }
.te-chip.is-credit { background: var(--green-soft); color: var(--green); }
.te-chip.is-holiday { background: var(--amber-soft); color: var(--orange); }
@media (max-width: 560px) {
  .time-log .time-item { grid-template-columns: auto minmax(0, 1fr); gap: .9rem; padding: .9rem; }
  .te-date { width: 54px; height: 62px; border-radius: 16px; } .te-day { font-size: 1.4rem; }
  .te-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: start; padding-top: .75rem; border-top: 1px solid var(--line); }
  .te-slot b { font-size: 1.2rem; }
}

/* ---------- Folga creditada em feriado ---------- */
.time-log .time-item { align-items: center; }
.te-credit { grid-column: 1 / -1; display: flex; align-items: center; gap: .8rem; padding: .75rem 1rem; border-radius: 16px; background: var(--green-soft); color: var(--green); }
.te-credit svg { width: 24px; height: 24px; }
.te-credit span { display: grid; gap: .1rem; }
.te-credit b { font-weight: 600; font-size: .95rem; }
.te-credit small { color: var(--ink-2); font-size: .8rem; }
.holiday-banner { margin-top: .6rem; max-width: 34ch; padding: .55rem 1rem; border-radius: 16px; font-size: .88rem; line-height: 1.35; text-align: center; background: rgba(255, 255, 255, .12); color: var(--pill-ink); }
[data-theme="dark"] .holiday-banner { background: rgba(0, 0, 0, .1); }
.holiday-banner.done { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
