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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #1a202c;
    min-height: 100vh;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

.back-to-site {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    color: #0f4336;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.back-to-site:hover {
    background: #0f4336;
    color: white;
    transform: translateX(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-site i {
    transition: transform 0.3s ease;
}

.back-to-site:hover i {
    transform: translateX(-3px);
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 0.5rem;
}

.login-header h1.domain-header {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000000 !important;
    background: none !important;
    -webkit-text-fill-color: #000000 !important;
}

.login-header p {
    color: #64748b;
    font-size: 0.9375rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
    font-size: 0.875rem;
}

.login-form label i {
    margin-right: 0.5rem;
    color: #10b981;
}

.login-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.875rem;
    text-align: center;
}

/* Dashboard */
.dashboard-screen {
    min-height: 100vh;
    background: #f8fafc;
}

.admin-header {
    background: linear-gradient(135deg, #0f4336 0%, #0a2e24 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-left h1 i {
    margin-right: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.user-info i {
    font-size: 1.5rem;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

/* Stats Dashboard */
.stats-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.controls-bar {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.btn-export, .btn-refresh {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9375rem;
}

.btn-export {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-refresh {
    background: white;
    color: #10b981;
    border: 2px solid #10b981;
}

.btn-refresh:hover {
    background: #10b981;
    color: white;
}

/* Table */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.leads-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 700;
    color: #334155;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leads-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.leads-table tbody tr:hover {
    background: #f8fafc;
}

.leads-table td {
    padding: 1.25rem 1.5rem;
    font-size: 0.9375rem;
}

.loading-row td {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 1rem;
}

.lead-name {
    font-weight: 600;
    color: #1a202c;
}

.lead-email, .lead-phone {
    color: #64748b;
    font-size: 0.875rem;
}

.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-excellent {
    background: #d1fae5;
    color: #065f46;
}

.badge-good {
    background: #dbeafe;
    color: #1e40af;
}

.badge-fair {
    background: #fef3c7;
    color: #92400e;
}

.badge-building {
    background: #fee2e2;
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-view {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fca5a5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

.close-modal {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #fca5a5;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-print {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Lead Detail */
.lead-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.detail-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-row {
    margin-bottom: 1rem;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
}

/* Documents Section */
.documents-section {
    grid-column: 1 / -1;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.document-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.document-item:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.document-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.document-label i {
    color: #10b981;
}

.document-preview {
    text-align: center;
}

.document-link {
    display: block;
    text-decoration: none;
    color: #6366f1;
    font-weight: 600;
    transition: all 0.3s ease;
}

.document-link:hover {
    color: #4f46e5;
}

.document-thumbnail {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.document-thumbnail:hover {
    border-color: #6366f1;
    transform: scale(1.02);
}

.document-link i.fa-file-pdf {
    font-size: 3rem;
    color: #dc2626;
    display: block;
    margin-bottom: 0.5rem;
}

.no-documents {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.no-documents i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.no-documents p {
    font-size: 1rem;
    font-weight: 500;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .modal-content, .modal-content * {
        visibility: visible;
    }

    .modal-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        max-height: none;
        box-shadow: none;
    }

    .modal-header, .modal-footer {
        display: none;
    }

    .detail-section {
        page-break-inside: avoid;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-controls {
        justify-content: stretch;
    }

    .filter-controls > * {
        flex: 1;
    }

    .leads-table {
        font-size: 0.875rem;
    }

    .leads-table th, .leads-table td {
        padding: 0.75rem 0.5rem;
    }

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