/* ═══════════════════════════════════════════════════════════════════════════
   SNND Data Table Design System
   Load after style.css.  Overrides legacy row/header classes for immediate
   site-wide improvement, and introduces .snnd-table + .snnd-table-wrap for
   new and redesigned tables going forward.

   Palette: #113157 navy | #5491BE accent blue | #f4f7fb light stripe
            Raleway for headers/labels | Arial for data
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── Screen-reader-only utility ──────────────────────────────────────────── *
 * Visually hidden but announced by assistive technology.                     */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}


/* ── Card wrapper ─────────────────────────────────────────────────────────── *
 * Wrap a table in <div class="snnd-table-wrap"> to get the card look.        */

.snnd-table-wrap {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
    overflow-x: auto;
    margin-bottom: 28px;
}

.snnd-table-wrap::-webkit-scrollbar {
    height: 8px;
}

.snnd-table-wrap::-webkit-scrollbar-track {
    background: #f0f4f8;
    border-radius: 0 0 12px 12px;
}

.snnd-table-wrap::-webkit-scrollbar-thumb {
    background: #a0b4c8;
    border-radius: 4px;
}

.snnd-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #5491BE;
}


/* ── Search form helpers ──────────────────────────────────────────────────── *
 * .snnd-search-card — free-standing card above a data table.                 *
 * .snnd-search-row / .snnd-search-label / .snnd-search-divider — use inside  *
 * any search form to replace cramped nested-table layouts.                   */

.snnd-search-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid darkgray;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 16px 22px 12px;
    margin-bottom: 18px;
}

.snnd-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.snnd-search-label {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    white-space: nowrap;
    color: #2c3e50;
    min-width: 185px;
}

.snnd-search-divider {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #6c8aab;
    padding: 3px 0 3px 185px;
    border-top: 1px solid #e8edf3;
    border-bottom: 1px solid #e8edf3;
    margin: 2px 0;
}

.snnd-search-actions {
    display: flex;
    align-items: center;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid #e8edf3;
    gap: 16px;
}


/* ── Base table ───────────────────────────────────────────────────────────── */

.snnd-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #2c3e50;
}


/* ── Header ───────────────────────────────────────────────────────────────── */

.snnd-table thead tr {
    background-color: #113157;
}

.snnd-table thead th {
    padding: 10px 12px;
    color: #ffffff;
    font-family: Raleway, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 3px solid #0a2340;
}

.snnd-table thead th.col-center { text-align: center; }
.snnd-table thead th.col-right  { text-align: right;  }

/* ── Sortable column headers ──────────────────────────────────────────────── */
.snnd-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}
/* Sort direction is shown by the FontAwesome .snnd-sort-icon placed in each
   sortable header (fa-sort / fa-sort-up / fa-sort-down), matching the
   userManagement user-table standard. snnd-sort.js swaps the icon class. */


/* ── Body cells ───────────────────────────────────────────────────────────── */

.snnd-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #e8edf3;
    vertical-align: middle;
    line-height: 1.45;
}

.snnd-table tbody td.col-center { text-align: center; }
.snnd-table tbody td.col-right  { text-align: right;  }
.snnd-table tbody td.col-nowrap { white-space: nowrap; }


/* ── Alternating rows ─────────────────────────────────────────────────────── */

.snnd-table tbody tr.striped     { background-color: #f4f7fb; }
.snnd-table tbody tr.not_striped { background-color: #ffffff; }


/* ── Hover ────────────────────────────────────────────────────────────────── */

.snnd-table tbody tr.striped:hover,
.snnd-table tbody tr.not_striped:hover {
    background-color: #dce9f7;
    transition: background-color 0.15s ease;
}


/* ── Past-due / overdue rows ──────────────────────────────────────────────── */

.snnd-table tbody tr.past_due {
    background-color: rgba(190, 40, 40, 0.07);
}

.snnd-table tbody tr.past_due td {
    color: #6e1f1f;
    border-bottom-color: rgba(190, 40, 40, 0.15);
}

/* Subtle left accent stripe on overdue rows */
.snnd-table tbody tr.past_due td:first-child {
    border-left: 3px solid rgba(190, 40, 40, 0.50);
    padding-left: 9px;
}

.snnd-table tbody tr.past_due:hover {
    background-color: rgba(190, 40, 40, 0.13);
}


/* ── Status badges ────────────────────────────────────────────────────────── *
 * Usage: <span class="snnd-badge snnd-badge-paid">Paid</span>               */

.snnd-badge {
    display: inline-block;
    border-radius: 10px;
    padding: 2px 9px;
    font-family: Raleway, sans-serif;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.snnd-badge-paid {
    background: rgba(0, 128, 60, 0.12);
    color: #0a5c2a;
    border: 1px solid rgba(0, 128, 60, 0.28);
}

.snnd-badge-draft {
    background: rgba(84, 145, 190, 0.14);
    color: #113157;
    border: 1px solid rgba(84, 145, 190, 0.35);
}

.snnd-badge-final {
    background: rgba(200, 130, 0, 0.12);
    color: #7a4e00;
    border: 1px solid rgba(200, 130, 0, 0.28);
}

.snnd-badge-overdue {
    background: rgba(190, 40, 40, 0.12);
    color: #7a1f1f;
    border: 1px solid rgba(190, 40, 40, 0.30);
}

.snnd-badge-void {
    background: rgba(120, 120, 120, 0.10);
    color: #666;
    border: 1px solid rgba(120, 120, 120, 0.22);
    text-decoration: line-through;
}

.snnd-badge-pending {
    background: rgba(84, 145, 190, 0.10);
    color: #2b5c8a;
    border: 1px solid rgba(84, 145, 190, 0.28);
}


/* ═══════════════════════════════════════════════════════════════════════════
   LEGACY CLASS OVERRIDES
   Existing PHP pages emit .striped / .not_striped / .past_due / header
   class names.  These rules refresh every existing table without requiring
   markup changes.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Row backgrounds ──────────────────────────────────────────────────────── */

tr.striped     { background-color: #f4f7fb !important; }
tr.not_striped { background-color: #ffffff !important; }
tr.past_due    { background-color: rgba(190, 40, 40, 0.07) !important; }


/* ── Cell spacing and type on legacy rows ─────────────────────────────────── */

tr.striped td,
tr.not_striped td {
    padding: 7px 10px;
    border-bottom: 1px solid #e8edf3;
    vertical-align: middle;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #2c3e50;
}

tr.past_due td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(190, 40, 40, 0.15) !important;
    vertical-align: middle;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #6e1f1f !important;
}

tr.past_due td:first-child {
    border-left: 3px solid rgba(190, 40, 40, 0.50);
    padding-left: 7px;
}


/* ── Hover on legacy rows ─────────────────────────────────────────────────── */

tr.striped:hover,
tr.not_striped:hover {
    background-color: #dce9f7 !important;
    cursor: default;
}

tr.past_due:hover {
    background-color: rgba(190, 40, 40, 0.13) !important;
}


/* ── Legacy table header classes ──────────────────────────────────────────── */

.finalResultsTableHeader th,
.preliminaryResultsTableHeader th,
.adminResultsTableHeader th {
    padding: 10px 12px !important;
    color: #ffffff !important;
    background-color: #113157 !important;
    font-family: Raleway, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 3px solid #0a2340 !important;
    text-align: left;
}


/* ── Legacy inline-styled headers (th with style="color:#fbfbfb;...") ──────── *
 * Tables that use inline style on TH already get the right colors.           *
 * Add Raleway + padding via a targeted selector on tables that use these IDs. */

#finalSearchResults th,
#preliminarySearchResults th,
#paidSearchResults th,
#adminSearchResults th {
    padding: 10px 12px;
    font-family: Raleway, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 3px solid #0a2340;
}

#finalSearchResults td,
#preliminarySearchResults td,
#paidSearchResults td,
#adminSearchResults td {
    font-size: 12px !important;
}
