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

:root {
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Global Brand Colors (Constant across themes) */
    --brand-red: #d11a2a;
    --brand-red-hover: #b01421;
    --brand-red-alpha: rgba(209, 26, 42, 0.1);
    --brand-black: #111111;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-input: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --sidebar-shadow: 4px 0 25px rgba(0, 0, 0, 0.02);
    
    --badge-bg-pending: rgba(245, 158, 11, 0.1);
    --badge-text-pending: #d97706;
    --badge-bg-success: rgba(16, 185, 129, 0.1);
    --badge-text-success: #059669;
    --badge-bg-error: rgba(239, 68, 68, 0.1);
    --badge-text-error: #dc2626;
    
    --sidebar-active-bg: rgba(209, 26, 42, 0.08);
    --sidebar-active-text: var(--brand-red);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #0b0f17;
    --bg-secondary: #121824;
    --bg-sidebar: #0f1420;
    --bg-input: #1b2336;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #1e293b;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --sidebar-shadow: 4px 0 25px rgba(0, 0, 0, 0.2);
    
    --badge-bg-pending: rgba(245, 158, 11, 0.15);
    --badge-text-pending: #fbbf24;
    --badge-bg-success: rgba(16, 185, 129, 0.15);
    --badge-text-success: #34d399;
    --badge-bg-error: rgba(239, 68, 68, 0.15);
    --badge-text-error: #f87171;
    
    --sidebar-active-bg: rgba(209, 26, 42, 0.18);
    --sidebar-active-text: #ff4a5a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Layout Framework */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px 10px;
    box-shadow: var(--sidebar-shadow);
    transition: background-color var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.logo-container {
    padding: 2px 8px 8px 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-container svg {
    max-width: 100%;
    height: auto;
}

.portal-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-top: 8px;
    padding-left: 4px;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

.nav-item button {
    width: 100%;
    background: none;
    border: none;
    padding: 7px 11px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-bounce);
}

.nav-item button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    transition: transform 0.2s;
}

.nav-item button:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.nav-item button:hover svg {
    transform: translateX(3px);
}

.nav-item.active button {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-item.active button svg {
    stroke: var(--sidebar-active-text);
}

/* Sidebar Footer & Theme Toggle */
.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 6px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
    padding: 3px 8px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
}

.theme-toggle-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 2;
}

input:checked + .slider {
    background-color: var(--brand-red);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider svg {
    width: 14px;
    height: 14px;
    fill: white;
    z-index: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 1px 2px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-red) 0%, #ff5e62 100%);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(209, 26, 42, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-primary);
}

/* Top Header Bar */
.top-header {
    height: 56px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.header-left {
    display: flex;
    flex-direction: column;
}

.breadcrumb {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.active-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    position: relative;
    width: 280px;
}

.search-bar input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px 16px 10px 40px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--brand-red);
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-input);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.825rem;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Tab Content Display */
.content-body {
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

.content-body::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Dashboard UI Elements */

/* Grid Cards Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.metric-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.metric-trend.up {
    color: #10b981;
}

.metric-trend.down {
    color: #ef4444;
}

.metric-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-red);
}

.metric-icon-container svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

/* Sections & Panel Layouts */
.section-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    gap: 12px;
}

.ponto-section-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.ponto-section-header .section-title {
    width: auto;
    flex: 1 1 auto;
    padding-top: 0;
}

/* Botão "Imprimir" injetado via JS (garantirBotoesImpressaoSubabas) — mantém na 1ª linha,
   ao lado do título, em vez de disputar espaço com os campos abaixo. */
.ponto-section-header .print-subtab-btn {
    order: 1;
    flex: 0 0 auto;
}

.ponto-header-actions {
    order: 2;
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ponto-header-fields {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.9fr) minmax(120px, 0.6fr) minmax(220px, 1.2fr);
    gap: 12px 14px;
}

.ponto-competencia-selects {
    display: flex;
    gap: 8px;
}

.ponto-competencia-selects select {
    flex: 1;
    min-width: 0;
}

.ponto-header-actions .form-group {
    margin-bottom: 0;
}

.ponto-header-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.ponto-header-buttons .btn {
    min-height: 44px;
    padding: 9px 18px;
}

.ponto-limpar-btn {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.ponto-limpar-btn:hover {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}

.ponto-preencher-obra-btn {
    margin-left: auto;
}

button.ponto-anexar-cartao-btn {
    background-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

button.ponto-anexar-cartao-btn:hover {
    background-color: #2563eb;
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3);
}

.ponto-obra-field {
    display: flex;
    flex-direction: column;
}

.ponto-banco-field {
    min-width: 100px;
}

.ponto-banco-field #ponto-banco-condicao {
    min-height: 42px;
    display: flex;
    align-items: center;
}

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

    .ponto-header-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .ponto-preencher-obra-btn {
        margin-left: 0;
    }
}

/* Interactive Forms & Controls */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--transition-speed);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--brand-red);
}

.nf-registro-form {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
}

.nf-registro-form .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.nf-ia-resumo {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.nf-ia-resumo strong {
    color: var(--text-primary);
}

.vt-comp-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    background-color: var(--bg-secondary);
}

.vt-comp-lancamento {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px 34px;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
}

.vt-comp-lancamento-title {
    min-width: 0;
}

.vt-comp-lancamento-title strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.vt-comp-lancamento-title span {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.25;
    margin-top: 2px;
}

.vt-comp-valor {
    width: 100%;
    min-width: 0;
    height: 36px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 10px;
    text-align: right;
    transition: border-color var(--transition-speed), background-color var(--transition-speed);
}

.vt-comp-valor:focus {
    outline: none;
    border-color: var(--brand-red);
    background-color: var(--bg-primary);
}

.vt-comp-total {
    max-width: 190px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.vt-comp-total input[readonly] {
    color: var(--text-primary);
    font-weight: 700;
    cursor: default;
}

/* Buttons */
.btn {
    font-family: 'Outfit', sans-serif;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-bounce);
}

.btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-primary {
    background-color: var(--brand-red);
    color: white;
    box-shadow: 0 4px 12px rgba(209, 26, 42, 0.2);
}

.btn-primary:hover {
    background-color: var(--brand-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(209, 26, 42, 0.3);
}

.btn-secondary {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.btn.vt-comp-remover {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.btn.vt-comp-remover svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
}

.btn.vt-comp-remover:hover {
    color: var(--brand-red);
}

.notification-config-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-primary);
    padding: 14px;
    margin: 0 0 14px 0;
}

.notification-config-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.notification-config-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notification-config-title strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.notification-config-title span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.notification-email-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
}

.notification-email-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.notification-email-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-red);
    flex-shrink: 0;
}

.notification-email-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notification-email-info strong {
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-email-info span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.notification-config-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.notification-config-status {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.notification-modal-content {
    width: min(760px, 94vw);
}

.notification-modal-subtitle {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.notification-modal-table-wrapper {
    max-height: 58vh;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.notification-modal-table {
    min-width: 520px;
}

.notification-modal-table td:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notification-modal-table td:first-child strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.notification-modal-table td:first-child span {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.notification-role-select {
    min-width: 150px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.notification-role-select.role-principal {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.45);
}

.notification-role-select.role-copia {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.5);
}

.notification-role-select.role-nao-enviar {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
}

.notification-role-select option[value="principal"] {
    color: #16a34a;
}

.notification-role-select option[value="copia"] {
    color: #f59e0b;
}

.notification-role-select option[value="nao_enviar"] {
    color: #ef4444;
}

.notification-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

/* Styled Table Components */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.custom-table th {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border-color);
}

.custom-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr {
    transition: background-color 0.15s;
}

.custom-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.vt-workdays-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 48px;
}

.vt-workdays-info {
    opacity: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.vt-workdays-cell:hover .vt-workdays-info,
.vt-workdays-info:focus {
    opacity: 1;
}

.vt-workdays-info:hover,
.vt-workdays-info:focus {
    color: var(--brand-red);
    border-color: var(--brand-red);
}

.vt-workdays-exceptions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.vt-workdays-exceptions h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.vt-workdays-exceptions ul {
    margin: 0;
    padding-left: 18px;
    max-height: 280px;
    overflow: auto;
}

.vt-workdays-exceptions li {
    margin-bottom: 4px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-pending {
    background-color: var(--badge-bg-pending);
    color: var(--badge-text-pending);
}

.badge-success {
    background-color: var(--badge-bg-success);
    color: var(--badge-text-success);
}

.badge-error {
    background-color: var(--badge-bg-error);
    color: var(--badge-text-error);
}

/* Férias */
.ferias-date-field {
    position: relative;
}

.ferias-date-field input {
    padding-right: 44px !important;
    font-family: 'Outfit', sans-serif;
}

.ferias-date-trigger {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.ferias-date-trigger:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.ferias-date-picker {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 2000;
    width: min(100%, 320px);
    min-width: 292px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.ferias-date-picker.active {
    display: block;
}

.ferias-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ferias-date-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.ferias-date-title select {
    height: 30px;
    max-width: 112px;
    padding: 0 24px 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: capitalize;
    cursor: pointer;
}

.ferias-date-header button,
.ferias-date-footer button {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}

.ferias-date-header button {
    width: 34px;
    height: 30px;
    font-size: 1.25rem;
    line-height: 1;
}

.ferias-date-weekdays,
.ferias-date-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ferias-date-weekdays {
    margin-bottom: 6px;
}

.ferias-date-weekdays span {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.ferias-date-day {
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
}

.ferias-date-day:hover {
    border-color: var(--brand-red);
    background: var(--brand-red-alpha);
}

.ferias-date-day.muted {
    color: var(--text-muted);
    opacity: 0.65;
}

.ferias-date-day.today {
    border-color: var(--border-color);
    font-weight: 700;
}

.ferias-date-day.selected {
    background: var(--brand-red);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(209, 26, 42, 0.28);
}

.ferias-date-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.ferias-date-footer button {
    padding: 7px 10px;
    font-size: 0.78rem;
}

.ferias-date-footer button:hover,
.ferias-date-header button:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.ferias-periodo-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 180px;
    line-height: 1.2;
}

.ferias-prazo-bar {
    width: 100%;
    height: 2px;
    min-height: 2px;
    max-height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    line-height: 0;
    flex: 0 0 2px;
}

.ferias-prazo-bar span {
    display: block;
    height: 100%;
    min-height: 2px;
    max-height: 2px;
    border-radius: inherit;
    transition: width 0.2s ease;
}

/* Special Module Layouts */

/* Upload Zone Component */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    background-color: var(--bg-input);
    cursor: pointer;
    transition: border-color var(--transition-speed);
}

.upload-zone:hover {
    border-color: var(--brand-red);
}

.upload-zone.dragover {
    border-color: var(--brand-red);
    background-color: rgba(209, 26, 42, 0.06);
}

.ponto-arquivo-modal-content {
    width: min(560px, 94vw);
}

.ponto-relatorio-importacao-modal-content {
    width: min(620px, 94vw);
}

.ponto-relatorio-importacao-body {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-icon {
    color: var(--brand-red);
    margin-bottom: 6px;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.upload-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Home pendency radar */
.home-alert-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
}

.home-alert-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border: 1px solid rgba(209, 26, 42, 0.18);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(209, 26, 42, 0.12), rgba(245, 158, 11, 0.1) 52%, rgba(16, 185, 129, 0.08));
    box-shadow: var(--card-shadow);
}

.home-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand-red);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.home-alert-hero h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.65rem;
    letter-spacing: 0;
}

.home-alert-hero p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.home-alert-total {
    min-width: 142px;
    padding: 16px 18px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    text-align: center;
}

.home-alert-total span {
    display: block;
    color: var(--brand-red);
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1;
}

.home-alert-total small {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
}

.home-alert-metrics,
.home-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.home-alert-metric,
.home-module-card,
.home-priority-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: var(--card-shadow);
}

.home-alert-metric {
    padding: 14px 16px;
}

.home-alert-metric strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.55rem;
    line-height: 1;
}

.home-alert-metric span {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.home-alert-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: 18px;
}

.home-section-card {
    margin-bottom: 0;
}

.home-module-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.home-module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(209, 26, 42, 0.35);
}

.home-module-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.home-module-title {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.2;
}

.home-module-sub {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.home-module-count {
    min-width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 800;
}

.home-module-count.critico { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.home-module-count.atencao { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.home-module-count.ok { background: rgba(16, 185, 129, 0.12); color: #059669; }

.home-module-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.home-tag {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.home-tag.critico { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.home-tag.atencao { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.home-tag.ok { background: rgba(16, 185, 129, 0.12); color: #059669; }

.home-priority-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-priority-item {
    padding: 12px 14px;
    border-left: 4px solid var(--brand-red);
}

.home-priority-item.atencao {
    border-left-color: #f59e0b;
}

.home-priority-item.ok {
    border-left-color: #10b981;
}

.home-priority-title {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 0.9rem;
}

.home-priority-detail {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.home-pendencias-empty {
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 22px;
    text-align: center;
}

#modal-home-pendencias .modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

.home-pendencias-group {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    margin-bottom: 12px;
    overflow: hidden;
}

.home-pendencias-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.home-pendencias-group-head strong {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 800;
}

.home-pendencias-group-head span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-pendencias-items {
    display: flex;
    flex-direction: column;
}

.home-pendencias-row {
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
}

.home-pendencias-row + .home-pendencias-row {
    border-top: 1px solid var(--border-color);
}

.home-pendencias-row.critico {
    border-left-color: var(--brand-red);
}

.home-pendencias-row strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.home-pendencias-row span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: 3px;
}

@media (max-width: 980px) {
    .home-alert-layout,
    .home-alert-hero {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
}

/* Employee list styling */
.employee-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

#employees-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.employee-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed);
}

.employee-card:hover {
    transform: translateY(-3px);
}

.employee-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-color: var(--brand-red-alpha);
    color: var(--brand-red);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.employee-card-details {
    flex-grow: 1;
    min-width: 0;
}

.employee-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#employees-grid .employee-card-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
}

@media (max-width: 860px) {
    #employees-grid {
        grid-template-columns: 1fr;
    }
}

.employee-card-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.employee-card-badge {
    font-size: 0.7rem;
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--bg-primary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.form-group.emp-field-pending label {
    color: #ef4444;
}

.form-group.emp-field-pending input,
.form-group.emp-field-pending select,
.form-group.emp-field-pending textarea {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.08);
}

/* CSS Progress Bar */
.progress-bar-container {
    width: 100%;
    background-color: var(--bg-primary);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--brand-red);
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

/* Alert Notification Panel */
.alert-banner {
    background-color: rgba(239, 68, 68, 0.08);
    border-left: 4px solid #ef4444;
    border-radius: 0 10px 10px 0;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

[data-theme="dark"] .alert-banner {
    background-color: rgba(239, 68, 68, 0.15);
}

.alert-banner-icon {
    color: #ef4444;
}

.alert-banner-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.alert-banner-content {
    flex-grow: 1;
}

.alert-banner-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-banner-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Mini CSS Visual Grid */
.hour-bank-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.hour-bank-day {
    aspect-ratio: 1;
    background-color: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

.hour-bank-day.filled-positive {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-weight: 600;
}

.hour-bank-day.filled-negative {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-weight: 600;
}

/* Modal Simple Simulation style */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--brand-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 24px 8px;
    }
    
    .logo-container {
        align-items: center;
        padding: 8px 4px 20px 4px;
    }
    
    .logo-container svg {
        width: 40px;
        height: 40px;
    }
    
    .portal-title, .theme-toggle-label, .user-info, .nav-item button span {
        display: none;
    }
    
    .nav-item button {
        justify-content: center;
        padding: 12px;
    }
    
    .nav-item button svg {
        margin: 0;
    }
    
    .theme-toggle-container {
        justify-content: center;
        padding: 8px 4px;
    }
    
    .user-profile {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
    }
    
    .logo-container {
        border-bottom: none;
        margin-bottom: 0;
        padding: 0;
    }
    
    .nav-menu {
        display: none; /* In a real app we'd add a burger menu, but let's keep it simple here */
    }
    
    .sidebar-footer {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
        flex-direction: row;
        align-items: center;
    }
    
    .main-content {
        height: calc(100vh - 70px);
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .search-bar {
        width: 180px;
    }
    
    .content-body {
        padding: 16px;
    }
}

/* Filtros de Notas Fiscais */
.filter-btn-group {
    display: flex;
    background-color: var(--bg-input);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    gap: 4px;
    align-items: center;
}

.btn-filter {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition-bounce);
}

.btn-filter svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: none;
}

.btn-filter:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .btn-filter:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-filter.active {
    background-color: var(--brand-red);
    color: white;
    box-shadow: 0 2px 8px rgba(209, 26, 42, 0.2);
}

.btn-filter.active:hover {
    background-color: var(--brand-red);
    color: white;
}

/* Estilos de Paginação */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 0.825rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 6px;
}

.pagination-btn {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    transition: var(--transition-bounce);
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
    box-shadow: 0 2px 8px rgba(209, 26, 42, 0.2);
}

/* Ponto Split Layout & Timeline Styles */
@media (max-width: 1024px) {
    .ponto-split-layout {
        flex-direction: column;
    }
}

.ponto-table-section {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px;
}

.ponto-diario-table tbody tr {
    cursor: pointer;
}

.ponto-diario-table tbody tr.active-row {
    background-color: rgba(209, 26, 42, 0.05);
}

.details-sticky-container {
    position: sticky;
    top: 24px;
}

.details-widget-title {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Vertical Timeline */
.timeline-container {
    position: relative;
    margin-top: 10px;
    padding-left: 20px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 4px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding-left: 12px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--bg-secondary);
}

.timeline-dot.direction {
    background-color: #10b981; /* green */
    box-shadow: 0 0 6px #10b981;
}

.timeline-dot.espera {
    background-color: #f59e0b; /* orange */
    box-shadow: 0 0 6px #f59e0b;
}

.timeline-dot.refeicao, .timeline-dot.repouso {
    background-color: #3b82f6; /* blue */
    box-shadow: 0 0 6px #3b82f6;
}

.timeline-dot.jornada {
    background-color: var(--brand-red); /* brand red */
    box-shadow: 0 0 6px var(--brand-red);
}

.timeline-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.timeline-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.timeline-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Compliance Alert Cards */
.compliance-alert-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.compliance-alert-card:hover {
    transform: translateX(2px);
}

.compliance-alert-card.warning {
    background-color: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.compliance-alert-icon {
    font-size: 1rem;
    line-height: 1;
    margin-top: 2px;
}

.compliance-alert-card.danger .compliance-alert-icon {
    color: #ef4444;
}

.compliance-alert-card.warning .compliance-alert-icon {
    color: #f59e0b;
}

.compliance-alert-info {
    flex-grow: 1;
    min-width: 0;
}

.compliance-alert-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow-wrap: break-word;
}

.compliance-alert-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow-wrap: break-word;
}

.employee-card-param-summary {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    border-top: 1px dashed var(--border-color);
    padding-top: 4px;
}

/* Modal Tabs Styling */
.modal-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
}

.modal-tabs-header::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.modal-tab-btn {
    background: none;
    border: none;
    padding: 8px 12px 12px 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

.modal-tab-btn:hover {
    color: var(--text-primary);
}

.modal-tab-btn.active {
    color: var(--brand-red);
}

.modal-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--brand-red);
}

.modal-tab-pane {
    display: none;
}

.modal-tab-pane.active {
    display: block;
}

/* Uploaded Files Styling */
.modal-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
}

.modal-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-file-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-file-size {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.modal-file-actions {
    display: flex;
    gap: 8px;
}

.btn-file-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-file-action:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-file-action.delete:hover {
    color: #ef4444;
}

.btn-file-action svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Spreadsheet Table Custom Styling */
.sheet-table {
    font-size: 0.75rem !important;
}

.sheet-table th {
    color: var(--text-primary);
    text-align: center;
    vertical-align: middle;
}

.sheet-input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.775rem;
    color: var(--text-primary);
    padding: 6px 0;
    font-family: 'Outfit', sans-serif;
}

.sheet-input:focus {
    outline: 1px solid var(--brand-red);
    background-color: var(--bg-primary);
    border-radius: 4px;
}

.sheet-table select {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    font-family: 'Outfit', sans-serif;
    outline: none;
}

.sheet-table select:focus {
    outline: 1px solid var(--brand-red);
    background-color: var(--bg-primary);
    border-radius: 4px;
}

.sheet-table select option {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.sheet-table tr.active-row {
    background-color: rgba(220, 26, 42, 0.08) !important; /* Tint using brand-red */
    border: 1px solid var(--brand-red);
}

.sheet-table tr.active-row td {
    border-top: 1px solid var(--brand-red);
    border-bottom: 1px solid var(--brand-red);
}

.sheet-table tr:hover:not(.active-row) {
    background-color: var(--bg-secondary);
}

/* Sub-subtabs in Financeiro (Relatório / Histórico) */
.sub-subtabs-nav {
    display: flex;
    gap: 8px;
    margin: 15px 0 20px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.btn-sub-subtab {
    background: none;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.btn-sub-subtab:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.btn-sub-subtab.active {
    color: var(--brand-red);
    background-color: var(--brand-red-alpha);
    font-weight: 600;
}

/* Logo por tema: claro no tema claro, "LOGO DARAUJO ESCURO" no tema escuro */
:root:not([data-theme="dark"]) .logo-escuro { display: none !important; }
[data-theme="dark"] .logo-claro { display: none !important; }

/* ══════════════════════ CONTROLE DE ACESSO — Login / MFA ══════════════════════ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;              /* oculto até a checagem de sessão decidir */
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(1200px 600px at 20% -10%, rgba(209, 26, 42, 0.12), transparent 60%),
                var(--bg-primary);
}
/* Estados do body: sem classe = "verificando" (nada aparece, evita o flash da tela de
   login antes de saber se a sessão é válida). .mostrar-login = overlay. .autenticado = app. */
body.mostrar-login .login-overlay { display: flex; }
body:not(.autenticado) .app-container { display: none !important; }

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    padding: 32px 30px;
}
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}
.login-brand img { max-width: 190px; width: 100%; height: auto; }
.login-brand-sub {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.login-step { display: none; flex-direction: column; }
.login-step.active { display: flex; }
.login-title { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.login-desc { font-size: 0.9rem; color: var(--text-secondary); margin: 0 0 20px; line-height: 1.5; }
.login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.login-field > span { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--brand-red-alpha);
}
.login-senha-wrap { position: relative; display: flex; align-items: center; }
.login-senha-wrap input { padding-right: 44px; }
.login-eye {
    position: absolute; right: 8px;
    background: none; border: none; cursor: pointer;
    font-size: 1.05rem; opacity: 0.6; padding: 6px;
}
.login-eye:hover { opacity: 1; }
.login-codigo-input {
    letter-spacing: 0.28em;
    text-align: center;
    text-transform: uppercase;
    font-size: 1.25rem !important;
    font-weight: 700;
}
/* O placeholder não deve herdar o tamanho/espaçamento do código digitado */
.login-codigo-input::placeholder {
    font-size: 0.9rem;
    letter-spacing: normal;
    text-transform: none;
    font-weight: 400;
}
.login-checkbox {
    display: flex; align-items: center; gap: 9px;
    font-size: 0.88rem; color: var(--text-secondary);
    margin-bottom: 18px; cursor: pointer;
}
.login-checkbox input { width: 16px; height: 16px; accent-color: var(--brand-red); }
.login-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--brand-red);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.login-btn:hover { background: var(--brand-red-hover); }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: 0.6; cursor: default; }
.login-btn-confirmar { margin-top: 10px; }
.login-link {
    background: none; border: none; cursor: pointer;
    color: var(--brand-red); font-size: 0.85rem; font-weight: 600;
    padding: 10px 0 0; text-align: center;
}
.login-link:hover { text-decoration: underline; }
.login-inline-actions { display: flex; justify-content: space-between; gap: 10px; }
.login-alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.86rem;
    margin-bottom: 18px;
    line-height: 1.4;
}
.login-alert.erro { background: var(--badge-bg-error); color: var(--badge-text-error); }
.login-alert.ok { background: var(--badge-bg-success); color: var(--badge-text-success); }
.login-alert.info { background: var(--brand-red-alpha); color: var(--brand-red); }

.senha-policy { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.senha-policy li {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: var(--text-muted);
    transition: color .15s;
}
.senha-policy li .pol-icon { font-size: 0.9rem; width: 16px; text-align: center; }
.senha-policy li.ok { color: var(--badge-text-success); }
.senha-policy li.ok .pol-icon::before { content: "✔"; }
.senha-policy li.ok .pol-icon { font-size: 0; }
.senha-policy li.ok .pol-icon::before { font-size: 0.9rem; }

/* Chip de usuário + botão Sair na topbar */
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand-red); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; text-transform: uppercase;
}
.user-chip-info { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.user-chip-role { font-size: 0.72rem; color: var(--text-muted); }
.btn-logout {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
    transition: border-color .15s, color .15s;
}
.btn-logout:hover { border-color: var(--brand-red); color: var(--brand-red); }
.btn-logout svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Botões de ação da tabela de usuários (Controle de Acesso) */
.btn-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-right: 5px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    vertical-align: middle;
    transition: color .15s, border-color .15s, background .15s;
}
.btn-acao:last-child { margin-right: 0; }
.btn-acao svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.btn-acao:hover {
    color: var(--brand-red);
    border-color: var(--brand-red);
    background: var(--brand-red-alpha);
}
.btn-acao-danger:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: var(--badge-bg-error);
}

@media (max-width: 640px) {
    .user-chip-info { display: none; }
    .login-card { padding: 26px 20px; }
}
