/* ==========================================================================
   Latham Builder Dashboard Styles
   Brand Navy: #002e5e
   ========================================================================== */

/* ---------- Scorecard ---------- */
.scorecard {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.scorecard .stat {
    flex: 1 1 0;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #002e5e 0%, #003d7a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 46, 94, .15);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.scorecard .stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 46, 94, .25);
	background: #cdd8df;
	border-color: #002e5e;
    transition: background-color .15s ease, border-color .15s ease;
}

.scorecard .stat:hover span.stat-desc {
    color: #000;
}

.scorecard .stat.active {
    background: #fff;
    color: #002e5e;
    border: 2px solid #002e5e;
    box-shadow: 0 4px 14px rgba(0, 46, 94, .18);
}

.scorecard .stat svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    opacity: .85;
}

.scorecard .stat.active svg {
    color: #002e5e;
    opacity: 1;
}

.scorecard .stat h3 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.scorecard .stat p {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 500;
    opacity: .9;
}

.scorecard .stat.active p {
    opacity: 1;
    color: #002e5e;
}

.scorecard .stat-desc {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, .65);
    margin-top: 2px;
    line-height: 1.3;
}

.scorecard .stat.active .stat-desc {
    color: #6b7c93;
}

/* ---------- Table Wrapper ---------- */
.builder-table-wrapper {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    overflow: hidden;
    background: #fff;
}

#builder-table-ajax_length {
    margin-left: 15px;
    margin-top: 6px;
}

#builder-table-ajax_filter {
    margin-right: 15px;
    margin-top: 6px;
}
/* ---------- Table Header ---------- */
#builder-table-ajax thead th,
#builder-table thead th {
    background: linear-gradient(135deg, #002e5e 0%, #003d7a 100%) !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 14px;
    border-bottom: none !important;
    white-space: nowrap;
}

/* DataTables sort arrows on dark header */
#builder-table-ajax thead .sorting::after,
#builder-table-ajax thead .sorting_asc::after,
#builder-table-ajax thead .sorting_desc::after,
#builder-table thead .sorting::after,
#builder-table thead .sorting_asc::after,
#builder-table thead .sorting_desc::after {
    opacity: .6 !important;
}

#builder-table-ajax thead .sorting_asc::after,
#builder-table-ajax thead .sorting_desc::after,
#builder-table thead .sorting_asc::after,
#builder-table thead .sorting_desc::after {
    opacity: 1 !important;
}

/* ---------- Table Rows ---------- */
#builder-table-ajax tbody td,
#builder-table tbody td {
    padding: 10px 14px;
    font-size: 13px;
    vertical-align: middle;
    border-bottom: 1px solid #eef1f6;
}

#builder-table-ajax tbody tr:nth-child(odd),
#builder-table tbody tr:nth-child(odd) {
    background-color: #f8fafc;
}

#builder-table-ajax tbody tr:nth-child(even),
#builder-table tbody tr:nth-child(even) {
    background-color: #fff;
}

#builder-table-ajax tbody tr:hover,
#builder-table tbody tr:hover {
    background-color: #eef3f8 !important;
    transition: background-color .15s ease;
}

/* Override theme's td:last-child color */
#builder-table-ajax tbody td:last-child,
#builder-table tbody td:last-child {
    color: inherit !important;
}

/* ---------- Builder Name Column ---------- */
.builder-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a2332;
}

/* Hide sugar ID (kept in HTML for search, but visually hidden) */
#builder-table-ajax .sugarid,
#builder-table .sugarid {
    display: none;
}

/* ---------- Category Cell Icons ---------- */
#builder-table-ajax svg,
#builder-table svg {
    width: 14px;
    height: auto;
}

.icon-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.icon-status.icon-active {
    background-color: rgba(0, 46, 94, .08);
}

.icon-status.icon-active:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 46, 94, .15);
}

.icon-status.icon-inactive {
    opacity: .4;
}

.display-options {
    display: flex;
    gap: 4px;
    align-items: center;
}

.display-options > div {
    display: flex;
    align-items: center;
}

/* ---------- Action Column ---------- */
#builder-table-ajax thead th:last-child,
#builder-table thead th:last-child,
#builder-table-ajax tbody td:last-child,
#builder-table tbody td:last-child {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: right;
}

.builder-actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.btn-row-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #dde2ea;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn-row-edit:hover {
    background: #002e5e;
    color: #fff !important;
    border-color: #002e5e;
    transform: scale(1.08);
    box-shadow: 0 3px 8px rgba(0, 46, 94, .2);
}

/* ---------- DataTables Controls ---------- */

/* Search input */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #002e5e;
    box-shadow: 0 0 0 3px rgba(0, 46, 94, .12);
}

/* Tippy */

div[data-tippy-root] {
    z-index: 10000 !important;
    background-color: #002e5e !important;
    color: #fff !important;
    padding: 5px 12px !important;
    border-radius: 6px !important;
    border: 1px solid #d1d9e6 !important;
}
div[data-tippy-root] .tippy-arrow {
    display: none !important;
}
/* Pagination */
#builder-table-ajax_paginate {
    margin-right: 15px;
    margin-top: 6px;
}

#builder-table-ajax_info {
    margin-left: 15px;
    margin-top: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    border: 1px solid #d1d9e6 !important;
    background: #fff !important;
    color: #3a4a5c !important;
    margin: 0 2px;
    padding: 5px 12px !important;
    transition: background .15s ease, color .15s ease;
}

.dataTables_wrapper .dataTables_paginate#builder-table-ajax_paginate .paginate_button:hover {
    background: #eef3f8 !important;
    border-color: #002e5e !important;
    color: #002e5e !important;
}

.dataTables_wrapper .dataTables_paginate#builder-table-ajax_paginate .paginate_button.current {
    background: #002e5e !important;
    border-color: #002e5e !important;
    color: #fff !important;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: .4;
    cursor: default;
}

/* Processing indicator */
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, .9) !important;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

/* Info text */
.dataTables_wrapper .dataTables_info {
    color: #6b7c93;
    font-size: 13px;
}

/* Length selector */
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .scorecard {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .scorecard {
        grid-template-columns: 1fr;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
    }

    .scorecard .stat {
        padding: 14px 16px;
    }

    .scorecard .stat h3 {
        font-size: 22px;
    }
}
