/* Turnos — estilos compartidos */
:root {
    --color-primary: #CA3C42;
    --color-primary-dark: #9a2a30;
    --color-bg: #f8fafc;
    --color-text: #0f172a;
    --color-muted: #64748b;
    --color-border: #e2e8f0;
}

body { background: var(--color-bg); color: var(--color-text); font-family: 'Outfit', system-ui, sans-serif; margin: 0; }

.turnos-header { background: white; padding: 1.5rem 2rem; border-bottom: 1px solid var(--color-border); }
.turnos-header h1 { color: var(--color-primary); margin: 0; font-weight: 800; }

.cards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem; padding: 2rem; max-width: 1400px; margin: 0 auto;
}
.action-card {
    background: white; border: 1px solid var(--color-border); border-radius: 16px;
    padding: 1.5rem; text-decoration: none; color: var(--color-text);
    display: flex; flex-direction: column; gap: 0.75rem; transition: transform 0.15s, box-shadow 0.15s;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); border-color: var(--color-primary); }
.action-card .icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: #fef2f2; color: var(--color-primary); font-size: 1.4rem; }
.action-card h3 { margin: 0; font-weight: 700; font-size: 1.1rem; }
.action-card p { margin: 0; color: var(--color-muted); font-size: 0.9rem; }

/* Grid programación */
.prog-grid { background: white; border: 1px solid var(--color-border); border-radius: 12px; overflow: auto; max-height: 75vh; }
.prog-grid table { border-collapse: collapse; width: 100%; }
.prog-grid th, .prog-grid td {
    padding: 0.4rem 0.6rem; text-align: center; border: 1px solid var(--color-border);
    font-size: 0.85rem; white-space: nowrap;
}
.prog-grid th { background: #f1f5f9; font-weight: 700; position: sticky; top: 0; z-index: 1; }
.prog-grid th.col-name, .prog-grid td.col-name { text-align: left; position: sticky; left: 0; background: white; min-width: 200px; z-index: 1; }
.prog-grid th.col-name { z-index: 2; background: #f1f5f9; }
.prog-grid .cell-turno { cursor: pointer; font-weight: 700; }
.prog-grid .cell-turno:hover { outline: 2px solid var(--color-primary); }
.prog-grid .turno-badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 6px; color: white; font-size: 0.8rem; font-weight: 700; min-width: 28px; }

/* Tablet */
.tablet-bg { background: linear-gradient(135deg, #fee2e2 0%, #f8fafc 100%); min-height: 100vh; }
.tablet-card { background: white; padding: 2rem; border-radius: 20px; max-width: 480px; margin: 4rem auto; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15); }
.tablet-pin-input { font-size: 2rem; text-align: center; letter-spacing: 0.5rem; padding: 1rem; border: 2px solid var(--color-border); border-radius: 12px; width: 100%; box-sizing: border-box; }
.tablet-operario-card {
    background: white; border-radius: 16px; border: 1px solid var(--color-border); padding: 1rem;
    display: flex; gap: 1rem; align-items: center; min-height: 80px;
}
.tablet-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.5rem; }
.tablet-buttons button {
    padding: 0.75rem 0.5rem; border-radius: 10px; border: 1px solid var(--color-border); background: white;
    font-weight: 700; cursor: pointer; min-height: 60px;
}
.tablet-buttons button.ok { color: #16a34a; border-color: #86efac; }
.tablet-buttons button.warn { color: #f59e0b; border-color: #fde68a; }
.tablet-buttons button.danger { color: #dc2626; border-color: #fecaca; }
.tablet-buttons button.muted { color: var(--color-muted); }

/* Pública */
.pub-wrap { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.pub-header { background: var(--color-primary); color: white; padding: 1.25rem; border-radius: 14px; margin-bottom: 1rem; }
.pub-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pub-tabs button {
    padding: 0.5rem 1rem; border-radius: 10px; border: 1px solid var(--color-border); background: white; cursor: pointer; font-weight: 600;
}
.pub-tabs button.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.pub-grid table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; }
.pub-grid th, .pub-grid td { padding: 0.5rem; border: 1px solid #f1f5f9; font-size: 0.9rem; text-align: center; }
.pub-grid td.user-name { text-align: left; font-weight: 600; }
@media (max-width: 640px) {
    .pub-grid th, .pub-grid td { font-size: 0.75rem; padding: 0.35rem; }
}

.btn-primary { background: var(--color-primary); color: white; border: none; padding: 0.5rem 1rem; border-radius: 10px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: white; color: var(--color-text); border: 1px solid var(--color-border); padding: 0.5rem 1rem; border-radius: 10px; font-weight: 600; cursor: pointer; }
.btn-secondary:hover { background: #f1f5f9; }
