:root {
    --primary-cyan: #1DB9E8;
    --dark-gray: #4A4A4A;
    --light-cyan: #E0F7FF;
    --success-green: #28a745;
    --warning-yellow: #ffc107;
    --danger-red: #dc3545;
    --text-dark: #2c3e50;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1DB9E8 0%, #0A8AB8 100%);
    min-height: 100vh;
    padding: 15px;
    font-size: 15px;
}

.container-fluid {
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
}

.company-logo {
    height: 80px;
    width: 80px;
    object-fit: contain;
}

.dashboard-title {
    color: var(--primary-cyan);
    font-size: 2.0625rem;
    font-weight: 700;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-filter {
    display: flex;
    align-items: center;
    background: rgba(29, 185, 232, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(29, 185, 232, 0.3);
}

.date-filter label {
    color: var(--text-dark);
    margin: 0;
    font-size: 0.9375rem;
    white-space: nowrap;
    font-weight: 600;
}

.date-filter input[type="date"] {
    width: 150px;
    background: white;
    border: 1px solid #ddd;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
}

.date-filter .btn-secondary {
    background: var(--danger-red);
    border: none;
    color: white;
    padding: 0.375rem 0.75rem;
}

.date-filter .btn-secondary:hover {
    background: #c82333;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    border: 2px solid var(--primary-cyan);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.0625rem;
}

.date-display i {
    color: var(--primary-cyan);
    font-size: 1.1rem;
}

.date-display span {
    color: var(--primary-cyan);
    font-weight: 700;
}

.no-data-message {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    margin: 20px 0;
    padding: 60px 40px;
}

.no-data-content {
    text-align: center;
    max-width: 600px;
}

.no-data-content i {
    font-size: 120px;
    color: var(--warning-yellow);
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

.no-data-content h2 {
    font-size: 2.5625rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 20px;
}

.no-data-content p {
    font-size: 1.25rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.last-update {
    color: var(--text-dark);
    font-size: 0.9375rem;
}

.btn-refresh {
    background: var(--primary-cyan);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-refresh:hover {
    background: #0A8AB8;
    transform: translateY(-2px);
}

.btn-print {
    background: var(--success-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-print:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-weekly {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-weekly:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-red);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dashboard-section {
    animation: fadeIn 0.5s ease-in;
}

/* Set compact minimum heights for symmetry */
.dashboard-section:nth-child(1) .status-card {
    min-height: 240px;
    max-height: 240px;
}

.dashboard-section:nth-child(1) .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
}

.dashboard-section:nth-child(1) canvas {
    max-height: 130px !important;
    height: 130px !important;
    width: 130px !important;
    margin: 10px auto;
}

.dashboard-section:nth-child(1) h5 {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 600;
}

.dashboard-section:nth-child(1) p {
    margin-top: 10px;
    margin-bottom: 0;
    text-align: center;
    line-height: 1.4;
}

.dashboard-section:nth-child(2) .status-card {
    min-height: 280px;
}

.dashboard-section:nth-child(3) .status-card {
    min-height: 280px;
    max-height: 280px;
}

.dashboard-section:nth-child(4) .status-card {
    min-height: 280px;
}

.dashboard-section:nth-child(5) .status-card {
    min-height: 250px;
}

.dashboard-section:nth-child(6) .status-card {
    min-height: 280px;
}

/* Adjust Bins chart */
.dashboard-section:nth-child(6) #binsChart {
    max-height: 220px !important;
    height: 220px !important;
    width: 100% !important;
    max-width: 450px !important;
}

/* Make Virtual Machines and Row Materials equal height */
.dashboard-section:nth-child(3) .card-body {
    max-height: 280px;
    overflow: hidden;
}

.dashboard-section:nth-child(3) .table-responsive {
    max-height: 220px;
    overflow-y: auto;
}

.dashboard-section:nth-child(3) canvas {
    max-height: 220px !important;
    height: 220px !important;
    width: 100% !important;
    max-width: 450px !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 18px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
}

.section-title {
    color: var(--primary-cyan);
    font-size: 1.25rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.section-title i {
    margin-right: 8px;
    font-size: 1.1rem;
}

.status-card {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.status-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    justify-content: center;
}

.status-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-title {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.0625rem;
    text-align: left;
}

.card-title i {
    color: var(--primary-cyan);
    margin-right: 6px;
    font-size: 0.9rem;
}

/* Override text-center for card bodies with charts */
.status-card .card-body.text-center {
    text-align: left !important;
    display: flex;
    flex-direction: column;
}

.status-card .card-body.text-center .card-title {
    text-align: left;
    margin-bottom: 15px;
}

/* Chart container layout - centered with legend below */
.dashboard-section:nth-child(3) .card-body.text-center,
.dashboard-section:nth-child(6) .card-body.text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 18px 25px 20px 25px;
    min-height: 400px;
    width: 100%;
    gap: 15px;
}

.dashboard-section:nth-child(3) .card-body.text-center .card-title,
.dashboard-section:nth-child(6) .card-body.text-center .card-title {
    align-self: flex-start;
    margin-bottom: 0;
}

.dashboard-section:nth-child(3) .card-body.text-center canvas,
.dashboard-section:nth-child(6) .card-body.text-center canvas {
    margin: 0 auto;
    flex-shrink: 0;
}

.dashboard-section:nth-child(3) .card-body.text-center p,
.dashboard-section:nth-child(6) .card-body.text-center p {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 15px 0 0 0;
    color: var(--text-dark);
    width: 100%;
}

/* Make all rows have equal height cards */
.row.g-3 {
    display: flex;
    flex-wrap: wrap;
}

.row.g-3 > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* WiFi Coverage Grid */
.wifi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    flex: 1;
    align-content: center;
    align-items: center;
}

.wifi-item {
    padding: 12px 15px;
    border-radius: 8px;
    background: white;
    font-weight: 600;
    transition: transform 0.2s;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 85px;
    max-height: 85px;
    text-align: left;
    gap: 8px;
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.wifi-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.wifi-item.good { 
    border-left: 6px solid var(--success-green);
}

.wifi-item.warning { 
    border-left: 6px solid var(--warning-yellow);
}

.wifi-item.bad { 
    border-left: 6px solid var(--danger-red);
}

/* Speed Cards */
.speed-card {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
}

.speed-card.upload {
    background: linear-gradient(135deg, #1DB9E8 0%, #0A8AB8 100%);
}

.speed-card.download {
    background: linear-gradient(135deg, #5A5A5A 0%, #3A3A3A 100%);
}

.speed-card i {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.speed-card h3 {
    font-size: 1.5625rem;
    font-weight: 700;
    margin: 8px 0;
}

.speed-card p {
    margin: 0;
    font-size: 0.9375rem;
    opacity: 0.9;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead {
    background: var(--light-cyan);
    color: var(--dark-gray);
}

.table thead th {
    text-align: center;
}

.table thead th:first-child {
    text-align: left;
}

.table tbody td {
    text-align: center;
}

.table tbody td:first-child {
    text-align: left;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: var(--light-cyan);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.status-badge.good {
    background: var(--success-green);
    color: white;
}

.status-badge.warning {
    background: var(--warning-yellow);
    color: #333;
}

.status-badge.bad {
    background: var(--danger-red);
    color: white;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    flex: 1;
    align-content: center;
    align-items: center;
}

/* Security Screens - specific styling for better spacing */
#securityScreens.status-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

#securityScreens .status-item {
    padding: 18px 20px;
    min-height: 130px;
    max-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    min-width: 200px;
}

#securityScreens .status-item h6 {
    font-size: 1.0625rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

#securityScreens .status-item p {
    font-size: 0.9375rem;
    padding: 10px 18px;
    min-width: 130px;
}

#securityScreens .status-item.bad {
    min-width: 220px;
}

#securityScreens .status-item.bad p {
    min-width: 150px;
    padding: 10px 20px;
}

/* Server Room - make items uniform */
#serverRoom.status-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-content: center;
}

/* Services - make items uniform */
#servicesStatus.status-grid {
    grid-template-columns: repeat(2, 1fr);
    align-content: start;
    gap: 15px;
}

/* Gates - make items uniform */
#gatesStatus.status-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-content: center;
}

.status-item {
    padding: 15px 18px;
    border-radius: 8px;
    background: white;
    font-weight: 600;
    transition: transform 0.2s;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 110px;
    max-height: 110px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.status-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.status-item.good {
    border-left: 6px solid var(--success-green);
}

.status-item.warning {
    border-left: 6px solid var(--warning-yellow);
}

.status-item.bad {
    border-left: 6px solid var(--danger-red);
}

.status-item h6 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-dark);
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    line-height: 1.3;
}

.status-item p {
    font-size: 0.9375rem;
    margin: 0;
    padding: 10px 18px;
    border-radius: 16px;
    font-weight: 600;
    align-self: center;
    min-width: 90px;
    text-align: center;
    line-height: 1.3;
    width: 100%;
    max-width: 150px;
}

.status-item.good p {
    background: var(--success-green);
    color: white;
}

.status-item.warning p {
    background: var(--warning-yellow);
    color: #333;
}

.status-item.bad p {
    background: var(--danger-red);
    color: white;
    padding: 10px 16px;
    min-width: 100px;
}

/* Camera Stats */
.camera-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 10px;
    flex: 1;
}

.stat-item.good {
    background: #d4edda;
}

.stat-item.bad {
    background: #f8d7da;
}

.stat-item i {
    font-size: 2.5rem;
}

.stat-item h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-item p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 992px) {
    body {
        padding: 10px;
    }
    
    .dashboard-header {
        padding: 15px 20px;
    }
    
    .company-logo {
        height: 60px;
        width: 60px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .header-controls {
        gap: 12px;
    }
    
    .date-filter {
        padding: 0.5rem 0.8rem;
    }
    
    .date-display {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    
    .section-container {
        padding: 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .wifi-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    #securityScreens.status-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    #securityScreens .status-item {
        min-width: auto;
        padding: 15px;
        min-height: 115px;
        max-height: 115px;
    }
    
    #securityScreens .status-item h6 {
        font-size: 0.9rem;
    }
    
    #securityScreens .status-item p {
        font-size: 0.85rem;
        padding: 8px 14px;
    }
    
    .no-data-message {
        min-height: 400px;
        padding: 40px 30px;
    }
    
    .no-data-content i {
        font-size: 100px;
    }
    
    .no-data-content h2 {
        font-size: 2rem;
    }
    
    .no-data-content p {
        font-size: 1.1rem;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .dashboard-header {
        padding: 12px 15px;
    }
    
    .dashboard-header > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .company-logo {
        height: 50px;
        width: 50px;
    }
    
    .dashboard-title {
        font-size: 1.2rem;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .date-filter {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        padding: 0.5rem;
        justify-content: space-between;
    }
    
    .date-filter label {
        font-size: 0.85rem;
        width: 100%;
    }
    
    .date-filter input[type="date"] {
        flex: 1;
        min-width: 140px;
        font-size: 0.85rem;
    }
    
    .date-filter .btn-secondary {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .date-display {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }
    
    .date-display i {
        font-size: 1rem;
    }
    
    .btn-refresh,
    .btn-print,
    .btn-weekly {
        padding: 10px 15px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .btn-danger {
        padding: 8px 12px;
    }
    
    .section-container {
        padding: 12px;
    }
    
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .card-title {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }
    
    .wifi-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 8px;
    }
    
    .wifi-item {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 8px;
    }
    
    #securityScreens.status-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    #securityScreens .status-item {
        min-width: auto;
        padding: 12px 15px;
        min-height: 110px;
        max-height: 110px;
    }
    
    #securityScreens .status-item h6 {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    #securityScreens .status-item p {
        font-size: 0.8rem;
        padding: 8px 12px;
        min-width: auto;
        width: 100%;
    }
    
    #securityScreens .status-item.bad {
        min-width: auto;
    }
    
    #securityScreens .status-item.bad p {
        min-width: auto;
        padding: 8px 12px;
    }
    
    .status-item {
        padding: 10px;
    }
    
    .status-item h6 {
        font-size: 0.8rem;
    }
    
    .status-item p {
        font-size: 0.8rem;
    }
    
    .speed-card {
        padding: 15px;
    }
    
    .speed-card i {
        font-size: 2rem;
    }
    
    .speed-card h3 {
        font-size: 1.5rem;
    }
    
    .speed-card p {
        font-size: 0.9rem;
    }
    
    .camera-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .stat-item {
        padding: 15px;
        gap: 12px;
    }
    
    .stat-item i {
        font-size: 2rem;
    }
    
    .stat-item h3 {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 8px 6px;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    canvas {
        max-height: 200px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .dashboard-header {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .company-logo {
        height: 40px;
        width: 40px;
    }
    
    .dashboard-title {
        font-size: 1rem;
    }
    
    .date-filter {
        padding: 0.4rem;
    }
    
    .date-filter label {
        font-size: 0.8rem;
    }
    
    .date-filter input[type="date"] {
        font-size: 0.8rem;
        min-width: 120px;
    }
    
    .date-filter .btn-secondary {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .date-display {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .date-display i {
        font-size: 0.9rem;
    }
    
    .btn-refresh,
    .btn-print,
    .btn-weekly {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .btn-danger {
        padding: 6px 10px;
    }
    
    .no-data-content i {
        font-size: 80px;
    }
    
    .no-data-content h2 {
        font-size: 1.5rem;
    }
    
    .no-data-content p {
        font-size: 0.95rem;
    }
}

/* Extra small mobile devices - 400px */
@media (max-width: 400px) {
    body {
        padding: 4px;
    }
    
    .dashboard-header {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .dashboard-header > div {
        gap: 8px;
    }
    
    .company-logo {
        height: 35px;
        width: 35px;
    }
    
    .dashboard-title {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .header-controls {
        gap: 8px;
    }
    
    .date-filter {
        padding: 0.35rem;
        gap: 6px;
    }
    
    .date-filter label {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    
    .date-filter input[type="date"] {
        font-size: 0.75rem;
        min-width: 110px;
        padding: 0.3rem 0.4rem;
    }
    
    .date-filter .btn-secondary {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .date-filter .btn-secondary i {
        font-size: 0.8rem;
    }
    
    .date-display {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .date-display i {
        font-size: 0.85rem;
    }
    
    .btn-refresh,
    .btn-print,
    .btn-weekly {
        padding: 7px 10px;
        font-size: 0.8rem;
    }
    
    .btn-refresh i,
    .btn-print i,
    .btn-weekly i {
        font-size: 0.85rem;
    }
    
    .btn-danger {
        padding: 6px 8px;
    }
    
    .dashboard-grid {
        gap: 12px;
    }
    
    .section-container {
        padding: 8px;
    }
    
    .section-title {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .card-title {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    .status-card .card-body {
        padding: 10px;
    }
    
    .wifi-grid,
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .wifi-item,
    .status-item {
        padding: 8px;
        font-size: 0.75rem;
        min-height: 90px;
        max-height: 90px;
    }
    
    .status-item h6 {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .status-item p {
        font-size: 0.75rem;
        padding: 6px 12px;
        min-width: 70px;
    }
    
    .speed-card {
        padding: 10px;
        min-height: 120px;
    }
    
    .speed-card i {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .speed-card h3 {
        font-size: 1.1rem;
    }
    
    .speed-card p {
        font-size: 0.75rem;
    }
    
    .table {
        font-size: 0.7rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 5px 3px;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    canvas {
        max-height: 130px !important;
        height: 130px !important;
    }
    
    .no-data-message {
        min-height: 350px;
        padding: 30px 20px;
    }
    
    .no-data-content i {
        font-size: 60px;
        margin-bottom: 20px;
    }
    
    .no-data-content h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .no-data-content p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* Routers section adjustments */
    .dashboard-section:nth-child(1) .status-card {
        min-height: 200px;
        max-height: 200px;
    }
    
    .dashboard-section:nth-child(1) canvas {
        max-height: 110px !important;
        height: 110px !important;
        width: 110px !important;
    }
    
    .dashboard-section:nth-child(1) h5 {
        font-size: 0.85rem;
    }
    
    .dashboard-section:nth-child(1) p {
        font-size: 0.8rem;
    }
}
    
    .dashboard-grid {
        gap: 15px;
    }
    
    .section-container {
        padding: 10px;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .card-title {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .wifi-grid,
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .wifi-item,
    .status-item {
        padding: 8px;
        font-size: 0.75rem;
    }
    
    .speed-card {
        padding: 12px;
    }
    
    .speed-card i {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .speed-card h3 {
        font-size: 1.2rem;
    }
    
    .speed-card p {
        font-size: 0.8rem;
    }
    
    .stat-item {
        padding: 12px;
        gap: 10px;
    }
    
    .stat-item i {
        font-size: 1.5rem;
    }
    
    .stat-item h3 {
        font-size: 1.2rem;
    }
    
    .stat-item p {
        font-size: 0.8rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 6px 4px;
    }
    
    canvas {
        max-height: 150px;
    }


/* Chart Containers */
canvas {
    max-height: 180px;
    height: 180px !important;
}

/* Print Styles - Optimized for 2 pages */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    
    body {
        background: white;
        padding: 0;
        font-size: 10pt;
    }
    
    .container-fluid {
        max-width: 100%;
        padding: 0;
    }
    
    .dashboard-header {
        border-radius: 0;
        margin-bottom: 10px;
        padding: 10px 15px;
        page-break-after: avoid;
    }
    
    .company-logo {
        height: 40px;
        width: 40px;
    }
    
    .dashboard-title {
        font-size: 1.3rem;
    }
    
    .btn-refresh,
    .btn-print,
    .date-filter .btn-secondary {
        display: none !important;
    }
    
    .date-filter {
        border: 1px solid #ddd;
    }
    
    .date-display {
        border: 1px solid var(--primary-cyan);
    }
    
    .no-data-message {
        display: none !important;
    }
    
    .dashboard-grid {
        gap: 10px;
    }
    
    .dashboard-section {
        page-break-inside: avoid;
        margin-bottom: 10px;
    }
    
    .section-container {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .section-title {
        color: var(--text-dark);
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .status-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        margin-bottom: 8px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .card-title {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    /* Compact charts for print */
    canvas {
        max-height: 120px !important;
        height: 120px !important;
    }
    
    /* Compact tables */
    .table {
        font-size: 9pt;
    }
    
    .table thead th,
    .table tbody td {
        padding: 4px 8px;
    }
    
    /* Compact grids */
    .wifi-grid,
    .status-grid {
        gap: 6px;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .wifi-item,
    .status-item {
        padding: 6px;
        font-size: 8pt;
    }
    
    .status-item h6 {
        font-size: 8pt;
        margin-bottom: 2px;
    }
    
    .status-item p {
        font-size: 7pt;
    }
    
    /* Compact speed cards */
    .speed-card {
        padding: 10px;
    }
    
    .speed-card i {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .speed-card h3 {
        font-size: 1.3rem;
        margin: 5px 0;
    }
    
    .speed-card p {
        font-size: 0.8rem;
    }
    
    /* Compact camera stats */
    .camera-stats {
        gap: 10px;
    }
    
    .stat-item {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .stat-item i {
        font-size: 1.5rem;
    }
    
    .stat-item h3 {
        font-size: 1.3rem;
    }
    
    .stat-item p {
        font-size: 0.75rem;
    }
    
    /* Status badges */
    .status-badge {
        padding: 2px 8px;
        font-size: 8pt;
    }
    
    /* Force page breaks */
    .dashboard-section:nth-child(4) {
        page-break-before: always;
    }
    
    /* Compact rows */
    .row.g-3 {
        --bs-gutter-y: 0.5rem;
        --bs-gutter-x: 0.5rem;
    }
    
    /* Hide animations during print */
    * {
        animation: none !important;
        transition: none !important;
    }
    
    /* Ensure content fits */
    h5 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    p {
        margin-bottom: 4px;
    }
}

/* Force Chart.js legends to display horizontally */
#rowMaterialsChart,
#binsChart {
    margin-bottom: 15px !important;
}

/* Target Chart.js legend ul element */
.dashboard-section:nth-child(3) canvas,
.dashboard-section:nth-child(6) canvas {
    margin-bottom: 0 !important;
}

/* Force horizontal legend layout using CSS */
.dashboard-section:nth-child(3) .card-body.text-center > *,
.dashboard-section:nth-child(6) .card-body.text-center > * {
    width: 100%;
}

/* Chart.js renders legend as part of canvas - we need to increase card width */
.dashboard-section:nth-child(3) .status-card,
.dashboard-section:nth-child(6) .status-card {
    min-width: 100%;
}

/* Notes Card Styling - Horizontal Layout */
.notes-content-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 80px;
}

.notes-content-horizontal p {
    margin: 0;
    width: 100%;
    text-align: center;
}

.notes-content-horizontal .note-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-cyan);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 250px;
    max-width: calc(33.333% - 10px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.notes-content-horizontal .note-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.notes-content-horizontal .note-label {
    font-weight: 600;
    color: var(--primary-cyan);
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notes-content-horizontal .note-label::before {
    content: "📌";
    font-size: 1rem;
}

.notes-content-horizontal .note-text {
    color: var(--text-dark);
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Responsive adjustments for notes */
@media (max-width: 1200px) {
    .notes-content-horizontal .note-item {
        max-width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .notes-content-horizontal .note-item {
        max-width: 100%;
    }
}
