/* RC-01.18 — Operational Calendar & Command Center */

.ts-command-center {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 1280px) {
    .ts-command-center {
        margin-bottom: 0.75rem;
    }
}

.ts-command-kicker {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #60a5fa;
}

.ts-next-event {
    padding: 1.15rem 1.2rem 1.2rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(34, 197, 94, 0.28);
    background:
        linear-gradient(180deg, rgba(34, 197, 94, 0.1), transparent 55%),
        rgba(2, 6, 23, 0.82);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ts-next-event:hover {
    border-color: rgba(34, 197, 94, 0.5);
}

.ts-next-event-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
}

.ts-next-event-date {
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
    color: #94a3b8;
}

.ts-next-event-countdown {
    margin: 0.65rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4ade80;
}

.ts-next-event-countdown--hoje {
    display: inline-flex;
    margin-top: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ts-cal-card {
    padding: 1.1rem 0.9rem 1.15rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(51, 65, 85, 0.9);
    background: rgba(2, 6, 23, 0.72);
}

@media (min-width: 768px) {
    .ts-cal-card {
        padding: 1.35rem 1.35rem 1.4rem;
    }
}

.ts-cal-root {
    min-width: 0;
}

.ts-cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.ts-cal-month-label {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: 650;
    color: #fff;
    letter-spacing: -0.01em;
}

.ts-cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(51, 65, 85, 0.95);
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    font-size: 1.35rem;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ts-cal-nav:hover {
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
}

.ts-cal {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.ts-cal-weekdays,
.ts-cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.2rem;
}

.ts-cal-week {
    margin-top: 0.2rem;
}

.ts-cal-weekday {
    padding: 0.15rem 0 0.38rem;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.ts-cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 4.05rem;
    padding: 0.24rem 0.2rem 0.26rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(30, 41, 59, 0.9);
    background: rgba(2, 6, 23, 0.45);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .ts-cal-day {
        min-height: 5.95rem;
        padding: 0.36rem 0.32rem 0.36rem;
        border-radius: 0.8rem;
    }
}

@media (min-width: 1280px) {
    .ts-cal-day {
        min-height: 6.85rem;
    }
}

.ts-cal-day.is-outside {
    opacity: 0.38;
    pointer-events: none;
}

.ts-cal-day.is-readonly {
    cursor: default;
}

.ts-cal-day.is-create::after {
    content: '+';
    margin-top: auto;
    padding-top: 0.15rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.ts-cal-day.is-create:hover,
.ts-cal-day.has-events:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(15, 23, 42, 0.7);
}

.ts-cal-day.is-today {
    border-color: rgba(59, 130, 246, 0.7);
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.16), transparent 70%),
        rgba(2, 6, 23, 0.7);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.ts-cal-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.15rem;
    min-height: 1.15rem;
}

.ts-cal-num {
    font-size: 0.72rem;
    font-weight: 650;
    color: #cbd5e1;
}

.ts-cal-day.is-today .ts-cal-num {
    color: #93c5fd;
}

.ts-cal-hoje {
    display: none;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (min-width: 640px) {
    .ts-cal-hoje {
        display: inline-flex;
    }
}

.ts-cal-events {
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
    min-width: 0;
}

.ts-cal-event {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.38rem 0.5rem;
    min-width: 0;
    padding: 0.14rem 0.22rem;
    border-radius: 0.4rem;
    text-decoration: none;
    color: inherit;
    background: rgba(15, 23, 42, 0.55);
}

.ts-cal-dot {
    flex-shrink: 0;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: #94a3b8;
}

.ts-cal-event--green .ts-cal-dot,
.ts-cal-event-card--green .ts-cal-dot { background: #22c55e; }
.ts-cal-event--yellow .ts-cal-dot,
.ts-cal-event-card--yellow .ts-cal-dot { background: #eab308; }
.ts-cal-event--blue .ts-cal-dot,
.ts-cal-event-card--blue .ts-cal-dot { background: #3b82f6; }
.ts-cal-event--purple .ts-cal-dot,
.ts-cal-event-card--purple .ts-cal-dot { background: #a78bfa; }
.ts-cal-event--gray .ts-cal-dot,
.ts-cal-event-card--gray .ts-cal-dot { background: #94a3b8; }
.ts-cal-event--red .ts-cal-dot,
.ts-cal-event-card--red .ts-cal-dot { background: #ef4444; }

.ts-cal-event-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.56rem;
    font-weight: 600;
    color: #e2e8f0;
}

.ts-cal-ready {
    flex-shrink: 0;
    margin-left: 0.1rem;
    font-size: 0.52rem;
    font-weight: 650;
    color: #cbd5e1;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

@media (max-width: 639px) {
    .ts-cal-ready {
        display: none;
    }
}

.ts-cal-more {
    margin-top: auto;
    padding: 0.15rem 0.1rem 0;
    border: 0;
    background: transparent;
    color: #93c5fd;
    font-size: 0.58rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ts-cal-more--ghost {
    color: #64748b;
    font-weight: 600;
}

@media (min-width: 1280px) {
    .ts-cal-more--ghost {
        display: none;
    }
}

.ts-cal-preview {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 0.35rem);
    z-index: 30;
    width: 16.5rem;
    max-width: min(16.5rem, 70vw);
    padding: 0.75rem 0.8rem 0.8rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(51, 65, 85, 0.95);
    background: rgba(2, 6, 23, 0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.ts-cal-preview-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.ts-cal-preview-row,
.ts-cal-preview-etapa {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.ts-cal-preview-etapa {
    color: #cbd5e1;
    font-weight: 600;
}

@media (hover: hover) and (min-width: 1280px) {
    .ts-cal-event:hover .ts-cal-preview,
    .ts-cal-event:focus-visible .ts-cal-preview {
        display: block;
        animation: ts-cal-preview-in 0.16s ease;
    }
}

@keyframes ts-cal-preview-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ts-cal-panel {
    margin-top: 0.9rem;
    padding: 0.9rem 0.95rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: rgba(15, 23, 42, 0.55);
    animation: ts-cal-preview-in 0.18s ease;
}

.ts-cal-panel-kicker {
    margin: 0 0 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #60a5fa;
}

.ts-cal-panel-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.65rem;
}

.ts-cal-event-card {
    display: block;
    padding: 0.8rem 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(51, 65, 85, 0.9);
    background: rgba(2, 6, 23, 0.7);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease;
}

.ts-cal-event-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.ts-cal-event-card-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ts-cal-event-card-name {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.ts-cal-event-card-meta,
.ts-cal-event-card-etapa {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.ts-cal-event-card-etapa {
    color: #e2e8f0;
    font-weight: 600;
}

.ts-prontidao-badge {
    font-size: 0.7rem;
    line-height: 1.2;
}

.ts-cal-root.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

@media (max-width: 639px) {
    .ts-command-center {
        margin-top: 1.5rem;
    }

    .ts-cal-day {
        min-height: 3.58rem;
        padding: 0.2rem 0.1rem 0.18rem;
    }

    .ts-cal-event-name {
        font-size: 0.5rem;
    }

    .ts-cal-weekday {
        font-size: 0.55rem;
        letter-spacing: 0.04em;
    }
}

/* RC-01.18.1 — Interactive dashboard KPI cards */
/* RC-01.18.2 — Hover must paint fully (no parent clip). */
.ts-kpi-grid {
    overflow: visible;
    content-visibility: visible;
    contain: none;
    padding: 0.45rem;
    margin: -0.45rem;
}

.ts-kpi-card {
    position: relative;
    z-index: 0;
    display: block;
    padding: 1rem 1.05rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(30, 41, 59, 1);
    background: rgba(2, 6, 23, 0.6);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

@media (min-width: 640px) {
    .ts-kpi-card {
        padding: 1.25rem;
    }
}

.ts-kpi-card:hover,
.ts-kpi-card:focus-visible {
    z-index: 2;
    transform: translateY(-2px);
    background: rgba(15, 23, 42, 0.72);
    outline: none;
}

.ts-kpi-card--electric:hover,
.ts-kpi-card--electric:focus-visible {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45), 0 0 22px rgba(59, 130, 246, 0.18);
}

.ts-kpi-card--neon:hover,
.ts-kpi-card--neon:focus-visible {
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45), 0 0 22px rgba(34, 197, 94, 0.16);
}

.ts-kpi-card--amber:hover,
.ts-kpi-card--amber:focus-visible {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45), 0 0 18px rgba(245, 158, 11, 0.14);
}

.ts-kpi-card--red:hover,
.ts-kpi-card--red:focus-visible {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45), 0 0 18px rgba(239, 68, 68, 0.14);
}

.ts-kpi-card--slate:hover,
.ts-kpi-card--slate:focus-visible {
    border-color: rgba(100, 116, 139, 0.55);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.4);
}
