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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #2c3e50;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    /* background: #ffffff; */
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.report-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    border-bottom: 4px solid rgba(255, 255, 255, 0.2);
}

.domain-name {
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.report-date {
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 15px;
    letter-spacing: 0.3px;
}

.status-indicator {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link {
    position: absolute;
    top: 20px;
    left: 30px;
}

.nav-link a {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.nav-link a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd700;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.status-dot.connected {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.status-dot.disconnected {
    background: #ef4444;
    animation: none;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.report-container {
    padding: 40px;
    background: #fafbfc;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95em;
}

thead {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 16px 14px;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 1px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
}

th:first-child {
    text-align: left;
    border-left: none;
}

th:not(:first-child) {
    text-align: right;
}

td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    background: white;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background-color: #f8f9ff !important;
    transform: scale(1.001);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

tbody tr:nth-child(even):hover {
    background-color: #f0f2ff !important;
}

/* Number columns */
.number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #2c3e50;
}

/* Date column styling */
td:first-child {
    font-weight: 500;
    color: #495057;
}

/* Grand Total Row */
tfoot {
    background: #fff;
}

.grand-total-row {
    background: linear-gradient(180deg, #fff5f5 0%, #ffe5e5 100%) !important;
    font-weight: 700;
    border-top: 3px solid #dc3545;
    box-shadow: 0 -2px 8px rgba(220, 53, 69, 0.1);
}

.grand-total-row:hover {
    background: linear-gradient(180deg, #ffe5e5 0%, #ffd6d6 100%) !important;
    transform: none !important;
}

.grand-total-label {
    font-weight: 800;
    font-size: 1.15em;
    color: #c53030;
    text-align: left;
    padding: 18px 14px;
    border-top: 3px solid #dc3545;
    border-bottom: none;
    letter-spacing: 0.5px;
    background: linear-gradient(180deg, #fff5f5 0%, #ffe5e5 100%);
}

.grand-total-row td {
    font-weight: 800;
    font-size: 1.05em;
    color: #c53030;
    padding: 18px 14px;
    border-top: 3px solid #dc3545;
    border-bottom: none;
    background: linear-gradient(180deg, #fff5f5 0%, #ffe5e5 100%);
}

.grand-total-row td.number-cell {
    font-size: 1.08em;
}

.last-update {
    padding: 20px 40px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    text-align: center;
    color: #6c757d;
    font-size: 0.875em;
    border-top: 1px solid #dee2e6;
    font-weight: 500;
}

.last-update span {
    color: #495057;
    font-weight: 600;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 50px;
    color: #6c757d;
    font-size: 1em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }

    .report-container {
        padding: 20px;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 12px 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .report-header {
        padding: 30px 20px;
    }

    .domain-name {
        font-size: 2.2em;
    }

    .report-date {
        font-size: 1em;
    }

    .status-indicator {
        position: static;
        margin-top: 15px;
        justify-content: center;
        display: inline-flex;
    }

    .report-container {
        padding: 15px;
    }

    .table-wrapper {
        border-radius: 6px;
    }

    th, td {
        padding: 10px 8px;
        font-size: 0.8em;
    }

    th {
        font-size: 0.7em;
        padding: 12px 8px;
    }

    .grand-total-label,
    .grand-total-row td {
        font-size: 0.95em;
        padding: 14px 8px;
    }

    .last-update {
        padding: 15px 20px;
        font-size: 0.8em;
    }
}

/* Scrollbar styling */
.report-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.report-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.report-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.report-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }

    .status-indicator {
        display: none;
    }

    .report-container {
        max-height: none;
        overflow: visible;
    }
}
