body {
    background: #f6f8fa;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.card {
    border-radius: 1rem;
}

.card-title {
    font-weight: 600;
    color: #2d4158;
}

.btn-primary {
    background: #2962ff;
    border: none;
}

.btn-primary:hover {
    background: #0039cb;
}

.sidebar {
    background: #14213d;
    min-height: 100vh;
    color: #fff;
    width: 220px;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
}

.sidebar .sidebar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 1.5rem 1rem 1rem 1.3rem;
    letter-spacing: 1px;
    color: #fff;
}

.sidebar .nav-link {
    color: #a6b1cb;
    font-weight: 500;
    padding: 12px 1.5rem;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    color: #fff;
    background: #223058;
    border-left: 3px solid #2962ff;
    text-decoration: none;
}

.sidebar .sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    color: #a6b1cb;
}

.main-content {
    margin-left: 220px;
    padding: 1.5rem 2rem 2rem 2rem;
}

.topbar {
    background: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e9f2;
    padding-left: 220px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar .user-info {
    margin-left: auto;
    margin-right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c1d3fe;
    display: inline-block;
    object-fit: cover;
}

.kpi-row {
    display: flex;
    gap: 18px;
    margin-bottom: 2rem;
}

.kpi-card {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.kpi-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-main {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 0;
    line-height: 1.1;
}

.kpi-percent {
    font-size: 1.15rem;
    font-weight: 600;
    color: #00bcd4;
    margin-bottom: 0;
    line-height: 1.1;
    margin-left: 8px;
    letter-spacing: -1px;
}

.kpi-main-row {
    display: flex;
    align-items: end;
    gap: 7px;
    margin-bottom: 4px;
}

.kpi-small {
    font-size: 0.93rem;
    color: #666;
}

.kpi-card .card-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 2px;
}

@media (max-width: 991px) {
    .kpi-row {
        flex-direction: column;
        gap: 12px;
    }
}

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

.kpi-table-modern,
.table.table-bordered {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-size: 0.78rem;
    color: #223;
    background: #fff;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    min-width: 900px;
    box-shadow: 0 2px 8px 0 rgba(40, 60, 90, 0.04);
}

.kpi-table-modern th,
.table.table-bordered th {
    background: #fafbfc !important;
    color: #263253 !important;
    font-weight: 600;
    border-bottom: 2px solid #e4e8f0 !important;
    padding: 0.5em 0.9em;
    text-align: left;
}

.kpi-table-modern td,
.table.table-bordered td {
    padding: 0.45em 0.9em;
    border-bottom: 1px solid #f0f2f5 !important;
    text-align: right;
    background: #fff;
}

.kpi-table-modern td:first-child,
.kpi-table-modern th:first-child,
.table.table-bordered td:first-child,
.table.table-bordered th:first-child {
    text-align: left;
}

.kpi-table-modern tr.divider-row td,
.table.table-bordered tr.divider-row td {
    border: none !important;
    height: 8px;
    background: transparent !important;
}

.kpi-table-modern tr.table-secondary td,
.table.table-bordered tr.table-secondary td {
    background: #f7faff !important;
    color: #1a2233;
    font-weight: 600;
}

.text-primary {
    color: #2962ff !important;
}

.td-bg-success {
    background: #38c172 !important;
    color: #fff !important;
}

.td-bg-danger {
    background: #e3342f !important;
    color: #fff !important;
}

.td-bg-secondary {
    background: #6c757d !important;
    color: #fff !important;
}

/* Default hover effect for table rows */
.kpi-table-modern tr:hover td,
.table.table-bordered tr:hover td {
    background: #f4f7fd !important;
}

/* Specifically disable hover for rows with no-hover class */
.kpi-table-modern tr.no-hover:hover td,
.table.table-bordered tr.no-hover:hover td {
    background: inherit !important;
    color: inherit !important;
}

/* Ensure colored cells maintain their colors even on hover for no-hover rows */
.kpi-table-modern tr.no-hover:hover td.td-bg-success,
.table.table-bordered tr.no-hover:hover td.td-bg-success {
    background: #38c172 !important;
    color: #fff !important;
}

.kpi-table-modern tr.no-hover:hover td.td-bg-danger,
.table.table-bordered tr.no-hover:hover td.td-bg-danger {
    background: #e3342f !important;
    color: #fff !important;
}

.kpi-table-modern tr.no-hover:hover td.td-bg-secondary,
.table.table-bordered tr.no-hover:hover td.td-bg-secondary {
    background: #6c757d !important;
    color: #fff !important;
}

/* Table border styling to match cards */
.table-border-primary {
    border: 1px solid #2962ff !important;
    border-radius: 10px;
    overflow: hidden;
}

.table-border-success {
    border: 1px solid #28a745 !important;
    border-radius: 10px;
    overflow: hidden;
}

.table-border-secondary {
    border: 2px solid #6c757d !important;
    border-radius: 10px;
    overflow: hidden;
}

.table-border-info {
    border: 2px solid #17a2b8 !important;
    border-radius: 10px;
    overflow: hidden;
}

.table-border-warning {
    border: 2px solid #ffc107 !important;
    border-radius: 10px;
    overflow: hidden;
}

.table-border-danger {
    border: 2px solid #dc3545 !important;
    border-radius: 10px;
    overflow: hidden;
}

.clickable-revenue {
    cursor: pointer;
    color: #2962ff;
    text-decoration: underline;
    transition: color 0.2s;
}

.clickable-revenue:hover {
    color: #0039cb;
    background-color: #f0f7ff;
    padding: 2px 4px;
    border-radius: 3px;
}

.revenue-cell {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
}
/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    max-width: 480px;
    width: 100%;
}

.login-page .logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2962ff;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.login-page .tagline {
    color: #6c757d;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.login-page .form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-page .form-control:focus {
    border-color: #2962ff;
    box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.1);
}

.btn-login {
    background: linear-gradient(45deg, #2962ff, #1976d2);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(41, 98, 255, 0.4);
}

.input-group-custom {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group-custom i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

.input-group-custom .form-control {
    padding-left: 45px;
}

.features {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #6c757d;
}

.feature-item i {
    color: #2962ff;
    margin-right: 12px;
    font-size: 1.2rem;
}

.login-page .alert {
    border-radius: 12px;
    border: none;
    padding: 12px 16px;
}

.footer-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Spinner animation */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.bonus-commission-cell {
    cursor: pointer;
    color: #0066cc;
    transition: background-color 0.2s;
}

.bonus-commission-cell:hover {
    background-color: #f0f7ff;
    border-radius: 3px;
    text-decoration: underline;
}

.clickable-revenue {
    cursor: pointer;
    color: #000;
    text-decoration: none;
    transition: color 0.2s;
}

.clickable-revenue:hover {
    color: #0039cb;
    background-color: #f0f7ff;
    padding: 2px 4px;
    border-radius: 3px;
}

.revenue-cell {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
}

.bonus-commission-cell {
    cursor: pointer;
    color: #0066cc;
    transition: background-color 0.2s;
}

.bonus-commission-cell:hover {
    background-color: #f0f7ff;
    border-radius: 3px;
    text-decoration: underline;
}

/* Enhanced KPI Card Styles */
.kpi-divider {
    margin: 8px 0;
    border-top: 1px solid #e9ecef;
}

.kpi-annual-row {
    margin-top: 8px;
}

.kpi-annual-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.kpi-annual-value {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.kpi-annual-amount {
    font-weight: 600;
    font-size: 1.1rem;
}

.kpi-annual-percent {
    font-weight: 700;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.05);
}

.kpi-annual-target {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #fd7e14 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Split Login Page Styles */
.split-login-page {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.split-login-container {
    display: flex;
    height: 100vh;
}

/* Left Panel */
.left-panel {
    flex: 1;
    background: #2c3e50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.left-content {
    max-width: 500px;
    width: 100%;
}

.brand-logo {
    margin-bottom: 3rem;
}

.logo-image {
    max-width: 200px;
    height: auto;
}

.logo-fallback {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    display: none;
}

/* Hide fallback text if image loads */
.logo-image:not([src=""])+.logo-fallback {
    display: none;
}

/* Show fallback text if image fails to load */
.logo-image[src=""] {
    display: none;
}

.logo-image[src=""]+.logo-fallback {
    display: block;
}

.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: white;
}

.hero-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    color: #ecf0f1;
}

/* Right Panel */
.right-panel {
    flex: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.login-form-container {
    max-width: 400px;
    width: 100%;
}

.login-form-container h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #6c757d;
    margin-bottom: 2rem;
}

.signup-link {
    color: #007bff;
    text-decoration: none;
}

.signup-link:hover {
    text-decoration: underline;
}

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

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.login-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
}

.forgot-password a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.875rem;
}

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

.btn-login {
    background: #2c3e50;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.btn-login:hover {
    background: #34495e;
}

.form-check-label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .split-login-container {
        flex-direction: column;
    }

    .left-panel {
        flex: 0 0 auto;
        padding: 2rem;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .right-panel {
        flex: 1;
        padding: 2rem;
    }
}