.idex-wrap {
    max-width: 1050px;
    margin: 24px auto;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.idex-header {
    padding: 22px 24px;
    border-bottom: 1px solid #e5e7eb;
}
.idex-header h2 { margin: 0; font-size: 24px; }
.idex-subtitle { margin-top: 4px; color: #6b7280; font-size: 14px; }
.idex-breadcrumbs {
    padding: 12px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}
.idex-breadcrumbs a { text-decoration: none; }
.idex-sep { margin: 0 8px; color: #9ca3af; }
.idex-table-wrap {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.idex-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: auto;
    margin: 0;
}
.idex-table th,
.idex-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef0f2;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.35;
}
.idex-table th {
    font-size: 12px;
    color: #4b5563;
    background: #fff;
}
.idex-entry-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 500;
}
.idex-file-name { color: #1d2327 !important; }
/* O nome tem estilo próprio para não herdar regras do tema e para não colapsar em tabelas estreitas. */
.idex-wrap .idex-entry-name {
    display: inline !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    color: #1d2327 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    text-indent: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
.idex-wrap a.idex-entry-link .idex-entry-name {
    color: #135e96 !important;
}
.idex-icon { width: 22px; display: inline-block; flex: 0 0 22px; }
.idex-col-name {
    width: auto;
    min-width: 0;
}
.idex-col-name .idex-entry-link {
    max-width: 100%;
    min-width: 0;
}
.idex-col-name .idex-entry-name {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* As colunas auxiliares ocupam apenas o espaço mínimo necessário; o restante fica para o nome. */
.idex-col-size {
    width: 1%;
    white-space: nowrap;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
.idex-col-date {
    width: 1%;
    white-space: nowrap;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
.idex-col-action {
    width: 1%;
    white-space: nowrap;
    padding-left: 8px !important;
    padding-right: 10px !important;
    text-align: right !important;
}
.idex-download {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    text-decoration: none;
}
.idex-download:hover { background: #f8fafc; }
.idex-empty { text-align: center !important; color: #6b7280; padding: 28px !important; }
.idex-message {
    padding: 14px 16px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
}
.idex-warning { border-left: 4px solid #dba617; }

/* Tabela responsiva */
@media (max-width: 760px) {
    .idex-table {
        table-layout: auto;
    }
    .idex-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .idex-table tbody,
    .idex-table tr,
    .idex-table td {
        display: block;
        width: 100%;
    }
    .idex-table tr {
        padding: 12px 14px;
        border-bottom: 1px solid #eef0f2;
    }
    .idex-table td {
        box-sizing: border-box;
        padding: 4px 0;
        border: 0;
        text-align: left !important;
        white-space: normal;
    }
    .idex-table td[data-label]:not(.idex-col-name):not(.idex-col-action)::before {
        content: attr(data-label) ": ";
        display: inline;
        font-weight: 600;
        color: #4b5563;
    }
    .idex-col-name {
        padding-bottom: 7px !important;
        font-size: 15px;
    }
    .idex-col-size,
    .idex-col-date,
    .idex-col-action {
        width: 100%;
    }
    .idex-col-action {
        padding-top: 9px !important;
    }
    .idex-download {
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
    }
    .idex-folder-row-item td,
    .idex-empty {
        padding: 4px 0 !important;
    }
}

@media (max-width: 420px) {
    .idex-header { padding: 18px 16px; }
    .idex-header h2 { font-size: 20px; }
    .idex-breadcrumbs { padding: 10px 14px; overflow-wrap: anywhere; }
    .idex-table tr { padding: 11px 12px; }
}

/* Backoffice */
.idex-admin-page .idex-wrap {
    max-width: none;
    margin: 16px 0 0;
}
.idex-wrap-admin {
    border-radius: 4px;
}
.idex-admin-page .idex-breadcrumbs {
    font-size: 14px;
}
.idex-admin-page .idex-entry-link .dashicons {
    line-height: 1;
    width: 22px;
    height: 22px;
    font-size: 20px;
}
.idex-admin-page .idex-download {
    background: #f6f7f7;
}
.idex-admin-page .idex-download:hover {
    background: #f0f0f1;
}

/* Explorador em duas colunas */
.idex-explorer-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 460px;
}
.idex-sidebar {
    border-right: 1px solid #e5e7eb;
    background: #f8fafc;
    min-width: 0;
    overflow: auto;
}
.idex-sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    background: #f1f5f9;
}
.idex-folder-tree {
    padding: 8px;
    font-size: 14px;
}
.idex-tree-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}
.idex-tree-node {
    margin: 1px 0;
    padding: 0;
}
.idex-tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: #1d2327;
}
.idex-tree-item:hover {
    background: #e9f2fb;
    color: #135e96;
}
.idex-tree-item.is-current {
    background: #dbeafe;
    color: #0a4b78;
    font-weight: 600;
}
.idex-tree-item.is-ancestor {
    font-weight: 600;
}
.idex-tree-item .dashicons {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    font-size: 17px;
    line-height: 18px;
}
.idex-tree-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.idex-main {
    min-width: 0;
    background: #fff;
}
.idex-main .idex-breadcrumbs {
    border-top: 0;
}

@media (max-width: 900px) {
    .idex-explorer-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .idex-explorer-layout {
        display: block;
    }
    .idex-sidebar {
        max-height: 230px;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Ordenação */
.idex-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    font: inherit;
    white-space: nowrap;
}
.idex-sort-link:hover,
.idex-sort-link:focus {
    color: #135e96;
    text-decoration: none;
}
.idex-sort-link.is-active {
    color: #135e96;
    font-weight: 600;
}
.idex-sort-indicator {
    display: inline-block;
    width: 12px;
    text-align: center;
    font-size: 11px;
    line-height: 1;
    opacity: .8;
}
.idex-sort-mobile {
    display: none;
}

@media (max-width: 760px) {
    .idex-sort-mobile {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 14px;
        border-bottom: 1px solid #e5e7eb;
        background: #fff;
        font-size: 12px;
    }
    .idex-sort-mobile-label {
        color: #4b5563;
        font-weight: 600;
        margin-right: 2px;
    }
    .idex-sort-mobile-link {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        padding: 5px 8px;
        border: 1px solid #dcdcde;
        border-radius: 4px;
        background: #fff;
        color: #2c3338;
        text-decoration: none;
        line-height: 1.2;
    }
    .idex-sort-mobile-link.is-active {
        border-color: #72aee6;
        background: #f0f6fc;
        color: #135e96;
        font-weight: 600;
    }
}
