/* LIBAC public accreditation registry */

.list-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: -30px 0 34px;
    position: relative;
    z-index: 2;
}

.stat-box {
    min-width: 0;
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #edf1f5;
    box-shadow: 0 10px 28px rgba(20, 42, 74, .08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(20, 42, 74, .11);
}

.stat-icon {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-icon.blue { background: rgba(0, 86, 179, .10); color: var(--primary-color); }
.stat-icon.green { background: rgba(40, 167, 69, .10); color: #218838; }
.stat-icon.gold { background: rgba(197, 160, 89, .13); color: #9b762d; }

.stat-info { min-width: 0; }
.stat-info h3 { margin: 0; font-size: 1.05rem; color: var(--text-dark); line-height: 1.5; }
.stat-info p { margin: 4px 0 0; color: var(--text-light); font-size: .9rem; }

.controls-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.search-wrapper {
    position: relative;
    width: min(100%, 680px);
}

.search-wrapper input {
    width: 100%;
    min-height: 54px;
    padding: 14px 50px 14px 18px;
    border: 1px solid #dfe5eb;
    border-radius: 14px;
    font: inherit;
    font-size: .96rem;
    color: var(--text-dark);
    background: #fff;
    box-shadow: 0 6px 18px rgba(20, 42, 74, .05);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.search-wrapper input::placeholder { color: #8b96a5; }
.search-wrapper input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(197, 160, 89, .12), 0 8px 20px rgba(20, 42, 74, .06);
}

.search-icon {
    position: absolute;
    inset-inline-start: 19px;
    top: 50%;
    transform: translateY(-50%);
    color: #7a8796;
    pointer-events: none;
}

.table-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(20, 42, 74, .07);
    overflow: hidden;
}

.table-card[hidden], .no-results-state[hidden] { display: none !important; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.data-table thead { background: var(--primary-color); color: #fff; }
.data-table th {
    padding: 17px 18px;
    text-align: right;
    font-weight: 700;
    font-size: .91rem;
    line-height: 1.5;
    white-space: nowrap;
}

.data-table th:nth-child(1) { width: 16%; }
.data-table th:nth-child(2) { width: 30%; }
.data-table th:nth-child(3) { width: 26%; }
.data-table th:nth-child(4) { width: 16%; }
.data-table th:nth-child(5) { width: 12%; }

.data-table td {
    padding: 17px 18px;
    border-bottom: 1px solid #edf1f5;
    color: var(--text-dark);
    font-size: .93rem;
    line-height: 1.75;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.data-table tbody tr { background: #fff; transition: background-color .18s ease; }
.data-table tbody tr:nth-child(even) { background: #fbfcfd; }
.data-table tbody tr:hover { background: #f4f8fc; }
.data-table tbody tr:last-child td { border-bottom: 0; }

.company-ref-cell strong {
    color: var(--primary-color);
    font-family: Arial, sans-serif;
    font-weight: 700;
    letter-spacing: .2px;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.company-name-cell { font-weight: 700; }
.company-date-cell { direction: ltr; text-align: center; white-space: nowrap; }
.company-date-cell time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    padding: 6px 10px;
    border: 1px solid #e0e7ef;
    border-radius: 9px;
    background: #f8fafc;
    color: #334155;
    font: 700 .9rem/1.4 Arial, sans-serif;
    letter-spacing: .2px;
    unicode-bidi: isolate;
}

.company-status-cell { text-align: center; }
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 92px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.status.active { background: #eaf7ee; color: #1c6b35; border: 1px solid #cdebd6; }
.status.expired { background: #fdf0f0; color: #b42323; border: 1px solid #f4cccc; }
.status i { font-size: .77rem; }

.table-message { text-align: center !important; padding: 28px 18px !important; color: var(--text-light) !important; }
.table-message.is-error { color: #b42323 !important; }

.no-results-state {
    text-align: center;
    padding: 54px 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px dashed #d7dee7;
    margin-top: 24px;
}
.no-results-state i { font-size: 2.7rem; color: #b8c0ca; margin-bottom: 14px; }
.no-results-state h3 { margin: 0 0 8px; color: var(--text-dark); }
.no-results-state p { margin: 0; color: var(--text-light); }

@media (max-width: 1000px) {
    .list-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .list-stats .stat-box:last-child { grid-column: 1 / -1; }
    .data-table th, .data-table td { padding-inline: 14px; }
}

@media (max-width: 760px) {
    .list-stats {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 0;
        margin-bottom: 24px;
    }
    .list-stats .stat-box:last-child { grid-column: auto; }
    .stat-box { padding: 16px; }
    .stat-icon { flex-basis: 50px; width: 50px; height: 50px; border-radius: 12px; }

    .controls-container { margin-bottom: 18px; }
    .search-wrapper input { min-height: 50px; border-radius: 12px; padding-inline-start: 46px; }
    .search-icon { inset-inline-start: 17px; }

    .table-card {
        border: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }
    .table-responsive { overflow: visible; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table { table-layout: auto; }
    .data-table thead { display: none; }

    .data-table tbody {
        display: grid;
        gap: 14px;
    }

    .data-table tbody tr,
    .data-table tbody tr:nth-child(even) {
        border: 1px solid #e4eaf0;
        border-radius: 14px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 7px 20px rgba(20, 42, 74, .06);
    }
    .data-table tbody tr:hover { background: #fff; }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-bottom: 1px solid #edf1f5;
        text-align: right;
        min-height: 48px;
    }
    .data-table td::before {
        content: attr(data-label);
        color: #657184;
        font-weight: 700;
        font-size: .82rem;
        line-height: 1.5;
    }
    .data-table td:last-child { border-bottom: 0; }
    .company-date-cell { direction: rtl; text-align: right; white-space: normal; }
    .company-date-cell time { justify-self: start; direction: ltr; min-width: 100px; }
    .company-status-cell { text-align: right; }
    .company-status-cell .status { justify-self: start; }
    .company-ref-cell strong { justify-self: start; }

    .table-message {
        display: block !important;
        padding: 24px 16px !important;
    }
    .table-message::before { content: none !important; }
}

@media (max-width: 420px) {
    .data-table td {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 12px 13px;
    }
    .data-table td::before { font-size: .78rem; }
}
