:root {
    --guinda: #6b1839;
    --guinda-dark: #4d1028;
    --guinda-soft: #9b2247;
    --guinda-card: #8b2446;
    --rose-bg: #f6f2f4;
    --text: #1f2430;
    --muted: #667085;
    --border: rgba(255, 255, 255, 0.4);
    --line: #e5e7eb;
    --success: #2f9a3f;
    --shadow: 0 20px 50px rgba(36, 7, 18, 0.16);
    --radius: 1.5rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: #ffffff;
}

img {
    display: block;
    max-width: 100%;
}

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

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

.site-shell {
    min-height: 100vh;
}

.container,
.auth-shell,
.admin-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--guinda);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
}

.brand img {
    height: 3.2rem;
    width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 600;
}

.nav a:hover {
    text-decoration: underline;
}

.llave-link img {
    height: 1.8rem;
    filter: brightness(0) invert(1);
}

.search-box button svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    padding: 0.25rem;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 1.6rem;
    height: 2px;
    margin: 0.28rem 0;
    background: #ffffff;
}

.hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 75% 15%, rgba(255, 255, 255, 0.12), transparent 20%),
        linear-gradient(90deg, #2d0a1a 0%, #4d1028 45%, #9d3d5c 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 4.5rem 0 7.5rem;
}

.hero-image-wrap {
    position: absolute;
    right: 10%;
    top: 4.8rem;
    width: min(33vw, 360px);
}

.hero-copy {
    max-width: 42rem;
    margin-bottom: 2rem;
}

.hero-kicker {
    margin: 0 0 0.5rem;
    font-size: clamp(3.8rem, 6vw, 5.8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
}

.hero h1 {
    margin: 0;
    max-width: 38rem;
    font-size: clamp(1.6rem, 4vw, 3.5rem);
    line-height: 1.08;
    font-weight: 300;
}

.search-box {
    display: flex;
    align-items: stretch;
    width: min(100%, 980px);
    margin: 0 auto;
    border-radius: 999px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.search-box input[type="text"] {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 1.35rem 1.8rem;
    font-size: clamp(1rem, 2.4vw, 1.35rem);
    color: #111111;
}

.search-box input[type="text"]::placeholder {
    color: #9a9a9a;
    font-style: italic;
}

.search-box button,
.button-solid {
    border: 0;
    color: #ffffff;
    background: var(--guinda);
    cursor: pointer;
}

.search-box button {
    min-width: 5.25rem;
    padding: 0 1.4rem;
}

.search-box button:hover,
.button-solid:hover {
    background: var(--guinda-dark);
}

.search-inline-error {
    width: min(100%, 980px);
    margin: 0.85rem auto 0;
    color: #ffffff;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.8rem;
}

.pill-row a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.65rem 1.15rem;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: var(--guinda-soft);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}

.notice {
    width: min(100%, 980px);
    margin: 2rem auto 0;
    padding: 1.25rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 1rem;
    background: rgba(98, 25, 49, 0.3);
    backdrop-filter: blur(10px);
}

.notice p {
    margin: 0;
    text-align: center;
    line-height: 1.6;
}

.hero-wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    color: var(--rose-bg);
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 5rem;
}

.hero-wave path {
    fill: currentColor;
}

.results-section,
.content {
    background: var(--rose-bg);
}

.results-section {
    padding: 0 0 1.2rem;
}

.results-panel {
    margin: -2rem auto 0;
    padding: 2rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 50px rgba(59, 17, 31, 0.12);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.results-header h2 {
    margin: 0;
    color: var(--guinda);
    font-size: clamp(2rem, 5vw, 3rem);
}

.results-close {
    color: #8f93a3;
    font-size: 2rem;
    line-height: 1;
}

.result-card {
    margin-bottom: 1rem;
    padding: 1.5rem 1.65rem;
    border-radius: 1.2rem;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(20, 20, 20, 0.06);
}

.result-card span {
    display: block;
    margin-bottom: 0.6rem;
    color: #5b6473;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.result-card strong {
    display: block;
    font-size: clamp(1.4rem, 4vw, 2rem);
    line-height: 1.35;
}

.result-card-primary {
    background: linear-gradient(135deg, #7a193f 0%, #8f2149 100%);
    color: #ffffff;
}

.result-card-success {
    background: var(--success);
    color: #ffffff;
}

.result-card-primary span,
.result-card-primary strong,
.result-card-success span,
.result-card-success strong {
    color: #ffffff;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed #d3c4cb;
    border-radius: 1.25rem;
    background: #ffffff;
    text-align: center;
}

.button-solid,
.button-muted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.85rem 1.25rem;
    border-radius: 0.9rem;
    font-weight: 700;
}

.button-muted {
    border: 1px solid #d8dde6;
    background: #ffffff;
    color: var(--text);
}

.content {
    padding: 2.6rem 0 3.2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.8fr) minmax(280px, 0.9fr);
    gap: 1.35rem;
    align-items: stretch;
}

.stack {
    display: grid;
    gap: 1rem;
}

.feature-card {
    position: relative;
    overflow: hidden;
    min-height: 12.5rem;
    padding: 2rem;
    border-radius: var(--radius);
    color: #ffffff;
    background: linear-gradient(90deg, var(--guinda) 0%, var(--guinda-card) 100%);
    box-shadow: var(--shadow);
}

.feature-card p {
    margin: 0 0 0.3rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.feature-card h2 {
    margin: 0;
    max-width: 14rem;
    font-size: clamp(2rem, 4vw, 3.7rem);
    line-height: 0.94;
}

.feature-card span {
    position: absolute;
    right: -1.25rem;
    top: 50%;
    display: grid;
    place-items: center;
    width: 5.6rem;
    height: 5.6rem;
    border-radius: 999px;
    background: #a84862;
    font-size: 2.4rem;
    transform: translateY(-50%);
}

.account-card,
.deadline-card,
.auth-card,
.admin-panel,
.admin-table-wrap,
.summary-card {
    padding: 1.75rem;
    border: 1px solid #e6e0e2;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 16px 35px rgba(60, 29, 38, 0.08);
}

.account-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.account-card img {
    height: 5rem;
    margin-bottom: 1.1rem;
}

.account-card p {
    margin: 0 0 1.2rem;
    color: #555555;
    line-height: 1.5;
}

.deadline-card h2,
.auth-card h1,
.admin-panel h2,
.admin-table-wrap h2 {
    margin: 0 0 1.25rem;
    font-size: 1.55rem;
}

.deadline-item h3 {
    margin: 0 0 0.75rem;
    color: var(--guinda);
    font-size: 1rem;
    line-height: 1.45;
}

.deadline-item a {
    color: var(--guinda);
    font-weight: 700;
}

.deadline-date {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.with-divider {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e6e6e6;
}

.page-muted {
    min-height: 100vh;
    padding: 2rem 0 3rem;
    background: linear-gradient(180deg, #f5edf0 0%, #fbfbfc 100%);
    overflow-x: hidden;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 5rem);
}

.auth-card {
    width: min(100%, 460px);
}

.auth-card p,
.muted,
.footer-note {
    color: var(--muted);
    line-height: 1.6;
    word-break: break-word;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
}

.flash-error {
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.flash-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

.field-grid {
    display: grid;
    gap: 1rem;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.field label {
    color: #344054;
    font-size: 0.95rem;
    font-weight: 600;
}

.field input,
.field textarea,
.field select,
.toolbar input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.9rem 1rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.9rem;
    background: #ffffff;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions,
.toolbar {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-shell {
    display: grid;
    gap: 1.25rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-header h1 {
    margin: 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.summary-card {
    min-width: 0;
}

.summary-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.45rem;
}

.summary-card strong {
    font-size: 2rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

.admin-panel,
.admin-table-wrap {
    min-width: 0;
    width: 100%;
}

.admin-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

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

.admin-table th,
.admin-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid #eaecf0;
    text-align: left;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
}

.admin-table th:first-child,
.admin-table td:first-child {
    width: 17%;
    min-width: 150px;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    width: 22%;
    min-width: 180px;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    width: 20%;
    min-width: 170px;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    width: 24%;
    min-width: 210px;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    width: 9%;
    min-width: 110px;
}

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
    width: 8%;
    min-width: 120px;
    text-align: center;
}

.admin-table td {
    font-size: 0.95rem;
}

.admin-table td strong {
    display: inline-block;
    margin-bottom: 0.2rem;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.92rem;
}

.table-action {
    width: auto;
    min-height: 2.3rem;
    padding: 0.6rem 0.9rem;
    white-space: nowrap;
}

.table-actions-stack {
    display: grid;
    gap: 0.5rem;
}

.table-actions-stack form {
    margin: 0;
}

.users-table .table-action {
    width: 100%;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 0.82rem;
    font-weight: 700;
}

.footer {
    display: none;
}

.footer-visible {
    display: block;
    background: var(--guinda);
    color: #ffffff;
    padding: 3.2rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
}

.footer-brand {
    height: 4rem;
    width: auto;
}

.footer p,
.footer li {
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
}

.footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-about-links {
    margin-top: 1rem;
}

.social-title {
    margin-top: 1.7rem;
}

.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.social-row img {
    height: 2rem;
}

.linea-079 img {
    height: 3rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1280px) {
    .hero-image-wrap {
        right: 4%;
        width: min(30vw, 280px);
    }

    .content-grid,
    .admin-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 820px) {
    .menu-toggle {
        display: inline-block;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
        background: var(--guinda);
    }

    .nav.is-open {
        display: flex;
    }

    .hero-content {
        padding-top: 3rem;
    }

    .hero-image-wrap {
        position: static;
        width: min(70vw, 320px);
        margin: 0 auto;
        padding-top: 2rem;
    }

    .hero-copy {
        margin-top: 1rem;
        text-align: center;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .form-actions {
        align-items: stretch;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-table {
        min-width: 820px;
    }
}

@media (max-width: 640px) {
    .container,
    .auth-shell,
    .admin-shell {
        width: min(100% - 1.25rem, 1180px);
    }

    .brand img {
        height: 2.4rem;
    }

    .hero-content {
        padding-bottom: 6.4rem;
    }

    .search-box {
        border-radius: 1.4rem;
    }

    .search-box input[type="text"] {
        padding: 1rem;
    }

    .search-box button {
        min-width: 4.2rem;
    }

    .pill-row {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.4rem;
    }

    .pill-row a {
        flex: 0 0 auto;
    }

    .results-panel {
        margin-top: -1rem;
        padding: 1.25rem;
    }

    .result-card strong {
        font-size: 1.15rem;
    }

    .feature-card {
        min-height: 10.6rem;
    }

    .feature-card h2 {
        max-width: 11rem;
        font-size: 2.6rem;
    }

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

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

    .toolbar input,
    .toolbar .button-solid,
    .toolbar .button-muted,
    .form-actions .button-solid,
    .form-actions .button-muted {
        width: 100%;
    }

    .admin-table {
        min-width: 780px;
    }

    .admin-panel,
    .admin-table-wrap,
    .summary-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container,
    .auth-shell,
    .admin-shell {
        width: min(100% - 1rem, 1180px);
    }

    .admin-table {
        min-width: 740px;
    }

    .field input,
    .field textarea,
    .field select,
    .toolbar input {
        padding: 0.85rem 0.9rem;
    }

    .button-solid,
    .button-muted {
        width: 100%;
    }
}
