* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #e5e7eb; color: #1a1a1a; }

.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; background: #1f2937; }
.login-box { background: white; padding: 40px; border-radius: 12px; width: 320px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-box h1 { margin: 0 0 4px; font-size: 22px; }
.login-box .subtitle { margin: 0 0 24px; color: #6b7280; font-size: 14px; }
.login-box label { display: block; font-size: 13px; margin-bottom: 4px; color: #374151; }
.login-box input { width: 100%; padding: 10px; margin-bottom: 16px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.login-box button { width: 100%; padding: 10px; background: #1f2937; color: white; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; }
.login-box button:hover { background: #111827; }
.alert-error { background: #fef2f2; color: #b91c1c; padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #1f2937; color: white; padding: 24px; flex-shrink: 0; }
.sidebar h2 { font-size: 18px; margin: 0 0 4px; }
.rol-tag { font-size: 12px; color: #9ca3af; margin: 0 0 24px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 4px; }
.sidebar a { color: #e5e7eb; text-decoration: none; display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.sidebar a:hover { background: #374151; }

.content { flex: 1; padding: 32px; }
.content h1 { margin-top: 0; font-size: 24px; }

.cards { display: flex; gap: 16px; margin: 24px 0; }
.card { background: white; padding: 20px 24px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); min-width: 200px; }
.card-number { font-size: 32px; font-weight: 700; display: block; }
.card-label { font-size: 13px; color: #6b7280; }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
th { background: #f9fafb; font-weight: 600; color: #374151; }

.badge { padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-parcial { background: #dbeafe; color: #1e40af; }
.badge-confirmada { background: #d1fae5; color: #065f46; }
.badge-cancelada { background: #fee2e2; color: #991b1b; }

button, .btn { padding: 8px 14px; border-radius: 6px; border: none; background: #1f2937; color: white; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #111827; }

form.inline { display: inline; }
input, select, textarea { font-family: inherit; }

form:not(.inline) label { display: block; font-size: 13px; margin: 10px 0 6px; color: #374151; }
form:not(.inline) input, form:not(.inline) select { width: 100%; max-width: 400px; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.icon-btn {
    background: #1f2937; color: white; border: none; border-radius: 6px;
    padding: 8px 12px; font-size: 16px; cursor: pointer; line-height: 1;
}
.icon-btn:hover { background: #111827; }
.icon-btn-danger { background: #991b1b; }
.icon-btn-danger:hover { background: #7f1d1d; }
.acciones-row { display: flex; gap: 6px; }

.reservas-cards { display: none; }
.desktop-table { display: block; }

.reserva-card {
    background: white; border-radius: 10px; padding: 16px; margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.reserva-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.reserva-card-row { margin-bottom: 6px; font-size: 14px; }
.reserva-card-actions { display: flex; gap: 8px; margin-top: 12px; }

dialog#modalPagos, dialog#modalEditar, dialog#modalNueva {
    border: none; border-radius: 12px; padding: 24px; width: 90vw; max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-height: 85vh; overflow-y: auto;
}
dialog#modalPagos::backdrop, dialog#modalEditar::backdrop, dialog#modalNueva::backdrop { background: rgba(0,0,0,0.5); }
dialog#modalPagos h3, dialog#modalEditar h3, dialog#modalNueva h3 { margin-top: 0; font-size: 16px; }
dialog#modalPagos label, dialog#modalEditar label, dialog#modalNueva label { display: block; font-size: 13px; margin: 10px 0 6px; color: #374151; }
dialog#modalPagos input, dialog#modalEditar input, dialog#modalEditar select, dialog#modalNueva input, dialog#modalNueva select {
    width: 100%; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}

dialog#modalVerComprobante {
    border: none; border-radius: 12px; padding: 16px; width: 92vw; max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-height: 90vh;
}
dialog#modalVerComprobante::backdrop { background: rgba(0,0,0,0.6); }
dialog#modalVerComprobante img { width: 100%; max-height: 75vh; object-fit: contain; display: block; border-radius: 6px; }
dialog#modalVerComprobante iframe { width: 100%; height: 70vh; border: none; border-radius: 6px; }

.link-btn {
    background: none; border: none; color: #2563eb; text-decoration: underline;
    padding: 0; font-size: 14px; cursor: pointer;
}
.link-btn:hover { background: none; color: #1e40af; }

.pago-fila {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 10px; border-radius: 6px; margin-bottom: 6px;
}
.pago-pendiente-whatsapp { background: #fef9c3; }
.pago-pendiente-pms { background: #dcfce7; }
.pago-validado { background: #d9f99d; }

.menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 18px;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
    .app-shell { flex-direction: column; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1000;
    }
    .sidebar.open { transform: translateX(0); }

    .menu-toggle { display: block; }

    .content { padding: 70px 16px 24px; }

    .cards { flex-direction: column; }
    .card { min-width: 0; }

    .desktop-table { display: none; }
    .reservas-cards { display: block; }
}

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 700px; }
.calendar-head { text-align:center; font-weight:600; font-size:12px; color:#6b7280; padding: 4px; }
.calendar-day { background: white; border-radius:6px; padding:8px 4px; text-align:center; cursor:pointer; box-shadow:0 1px 2px rgba(0,0,0,0.06); }
.calendar-day:hover { background:#f3f4f6; }
.calendar-day-num { font-size:12px; color:#6b7280; }
.calendar-day-price { font-size:14px; font-weight:600; margin-top:2px; }
.calendar-day-override { background:#fef3c7; }

dialog#modalPrecioDia { border:none; border-radius:12px; padding:24px; width:90vw; max-width:320px; box-shadow:0 20px 60px rgba(0,0,0,0.3); }
dialog#modalPrecioDia::backdrop { background: rgba(0,0,0,0.5); }
dialog#modalPrecioDia label { display:block; font-size:13px; margin:10px 0 6px; color:#374151; }
dialog#modalPrecioDia input { width:100%; padding:8px; border:1px solid #d1d5db; border-radius:6px; font-size:14px; }

.calendar-day-selected { outline: 3px solid #2563eb; }

.selection-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #1f2937; color: white;
    padding: 14px 20px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15); z-index: 998;
}

dialog#modalPrecioMultiple {
    border:none; border-radius:12px; padding:24px; width:90vw; max-width:320px;
    box-shadow:0 20px 60px rgba(0,0,0,0.3);
}
dialog#modalPrecioMultiple::backdrop { background: rgba(0,0,0,0.5); }
dialog#modalPrecioMultiple label { display:block; font-size:13px; margin:10px 0 6px; color:#374151; }
dialog#modalPrecioMultiple input { width:100%; padding:8px; border:1px solid #d1d5db; border-radius:6px; font-size:14px; }

.calendarito { display:inline-block; width:90px; border:1px solid #d1d5db; border-radius:8px; overflow:hidden; text-align:center; box-shadow:0 2px 6px rgba(0,0,0,0.12); }
.calendarito-mes { background:#ef4444; color:white; font-weight:700; font-size:12px; padding:4px 0; letter-spacing:1px; }
.calendarito-dia { font-size:32px; font-weight:800; padding:8px 0 2px; line-height:1; }
.calendarito-semana { font-size:11px; color:#ef4444; font-weight:600; padding-bottom:6px; text-transform:capitalize; }

.th-ordenable { cursor:pointer; user-select:none; }
.th-ordenable:hover { background:#e5e7eb; }

.card-link { text-decoration:none; color:inherit; display:flex; flex-direction:column; transition:transform 0.1s, box-shadow 0.1s; cursor:pointer; }
.card-link:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.12); }

.badge-por_llegar { background: #dbeafe; color: #1e40af; }
.badge-alojada { background: #d1fae5; color: #065f46; }
.badge-finalizada { background: #e5e7eb; color: #374151; }

/* Íconos de acciones más compactos */
.icon-btn {
    padding: 3px 6px !important;
    font-size: 13px !important;
    min-width: unset !important;
    line-height: 1.3 !important;
}

/* Íconos de orden en encabezados de tabla */
.sort-icon {
    display: inline-block;
    margin-left: 4px;
    color: #16a34a;
    font-size: 11px;
}

/* Mini tarjeta de calendario compacta para fechas en la tabla */
.calendarito-mini {
    display: inline-block;
    width: 46px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    overflow: hidden;
    text-align: center;
    font-size: 10px;
}
.calendarito-mini-mes {
    background: #ef4444;
    color: white;
    font-weight: 700;
    padding: 1px 0;
    letter-spacing: 0.5px;
}
.calendarito-mini-dia {
    font-size: 16px;
    font-weight: 800;
    padding: 1px 0;
    line-height: 1;
}

/* Íconos de acciones aún más compactos, todos del mismo tamaño */
.icon-btn {
    padding: 2px 5px !important;
    font-size: 12px !important;
    min-width: 22px !important;
    line-height: 1.2 !important;
}
.acciones-row {
    gap: 2px !important;
}

/* Íconos de ancho uniforme, sin importar el emoji que lleven dentro */
.icon-btn {
    padding: 0 !important;
    font-size: 12px !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Día de la semana en el mini-calendario */
.calendarito-mini-semana {
    font-size: 8px;
    color: #ef4444;
    font-weight: 700;
    padding-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
