/* =========================================
   ANJO CONTROL v6.0
   Branding: ANJO INOX
   + Login + Pesquisa Global + Histórico
   ========================================= */

/* =========================================
   TELA DE LOGIN
   ========================================= */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5597FC 0%, #25416E 100%);
    padding: 20px;
}
.login-screen.hidden { display: none; }
.login-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo-img { height: 48px; margin-bottom: 16px; filter: brightness(0); }
.login-version { font-size: 12px; color: #737373; margin-top: 4px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 13px; font-weight: 600; color: #404040; margin-bottom: 8px; }
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 14px;
    background: #FAFAFA;
    transition: all 0.15s ease;
}
.login-form input:focus {
    outline: none;
    border-color: #5597FC;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(85, 151, 252, 0.1);
}
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 48px; }
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #A3A3A3;
    cursor: pointer;
    padding: 4px;
}
.toggle-password:hover { color: #525252; }
.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #5597FC 0%, #25416E 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(85, 151, 252, 0.4); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.login-error {
    margin-top: 16px;
    padding: 12px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    color: #EF4444;
    font-size: 13px;
    text-align: center;
    display: none;
}
.login-error.show { display: block; }
.login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   ORIGINAL v5.8
   ========================================= */

:root {
    --primary: #5597FC;
    --primary-dark: #25416E;
    --primary-light: #7BB3FF;
    --black: #000000;
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E5E5E5;
    --gray-300: #D4D4D4;
    --gray-400: #A3A3A3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --success: #22C55E;
    --warning: #EAB308;
    --danger: #EF4444;
    --info: #3B82F6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.05);
    --radius: 6px;
    --radius-lg: 8px;
    --transition: all 0.15s ease;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

#app { display: flex; min-height: 100vh; }

/* Loading */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    background: var(--primary-dark);
}
.loading-logo { height: 64px; margin-bottom: 24px; opacity: 0.9; }
.loading-text { color: white; font-size: 12px; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.6; }

/* Sidebar */
.sidebar {
    width: 256px;
    background: var(--primary-dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo img { height: 28px; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-version { font-size: 10px; opacity: 0.5; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.1em; }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-section { margin-bottom: 4px; }
.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.4;
    padding: 16px 24px 8px;
    font-weight: 600;
}
.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border-left: 2px solid transparent;
    gap: 12px;
    position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.nav-item.active { background: rgba(255,255,255,0.1); color: var(--white); border-left-color: var(--primary); }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.5; flex-shrink: 0; }
.nav-badge {
    position: absolute;
    right: 16px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}
.nav-badge.warning { background: var(--warning); color: var(--gray-900); }
.nav-badge.info { background: var(--primary); }

/* Sidebar Footer - Usuário e Logout */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-email {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 8px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.8);
    color: white;
}

/* =========================================
   PESQUISA GLOBAL (NOVO V5.8)
   ========================================= */
.global-search-container {
    position: fixed;
    top: 0;
    left: 256px;
    right: 0;
    z-index: 50;
    padding: 12px 32px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.global-search-wrapper {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 0 12px;
    max-width: 600px;
    transition: var(--transition);
}

.global-search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(85, 151, 252, 0.15);
}

.global-search-icon {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    flex-shrink: 0;
}

.global-search-icon svg {
    width: 18px;
    height: 18px;
}

.global-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 14px;
    background: transparent;
    color: var(--gray-800);
}

.global-search-input::placeholder {
    color: var(--gray-400);
}

.global-search-shortcut {
    font-size: 11px;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.global-search-results {
    position: absolute;
    top: 100%;
    left: 32px;
    right: 32px;
    max-width: 600px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.global-search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-100);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(85, 151, 252, 0.1);
    border-radius: var(--radius);
    color: var(--primary);
    flex-shrink: 0;
}

.search-result-icon svg {
    width: 18px;
    height: 18px;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title mark {
    background: rgba(85, 151, 252, 0.2);
    color: var(--primary-dark);
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-module {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.search-no-results {
    padding: 32px;
    text-align: center;
    color: var(--gray-500);
}

.search-no-results-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--gray-300);
}

.search-no-results-icon svg {
    width: 100%;
    height: 100%;
}

/* Highlight Item Animation */
@keyframes highlightPulse {
    0% { background: rgba(85, 151, 252, 0.2); }
    50% { background: rgba(85, 151, 252, 0.4); }
    100% { background: transparent; }
}

.highlight-item {
    animation: highlightPulse 2s ease;
}

/* Main Content */
svg {
    width: 20px;
    height: 20px;
}

/* Ícones em cabeçalhos h3 */
h3 svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 6px;
}

/* Ícones de alerta (dots) */
.alerta-icon svg {
    width: 16px;
    height: 16px;
}

/* Ícones nos cards de conta */
.conta-card-icon svg {
    width: 16px;
    height: 16px;
}

/* Ícones no header de custo tipo */
.custo-tipo-nome svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
}

.main-content {
    flex: 1;
    margin-left: 256px;
    padding: 32px;
    padding-top: 80px; /* Espaço para a barra de pesquisa */
    min-height: 100vh;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}
.page-title svg { width: 24px; height: 24px; color: var(--primary); stroke-width: 1.5; }
.page-subtitle { color: var(--gray-500); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 12px; align-items: center; }

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}
.card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }
.card-icon.primary { background: rgba(85,151,252,0.1); color: var(--primary); }
.card-icon.success { background: rgba(34,197,94,0.1); color: var(--success); }
.card-icon.warning { background: rgba(234,179,8,0.1); color: var(--warning); }
.card-icon.danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.card-icon.info { background: rgba(59,130,246,0.1); color: var(--info); }
.card-label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.card-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 6px 0;
    letter-spacing: -0.02em;
    transition: filter 0.3s ease;
}
.card-value.success { color: var(--success); }
.card-value.warning { color: var(--warning); }
.card-value.danger { color: var(--danger); }
.card-value.hidden-value { filter: blur(8px); user-select: none; }
.card-detail { font-size: 12px; color: var(--gray-500); }
.card-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; }
.card-trend svg { width: 14px; height: 14px; }
.card-trend.up { color: var(--success); }
.card-trend.down { color: var(--danger); }

/* Privacy Toggle */
.privacy-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
}
.privacy-toggle:hover { border-color: var(--gray-300); color: var(--gray-800); }
.privacy-toggle.active { background: var(--primary-dark); color: white; border-color: var(--primary-dark); }
.privacy-toggle svg { width: 16px; height: 16px; stroke-width: 1.5; }

/* Sections */
.section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title svg { width: 18px; height: 18px; color: var(--primary); stroke-width: 1.5; }

/* Tables */
.table-container { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr.row-warning { background: rgba(234,179,8,0.05); }
.table-value { font-weight: 600; font-size: 18px; }
.table-value.positive { color: var(--success); }
.table-value.negative { color: var(--danger); }
.table-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; stroke-width: 1.5; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #16A34A; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #DC2626; }
.btn-warning { background: var(--warning); color: var(--gray-900); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-icon.sm { width: 28px; height: 28px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-800);
    transition: var(--transition);
    font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(85,151,252,0.1);
}
.form-input:disabled, .form-select:disabled { background: var(--gray-100); cursor: not-allowed; }
.form-textarea { min-height: 100px; resize: vertical; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 200px; }
.form-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.form-checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-hint { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

/* Status Badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.status-pending { background: rgba(234,179,8,0.1); color: #A16207; }
.status-approved { background: rgba(34,197,94,0.1); color: #15803D; }
.status-progress { background: rgba(59,130,246,0.1); color: #1D4ED8; }
.status-completed { background: rgba(34,197,94,0.1); color: #15803D; }
.status-cancelled { background: rgba(239,68,68,0.1); color: #B91C1C; }
.status-overdue { background: rgba(239,68,68,0.1); color: #B91C1C; }
.status-paid { background: rgba(34,197,94,0.1); color: #15803D; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.modal-close {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.modal-close svg { width: 18px; height: 18px; stroke-width: 1.5; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Filters */
.filters-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 12px; color: var(--gray-600); font-weight: 500; }
.filter-select {
    padding: 7px 10px;
    font-size: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    min-width: 140px;
}

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--gray-200); margin-bottom: 20px; }

.tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab svg {
    width: 16px !important;
    height: 16px !important;
    stroke-width: 1.5;
}

.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* Summary */
.summary-row {
    display: flex;
    gap: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.summary-item { flex: 1; min-width: 140px; }
.summary-label { font-size: 10px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; font-weight: 500; }
.summary-value { font-size: 18px; font-weight: 600; color: var(--gray-800); }
.summary-value.success { color: var(--success); }
.summary-value.danger { color: var(--danger); }
.summary-value.warning { color: var(--warning); }

/* Empty State */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state-icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--gray-300); }
.empty-state-icon svg { width: 100%; height: 100%; stroke-width: 1; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; }
.empty-state-text { color: var(--gray-500); font-size: 13px; margin-bottom: 24px; }

/* Calendar */
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.calendar-title { font-size: 15px; font-weight: 600; }
.calendar-nav { display: flex; gap: 4px; }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.calendar-weekday {
    padding: 10px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
}
.calendar-day {
    min-height: 80px;
    padding: 8px;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}
.calendar-day:hover { background: var(--gray-50); }
.calendar-day.other-month { background: var(--gray-50); }
.calendar-day.other-month .calendar-day-number { color: var(--gray-400); }
.calendar-day.today { background: rgba(85,151,252,0.05); }
.calendar-day.today .calendar-day-number { background: var(--primary); color: white; }
.calendar-day-number {
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    border-radius: 50%;
    margin-bottom: 4px;
}
.calendar-event {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.calendar-event.visita { background: rgba(85,151,252,0.15); color: var(--primary-dark); }
.calendar-event.instalacao { background: rgba(34,197,94,0.15); color: #15803D; }
.calendar-event.entrega { background: rgba(234,179,8,0.15); color: #A16207; }
.calendar-event.reuniao { background: rgba(139,92,246,0.15); color: #6D28D9; }
.calendar-event.outro { background: var(--gray-100); color: var(--gray-600); }

/* =========================================
   LEGENDA DA AGENDA (ATUALIZADA V5.8)
   Nomes em preto + quadradinho colorido horizontal
   ========================================= */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    margin-top: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
}

/* Cores para cada tipo */
.legend-color.visita { background: var(--info); }
.legend-color.instalacao { background: var(--warning); }
.legend-color.entrega { background: var(--success); }
.legend-color.reuniao { background: var(--primary); }
.legend-color.medicao { background: #9333ea; }
.legend-color.outro { background: var(--gray-400); }

/* =========================================
   HISTÓRICO DE ALTERAÇÕES (NOVO V5.8)
   ========================================= */
.historico-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.historico-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    transition: var(--transition);
}

.historico-item:hover {
    background: var(--gray-50);
}

.historico-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.historico-icon svg {
    width: 16px;
    height: 16px;
}

.historico-icon.criar {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.historico-icon.editar {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.historico-icon.excluir {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.historico-content {
    flex: 1;
    min-width: 0;
}

.historico-descricao {
    font-size: 13px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.historico-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.historico-usuario {
    font-weight: 500;
    color: var(--primary-dark);
}

.historico-modulo {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.historico-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-500);
}

.historico-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--gray-300);
}

/* Item List */
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}
.item-info { flex: 1; }
.item-name { font-weight: 500; font-size: 13px; }
.item-details { font-size: 12px; color: var(--gray-500); }
.item-value { font-weight: 600; color: var(--gray-800); }

/* Mobile */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px; 
    left: 16px;
    z-index: 101;
    width: 40px; height: 40px;
    background: var(--primary-dark);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn svg { width: 20px; height: 20px; stroke-width: 1.5; }

/* Swipe indicator (área invisível para swipe) */
.swipe-area {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 20px;
    height: 100vh;
    z-index: 99;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; padding: 24px; padding-top: 80px; }
    .global-search-container { left: 220px; }
}
@media (max-width: 768px) {
    .sidebar { 
        transform: translateX(-100%); 
        width: 280px;
        padding-top: env(safe-area-inset-top);
    }
    .sidebar.open { transform: translateX(0); }
    
    /* Esconder logo no sidebar mobile */
    .sidebar .sidebar-logo img { display: none; }
    .sidebar .sidebar-logo-text { display: none; }
    .sidebar-header { 
        padding: 16px 24px; 
        padding-top: calc(8px + env(safe-area-inset-top));
    }
    .sidebar-version { 
        font-size: 12px; 
        opacity: 0.7; 
        margin-top: 0;
    }
    
    .main-content { 
        margin-left: 0; 
        padding: 16px; 
        padding-top: calc(80px + env(safe-area-inset-top)); 
    }
    
    /* Ajustar posição do botão menu e pesquisa para safe area */
    .mobile-menu-btn { 
        display: flex; 
        top: calc(16px + env(safe-area-inset-top));
    }
    
    .global-search-container { 
        left: 0; 
        padding: 12px 16px; 
        padding-left: 70px;
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    .global-search-shortcut { display: none; }
    
    /* Área de swipe visível em mobile */
    .swipe-area { display: block; }
    
    .page-header { flex-direction: column; align-items: flex-start; }
    .cards-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .form-row > * { min-width: 100%; }
    .calendar-legend { gap: 12px; }
    
    /* Overlay quando menu aberto */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* =========================================
   SELETOR DE CLIENTE (ORÇAMENTOS)
   ========================================= */
.client-selector {
    position: relative;
}

.client-search {
    position: relative;
    display: flex;
    align-items: center;
}

.client-search-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
    width: 16px;
    height: 16px;
}

.client-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px !important;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    transition: var(--transition);
}

.client-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(85, 151, 252, 0.1);
}

.client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.client-dropdown.active {
    display: block;
    animation: fadeIn 0.15s ease;
}

.client-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-option:last-child {
    border-bottom: none;
}

.client-option:hover {
    background: var(--gray-50);
}

.client-option:active {
    background: rgba(85, 151, 252, 0.1);
}

.client-option-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    line-height: 1.3;
}

.client-option-details {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    line-height: 1.4;
}

.client-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.client-detail-item svg {
    flex-shrink: 0;
    color: var(--gray-400);
    width: 12px;
    height: 12px;
}

/* =========================================
   CATÁLOGO DE PRODUTOS
   ========================================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.product-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    line-height: 1.3;
    flex: 1;
}

.product-description {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
}

.product-price {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-dark);
}

.product-unit {
    font-size: 12px;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Cliente selecionado - Badge */
.selected-client-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(85, 151, 252, 0.08) 0%, rgba(37, 65, 110, 0.05) 100%);
    border: 1px solid rgba(85, 151, 252, 0.3);
    border-radius: var(--radius-lg);
    margin-top: 8px;
}

.selected-client-info {
    flex: 1;
    min-width: 0;
}

.selected-client-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.selected-client-contact {
    font-size: 12px;
    color: var(--gray-600);
}

.remove-client-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
    flex-shrink: 0;
}

.remove-client-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.remove-client-btn svg {
    width: 16px;
    height: 16px;
}

/* Estilos Mobile para Seletor de Cliente */
@media (max-width: 768px) {
    .client-dropdown {
        max-height: 220px;
    }
    
    .client-option {
        padding: 14px 16px;
    }
    
    .client-option-name {
        font-size: 15px;
    }
    
    .client-option-details {
        font-size: 13px;
    }
    
    .selected-client-badge {
        flex-direction: row;
        padding: 14px 16px;
    }
    
    .selected-client-name {
        font-size: 15px;
    }
    
    .selected-client-contact {
        font-size: 13px;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }
.font-mono { font-family: 'SF Mono', monospace; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.2s ease forwards; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Print */
@media print {
    .sidebar, .mobile-menu-btn, .btn, .modal-overlay, .global-search-container { display: none !important; }
    .main-content { margin-left: 0; padding: 0; padding-top: 0; }
    .card, .section { box-shadow: none; border: 1px solid var(--gray-200); }
}
/* =========================================
   ANJO CONTROL - CSS FOLHA DE PAGAMENTO
   Adicionar ao final do styles.css
   ========================================= */

/* Tabs Container */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-light);
    border-radius: 12px;
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(85, 151, 252, 0.1);
    color: var(--primary);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

/* Stat Cards aprimorados */
.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.stat-card.highlight .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-card.highlight .stat-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white;
}

/* Timeline */
.timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 10px;
    min-width: 180px;
    transition: all 0.2s ease;
}

.timeline-item.passado {
    opacity: 0.6;
}

.timeline-item.hoje {
    background: linear-gradient(135deg, var(--primary-light), rgba(85, 151, 252, 0.2));
    border: 2px solid var(--primary);
}

.timeline-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-content {
    display: flex;
    flex-direction: column;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.timeline-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Row Warning */
.row-warning {
    background: rgba(239, 68, 68, 0.08) !important;
}

/* Tabela de Folha */
.table-folha {
    width: 100%;
    border-collapse: collapse;
}

.table-folha td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table-folha .section-header {
    background: var(--bg-light);
}

.table-folha .section-header td {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
}

.table-folha .total-row {
    background: linear-gradient(135deg, var(--primary-light), rgba(85, 151, 252, 0.1));
}

.table-folha .total-row td {
    border-bottom: none;
    padding: 16px;
}

.text-right {
    text-align: right;
}

/* Folha Detalhes */
.folha-detalhes {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.folha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.folha-header h4 {
    margin: 0;
    font-size: 16px;
}

/* Alert personalizado */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1D4ED8;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #B45309;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert strong {
    font-weight: 600;
}

/* Form Select Small */
.form-select-sm {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .tabs-container {
        padding: 2px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .tab-btn span:not(.tab-btn svg) {
        display: none;
    }

    .timeline {
        flex-direction: column;
    }

    .timeline-item {
        min-width: 100%;
    }

    .stat-card {
        min-width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   FUNCIONÁRIOS - MODAL GRANDE E SEÇÕES
   ========================================= */

.modal-lg {
    max-width: 800px !important;
    width: 95%;
}

.modal-lg .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.form-label.required::after {
    content: " *";
    color: var(--danger);
}

/* Badges de tipo de contrato */
.badge-clt { background: var(--success-light); color: var(--success); }
.badge-estagiario { background: var(--info-light); color: var(--info); }
.badge-socio { background: var(--warning-light); color: var(--warning); }
.badge-autonomo { background: var(--gray-200); color: var(--gray-700); }

/* Action buttons inline */
.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Mobile responsivo para modal grande */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 100% !important;
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-lg .modal-body {
        max-height: calc(100vh - 140px);
    }
    
    .form-section-title {
        font-size: 0.9rem;
    }
    
    .action-buttons {
        justify-content: flex-end;
    }
}

/* =========================================
   CONTAS BANCÁRIAS - CARDS E GRID
   ========================================= */
.contas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.conta-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
}

.conta-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.conta-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.conta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.conta-icon svg {
    width: 18px;
    height: 18px;
}

.conta-info {
    flex: 1;
    min-width: 0;
}

.conta-actions {
    display: flex;
    gap: 4px;
}

.conta-pix {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
    color: var(--gray-500);
}

.conta-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    background: rgba(85, 151, 252, 0.1);
    color: var(--primary);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
}

.conta-limite {
    margin-top: 8px;
}

.limite-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.limite-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.limite-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.limite-bar-fill.success { background: var(--success); }
.limite-bar-fill.warning { background: var(--warning); }
.limite-bar-fill.danger { background: var(--danger); }

.limite-percent {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
    text-align: right;
}

.conta-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.conta-card-icon svg {
    width: 16px;
    height: 16px;
}

/* Saldo por conta */
.contas-saldo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.conta-saldo-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px 16px;
    min-width: 180px;
    cursor: pointer;
    transition: var(--transition);
}

.conta-saldo-card:hover {
    background: var(--gray-100);
}

.conta-saldo-card.selected {
    background: rgba(85, 151, 252, 0.1);
    border-color: var(--primary);
}

.conta-nome {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
}

.conta-tipo {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: lowercase;
}

.conta-saldo {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
}

.conta-saldo.positivo {
    color: var(--success);
}

.conta-saldo.negativo {
    color: var(--danger);
}

/* =========================================
   ALERTAS E PAINEL DE URGÊNCIA
   ========================================= */
.alertas-panel {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(234, 179, 8, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.alertas-header {
    margin-bottom: 16px;
}

.alertas-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--gray-800);
    margin: 0;
}

.alertas-header h3 svg {
    width: 20px;
    height: 20px;
    color: var(--danger);
}

.alertas-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.alerta-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    min-width: 160px;
}

.alerta-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.alerta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.alerta-icon svg {
    width: 16px;
    height: 16px;
}

.alerta-info {
    flex: 1;
}

.alerta-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.alerta-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
}

.alerta-valor {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}

/* Alertas de margem (Floating) */
.alertas-margem {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.alerta-margem {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid;
}

.alerta-margem.critico {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.alerta-margem.alerta {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.2);
}

.alerta-margem .alerta-icon {
    flex-shrink: 0;
}

.alerta-margem .alerta-content {
    flex: 1;
}

.alerta-margem .alerta-content strong {
    display: block;
    font-size: 13px;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.alerta-margem .alerta-content span {
    font-size: 12px;
    color: var(--gray-500);
}

/* =========================================
   CUSTOS POR TIPO (FLOATING)
   ========================================= */
.custos-por-tipo {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.custo-tipo {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
}

.custo-tipo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.custo-tipo-nome {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.custo-tipo-nome svg {
    width: 14px;
    height: 14px;
}

.custo-tipo-valor {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.custo-tipo-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.custo-tipo-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.custo-tipo-fill.material {
    background: var(--primary);
}

.custo-tipo-fill.mao-obra {
    background: var(--success);
}

.custo-tipo-fill.outros {
    background: var(--warning);
}

/* =========================================
   CATEGORIA CHART (CUSTOS FIXOS)
   ========================================= */
.categoria-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.categoria-item {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
}

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

.categoria-nome {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.categoria-valor {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.categoria-valor small {
    font-weight: 400;
    color: var(--gray-500);
}

.categoria-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.categoria-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS
   ========================================= */
@media (max-width: 768px) {
    .contas-grid {
        grid-template-columns: 1fr;
    }
    
    .contas-saldo-grid {
        flex-direction: column;
    }
    
    .conta-saldo-card {
        min-width: 100%;
    }
    
    .alertas-grid {
        flex-direction: column;
    }
    
    .alerta-card {
        min-width: 100%;
    }
}
