:root {
    --wine: #951619;
    --wine-dark: #7d1115;
    --ink: #171f26;
    --charcoal: #2d2b2d;
    --gold: #f0b400;
    --surface: #ffffff;
    --bg: #f4f4f4;
    --text: #111111;
    --muted: #5b626c;
    --line: #dedede;
    --success: #147a45;
    --danger: #9f1d1d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Instrument Sans", "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--wine);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.inline-form {
    display: inline-flex;
}

.inline-form button {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    margin: 0;
    padding: 0;
}

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

.top-strip {
    background: var(--ink);
    color: #fff;
    font-size: 14px;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.top-strip__inner,
.brand-band__inner {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.top-strip__inner {
    min-height: 46px;
    position: relative;
}

.quick-links {
    align-items: center;
    display: flex;
    gap: 18px;
}

.quick-menu {
    display: none;
    margin-left: auto;
    position: relative;
}

.quick-menu summary {
    display: none;
}

.hamburger-lines,
.hamburger-lines::before,
.hamburger-lines::after {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 18px;
}

.hamburger-lines {
    position: relative;
}

.hamburger-lines::before,
.hamburger-lines::after {
    content: "";
    left: 0;
    position: absolute;
}

.hamburger-lines::before {
    top: -6px;
}

.hamburger-lines::after {
    top: 6px;
}

.top-strip a,
.main-nav a {
    color: #fff;
    font-weight: 800;
}

.brand-band {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand-band__inner {
    min-height: 112px;
}

.brand-mark {
    align-items: center;
    color: var(--text);
    display: flex;
    gap: 14px;
}

.brand-mark:hover {
    text-decoration: none;
}

.brand-seal {
    border: 2px solid var(--charcoal);
    border-radius: 50%;
    display: grid;
    font-weight: 900;
    height: 54px;
    place-items: center;
    width: 54px;
}

.brand-mark strong,
.brand-mark small,
.project-title span,
.project-title small {
    display: block;
	color: var(--muted);
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.brand-mark small,
.project-title small {
    color: var(--muted);
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.project-title {
    text-align: right;
}

.project-title span {
    color: var(--wine-dark);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.15;
}

.main-nav {
    background: var(--wine);
    color: #fff;
}

.main-nav__inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
    font-weight: 800;
    min-height: 56px;
}

.main-nav a::before {
    color: var(--gold);
    content: "/";
    margin-right: 10px;
}

main {
    padding: 36px 0 56px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    color: var(--wine-dark);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.12;
    margin-bottom: 12px;
}

h2 {
    color: var(--wine-dark);
    font-size: 28px;
}

h3 {
    color: var(--charcoal);
    font-size: 20px;
    margin-bottom: 8px;
}

label {
    color: #333;
    display: grid;
    font-weight: 800;
    gap: 7px;
    margin-top: 10px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    color: #222;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--wine);
    border-radius: 3px;
    flex: 0 0 auto;
    height: 16px;
    min-height: 0;
    padding: 0;
    width: 16px;
}

label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    line-height: 1.3;
    margin: 8px 16px 8px 0;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

table {
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 16px;
    width: 100%;
}

th {
    background: #f7e9ea;
    color: var(--wine-dark);
    font-weight: 900;
}

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

tr:hover td {
    background: #fbfbfb;
}

.page-head {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 5px solid var(--wine);
    border-radius: 8px;
    margin-bottom: 22px;
    padding: 22px;
}

.page-head p {
    color: var(--muted);
    margin-bottom: 0;
}

.section,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}

.section {
    margin: 18px 0;
}

.card h2,
.card h3 {
    margin-bottom: 8px;
}

.section-title {
    align-items: center;
    border-bottom: 1px solid #ececec;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 0 0 16px;
    padding-bottom: 12px;
}

.section-title h2 {
    margin-bottom: 0;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

form {
    margin-bottom: 0;
}

form > button,
form > .btn {
    margin-top: 14px;
}

td form {
    margin-top: 10px;
}

td form:first-child {
    margin-top: 0;
}

td form button {
    margin-bottom: 8px;
}

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

.btn,
button {
    background: var(--wine);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    padding: 10px 14px;
    text-decoration: none;
}

.btn:hover,
button:hover {
    background: var(--wine-dark);
    text-decoration: none;
}

.btn-secondary {
    background: var(--charcoal);
}

.btn-secondary:hover {
    background: #161516;
}

.btn-ghost {
    background: #f7e9ea;
    color: var(--wine);
}

.btn-ghost:hover {
    background: #efdadd;
    color: var(--wine-dark);
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.ok,
.err {
    border-radius: 8px;
    margin-top: 0;
    padding: 14px 18px;
}

.ok {
    background: #edf7ef;
    border: 1px solid #b9dfc0;
    color: #1d5f2b;
}

.err {
    background: #fff1f1;
    border: 1px solid #efb8b8;
    color: #811d22;
}

.err p:last-child,
.ok:last-child {
    margin-bottom: 0;
}

.badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    padding: 5px 10px;
}

.badge-activo,
.badge-enviada {
    background: #e8f5ee;
    color: var(--success);
}

.badge-abierta,
.badge-convocado,
.badge-pendiente_password {
    background: #fff8df;
    color: #775500;
}

.badge-borrador,
.badge-cerrada {
    background: #f3f3f3;
    color: var(--charcoal);
}

.badge-inactivo,
.badge-bloqueada {
    background: #fff1f1;
    color: var(--danger);
}

.metric {
    color: var(--wine);
    display: block;
    font-size: 34px;
    font-weight: 900;
    margin: 4px 0;
}

.kpi-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin: 14px 0;
}

.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.kpi span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.kpi strong {
    color: var(--wine-dark);
    display: block;
    font-size: 18px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

ul {
    padding-left: 20px;
}

@media (max-width: 760px) {
    .shell,
    main {
        width: min(100% - 24px, 1180px);
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-links {
        display: none;
    }

    .quick-menu {
        display: block;
    }

    .quick-menu summary {
        align-items: center;
        cursor: pointer;
        display: inline-flex;
        font-weight: 800;
        gap: 10px;
        list-style: none;
        min-height: 44px;
        padding: 0 2px;
    }

    .quick-menu summary::-webkit-details-marker {
        display: none;
    }

    .quick-menu nav {
        background: var(--ink);
        border: 1px solid rgba(255, 255, 255, .2);
        border-radius: 8px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
        display: none;
        min-width: 220px;
        padding: 12px;
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        z-index: 20;
    }

    .quick-menu[open] nav {
        display: grid;
        gap: 12px;
    }

    .quick-menu .inline-form,
    .quick-menu .inline-form button,
    .quick-menu nav a {
        text-align: left;
        width: 100%;
    }

    .brand-band__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding: 18px 0;
    }

    .project-title {
        text-align: left;
    }

    .project-title span {
        font-size: 22px;
    }

    .project-title small {
        display: none;
    }

    .main-nav__inner {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }

    .section,
    .card,
    .page-head {
        padding: 16px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .btn,
    button {
        width: 100%;
    }

    .actions form {
        width: 100%;
    }
}
