
        /* =====================================================
           CSS COMPLETO - FISIOGEST PRO
           ===================================================== */
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

:root {
    --primary: #235a4c;
    --primary-dark: #1a4036;
    --primary-light: #8cb4ac;
    --secondary: #728e84;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #8bac9f;
    --light: #f0ecdf;
    --dark: #343a40;
    --white: #ffffff;
    --gray-100: #f5f3eb;
    --gray-200: #e8e5d9;
    --gray-300: #d4cfbf;
    --gray-400: #b8b09e;
    --gray-500: #9c9480;
    --gray-600: #728e84;
    --gray-700: #4a6a5e;
    --gray-800: #2d4a40;
    --gray-900: #1a3028;
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-100);
    --text-primary: var(--gray-800);
    --text-muted: var(--gray-600);
    --border-color: var(--gray-300);
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary: #3d7a6b;
    --primary-dark: #2d5f52;
    --primary-light: #6da89a;
    --secondary: #5a7d72;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --info: #5dade2;
    --light: #2c3e50;
    --dark: #ecf0f1;
    --white: #1a1a2e;
    --gray-100: #16213e;
    --gray-200: #1a1a2e;
    --gray-300: #2a2a4a;
    --gray-400: #3a3a5a;
    --gray-500: #6a6a8a;
    --gray-600: #8a8aaa;
    --gray-700: #aaaacc;
    --gray-800: #ccccdd;
    --gray-900: #eeeef5;
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #eeeef5;
    --text-muted: #8a8aaa;
    --border-color: #2a2a4a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

[data-theme="dark"] .financial-tabs .tab {
    background: var(--gray-200);
    border-color: var(--gray-300);
    color: var(--gray-600);
}
[data-theme="dark"] .financial-tabs .tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
[data-theme="dark"] .package-card {
    background: var(--gray-200);
    border-color: var(--gray-300);
}
[data-theme="dark"] .package-progress {
    background: var(--gray-300);
}
[data-theme="dark"] .cashflow-card {
    background: var(--gray-200);
    border-color: var(--gray-300);
}
[data-theme="dark"] .overdue-row {
    background: rgba(231,76,60,0.12) !important;
}
[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, var(--gray-200) 0%, var(--gray-300) 100%);
    color: var(--text-primary);
}
[data-theme="dark"] .sidebar .nav-item {
    color: var(--text-muted);
}
[data-theme="dark"] .sidebar .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}
[data-theme="dark"] .sidebar .nav-section {
    color: var(--gray-500);
}
[data-theme="dark"] .sidebar-header {
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] .sidebar-footer {
    background: var(--bg-primary);
    border-top-color: var(--border-color);
    color: var(--text-primary);
}

        body {
            font-family: var(--font-family);
            background-color: var(--bg-secondary);
            color: var(--text-primary);
            line-height: 1.6;
            min-height: 100vh;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        /* =====================================================
           LOADING OVERLAY
           ===================================================== */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255,255,255,0.95);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            gap: 20px;
        }

        .loading-overlay.hidden {
            display: none;
        }

        .spinner {
            width: 50px;
            height: 50px;
            border: 4px solid var(--gray-300);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* =====================================================
           TOAST NOTIFICATIONS
           ===================================================== */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            background: var(--bg-primary);
            color: var(--text-primary);
            padding: 16px 20px;
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 300px;
            max-width: 450px;
            animation: slideIn 0.3s ease;
            border-left: 4px solid var(--primary);
        }

        .toast.success { border-left-color: var(--success); }
        .toast.error { border-left-color: var(--danger); }
        .toast.warning { border-left-color: var(--warning); }

        .toast-icon { font-size: 1.5em; }
        .toast-message { flex: 1; }
        .toast-close {
            background: none;
            border: none;
            font-size: 1.2em;
            cursor: pointer;
            color: var(--gray-500);
            padding: 0 5px;
        }

        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        /* =====================================================
           AUTH SCREENS (Login/Registro)
           ===================================================== */
        .auth-container {
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            background: linear-gradient(135deg, #0077b6 0%, #00b4d8 50%, #90e0ef 100%);
        }

        .auth-box {
            background: var(--bg-primary);
            color: var(--text-primary);
            padding: 40px;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            width: 100%;
            max-width: 480px;
        }

        .auth-logo {
            text-align: center;
            margin-bottom: 30px;
        }

        .auth-logo-img {
            max-height: 80px;
            margin-bottom: 10px;
        }

        .auth-logo h1 {
            font-size: 2em;
            color: var(--primary);
            margin-bottom: 5px;
        }

        .auth-logo p {
            color: var(--gray-600);
            font-size: 0.95em;
        }

        .auth-badge {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin: 20px 0;
        }

        .auth-badge span {
            background: var(--gray-100);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.8em;
            color: var(--gray-700);
        }

        .auth-tabs {
            display: flex;
            margin-bottom: 25px;
            border-bottom: 2px solid var(--gray-200);
        }

        .auth-tab {
            flex: 1;
            padding: 12px;
            text-align: center;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            color: var(--gray-500);
            transition: var(--transition);
            position: relative;
        }

        .auth-tab.active {
            color: var(--primary);
        }

        .auth-tab.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--primary);
        }

        .auth-form {
            display: none;
        }

        .auth-form.active {
            display: block;
        }

        /* =====================================================
           FORMS
           ===================================================== */
        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: var(--gray-700);
            font-size: 0.95em;
        }

        .form-group label .required {
            color: var(--danger);
        }

        .form-control {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-sm);
            font-size: 1em;
            font-family: inherit;
            transition: var(--transition);
            background: var(--bg-primary);
            color: var(--text-primary);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(0,119,182,0.1);
        }

        .form-control:disabled {
            background: var(--gray-100);
            cursor: not-allowed;
        }

        .form-control.error {
            border-color: var(--danger);
        }

        textarea.form-control {
            resize: vertical;
            min-height: 100px;
        }

        select.form-control {
            cursor: pointer;
        }

        .form-text {
            font-size: 0.85em;
            color: var(--gray-600);
            margin-top: 5px;
        }

        .form-error {
            font-size: 0.85em;
            color: var(--danger);
            margin-top: 5px;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
        }

        .form-grid-2 {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
        }

        .form-grid-3 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }

        .form-group.full-width {
            grid-column: 1 / -1;
        }

        .input-group {
            display: flex;
            gap: 0;
        }

        .input-group .form-control {
            border-radius: var(--radius-sm) 0 0 var(--radius-sm);
        }

        .input-group-text {
            padding: 12px 16px;
            background: var(--gray-100);
            border: 2px solid var(--gray-300);
            border-left: none;
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
            color: var(--gray-600);
        }

        /* Checkbox e Radio */
        .form-check {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 10px;
        }

        .form-check input[type="checkbox"],
        .form-check input[type="radio"] {
            width: 20px;
            height: 20px;
            margin-top: 2px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        .form-check label {
            cursor: pointer;
            font-weight: normal;
            margin-bottom: 0;
        }

        /* =====================================================
           BUTTONS
           ===================================================== */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 24px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 1em;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            white-space: nowrap;
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: var(--white);
        }

        .btn-primary:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,119,182,0.4);
        }

        .btn-secondary {
            background: var(--gray-200);
            color: var(--gray-700);
        }

        .btn-secondary:hover:not(:disabled) {
            background: var(--gray-300);
        }

        .btn-success {
            background: var(--success);
            color: var(--white);
        }

        .btn-success:hover:not(:disabled) {
            background: #218838;
        }

        .btn-danger {
            background: var(--danger);
            color: var(--white);
        }

        .btn-danger:hover:not(:disabled) {
            background: #c82333;
        }

        .btn-warning {
            background: var(--warning);
            color: var(--gray-800);
        }

        .btn-info {
            background: var(--info);
            color: var(--white);
        }
        .btn-info:hover:not(:disabled) {
            background: #138496;
        }

        .btn-outline {
            background: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
        }

        .btn-outline:hover:not(:disabled) {
            background: var(--primary);
            color: var(--white);
        }

        .btn-sm {
            padding: 8px 16px;
            font-size: 0.9em;
        }

        .btn-lg {
            padding: 16px 32px;
            font-size: 1.1em;
        }

        .btn-block {
            width: 100%;
        }

        .btn-icon {
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: var(--radius-sm);
        }

        .btn-group {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        /* =====================================================
           APP LAYOUT
           ===================================================== */
        .app-container {
            display: none;
            min-height: 100vh;
        }

        .app-container.active {
            display: flex;
        }

        /* Sidebar */
        .sidebar {
            width: 280px;
            background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
            color: var(--white);
            position: fixed;
            top: 0;
            left: 0;
            height: 100vh;
            z-index: 1000;
            transition: var(--transition);
            display: flex;
            flex-direction: column;
        }

        .sidebar-header {
            padding: 25px 20px;
            text-align: center;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .sidebar-logo-img {
            max-height: 50px;
            margin-bottom: 8px;
        }

        .sidebar-header h2 {
            font-size: 1.5em;
            margin-bottom: 5px;
        }

        .sidebar-header .badge {
            display: inline-block;
            background: var(--success);
            color: var(--white);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75em;
            margin-top: 8px;
        }

        .sidebar-user {
            padding: 20px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .sidebar-user-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .sidebar-user-avatar {
            width: 45px;
            height: 45px;
            background: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.2em;
        }

        .sidebar-user-name {
            font-weight: 600;
            font-size: 0.95em;
        }

        .sidebar-user-role {
            font-size: 0.8em;
            color: var(--primary-light);
        }

        .sidebar-nav {
            padding: 15px 0;
            flex: 1;
            overflow-y: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        .sidebar-nav::-webkit-scrollbar {
            display: none;
        }

        .nav-section {
            padding: 10px 20px 5px;
            font-size: 0.75em;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--gray-500);
        }

        .nav-item {
            display: block;
            padding: 12px 20px;
            color: rgba(255,255,255,0.8);
            text-decoration: none;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
            font-size: 0.95em;
        }

        .nav-item:hover {
            background: rgba(255,255,255,0.1);
            color: var(--white);
        }

        .nav-item.active {
            background: var(--primary);
            color: var(--white);
        }

        .nav-item-icon {
            font-size: 1.2em;
            width: 24px;
            text-align: center;
        }

        .sidebar-footer {
            padding: 15px 20px;
            border-top: 1px solid rgba(255,255,255,0.1);
            flex-shrink: 0;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            margin-left: 280px;
            min-height: 100vh;
            background: var(--gray-100);
        }

        .main-header {
            background: var(--white);
            padding: 20px 30px;
            box-shadow: var(--shadow-sm);
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .main-header h1 {
            font-size: 1.5em;
            color: var(--gray-800);
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .main-body {
            padding: 30px;
        }

        /* =====================================================
           SECTIONS
           ===================================================== */
        .section {
            display: none;
        }

        .section.active {
            display: block;
        }

        /* =====================================================
           CARDS
           ===================================================== */
        .card {
            background: var(--bg-primary);
            color: var(--text-primary);
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            margin-bottom: 25px;
            overflow: hidden;
        }

        .card-header {
            padding: 20px 25px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }

        .card-header h2 {
            font-size: 1.2em;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .card-body {
            padding: 25px;
        }

        .card-footer {
            padding: 15px 25px;
            border-top: 1px solid var(--gray-200);
            background: var(--gray-50);
        }

        /* Stats Cards */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: var(--white);
            padding: 25px;
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            display: flex;
            align-items: center;
            gap: 20px;
            transition: var(--transition);
        }

        .stat-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow);
        }

        .stat-icon {
            width: 60px;
            height: 60px;
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8em;
        }

        .stat-icon.blue { background: rgba(0,119,182,0.1); color: var(--primary); }
        .stat-icon.green { background: rgba(40,167,69,0.1); color: var(--success); }
        .stat-icon.orange { background: rgba(255,193,7,0.1); color: #e0a800; }
        .stat-icon.purple { background: rgba(111,66,193,0.1); color: #6f42c1; }
        .stat-icon.red { background: rgba(220,53,69,0.1); color: var(--danger); }

        .stat-info h3 {
            font-size: 1.8em;
            color: var(--gray-800);
            line-height: 1.2;
        }

        .stat-info p {
            color: var(--gray-600);
            font-size: 0.9em;
        }

        /* =====================================================
           TABLES
           ===================================================== */
        .table-responsive {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        table th,
        table td {
            padding: 15px;
            text-align: left;
            border-bottom: 1px solid var(--gray-200);
        }

        table th {
            background: var(--bg-secondary);
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.9em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        table tbody tr:hover {
            background: var(--bg-secondary);
        }

        table td {
            color: var(--gray-700);
        }

        .table-actions {
            display: flex;
            gap: 5px;
        }

        /* =====================================================
           BADGES
           ===================================================== */
        .badge {
            display: inline-flex;
            align-items: center;
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 0.8em;
            font-weight: 600;
        }

        .badge-primary { background: rgba(0,119,182,0.1); color: var(--primary); }
        .badge-success { background: rgba(40,167,69,0.1); color: var(--success); }
        .badge-warning { background: rgba(255,193,7,0.2); color: #856404; }
        .badge-danger { background: rgba(220,53,69,0.1); color: var(--danger); }
        .badge-info { background: rgba(23,162,184,0.1); color: var(--info); }
        .badge-secondary { background: var(--gray-200); color: var(--gray-700); }

        /* =====================================================
           ALERTS
           ===================================================== */
        .alert {
            padding: 15px 20px;
            border-radius: var(--radius-sm);
            margin-bottom: 20px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .alert-icon { font-size: 1.3em; }

        .alert-info {
            background: rgba(0,119,182,0.1);
            border-left: 4px solid var(--primary);
            color: var(--primary-dark);
        }

        .alert-success {
            background: rgba(40,167,69,0.1);
            border-left: 4px solid var(--success);
            color: #155724;
        }

        .alert-warning {
            background: rgba(255,193,7,0.15);
            border-left: 4px solid var(--warning);
            color: #856404;
        }

        .alert-danger {
            background: rgba(220,53,69,0.1);
            border-left: 4px solid var(--danger);
            color: #721c24;
        }

        /* =====================================================
           MODALS
           ===================================================== */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            display: none;
            justify-content: center;
            align-items: flex-start;
            padding: 50px 20px;
            z-index: 2000;
            overflow-y: auto;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: var(--bg-primary);
            color: var(--text-primary);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 700px;
            max-height: calc(100vh - 100px);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            animation: modalIn 0.3s ease;
        }

        .modal.modal-lg {
            max-width: 900px;
        }

        .modal.modal-xl {
            max-width: 1100px;
        }

        @keyframes modalIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            padding: 20px 25px;
            border-bottom: 1px solid var(--gray-200);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--gray-50);
        }

        .modal-header h2 {
            font-size: 1.25em;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5em;
            cursor: pointer;
            color: var(--gray-500);
            padding: 5px;
            line-height: 1;
            transition: var(--transition);
        }

        .modal-close:hover {
            color: var(--danger);
        }

        .modal-body {
            padding: 25px;
            overflow-y: auto;
            flex: 1;
        }

        .modal-footer {
            padding: 15px 25px;
            border-top: 1px solid var(--gray-200);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            background: var(--gray-50);
        }

        /* =====================================================
           SEARCH
           ===================================================== */
        .search-box {
            position: relative;
            margin-bottom: 20px;
        }

        .search-box input {
            width: 100%;
            padding: 12px 20px 12px 45px;
            border: 2px solid var(--gray-300);
            border-radius: var(--radius-sm);
            font-size: 1em;
            transition: var(--transition);
        }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .search-box::before {
            content: '\f002';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 1.1em;
        }

        /* =====================================================
           TABS
           ===================================================== */
        .tabs {
            display: flex;
            border-bottom: 2px solid var(--gray-200);
            margin-bottom: 25px;
            overflow-x: auto;
        }

        .tab-btn {
            padding: 12px 20px;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.95em;
            font-weight: 600;
            color: var(--gray-600);
            transition: var(--transition);
            position: relative;
            white-space: nowrap;
        }

        .tab-btn:hover {
            color: var(--primary);
        }

        .tab-btn.active {
            color: var(--primary);
        }

        .tab-btn.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--primary);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* === Financial Tabs === */
        .financial-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            flex: 1;
        }
        .financial-tabs .tab {
            padding: 8px 14px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 0.85em;
            font-weight: 600;
            color: var(--text-muted);
            transition: var(--transition);
            white-space: nowrap;
        }
        .financial-tabs .tab:hover {
            color: var(--primary);
            border-color: var(--primary-light);
        }
        .financial-tabs .tab.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }

        /* === KPI Grid (financeiro) === */
        .kpi-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 20px;
        }
        .kpi-grid .stat-card {
            padding: 16px;
            gap: 12px;
        }
        .kpi-grid .stat-icon {
            width: 44px;
            height: 44px;
            font-size: 1.3em;
        }
        .kpi-grid .stat-info h3 {
            font-size: 1.1em;
        }
        .kpi-grid .stat-info p {
            font-size: 0.75em;
        }

        /* === Package Grid / Cards === */
        .package-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 16px;
        }
        .package-card {
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
        }
        .package-card:hover {
            box-shadow: var(--shadow);
        }
        .package-card h4 {
            margin-bottom: 8px;
            color: var(--text-primary);
        }
        .package-card p {
            margin-bottom: 4px;
            font-size: 0.9em;
            color: var(--text-muted);
        }
        .package-card .pacote-status {
            display: inline-block;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 0.8em;
            font-weight: 600;
        }
        .package-card .pacote-status.ativo {
            background: rgba(40,167,69,0.15);
            color: var(--success);
        }
        .package-card .pacote-status.expirado {
            background: rgba(220,53,69,0.15);
            color: var(--danger);
        }
        .package-card .pacote-status.cancelado {
            background: rgba(108,117,125,0.15);
            color: var(--gray-500);
        }
        .package-card .pacote-actions {
            display: flex;
            gap: 8px;
            margin-top: 12px;
        }

        /* Package Progress Bar */
        .package-progress {
            height: 8px;
            background: var(--gray-200);
            border-radius: 4px;
            margin: 12px 0;
            overflow: hidden;
        }
        .package-progress-bar {
            height: 100%;
            background: var(--primary);
            border-radius: 4px;
            transition: width 0.5s ease;
        }
        .package-progress-bar.warning {
            background: var(--warning);
        }
        .package-progress-bar.danger {
            background: var(--danger);
        }

        /* === Cashflow Grid === */
        .cashflow-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-top: 16px;
        }
        .cashflow-card {
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            padding: 20px;
            text-align: center;
            box-shadow: var(--shadow-sm);
        }
        .cashflow-card h3 {
            font-size: 0.9em;
            color: var(--text-muted);
            margin-bottom: 8px;
        }
        .cashflow-value {
            font-size: 1.6em;
            font-weight: 700;
        }
        .cashflow-card.income .cashflow-value {
            color: var(--success);
        }
        .cashflow-card.expense .cashflow-value {
            color: var(--danger);
        }
        .cashflow-card.balance .cashflow-value {
            color: var(--primary);
        }

        /* === Overdue Row === */
        .overdue-row {
            background: rgba(220,53,69,0.06) !important;
        }
        .overdue-row td:first-child {
            border-left: 3px solid var(--danger);
        }

        /* =====================================================
           ACCORDION / SECTIONS
           ===================================================== */
        .form-section {
            background: var(--gray-50);
            border-radius: var(--radius);
            padding: 20px;
            margin-bottom: 20px;
        }

        .form-section-title {
            font-size: 1.1em;
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* =====================================================
           CONSENT BOX
           ===================================================== */
        .consent-box {
            background: #fffbeb;
            border: 2px solid var(--warning);
            border-radius: var(--radius);
            padding: 20px;
            margin-bottom: 25px;
        }

        .consent-box h4 {
            color: #92400e;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .consent-box p {
            color: #78350f;
            font-size: 0.95em;
            margin-bottom: 15px;
        }

        /* =====================================================
           PRONTUÁRIO
           ===================================================== */
        .prontuario-header {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: var(--white);
            padding: 25px;
            border-radius: var(--radius);
            margin-bottom: 25px;
        }

        .prontuario-header h3 {
            font-size: 1.3em;
            margin-bottom: 5px;
        }

        .prontuario-header p {
            opacity: 0.9;
            font-size: 0.9em;
        }

        .evolucao-item {
            background: var(--gray-50);
            border-left: 4px solid var(--primary);
            padding: 20px;
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
            margin-bottom: 15px;
        }

        .grafico-dor-wrapper { max-width: 500px; margin: 0 auto; }
        .evolucao-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .evolucao-date {
            font-size: 0.9em;
            color: var(--gray-600);
        }

        .evolucao-content p {
            margin-bottom: 10px;
        }

        .evolucao-content strong {
            color: var(--gray-700);
        }

        /* =====================================================
           AGENDA
           ===================================================== */
        .agenda-day {
            background: var(--white);
            border-radius: var(--radius);
            margin-bottom: 15px;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }

        .agenda-day-header {
            background: var(--primary);
            color: var(--white);
            padding: 12px 20px;
            font-weight: 600;
        }

        .agenda-item {
            display: flex;
            align-items: center;
            padding: 15px 20px;
            border-bottom: 1px solid var(--gray-200);
            gap: 15px;
        }

        .agenda-item:last-child {
            border-bottom: none;
        }

        .agenda-time {
            font-weight: 700;
            color: var(--primary);
            min-width: 70px;
            font-size: 1.1em;
        }

        .agenda-info {
            flex: 1;
        }

        .agenda-info h4 {
            color: var(--gray-800);
            margin-bottom: 3px;
        }

        .agenda-info p {
            font-size: 0.85em;
            color: var(--gray-600);
        }

        /* =====================================================
           EMPTY STATE
           ===================================================== */
        .empty-state {
            text-align: center;
            padding: 50px 20px;
            color: var(--gray-500);
        }

        .empty-state-icon {
            font-size: 4em;
            margin-bottom: 20px;
            opacity: 0.5;
        }

        .empty-state h3 {
            color: var(--gray-600);
            margin-bottom: 10px;
        }

        .empty-state p {
            margin-bottom: 20px;
        }

        /* =====================================================
           UTILITIES
           ===================================================== */
        .text-center { text-align: center; }
        .text-right { text-align: right; }
        .text-muted { color: var(--gray-600); }
        .text-success { color: var(--success); }
        .text-danger { color: var(--danger); }
        .text-primary { color: var(--primary); }

        .mt-1 { margin-top: 0.5rem; }
        .mt-2 { margin-top: 1rem; }
        .mt-3 { margin-top: 1.5rem; }
        .mt-4 { margin-top: 2rem; }

        .mb-1 { margin-bottom: 0.5rem; }
        .mb-2 { margin-bottom: 1rem; }
        .mb-3 { margin-bottom: 1.5rem; }
        .mb-4 { margin-bottom: 2rem; }

        .d-none { display: none; }
        .d-flex { display: flex; }
        .justify-between { justify-content: space-between; }
        .align-center { align-items: center; }
        .gap-1 { gap: 0.5rem; }
        .gap-2 { gap: 1rem; }

        /* =====================================================
           PRINT STYLES
           ===================================================== */
        @media print {
            .sidebar,
            .main-header,
            .btn,
            .modal-overlay,
            .toast-container {
                display: none !important;
            }

            .main-content {
                margin: 0;
                padding: 20px;
            }

            .card {
                box-shadow: none;
                border: 1px solid var(--gray-300);
            }
        }

        /* =====================================================
           RESPONSIVE
           ===================================================== */
        @media (max-width: 992px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar.active {
                transform: translateX(0);
            }

            .main-content {
                margin-left: 0;
            }

            .menu-toggle {
                display: block !important;
            }
        }

        @media (max-width: 768px) {
            .form-grid-2,
            .form-grid-3 {
                grid-template-columns: 1fr;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .modal {
                margin: 20px;
                max-height: calc(100vh - 40px);
            }

            .main-body {
                padding: 15px;
            }

            .card-body {
                padding: 15px;
            }

            table th,
            table td {
                padding: 10px;
                font-size: 0.9em;
            }
        }

        /* Menu toggle button (mobile) */
        .menu-toggle {
            display: none;
            background: none;
            border: none;
            font-size: 1.5em;
            cursor: pointer;
            padding: 5px;
        }

        /* Overlay for mobile sidebar */
        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 999;
        }

        .sidebar-overlay.active {
            display: block;
        }
    




/* =====================================================
   MELHORIAS - SKELETON LOADING
   ===================================================== */
.skeleton-pulse {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.skeleton-line {
    height: 16px;
    background: var(--gray-200);
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-30 { width: 30%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }

.skeleton-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    background: var(--gray-200);
}

.skeleton-info {
    flex: 1;
}

.skeleton-table {
    padding: 10px 0;
}

.skeleton-header, .skeleton-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.skeleton-header .skeleton-line {
    height: 12px;
    background: var(--gray-300);
}

/* =====================================================
   CONFIRMATION DIALOG
   ===================================================== */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confirm-overlay.active {
    opacity: 1;
}

.confirm-dialog {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px 35px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.confirm-overlay.active .confirm-dialog {
    transform: scale(1);
}

.confirm-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.confirm-message {
    font-size: 1.1em;
    color: var(--gray-700);
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn {
    min-width: 120px;
}

/* =====================================================
   FORM ERROR HIGHLIGHT
   ===================================================== */
.form-control.error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1) !important;
}

.form-error {
    font-size: 0.85em;
    color: var(--danger);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-error::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.9em;
}

/* =====================================================
   PASSWORD TOGGLE
   ===================================================== */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    color: var(--gray-600);
    transition: var(--transition);
    line-height: 1;
}

.toggle-password:hover {
    color: var(--primary);
}

/* =====================================================
   FORGOT PASSWORD LINK
   ===================================================== */
.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* =====================================================
   CHART PLACEHOLDER
   ===================================================== */
.chart-container {
    position: relative;
    width: 100%;
    max-height: 300px;
    margin: 20px 0;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    padding: 10px 0;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    border-radius: 6px 6px 0 0;
    min-width: 20px;
    transition: height 0.5s ease;
    position: relative;
    min-height: 4px;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar-label {
    text-align: center;
    font-size: 0.75em;
    color: var(--gray-600);
    margin-top: 8px;
}

.chart-bar-value {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

/* =====================================================
   RESPONSIVE IMPROVEMENTS
   ===================================================== */
@media (max-width: 480px) {
    .auth-box {
        padding: 25px 20px;
    }

    .auth-logo h1 {
        font-size: 1.5em;
    }

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

    .modal {
        margin: 10px;
    }

    .confirm-dialog {
        padding: 20px;
    }

    .chart-bars {
        height: 150px;
        gap: 4px;
    }

    .chart-bar-label {
        font-size: 0.65em;
    }

    .calendario-grid {
        gap: 2px;
    }
    .calendario-dia {
        padding: 6px 4px;
        min-height: 50px;
    }
    .calendario-dia-numero {
        font-size: 0.9em;
    }
    .calendario-titulo {
        font-size: 1em;
    }
}

/* =====================================================
   CALENDÁRIO
   ===================================================== */
.calendario-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.calendario-titulo {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    text-transform: capitalize;
}
.calendario-visao-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 3px;
    width: fit-content;
}
.calendario-visao-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}
.calendario-visao-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}
.calendario-dia-semana {
    text-align: center;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 4px;
}
.calendario-dia {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 6px;
    min-height: 65px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-primary);
}
.calendario-dia:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}
.calendario-dia.vazio {
    background: var(--bg-secondary);
    border-color: transparent;
    cursor: default;
}
.calendario-dia.vazio:hover {
    box-shadow: none;
    border-color: transparent;
}
.calendario-dia.hoje {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--bg-primary));
}
.calendario-dia.selecionado {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
    background: color-mix(in srgb, var(--primary) 15%, var(--bg-primary));
}
.calendario-dia.com-evento {
    font-weight: 500;
}
.calendario-dia-numero {
    display: block;
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 4px;
}
.calendario-dia-qtd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    padding: 0 5px;
    position: absolute;
    top: 4px;
    right: 4px;
}
.calendario-dia-dots {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.calendario-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.calendario-dot.realizado { background: var(--success); }
.calendario-dot.pendente { background: var(--warning); }

/* Timeline de eventos */
.calendario-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.calendario-evento-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    transition: background 0.15s;
}
.calendario-evento-item:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--bg-secondary));
}
.calendario-evento-item.livre {
    border-left-color: var(--success);
    background: transparent;
    cursor: pointer;
    opacity: 0.7;
}
.calendario-evento-item.livre:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--success) 8%, var(--bg-primary));
}
.calendario-evento-item.cancelado {
    border-left-color: var(--danger);
    opacity: 0.5;
}
.calendario-evento-hora {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary);
    min-width: 50px;
    text-align: center;
}
.calendario-evento-info {
    flex: 1;
}
.calendario-evento-info strong {
    display: block;
    font-size: 0.95em;
}
.calendario-evento-info .text-muted {
    font-size: 0.8em;
}

/* Paginação */
.paginacao {
    padding: 10px 25px;
}
.paginacao-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.paginacao-info {
    font-size: 0.85em;
    color: var(--text-muted);
}
.paginacao-inner .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Drag-and-drop handle */
.dnd-handle {
    cursor: grab;
    font-size: 1.2em;
    color: var(--text-muted);
    user-select: none;
    margin-right: 4px;
}
.dnd-handle:active {
    cursor: grabbing;
}

/* Layout calendário lado a lado */
.calendario-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.calendario-col {
    flex: 0 0 55%;
    min-width: 0;
}
.calendario-eventos-col {
    flex: 1;
    min-width: 0;
}
@media (max-width: 992px) {
    .calendario-layout {
        flex-direction: column;
    }
    .calendario-col {
        flex: none;
        width: 100%;
    }
}

/* Responsivo calendário */
@media (max-width: 768px) {
    .calendario-dia {
        min-height: 50px;
        padding: 6px 4px;
    }
    .calendario-dia-numero {
        font-size: 0.85em;
    }
    .calendario-dia-qtd {
        font-size: 0.6em;
        min-width: 16px;
        height: 16px;
    }
    .calendario-evento-item {
        flex-wrap: wrap;
        gap: 6px;
    }
    .calendario-evento-hora {
        min-width: 40px;
        font-size: 1em;
    }
}

/* =====================================================
   RECORRÊNCIA / DIAS DA SEMANA
   ===================================================== */
.dias-semana-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.dias-semana-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.dias-semana-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.dias-semana-item:has(input:checked) {
    background: color-mix(in srgb, var(--primary) 20%, var(--bg-secondary));
    border: 1px solid var(--primary);
}

/* =====================================================
   ANEXOS / FILE UPLOAD
   ===================================================== */
.anexo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.15s;
}
.anexo-item:hover {
    background: color-mix(in srgb, var(--primary) 6%, var(--bg-secondary));
}
.anexo-preview {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-primary);
}
.anexo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.anexo-icon {
    font-size: 1.5em;
}
.anexo-info {
    flex: 1;
    min-width: 0;
}
.anexo-info strong {
    display: block;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.anexo-info .text-muted {
    font-size: 0.8em;
}
.anexo-info p {
    font-size: 0.85em;
    margin: 2px 0 0;
}
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    z-index: 1000;
    box-shadow: var(--shadow);
}
.autocomplete-dropdown .autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    transition: background 0.15s;
    color: var(--text-primary);
}
.autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-dropdown .autocomplete-item:hover,
.autocomplete-dropdown .autocomplete-item.active {
    background: var(--bg-secondary);
}
.autocomplete-dropdown .autocomplete-item strong {
    color: var(--primary);
}
.admin-only { display: none; }
body.is-admin .admin-only { display: revert; }

/* Painel Master - Tabs */
#masterTabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0.5rem;
}
#masterTabs .tab {
    font-size: 0.8em;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
}
.planos-grid .planocard { border: 1px solid var(--border-color); }
.planos-grid .planocard.opacity-50 { opacity: 0.5; }
.planos-grid .planocard .card-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem; }
.planos-grid .planocard .card-header h3 { margin: 0; font-size: 1.05rem; }
.planos-grid .planocard .card-body p { margin: 0.25rem 0; font-size: 0.9em; }

/* Admin standalone page */
.admin-container { display: none; min-height: 100vh; }
.admin-container.active { display: block; }
.admin-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: var(--card-bg); border-bottom: 1px solid var(--border-color); }
.admin-header-left { display: flex; align-items: center; gap: 12px; }
.admin-header-left h1 { font-size: 1.3rem; margin: 0; }
.admin-header-left img { height: 36px; }
.admin-content { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }
.text-muted.text-center { text-align: center; }

/* Procedimentos e Protocolos */
.form-control-sm {
    font-size: 0.875em;
    padding: 0.3rem 0.6rem;
    height: auto;
}
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875em;
}
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-2 { gap: 0.75rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* =====================================================
   RESPONSIVIDADE PARA SMARTPHONES
   ===================================================== */
@media (max-width: 576px) {
    .main-header {
        padding: 12px 15px;
    }
    .main-header h1 {
        font-size: 1.1em;
    }
    .header-actions #currentDate {
        display: none;
    }
    .header-actions .btn-sm {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .main-body {
        padding: 10px;
    }

    .card-header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .card-header h2 {
        font-size: 1em;
    }
    .card-header .btn-group {
        width: 100%;
    }
    .card-header .btn-group .btn {
        flex: 1;
        justify-content: center;
        font-size: 0.85em;
        padding: 10px 12px;
    }
    .card-header .btn {
        width: 100%;
        justify-content: center;
    }
    .card-body {
        padding: 12px;
    }

    .stat-card {
        padding: 15px;
        gap: 12px;
    }
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
        flex-shrink: 0;
    }
    .stat-info h3 {
        font-size: 1.3em;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    .btn-sm {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9em;
    }

    table th,
    table td {
        padding: 8px 10px;
        font-size: 0.8em;
    }
    .table-actions {
        gap: 3px;
    }
    .table-actions .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8em;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin: 0;
    }
    .modal.modal-lg,
    .modal.modal-xl {
        max-width: 100%;
    }
    .modal-header {
        padding: 15px;
    }
    .modal-header h2 {
        font-size: 1em;
    }
    .modal-body {
        padding: 15px;
    }
    .modal-footer {
        padding: 12px 15px;
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .form-group {
        margin-bottom: 12px;
    }
    .form-control {
        padding: 10px 14px;
        font-size: 0.9em;
    }
    .form-section {
        padding: 12px;
    }

    .search-box input {
        padding: 10px 14px 10px 40px;
        font-size: 0.9em;
    }

    .tabs {
        gap: 0;
    }
    .tab-btn {
        padding: 10px 14px;
        font-size: 0.85em;
    }

    .calendario-evento-item {
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
    }
    .calendario-evento-hora {
        font-size: 0.9em;
        min-width: 40px;
    }
    .calendario-evento-info strong {
        font-size: 0.85em;
    }

    .empty-state {
        padding: 30px 15px;
    }
    .empty-state-icon {
        font-size: 3em;
    }
    .empty-state h3 {
        font-size: 1em;
    }

    .consent-box {
        padding: 12px;
    }

    .evolucao-item {
        padding: 12px;
    }
    .evolucao-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .anexo-item {
        flex-wrap: wrap;
    }
    .anexo-preview {
        width: 40px;
        height: 40px;
    }

    .chart-bars {
        height: 120px;
        gap: 3px;
    }
    .chart-bar-value {
        font-size: 0.6em;
        top: -16px;
    }

    .dias-semana-item {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    .calendario-dia {
        min-height: 40px;
        padding: 4px 2px;
    }
    .calendario-dia-numero {
        font-size: 0.8em;
    }
    .calendario-dia-qtd {
        font-size: 0.55em;
        min-width: 14px;
        height: 14px;
        top: 2px;
        right: 2px;
    }
    .calendario-titulo {
        font-size: 0.9em;
    }
    .calendario-visao-btn {
        padding: 4px 10px;
        font-size: 0.75em;
    }

    .prontuario-header {
        padding: 15px;
    }
    .prontuario-header h3 {
        font-size: 1em;
    }

    .sidebar {
        width: 85vw;
        max-width: 320px;
    }
    .sidebar-header {
        padding: 15px;
    }
    .sidebar-header h2 {
        font-size: 1.2em;
    }
    .sidebar-user {
        padding: 12px 15px;
    }
    .nav-item {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .nav-section {
        padding: 8px 15px 4px;
        font-size: 0.7em;
    }

    .confirm-dialog {
        padding: 20px;
        width: 95%;
    }
    .confirm-actions {
        flex-direction: column;
    }
    .confirm-actions .btn {
        width: 100%;
    }
    .confirm-message {
        font-size: 1em;
    }

    .toast {
        min-width: unset;
        max-width: calc(100vw - 20px);
        padding: 12px 16px;
        font-size: 0.9em;
    }
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .calendario-layout {
        flex-direction: column;
    }
    .calendario-col {
        flex: none;
        width: 100%;
    }
    .calendario-eventos-col {
        flex: none;
        width: 100%;
    }

    .agenda-item {
        padding: 10px 15px;
        gap: 10px;
        flex-wrap: wrap;
    }
    .agenda-time {
        font-size: 0.95em;
        min-width: 55px;
    }
}

@media (max-width: 400px) {
    .main-body {
        padding: 8px;
    }
    .card-header {
        padding: 10px 12px;
    }
    .card-body {
        padding: 10px;
    }
    table th,
    table td {
        padding: 6px 8px;
        font-size: 0.75em;
    }
    .stat-card {
        padding: 12px;
    }
    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1em;
    }
    .stat-info h3 {
        font-size: 1.1em;
}
.modal-body {
    padding: 12px;
}
}

.help-contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.help-contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--card-bg, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #dee2e6);
}

.help-contact-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #0077b6);
    color: #fff;
    border-radius: 8px;
    font-size: 1.1em;
    flex-shrink: 0;
}

.help-contact-item strong {
    display: block;
    font-size: 0.9em;
    color: var(--text-muted, #6c757d);
}

.help-contact-item p {
    margin: 0;
    font-size: 1em;
    color: var(--text-color, #333);
}

[data-theme="dark"] .help-contact-item {
    background: #2d2d2d;
    border-color: #444;
}

[data-theme="dark"] .help-contact-item p {
    color: #e0e0e0;
}


