:root {
    --text: #1a2332;
    --muted: #5c6570;
    --border: #c9c9c9;
    --panel: #f2f2f2;
    --panel-dark: #b9bbbe;
    --red: #d40000;
    --green-hrp: #1b7a3a;
    --blue: #0056b3;
    --black: #111111;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7f6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.public-body {
    min-height: 100vh;
}

.public-page {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 40px 0 34px;
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    text-align: left;
    background: var(--white);
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
}

.header-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    flex-shrink: 0;
}

.header-titles h2 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--green-hrp);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.public-header h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 800;
    color: var(--text);
}

.thin-rule {
    width: min(760px, 82%);
    height: 1px;
    margin: 40px auto 30px;
    background: #d8e2ec;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 47px;
    color: #3c4650;
    font-size: 16px;
}

.pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
}

.pager-link:not(.muted):hover {
    color: var(--green-hrp);
    text-decoration: underline;
}

.pager-link.muted {
    cursor: default;
    color: #54606b;
}

.pager-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 44px;
    margin: 0 1px;
    border-radius: 4px;
    color: var(--white);
    background: var(--green-hrp);
    font-weight: 700;
}

.document-panel {
    width: min(1060px, 100%);
    margin: 35px auto 42px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px 11px 0 0;
    background: var(--panel);
}

.document-panel-head {
    min-height: 55px;
    display: grid;
    place-items: center;
    background: linear-gradient(#e2e8f0, #cbd5e1);
}

.document-panel-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.document-panel-strip {
    height: 15px;
    background: var(--green-hrp);
}

.document-list {
    background: #eeeeee;
}

.document-row {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr) 76px 76px;
    align-items: center;
    min-height: 83px;
    border-top: 1px solid #d3d3d3;
    background: #f3f3f3;
}

.document-row:first-child {
    border-top: 0;
}

.document-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-file-icon img {
    width: 47px;
    height: 47px;
    display: block;
}

.document-copy {
    min-width: 0;
    padding-right: 18px;
}

.document-copy h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 19px;
    font-weight: 600;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.document-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.circle-action {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    border-radius: 50%;
    background: #f5f5f5;
    transition: transform 160ms ease, background-color 160ms ease;
}

.circle-action:hover {
    transform: translateY(-1px);
    background: #ffffff;
}

.circle-action.blue {
    border: 4px solid var(--blue);
}

.circle-action.black {
    border: 4px solid var(--black);
}

.circle-action img {
    width: 31px;
    height: 31px;
    display: block;
}

.document-empty {
    min-height: 104px;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #4d5964;
    font-size: 15px;
    text-align: center;
}

.public-login-link {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.public-login-link a:hover {
    color: var(--green-hrp);
    text-decoration: underline;
}

/* --- ESTILOS DEL PANEL DE ADMINISTRACIÓN --- */
.admin-body {
    min-height: 100vh;
    background: #f4f7f6;
    padding: 30px 0;
}

.admin-shell {
    width: min(1000px, calc(100% - 32px));
    margin: 0 auto;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--white);
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
}

.admin-topbar h1 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--text);
}

.admin-topbar p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    overflow: hidden;
}

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.admin-card-head h2 {
    margin: 0;
    font-size: 17px;
    color: var(--text);
}

.upload-form {
    padding: 24px;
    display: grid;
    gap: 16px;
    max-width: 600px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: var(--white);
}

.form-control:focus {
    border-color: var(--green-hrp);
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 122, 58, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    border: none;
}

.btn-red {
    background: var(--green-hrp);
    color: var(--white);
}

.btn-red:hover {
    filter: brightness(1.1);
}

.btn-blue {
    background: var(--blue);
    color: var(--white);
}

.btn-blue:hover {
    filter: brightness(1.1);
}

.btn-outline {
    background: var(--white);
    border: 1px solid #cbd5e1;
    color: var(--text);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: #dc2626;
    color: var(--white);
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.admin-table td {
    font-size: 14px;
    color: var(--text);
}

.inline-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.empty-admin {
    padding: 32px;
    text-align: center;
    color: var(--muted);
}