@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-VariableFont.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --black: #050505;
    --ink: #141414;
    --muted: #6f6f6f;
    --line: #e8e8e8;
    --surface: #ffffff;
    --soft: #f7f7f4;
    --yellow: #fff301;
    --orange: #ff7a1a;
    --green: #1f8f5f;
    --blue: #2668d9;
    --danger: #c33232;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 14px clamp(18px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--black);
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.brand.centered {
    justify-content: center;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--yellow);
    color: var(--black);
    border: 2px solid var(--black);
    box-shadow: 4px 4px 0 var(--black);
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.top-nav a,
.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.top-nav a:hover,
.top-nav a.active,
.nav-button:hover {
    border-color: var(--black);
    background: var(--black);
    color: #ffffff;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 58px;
}

.page-shell.narrow {
    width: min(860px, calc(100% - 32px));
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 32px;
    align-items: end;
    min-height: 360px;
    padding: clamp(28px, 5vw, 58px);
    border: 2px solid var(--black);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 243, 1, 0.18), transparent 42%),
        linear-gradient(315deg, rgba(255, 122, 26, 0.14), transparent 38%),
        var(--soft);
    box-shadow: 8px 8px 0 var(--black);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--orange);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 760px;
    margin: 0;
    color: var(--black);
    font-size: clamp(2.1rem, 4vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: 0;
}

h2 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 620px;
    margin: 18px 0 0;
    color: #333333;
    font-size: 1.05rem;
}

.quick-actions,
.button-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.quick-actions {
    align-content: end;
}

.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: #ffffff;
    color: var(--black);
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 4px 4px 0 var(--black);
}

.button.primary {
    background: var(--yellow);
}

.button.secondary {
    background: var(--orange);
    color: #ffffff;
}

.button.dark {
    background: var(--black);
    color: #ffffff;
}

.button.ghost {
    border-color: var(--line);
    background: #ffffff;
    color: var(--ink);
}

.button.full {
    width: 100%;
}

.feature-grid,
.metric-grid,
.admin-grid,
.two-column {
    display: grid;
    gap: 18px;
    margin-top: 32px;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid .wide {
    grid-column: 1 / -1;
}

.feature-card,
.metric-card,
.panel,
.toolbar-panel,
.auth-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.feature-card,
.metric-card,
.panel,
.toolbar-panel {
    padding: 22px;
}

.feature-card h2 {
    margin-top: 14px;
}

.feature-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--black);
    font-size: 0.82rem;
    font-weight: 850;
}

.pill.orange {
    background: var(--orange);
    color: #ffffff;
}

.pill.black {
    background: var(--black);
    color: #ffffff;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--black);
}

.metric-card.accent-yellow::before {
    background: var(--yellow);
}

.metric-card.accent-orange::before {
    background: var(--orange);
}

.metric-card span,
.metric-card small,
.muted {
    color: var(--muted);
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    color: var(--black);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
}

.page-title-row,
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.section-heading {
    align-items: center;
    margin-bottom: 14px;
}

.filter-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.form-stack,
.work-form {
    display: grid;
    gap: 16px;
}

.form-stack.compact {
    gap: 12px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--black);
    font-size: 0.92rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(255, 243, 1, 0.52);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.right {
    text-align: right;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ededed;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge.pendiente {
    background: #fff7bf;
}

.status-badge.revisado {
    background: #e8f0ff;
    color: var(--blue);
}

.status-badge.aprobado {
    background: #e8f7ef;
    color: var(--green);
}

.status-badge.pagado {
    background: #111111;
    color: #ffffff;
}

.alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--green);
    border-radius: 8px;
    background: #f6fff9;
    color: var(--ink);
    font-weight: 700;
}

.alert.danger {
    border-left-color: var(--danger);
    background: #fff5f5;
}

.alert.warning {
    border-left-color: var(--orange);
    background: #fff8ef;
}

.debug-box,
.copy-source {
    white-space: pre-wrap;
    overflow-x: auto;
}

.copy-source {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(255, 243, 1, 0.22), transparent 36%),
        linear-gradient(315deg, rgba(255, 122, 26, 0.16), transparent 34%),
        #ffffff;
}

.auth-shell {
    width: min(420px, calc(100% - 32px));
}

.auth-panel {
    padding: 28px;
}

.auth-panel h1 {
    margin-top: 22px;
    font-size: 2rem;
}

.token-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.token-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.token-item div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.token-item a,
.link-list a {
    color: var(--blue);
    overflow-wrap: anywhere;
}

.token-item span {
    color: var(--muted);
    font-size: 0.9rem;
}

.icon-button {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.86rem;
}

.report-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(24px, 5vw, 44px);
    border: 2px solid var(--black);
    border-radius: 8px;
    background: var(--soft);
    box-shadow: 8px 8px 0 var(--black);
    margin-bottom: 32px;
}

.report-meta {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px 16px;
    min-width: 280px;
    padding: 18px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.report-meta span {
    color: var(--muted);
    font-weight: 800;
}

.report-meta strong {
    text-align: right;
}

.link-list {
    margin: 0;
    padding-left: 18px;
}

.site-footer {
    padding: 28px 18px 36px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

.site-footer a {
    color: var(--black);
    font-weight: 850;
}

@media (max-width: 920px) {
    .site-header,
    .page-title-row,
    .report-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-panel,
    .feature-grid,
    .metric-grid,
    .two-column,
    .admin-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        align-items: stretch;
    }

    .quick-actions .button,
    .button-row .button {
        flex: 1 1 160px;
    }

    .report-meta {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .site-header {
        position: static;
        padding: 14px 16px;
    }

    .top-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .top-nav a,
    .nav-button {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 0.92rem;
    }

    .page-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 28px;
    }

    .hero-panel,
    .report-hero {
        padding: 22px;
        box-shadow: 5px 5px 0 var(--black);
    }

    h1 {
        font-size: 2.25rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .feature-card,
    .metric-card,
    .panel,
    .toolbar-panel {
        padding: 18px;
    }

    .token-item {
        align-items: stretch;
        flex-direction: column;
    }

    .token-item .icon-button {
        width: 100%;
    }
}

@media print {
    .site-header,
    .site-footer,
    .button-row,
    .toolbar-panel,
    .admin-grid,
    .nav-button,
    .copy-source {
        display: none !important;
    }

    body {
        background: #ffffff;
        color: #000000;
    }

    .page-shell {
        width: 100%;
        padding: 0;
    }

    .panel,
    .metric-card,
    .feature-card,
    .report-hero {
        box-shadow: none;
        border-color: #000000;
        break-inside: avoid;
    }

    table {
        min-width: 0;
        font-size: 12px;
    }
}
