* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

header h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 2.2rem;
}

.controls {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-scan {
    background: #3498db;
    color: white;
}

.btn-scan:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-add {
    background: #2ecc71;
    color: white;
}

.btn-add:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.btn-save {
    background: #2ecc71;
    color: white;
    padding: 12px 30px;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.stat-icon.total { background: #3498db; }
.stat-icon.online { background: #2ecc71; }
.stat-icon.offline { background: #e74c3c; }
.stat-icon.percentage { background: #9b59b6; }

.stat-info h3 {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-info p {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.main {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.aps-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-container {
    overflow-x: auto;
}

#apTable {
    width: 100%;
    border-collapse: collapse;
}

#apTable th {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#apTable td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
}

#apTable tr:hover {
    background: #f8f9fa;
}

.status {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status.online {
    background: #d5f4e6;
    color: #27ae60;
}

.status.offline {
    background: #fdeaea;
    color: #e74c3c;
}

.btn-action {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 3px;
    transition: all 0.3s ease;
}

.btn-action.delete {
    background: #e74c3c;
    color: white;
}

.btn-action.delete:hover {
    background: #c0392b;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    color: #bdc3c7;
}

.log-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.log-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-container {
    background: #2c3e50;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid #34495e;
}

.log-entry:last-child {
    border-bottom: none;
}

/* Modal - UPDATED FOR BETTER VIEWPORT HANDLING */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    background: #34495e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header .close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3498db;
    outline: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
.btn-debug {
    background: #9b59b6;
    color: white;
}

.btn-debug:hover {
    background: #8e44ad;
    transform: translateY(-2px);
}

.btn-action.edit {
    background: #3498db;
    color: white;
}

.btn-action.edit:hover {
    background: #2980b9;
}
/* Add to your existing CSS */
.btn-action.edit {
    background: #3498db;
    color: white;
}

.btn-action.edit:hover {
    background: #2980b9;
}

.btn-action {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 3px;
    transition: all 0.3s ease;
}

.btn-action.delete {
    background: #e74c3c;
    color: white;
}

.btn-action.delete:hover {
    background: #c0392b;
}

/* Add these styles to your existing CSS */

/* Stat card hover effects */
.stat-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Active filter styling */
.stat-card.active-filter {
    border: 3px solid #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.stat-card.active-filter .stat-icon {
    transform: scale(1.1);
}

/* Add indicator for clickable cards */
.stat-card::after {
    content: '👆 Click to filter';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.7rem;
    color: #7f8c8d;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::after {
    opacity: 1;
}

/* Filter indicator in table header */
.aps-section h2::after {
    content: '';
    font-size: 0.9rem;
    font-weight: normal;
    margin-left: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    background: #ecf0f1;
    color: #7f8c8d;
}

/* Different indicators for each filter */
.stat-card.total.active-filter ~ .aps-section h2::after {
    content: 'Showing: All APs';
    background: #3498db;
    color: white;
}

.stat-card.online.active-filter ~ .aps-section h2::after {
    content: 'Showing: Online APs';
    background: #2ecc71;
    color: white;
}

.stat-card.offline.active-filter ~ .aps-section h2::after {
    content: 'Showing: Offline APs';
    background: #e74c3c;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-card::after {
        font-size: 0.6rem;
        bottom: 3px;
        right: 3px;
    }
    
    .aps-section h2::after {
        font-size: 0.8rem;
        display: block;
        margin-top: 5px;
        margin-left: 0;
    }
}

/* Add tooltip for better UX */
.stat-card {
    position: relative;
}

.stat-card .filter-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.stat-card:hover .filter-tooltip {
    opacity: 1;
}

.stat-card .filter-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

/* Offline Notice Bar */
.offline-notice {
    display: none;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.offline-notice.show {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offline-notice-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.offline-notice-icon {
    font-size: 2rem;
    animation: bounce 1s infinite;
}

.offline-notice-text {
    flex-grow: 1;
}

.offline-notice-text h3 {
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.offline-notice-text p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.offline-ap-list {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.offline-ap-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offline-ap-item:last-child {
    border-bottom: none;
}

.offline-ap-name {
    font-weight: 600;
}

.offline-ap-ip {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-left: 10px;
}

.offline-ap-lastseen {
    font-size: 0.8rem;
    opacity: 0.7;
}

.btn-fix {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fix:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-dismiss {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.btn-dismiss:hover {
    opacity: 1;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .offline-notice {
        flex-direction: column;
        gap: 15px;
    }
    
    .offline-notice-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .offline-ap-list {
        max-height: 80px;
    }
    
    .offline-ap-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

/* ==================== BUSINESS SECTION STYLES ==================== */

.business-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.business-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.business-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.business-stat {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.business-stat:hover {
    transform: translateY(-3px);
}

.business-stat.total-investment {
    border-left-color: #3498db;
}

.business-stat.total-revenue {
    border-left-color: #2ecc71;
}

.business-stat.net-worth {
    border-left-color: #9b59b6;
}

.business-stat.monthly-avg {
    border-left-color: #f39c12;
}

.business-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.business-stat.total-investment .business-stat-icon {
    background: #3498db;
}

.business-stat.total-revenue .business-stat-icon {
    background: #2ecc71;
}

.business-stat.net-worth .business-stat-icon {
    background: #9b59b6;
}

.business-stat.monthly-avg .business-stat-icon {
    background: #f39c12;
}

.business-stat-info h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.business-stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.business-stat-info small {
    display: block;
    color: #95a5a6;
    font-size: 0.85rem;
}

.business-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.btn-business {
    background: #34495e;
    color: white;
}

.btn-business:hover {
    background: #2c3e50;
    transform: translateY(-2px);
}

/* Inventory and Sales Tables */
.inventory-section,
.sales-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #ecf0f1;
}

/* Form rows for inline fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Sale preview */
.sale-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.sale-preview h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-item.total {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Positive and negative values */
.positive {
    color: #2ecc71;
}

.negative {
    color: #e74c3c;
}

/* Status badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active { background: #d5f4e6; color: #27ae60; }
.status-spare { background: #fff3cd; color: #856404; }
.status-decommissioned { background: #e2e3e5; color: #383d41; }
.status-sold { background: #d1ecf1; color: #0c5460; }
.status-lost { background: #fdeaea; color: #721c24; }

/* Chart container */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Additional responsive styles for modals */
@media (max-width: 768px) {
    .business-summary {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .business-controls {
        flex-direction: column;
    }
    
    .business-controls .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal specific mobile styles */
    .modal-body {
        padding: 15px;
    }
    
    .sale-preview {
        padding: 10px;
    }
    
    .preview-item {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .business-stat {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .business-stat-info p {
        font-size: 1.5rem;
    }
}
/* ==================== BUSINESS GROWTH STYLES ==================== */

.growth-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-top: 3px solid #3498db;
}

.growth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.growth-header h3 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.growth-summary {
    margin-top: 20px;
}

.growth-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.growth-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
}

.growth-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.growth-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.growth-info h4 {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.growth-info p {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 3px 0;
}

.growth-info small {
    display: block;
    color: #95a5a6;
    font-size: 0.8rem;
}

.growth-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.growth-detail-section {
    margin-bottom: 25px;
}

.growth-detail-section h4 {
    color: #34495e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.growth-table {
    overflow-x: auto;
    margin-top: 10px;
}

.growth-table table {
    width: 100%;
    border-collapse: collapse;
}

.growth-table th {
    background: #2c3e50;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}

.growth-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.growth-table tr:hover {
    background: #f8f9fa;
}

.monthly-trends {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.month-trend {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid;
}

.month-trend.positive {
    border-left-color: #2ecc71;
    background: #f0f9f4;
}

.month-trend.negative {
    border-left-color: #e74c3c;
    background: #fef0f0;
}

.trend-month {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.trend-growth {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.trend-revenue {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.no-growth-data {
    text-align: center;
    color: #95a5a6;
    padding: 20px;
    font-style: italic;
}

/* Responsive styles for growth section */
@media (max-width: 768px) {
    .growth-cards {
        grid-template-columns: 1fr;
    }
    
    .growth-card {
        padding: 12px;
    }
    
    .monthly-trends {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .monthly-trends {
        grid-template-columns: 1fr;
    }
    
    .growth-table {
        font-size: 0.9rem;
    }
    
    .growth-table th,
    .growth-table td {
        padding: 8px;
    }
}


/* ==================== EXPORT STYLES ==================== */

/* Export Button */
.btn-export {
    background: #9b59b6;
    color: white;
}

.btn-export:hover {
    background: #8e44ad;
    transform: translateY(-2px);
}

/* Dropdown for export options */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #2c3e50;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f5f7fa;
}

.dropdown-content a i {
    width: 20px;
    text-align: center;
}

/* Export Options Modal */
.export-modal {
    max-width: 500px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.export-option:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.export-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.export-info {
    flex-grow: 1;
}

.export-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1rem;
}

.export-info p {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin: 0;
}

.export-option .fa-chevron-right {
    color: #95a5a6;
}

/* CSV/JSON Format Badges */
.format-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 5px;
}

.format-json {
    background: #3498db;
    color: white;
}

.format-csv {
    background: #2ecc71;
    color: white;
}

.format-pdf {
    background: #e74c3c;
    color: white;
}

/* Export Progress Indicator */
.export-progress {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 2000;
    text-align: center;
}

.export-progress.show {
    display: block;
}

.export-progress i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 15px;
    display: block;
}

.export-progress h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.export-progress p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Export success notification */
.export-success {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive styles for export */
@media (max-width: 768px) {
    .dropdown-content {
        position: fixed;
        top: auto;
        right: 20px;
        left: 20px;
        bottom: 20px;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .export-modal {
        width: 95%;
        max-width: 95%;
    }
    
    .export-option {
        padding: 12px;
    }
    
    .export-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}


/* Enhanced Export Modal Styles */
.export-section {
    margin-bottom: 25px;
}

.export-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* Enhanced export option cards */
.export-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.export-option:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.export-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Different colors for different export types */
.export-option:nth-child(1) .export-icon {
    background: #3498db; /* JSON */
}

.export-option:nth-child(2) .export-icon {
    background: #2ecc71; /* CSV */
}

.export-option:nth-child(3) .export-icon {
    background: #e74c3c; /* PDF */
}

.export-info {
    flex-grow: 1;
}

.export-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1rem;
    border: none;
    padding: 0;
}

.export-info p {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin: 0;
}

.format-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.format-json {
    background: #3498db;
    color: white;
}

.format-csv {
    background: #2ecc71;
    color: white;
}

.format-pdf {
    background: #e74c3c;
    color: white;
}

/* PDF Preview Styles */
.pdf-preview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
}

.pdf-preview.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-preview iframe {
    width: 90%;
    height: 90%;
    border: none;
    border-radius: 8px;
}

.pdf-preview-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.pdf-preview-controls button {
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.pdf-preview-controls button:hover {
    background: #3498db;
    color: white;
}

/* Export History */
.export-history {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.export-history h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.export-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.export-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.9rem;
}

.export-history-item:last-child {
    border-bottom: none;
}

.export-history-name {
    font-weight: 600;
    color: #2c3e50;
}

.export-history-date {
    color: #95a5a6;
    font-size: 0.8rem;
}

.export-history-format {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Responsive styles for export modal */
@media (max-width: 768px) {
    .export-grid {
        grid-template-columns: 1fr;
    }
    
    .export-option {
        padding: 12px;
    }
    
    .export-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .export-modal {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .export-option {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .export-info h3 {
        font-size: 0.9rem;
    }
    
    .export-info p {
        font-size: 0.8rem;
    }
}

/* Add these to your existing style.css file */

/* Export Button */
.btn-export {
    background: #9b59b6;
    color: white;
}

.btn-export:hover {
    background: #8e44ad;
    transform: translateY(-2px);
}

/* Dropdown for export options */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #2c3e50;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f5f7fa;
}

.dropdown-content a i {
    width: 20px;
    text-align: center;
}

/* Export Options Modal */
.export-modal {
    max-width: 500px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.export-option:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.export-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.export-info {
    flex-grow: 1;
}

.export-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1rem;
}

.export-info p {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin: 0;
}

.export-option .fa-chevron-right {
    color: #95a5a6;
}

/* CSV/JSON Format Badges */
.format-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 5px;
}

.format-json {
    background: #3498db;
    color: white;
}

.format-csv {
    background: #2ecc71;
    color: white;
}

.format-pdf {
    background: #e74c3c;
    color: white;
}

/* Export Progress Indicator */
.export-progress {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 2000;
    text-align: center;
}

.export-progress.show {
    display: block;
}

.export-progress i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 15px;
    display: block;
}

.export-progress h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.export-progress p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Export success notification */
.export-success {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* PDF Preview Styles */
.pdf-preview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
}

.pdf-preview.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-preview iframe {
    width: 90%;
    height: 90%;
    border: none;
    border-radius: 8px;
}

.pdf-preview-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.pdf-preview-controls button {
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.pdf-preview-controls button:hover {
    background: #3498db;
    color: white;
}

/* Enhanced Export Modal Styles */
.export-section {
    margin-bottom: 25px;
}

.export-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* Different colors for different export types */
.export-option:nth-child(1) .export-icon {
    background: #3498db; /* JSON */
}

.export-option:nth-child(2) .export-icon {
    background: #2ecc71; /* CSV */
}

.export-option:nth-child(3) .export-icon {
    background: #e74c3c; /* PDF */
}

/* Business Growth Styles */
.growth-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-top: 3px solid #3498db;
}

.growth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.growth-header h3 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.growth-summary {
    margin-top: 20px;
}

.growth-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.growth-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
}

.growth-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.growth-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.growth-info h4 {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.growth-info p {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 3px 0;
}

.growth-info small {
    display: block;
    color: #95a5a6;
    font-size: 0.8rem;
}

.growth-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.growth-detail-section {
    margin-bottom: 25px;
}

.growth-detail-section h4 {
    color: #34495e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.growth-table {
    overflow-x: auto;
    margin-top: 10px;
}

.growth-table table {
    width: 100%;
    border-collapse: collapse;
}

.growth-table th {
    background: #2c3e50;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}

.growth-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.growth-table tr:hover {
    background: #f8f9fa;
}

.monthly-trends {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.month-trend {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid;
}

.month-trend.positive {
    border-left-color: #2ecc71;
    background: #f0f9f4;
}

.month-trend.negative {
    border-left-color: #e74c3c;
    background: #fef0f0;
}

.trend-month {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.trend-growth {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.trend-revenue {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.no-growth-data {
    text-align: center;
    color: #95a5a6;
    padding: 20px;
    font-style: italic;
}

/* Responsive styles */
@media (max-width: 768px) {
    .dropdown-content {
        position: fixed;
        top: auto;
        right: 20px;
        left: 20px;
        bottom: 20px;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .export-modal {
        width: 95%;
        max-width: 95%;
    }
    
    .export-option {
        padding: 12px;
    }
    
    .export-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .growth-cards {
        grid-template-columns: 1fr;
    }
    
    .growth-card {
        padding: 12px;
    }
    
    .monthly-trends {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .monthly-trends {
        grid-template-columns: 1fr;
    }
    
    .export-modal {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .export-option {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .export-info h3 {
        font-size: 0.9rem;
    }
    
    .export-info p {
        font-size: 0.8rem;
    }
}
/* Table Sorting Styles */
#apTable thead th {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
    user-select: none;
}

#apTable thead th:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.sort-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #3498db;
}

/* Active filter highlight */
.stat-card.active-filter {
    box-shadow: 0 0 0 2px #3498db;
    transform: translateY(-2px);
}

/* Real-time update animation */
.status.online {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Socket status indicator */
.socket-status {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #2ecc71;
    z-index: 1000;
}

.socket-status.disconnected {
    background-color: #e74c3c;
}

.socket-status.connecting {
    background-color: #f39c12;
    animation: pulse 1s infinite;
}
/* Table Sorting Styles */
#apTable thead th {
    cursor: pointer;
    position: relative;
    padding-right: 25px;
    user-select: none;
    transition: background-color 0.2s;
}

#apTable thead th:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

#apTable thead th.sorting {
    background-color: rgba(52, 152, 219, 0.15);
    font-weight: 600;
}

.sort-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #3498db;
    font-weight: bold;
}

.sort-indicator.asc::after {
    content: ' ↑';
}

.sort-indicator.desc::after {
    content: ' ↓';
}

/* Status sorting visualization */
.status.online {
    color: #27ae60;
    font-weight: 600;
}

.status.offline {
    color: #e74c3c;
    font-weight: 600;
}

/* Make the whole header cell clickable */
#apTable thead th {
    position: relative;
}

#apTable thead th::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.3;
}

#apTable thead th:hover::after {
    opacity: 0.6;
}

#apTable thead th.sort-asc::after {
    border-bottom: 4px solid #3498db;
    border-top: none;
}

#apTable thead th.sort-desc::after {
    border-top: 4px solid #3498db;
    border-bottom: none;
}