/* ===== Calendari de Sales - Estils ===== */
.cs-wrap {
    font-family: inherit;
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8f7ff 0%, #ffffff 100%);
    box-shadow: 0 10px 35px rgba(40,30,103,.08);
}
.cs-wrap.cs-loading {
    opacity: .8;
}

.cs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.cs-top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, #281e67 0%, #4f46e5 100%);
    color: #fff;
}
.cs-main-title {
    font-size: 1.5rem;
    margin: 0;
    color: #fff;
}
.cs-header-subtitle {
    margin: 4px 0 0;
    color: rgba(255,255,255,.9);
}
.cs-reserva-btn {
    display: inline-block;
    background: #fff;
    color: #281e67;
    padding: 11px 22px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform .15s, box-shadow .15s;
}
.cs-reserva-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    color: #281e67;
}

.cs-sala-switcher {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0 18px;
}
.cs-sala-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f7ff 100%);
    border: 1px solid #e5e7eb;
    color: #281e67;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(40, 30, 103, 0.06);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cs-sala-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(40, 30, 103, 0.12);
    border-color: #4f46e5;
}
.cs-sala-card-active {
    background: linear-gradient(135deg, #281e67 0%, #4f46e5 100%);
    color: #fff;
    border-color: #4f46e5;
}
.cs-sala-card-title {
    font-weight: 700;
    font-size: 1rem;
}
.cs-sala-card-meta {
    font-size: .86rem;
    opacity: .9;
}

.cs-reservation-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    margin: 18px 0 24px;
    border-radius: 18px;
    background: #f8f6ff;
    border: 1px solid rgba(40,30,103,0.12);
}
.cs-reservation-text {
    font-size: .95rem;
    color: #1f1750;
    line-height: 1.5;
    margin: 0;
}
.cs-reservation-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 999px;
    background: #4f46e5;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: background .2s, transform .2s;
}
.cs-reservation-link:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.cs-calendar {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border-radius: 16px;
    overflow: hidden;
}
.cs-calendar th {
    padding: 8px;
    text-align: center;
    font-size: .8rem;
    color: #281e67;
    background: #f4f3fb;
    border: 1px solid #e5e5e5;
}
.cs-calendar td {
    vertical-align: top;
    border: 1px solid #e5e5e5;
    height: 104px;
    padding: 6px;
    font-size: .72rem;
    background: #fff;
}
.cs-empty { background: #fbfbfb; }
.cs-day-num { font-weight: 700; margin-bottom: 4px; color: #333; }
.cs-day-free .cs-day-num { color: #bbb; }
.cs-day-link { display: block; text-decoration: none; color: inherit; height: 100%; }
.cs-day-link:hover { background: #fffdf2; }

.cs-slot {
    display: block;
    padding: 3px 6px;
    margin-bottom: 3px;
    border-radius: 6px;
    color: #fff;
    font-size: .66rem;
    line-height: 1.25;
}
.cs-ocupada { background: #e74c3c; }
.cs-disponible { background: #27ae60; }
.cs-a_consultar { background: #f39c12; }

.cs-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}
.cs-nav-btn {
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 999px;
    text-decoration: none;
    color: #222;
    background: #fff;
    transition: background .15s, transform .15s;
    white-space: nowrap;
}
.cs-nav-btn:hover { background: #f4f3fb; transform: translateY(-1px); }
.cs-disabled { opacity: .4; pointer-events: none; }
.cs-month-label { font-weight: 700; font-size: 1.1rem; }

.cs-legend { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.cs-legend-item { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.cs-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }

.cs-room-info {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.cs-aforo, .cs-cat { margin: 4px 0; font-size: .92rem; }

@media (max-width: 840px) {
    .cs-reservation-panel { flex-direction: column; align-items: stretch; text-align: center; }
    .cs-reservation-link { width: 100%; }
}

@media (max-width: 640px) {
    .cs-wrap { padding: 14px; }
    .cs-calendar td { height: 76px; font-size: .64rem; padding: 6px; }
    .cs-slot { font-size: .58rem; padding: 4px 5px; }
    .cs-nav-btn { padding: 6px 10px; }
    .cs-month-label { font-size: .95rem; }
    .cs-sala-select-label { display: block; }
    .cs-sala-select-label select { width: 100%; max-width: none; margin-left: 0; }
    .cs-sala-selector { display: block; }
    .cs-selector-btn { margin-top: 10px; width: 100%; }
}

/* Badges i editor (admin) */
.cs-badge { display: inline-block; padding: 2px 9px; border-radius: 12px; color: #fff; font-size: .78rem; }

/* Admin específic */
.cs-day-editor { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; margin: 14px 0; }
.cs-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.cs-admin-monthnav { margin: 10px 0; display: flex; align-items: center; gap: 8px; }
.cs-admin-cal td { height: 72px; }
.cs-franja-table select, .cs-franja-table input { max-width: 150px; }
.cs-bulk-form { margin: 10px 0 16px; }
.cs-bulk-panel { background: #f8f7ff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.cs-bulk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cs-bulk-section { display: flex; flex-direction: column; gap: 8px; }
.cs-bulk-options { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-bulk-option { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e5e7eb; border-radius: 999px; padding: 6px 10px; }
.cs-bulk-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.cs-bulk-fields label { display: inline-flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.cs-bulk-fields input, .cs-bulk-fields select { min-width: 110px; }
.cs-bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cs-day-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.cs-bulk-day-select { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; color: #666; }
.cs-bulk-day-select input { margin: 0; }
