:root {
    --ink: #1b1b1b;
    --muted: #6e6a63;
    --line: #ddd7cc;
    --paper: #fffdf8;
    --panel: #ffffff;
    --accent: #f2a000;
    --accent-dark: #c77c00;
    --blue: #148fd1;
    --soft: #fff4dc;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    border-radius: 6px;
    min-height: 42px;
    padding: 0 16px;
    color: #161616;
    background: #e9e3d8;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(.98);
}

button:disabled {
    cursor: wait;
    opacity: .7;
}

.primary {
    color: #fff;
    background: var(--blue);
}

.secondary {
    color: #171717;
    background: var(--accent);
}

.ghost-button {
    background: transparent;
    border: 1px solid var(--line);
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    padding: 9px 11px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.hero img {
    width: 138px;
    height: auto;
    margin-bottom: 8px;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.session-card {
    display: grid;
    gap: 6px;
    min-width: 210px;
    padding: 14px;
    border-radius: 8px;
    background: #171717;
    color: #fff;
}

.session-card span {
    color: #d7d0c2;
    font-size: .82rem;
    text-transform: uppercase;
}

.session-card .ghost-button {
    color: #fff;
    border-color: rgba(255, 255, 255, .28);
}

.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #f3ce87;
    border-radius: 8px;
    background: var(--soft);
    font-weight: 700;
}

.panel {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 12px 30px rgba(40, 35, 25, .05);
}

.route-panel {
    display: none;
}

.route-panel.active {
    display: block;
}

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

.menu-grid a {
    display: grid;
    gap: 8px;
    min-height: 112px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff8ea;
    color: var(--ink);
    text-decoration: none;
}

.menu-grid a:hover,
.menu-grid a:focus {
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(199, 124, 0, .16);
}

.menu-grid strong {
    font-size: 1.08rem;
}

.menu-grid span {
    color: var(--muted);
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.panel-title span {
    font-size: 1.25rem;
    font-weight: 800;
}

.panel-title small {
    color: var(--muted);
    font-weight: 700;
}

.form-grid {
    display: grid;
    gap: 12px;
}

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

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

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

.form-grid.five {
    grid-template-columns: .7fr .9fr repeat(3, minmax(0, 1fr));
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.bottom-actions {
    justify-content: flex-end;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    gap: 10px;
    margin-bottom: 14px;
    align-items: end;
}

.search-row select {
    min-width: 190px;
}

.split {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr);
    gap: 14px;
}

.result-list {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: 520px;
    overflow: auto;
}

.result-item {
    display: grid;
    gap: 4px;
    width: 100%;
    min-height: unset;
    padding: 12px;
    text-align: left;
    background: #f8f4ec;
    border: 1px solid var(--line);
}

.result-item strong {
    color: var(--ink);
}

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

.detail-card {
    min-height: 260px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffaf0;
}

.detail-card h3 {
    margin: 12px 0;
    font-size: 1.12rem;
}

.detail-card dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 12px;
    margin: 0;
}

.detail-card dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-card dd {
    margin: 0;
}

.prenda-img {
    width: min(240px, 100%);
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.empty {
    padding: 18px;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fff;
}

.remito-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.remito-head h3,
.remito-head p {
    margin: 0;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.table-wrap.compact {
    margin-top: 14px;
    max-height: 360px;
}

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

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

th {
    position: sticky;
    top: 0;
    background: #f4efe6;
    color: #4b463d;
    font-size: .9rem;
}

.scanner-dock {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: none;
    width: min(420px, calc(100vw - 32px));
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
    z-index: 20;
}

.scanner-dock.open {
    display: grid;
    gap: 10px;
}

.scanner-dock > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.scanner-dock video {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    background: #111;
    object-fit: cover;
}

.scanner-dock p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 1100px) {
    .menu-grid,
    .form-grid.three,
    .form-grid.four,
    .form-grid.five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .hero {
        display: grid;
    }

    .menu-grid,
    .form-grid.two,
    .form-grid.three,
    .form-grid.four,
    .form-grid.five,
    .search-row {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 14px;
    }

    .panel-title {
        display: grid;
    }

    .detail-card dl {
        grid-template-columns: 1fr;
    }
}
