        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
        }

        body {
            background: #f0f7ff;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .crm-container {
            max-width: 1400px;
            width: 100%;
            background: white;
            border-radius: 28px;
            box-shadow: 0 20px 40px rgba(0, 40, 80, 0.12);
            padding: 24px 28px 32px;
            border: 1px solid #d0e6ff;
        }

        .header-crm {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-bottom: 18px;
            border-bottom: 4px solid #1a5f9c;
            margin-bottom: 24px;
            flex-wrap: wrap;
            gap: 12px;
        }

        .header-crm h1 {
            font-weight: 600;
            font-size: 1.9rem;
            color: #0a2f5a;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .header-crm h1 i {
            color: #2b7bc9;
        }

        .user-badge {
            background: #e6f0fa;
            padding: 10px 20px;
            border-radius: 60px;
            border: 1px solid #b6d4f0;
            color: #0f3d6b;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 0.95rem;
        }

        .user-badge .role-badge {
            background: #1a6bb0;
            color: white;
            padding: 2px 12px;
            border-radius: 30px;
            font-size: 0.7rem;
            text-transform: uppercase;
            font-weight: 700;
        }

        .btn-logout {
            background: transparent;
            border: 1.5px solid #1a6bb0;
            color: #1a6bb0;
            padding: 6px 16px;
            border-radius: 40px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: 0.2s;
        }

        .btn-logout:hover {
            background: #1a6bb0;
            color: white;
        }

        .login-overlay {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 460px;
        }

        .login-card {
            background: white;
            padding: 40px 44px;
            border-radius: 32px;
            border: 1px solid #c7def5;
            box-shadow: 0 8px 24px rgba(24, 84, 156, 0.08);
            width: 100%;
            max-width: 420px;
        }

        .login-card h2 {
            color: #0a2f5a;
            font-weight: 600;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .login-card h2 i {
            color: #2b7bc9;
        }

        .login-card p {
            color: #3b6a94;
            margin-bottom: 28px;
            border-left: 4px solid #6aa7e0;
            padding-left: 14px;
            font-size: 0.95rem;
        }

        .input-group {
            margin-bottom: 18px;
        }

        .input-group label {
            display: block;
            font-weight: 500;
            color: #1a4f7a;
            margin-bottom: 5px;
            font-size: 0.9rem;
        }

        .input-group input {
            width: 100%;
            padding: 12px 16px;
            border: 1.5px solid #cde0f2;
            border-radius: 40px;
            font-size: 0.95rem;
            transition: 0.2s;
            background: #fafcff;
        }

        .input-group input:focus {
            outline: none;
            border-color: #1a6bb0;
            box-shadow: 0 0 0 3px rgba(26, 107, 176, 0.15);
        }

        .btn-primary {
            background: #1a6bb0;
            border: none;
            padding: 13px 20px;
            border-radius: 60px;
            color: white;
            font-weight: 600;
            font-size: 1rem;
            width: 100%;
            cursor: pointer;
            transition: 0.2s;
        }

        .btn-primary:hover {
            background: #0f548f;
            transform: scale(0.99);
        }

        .dashboard {
            display: none;
        }

        .panel-grid {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 24px;
            margin-top: 10px;
        }

        @media (max-width: 900px) {
            .panel-grid {
                grid-template-columns: 1fr;
            }
        }

        .card {
            background: white;
            border-radius: 20px;
            border: 1px solid #d4e6fc;
            padding: 20px 22px;
            box-shadow: 0 4px 12px rgba(0, 45, 90, 0.03);
        }

        .card-title {
            font-weight: 600;
            color: #0a2f5a;
            font-size: 1.2rem;
            border-bottom: 2px solid #b3d4f0;
            padding-bottom: 12px;
            margin-bottom: 18px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .card-title i {
            color: #2b7bc9;
        }

        .service-item {
            background: #f8fbff;
            border-radius: 14px;
            padding: 14px 16px;
            margin-bottom: 12px;
            border-left: 6px solid #2b7bc9;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
        }

        .service-item .label {
            font-weight: 500;
            color: #1c4a72;
        }

        .service-item .due {
            background: #ffecdb;
            padding: 4px 14px;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 600;
            color: #b45a1c;
        }

        .service-item .due.alert {
            background: #ffe1e1;
            color: #b31b1b;
        }

        .action-buttons {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 4px;
        }

        .btn-sm {
            background: white;
            border: 1px solid #b6d0e8;
            padding: 4px 14px;
            border-radius: 40px;
            font-size: 0.75rem;
            font-weight: 600;
            color: #1a5f8a;
            cursor: pointer;
            transition: 0.1s;
        }

        .btn-sm:hover {
            background: #deecfc;
        }

        .btn-sm i {
            margin-right: 4px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        th {
            text-align: left;
            padding: 12px 6px 8px 0;
            color: #1f5480;
            border-bottom: 2px solid #b6d4f0;
            font-weight: 600;
        }

        td {
            padding: 12px 6px 12px 0;
            border-bottom: 1px solid #dceafa;
        }

        .badge-arrendatario {
            background: #dceafa;
            padding: 2px 12px;
            border-radius: 30px;
            color: #14446b;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .flex-between {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .mt-3 {
            margin-top: 18px;
        }
        .mb-2 {
            margin-bottom: 12px;
        }
        .text-muted {
            color: #4d7193;
            font-size: 0.9rem;
        }

        .add-arrendatario {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .add-arrendatario input {
            padding: 8px 16px;
            border: 1.5px solid #cde0f2;
            border-radius: 40px;
            flex: 1;
            min-width: 140px;
        }

        .btn-add {
            background: #1a6bb0;
            border: none;
            padding: 8px 22px;
            border-radius: 40px;
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: 0.2s;
        }

        .btn-add:hover {
            background: #0f548f;
        }

        .historial-item {
            background: #f5faff;
            padding: 8px 14px;
            border-radius: 30px;
            margin-bottom: 6px;
            font-size: 0.85rem;
            border: 1px solid #d4e6fc;
        }

        .print-btn {
            background: white;
            border: 1.5px solid #1a6bb0;
            padding: 6px 18px;
            border-radius: 60px;
            font-weight: 600;
            color: #1a6bb0;
            cursor: pointer;
            transition: 0.15s;
        }

        .print-btn:hover {
            background: #1a6bb0;
            color: white;
        }

        .hidden {
            display: none;
        }

        .user-list-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid #ecf3fa;
        }

        .user-list-item .user-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-list-item .user-actions {
            display: flex;
            gap: 8px;
        }

        .btn-danger {
            background: #dc3545;
            border: none;
            padding: 4px 14px;
            border-radius: 40px;
            color: white;
            font-weight: 600;
            font-size: 0.75rem;
            cursor: pointer;
            transition: 0.2s;
        }

        .btn-danger:hover {
            background: #c82333;
        }

        .access-code {
            font-family: monospace;
            background: #f0f7ff;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 0.85rem;
            color: #1a6bb0;
        }

        .empty-state {
            color: #6c8aa8;
            text-align: center;
            padding: 20px;
            font-style: italic;
        }
   