:root {
    --red: #b51f29;
    --red-dark: #8f1720;
    --ink: #202733;
    --muted: #697386;
    --bg: #eef1f5;
    --card: #ffffff;
    --line: #dfe5ee;
    --soft: #f8fafc;
    --green: #2e9d63;
    --orange: #f59e0b;
    --blue: #2878c7;
    --shadow: 0 10px 26px rgba(32, 39, 51, 0.10);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

.xc-app {
    height: 100vh;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.xc-topbar {
    flex: 0 0 74px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 12px 22px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    box-shadow: var(--shadow);
}

.xc-topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1;
}

.xc-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .8;
}

.xc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.xc-actions a,
.xc-actions button {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.xc-actions a {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.xc-actions button {
    background: #fff;
    color: var(--red-dark);
}

.xc-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 12px;
    margin-top: 10px;
    overflow: hidden;
}

.xc-left,
.xc-right {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.xc-left {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
}

.xc-card,
.xc-summary,
.xc-grid-wrap,
.xc-detail {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.xc-card {
    padding: 12px;
    min-width: 0;
    overflow: hidden;
}

.xc-card + .xc-card {
    margin-top: 0;
}

.xc-card-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.xc-card-title h2 {
    margin: 0;
    font-size: 18px;
}

.xc-card-title span {
    color: var(--muted);
    font-size: 12px;
}

.xc-weekdays,
.xc-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.xc-weekdays {
    margin-bottom: 6px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.xc-day {
    min-width: 0;
    min-height: 52px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.xc-day strong {
    font-size: 15px;
    line-height: 1;
}

.xc-day small,
.xc-day span {
    font-size: 10px;
    line-height: 1.15;
}

.xc-day.empty { background: #edf8f1; }
.xc-day.partial { background: #fff7df; }
.xc-day.full { background: #ffe6e8; }
.xc-day.disabled { background: #e8ebef; color: #6b7280; }
.xc-day.muted { opacity: .35; }

.xc-day.selected {
    outline: 2px solid rgba(181, 31, 41, .28);
    border-color: var(--red);
}

.xc-day.today strong {
    color: var(--red);
}

.xc-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

.xc-legend i {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
}

.xc-legend .empty { background: #9bd7ad; }
.xc-legend .partial { background: #f7c948; }
.xc-legend .full { background: #ef7b85; }
.xc-legend .disabled { background: #aab2bd; }

.xc-suggestion {
    padding: 10px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 14px;
    background: var(--soft);
    margin-top: 8px;
}

.xc-suggestion.ok { border-left-color: var(--green); }
.xc-suggestion.info { border-left-color: var(--blue); }
.xc-suggestion.warn { border-left-color: var(--orange); }

.xc-suggestion strong {
    font-size: 13px;
}

.xc-suggestion p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.xc-right {
    display: flex;
    flex-direction: column;
}

.xc-summary {
    flex: 0 0 76px;
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.xc-summary div {
    padding: 8px 10px;
    border-radius: 14px;
    background: var(--soft);
    border: 1px solid var(--line);
    min-width: 0;
}

.xc-summary span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 3px;
}

.xc-summary strong {
    font-size: 18px;
}

.xc-summary .danger strong {
    color: var(--red);
}

.xc-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.xc-resource-row,
.xc-grid {
    display: grid;
    grid-template-columns: 64px repeat(6, minmax(155px, 1fr));
    min-width: 0;
}

.xc-time-head,
.xc-resource,
.xc-time,
.xc-slot {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.xc-time-head,
.xc-resource {
    background: #fff;
}

.xc-time-head,
.xc-time {
    padding: 8px;
    font-weight: 800;
    color: var(--muted);
    background: #fff;
}

.xc-time-head {
    height: 62px;
    display: flex;
    align-items: center;
}

.xc-resource {
    height: 62px;
    padding: 9px 10px;
    overflow: hidden;
}

.xc-resource strong,
.xc-resource span,
.xc-resource em {
    display: block;
}

.xc-resource strong {
    font-size: 14px;
    line-height: 1.1;
}

.xc-resource span,
.xc-resource em {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.xc-resource.unavailable,
.xc-slot.unavailable {
    background: repeating-linear-gradient(-45deg, #f1f3f5, #f1f3f5 8px, #e4e7eb 8px, #e4e7eb 16px);
}

.xc-time {
    height: 52px;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.xc-slot {
    height: 52px;
    padding: 4px;
    background: #fff;
    overflow: visible;
}

.xc-reservation {
    min-height: 44px;
    border-radius: 11px;
    padding: 7px 8px;
    color: #fff;
    box-shadow: 0 6px 14px rgba(32, 39, 51, .16);
    cursor: pointer;
    overflow: hidden;
}

.xc-reservation b,
.xc-reservation strong,
.xc-reservation span,
.xc-reservation small {
    display: block;
}

.xc-reservation b {
    font-size: 10px;
    margin-bottom: 3px;
    opacity: .9;
}

.xc-reservation strong {
    font-size: 12px;
    line-height: 1.1;
}

.xc-reservation span {
    margin-top: 3px;
    font-size: 10px;
}

.xc-reservation small {
    margin-top: 3px;
    font-size: 10px;
    opacity: .88;
}

.xc-reservation.inamovible { background: linear-gradient(135deg, #c62632, #8f1720); }
.xc-reservation.movible { background: linear-gradient(135deg, #2e9d63, #1f7147); }
.xc-reservation.no_confirmada { background: linear-gradient(135deg, #f59e0b, #b76b00); }
.xc-reservation.intern { background: linear-gradient(135deg, #2878c7, #15508d); }

.xc-reservation.active {
    outline: 3px solid rgba(181, 31, 41, .22);
}

.xc-detail {
    flex: 0 0 74px;
    margin-top: 10px;
    padding: 12px;
    overflow: hidden;
}

.xc-detail h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.xc-detail p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.xc-detail-grid {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 90px minmax(0, 1fr);
    gap: 5px 10px;
    font-size: 12px;
}

.xc-detail-grid span {
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 1300px) {
    .xc-layout {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .xc-resource-row,
    .xc-grid {
        grid-template-columns: 60px repeat(6, minmax(135px, 1fr));
    }
}