﻿/* ===========================
   NS3-style table container
   =========================== */
.table-scroll-container,
.ns3-table-wrap {
    max-height: 56vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(16,24,40,.04);
    margin-top: 1rem;
    box-sizing: border-box;
}

    /* Themed scrollbar */
    .table-scroll-container::-webkit-scrollbar,
    .ns3-table-wrap::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    .table-scroll-container::-webkit-scrollbar-thumb,
    .ns3-table-wrap::-webkit-scrollbar-thumb {
        background: #c9d4e6;
        border-radius: 6px;
        border: 2px solid #f7f9fc;
    }

    .table-scroll-container::-webkit-scrollbar-track,
    .ns3-table-wrap::-webkit-scrollbar-track {
        background: #f0f4fa;
    }

/* ===========================
   NS3-style table
   =========================== */
.styled-table,
.ns3-table {
    width: 100%;
    min-width: 720px; /* keeps columns readable */
    border-collapse: separate; /* preserve corner radius */
    border-spacing: 0;
    background: #fff;
    color: #2e3c52;
    table-layout: auto;
}

    /* Sticky header with gradient + hairline borders */
    .styled-table thead th,
    .ns3-table thead th {
        position: sticky;
        top: 0;
        z-index: 3;
        background: linear-gradient(#f7f9fc, #eef2f7);
        color: #2e3c52;
        padding: 10px 12px;
        font-weight: 700;
        text-align: left;
        white-space: nowrap;
        border-bottom: 1px solid #e1e6ef;
        border-right: 1px solid #eef1f5;
        box-shadow: 0 2px 0 rgba(16,24,40,.04);
    }

        .styled-table thead th:first-child,
        .ns3-table thead th:first-child {
            border-top-left-radius: 8px;
        }

        .styled-table thead th:last-child,
        .ns3-table thead th:last-child {
            border-top-right-radius: 8px;
        }

    /* Body cells + zebra + hover */
    .styled-table tbody td,
    .ns3-table tbody td {
        padding: 10px 12px;
        white-space: nowrap;
        border-bottom: 1px solid #eef1f5;
        border-right: 1px solid #f1f4f8;
    }

    .styled-table tbody tr:nth-child(even) td,
    .ns3-table tbody tr:nth-child(even) td {
        background: #fbfcff;
    }

    .styled-table tbody tr:hover td,
    .ns3-table tbody tr:hover td {
        background: #f3f6fb;
    }

    /* Footer (totals) */
    .styled-table tfoot td,
    .ns3-table tfoot td {
        border-top: 1px solid #e1e6ef;
        background: #f8fafc;
        font-weight: 700;
    }

    /* Themed checkboxes */
    .styled-table input[type="checkbox"],
    .ns3-table input[type="checkbox"] {
        accent-color: #2f6aa3;
        width: 16px;
        height: 16px;
        border-radius: 4px;
        transition: box-shadow .2s ease;
    }

        .styled-table input[type="checkbox"]:hover,
        .styled-table input[type="checkbox"]:focus,
        .ns3-table input[type="checkbox"]:hover,
        .ns3-table input[type="checkbox"]:focus {
            box-shadow: 0 0 0 3px rgba(47,106,163,.15);
            outline: none;
        }

/* Inline link-like cells (e.g., Period column) */
.ns3-linklike {
    color: #2f6aa3;
}

/* Highlight + error */
.highlight {
    background: #fff2a8;
    box-shadow: inset 0 -1px 0 #f3e27b;
    font-weight: 700;
}

.error {
    color: #c44536;
    margin-top: 10px;
}

/* Sort modal / toolbar bits (unchanged, tightened) */
.sort-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sort-order-input {
    width: 50px;
}

.sort-direction {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Page size selector */
.page-size-selector {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

    .page-size-selector select {
        padding: .2rem .5rem;
    }

/* Print */
@media print {
    .no-print, th.no-print, td.no-print {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .styled-table, .ns3-table {
        min-width: 100%;
    }

    .table-scroll-container, .ns3-table-wrap {
        border-radius: 4px;
        max-height: 50vh;
    }

    .styled-table thead th, .styled-table td,
    .ns3-table thead th, .ns3-table td {
        padding: 6px;
        font-size: .8rem;
    }

    .sort-row, .page-size-selector {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Group/summary rows in ns3 palette */
.group-header {
    background: #e9f1f8;
    font-weight: 700;
    color: #2e3c52;
}

.group-subheader {
    background: #f3f7fc;
    color: #334155;
    font-style: normal;
}

.group-subsubheader {
    background: #f8fafc;
    font-size: .9em;
    padding-left: 16px;
}

.subtotal-row {
    background: #f9fbfe;
    font-style: italic;
}

.grand-total-row {
    background: #e3edf9;
    font-weight: 500;
}

.info-icon {
    margin-left: 5px;
    cursor: help;
    font-size: 0.9em;
    opacity: 0.7;
}

    .info-icon:hover {
        opacity: 1;
    }




/* Collection Routes header */
.cr-header {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.cr-card {
    background: #fff;
    border: 1px solid var(--border-1);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,.05);
}

.cr-card-title {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.cr-card-value {
    font-size: 1.25rem;
    font-weight: 200;
    color: var(--ink);
}

.cr-filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.cr-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
    margin-top: 0.5rem;
}


.check-grid {
    grid-template-columns: 1fr;
}

}

.check-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .checkbox-card:hover {
        background: #f0f7ff;
        border-color: #3399ff;
    }

    .checkbox-card input[type="checkbox"] {
        accent-color: #3399ff;
        width: 18px;
        height: 18px;
    }

    .checkbox-card:has(input[type="checkbox"]:checked) {
        background: #e6f2ff;
        border-color: #0066cc;
    }