:root {
    --bg: #f6f7fb;
    --card: #fff;
    --text: #111;
    --muted: #666;
    --border: #e9e9ef;
    --shadow: 0 2px 10px rgba(0, 0, 0, .06);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #111;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar a {
    color: #fff;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
}

.container {
    max-width: 1100px;
    margin: 14px auto;
    padding: 0 12px;
}

.card {
    background: var(--card);
    padding: 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

h1,
h2 {
    margin: 0 0 10px 0;
}

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

label {
    display: block;
    font-size: 14px;
    margin: 8px 0 6px;
    color: var(--muted);
}

input,
select {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 16px;
    /* evita zoom en iOS */
    outline: none;
}

button {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.error {
    background: #ffe3e3;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    color: #7a1e1e;
    border: 1px solid #ffc5c5;
}

/* Tablas móviles: scroll horizontal sin romper */
.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    /* fuerza scroll en móvil */
    background: #fff;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

/* Filtros */
.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

/* Login centrado */
.card form button {
    margin-top: 12px;
}

/* Desktop */
@media (min-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .card {
        padding: 16px;
    }

    /* filtros en fila en pantallas grandes */
    .filters {
        grid-template-columns: 220px 180px 220px 140px;
    }

    .filters button {
        width: auto;
        height: 44px;
        align-self: end;
    }
}

@media (max-width: 600px) {
    #punchBtn {
        position: sticky;
        bottom: 12px;
        z-index: 9;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    }
}


/* Móvil: mejora de toque y espaciado */
@media (max-width: 480px) {
    .topbar {
        padding: 10px 12px;
    }

    .topbar a {
        padding: 8px 10px;
    }
}