.routine-shell {
    --routine-ink: var(--capsule-color-text, #172033);
    --routine-muted: var(--capsule-color-muted, #748096);
    --routine-border: var(--capsule-color-border, #e2e7ef);
    --routine-primary: var(--capsule-color-primary, #5046e5);
    --project-muted: var(--routine-muted);
    color: var(--routine-ink);
    padding-bottom: 2rem;
}

.routine-nav {
    align-items: center;
    background: #fff;
    border: 1px solid var(--routine-border);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: 1.5rem;
    padding: .4rem;
}
.routine-nav a { border-radius: 8px; color: #657187; font-size: .84rem; font-weight: 750; padding: .55rem .8rem; text-decoration: none; }
.routine-nav a:hover { background: #f4f3ff; color: var(--routine-primary); }
.routine-nav a.is-active { background: #eeecff; color: var(--routine-primary); }

.routine-panel,
.routine-filter-card,
.routine-form-card,
.routine-table-card {
    background: #fff;
    border: 1px solid var(--routine-border);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(23, 32, 51, .05);
}
.routine-panel, .routine-form-card { padding: 1.25rem; }
.routine-filter-card { margin-bottom: 1.5rem; padding: 1rem; }
.routine-form-page { margin: 0 auto; max-width: 1100px; }
.routine-form-actions { align-items: center; border-top: 1px solid var(--routine-border); display: flex; gap: .65rem; justify-content: flex-end; margin-top: 1.5rem; padding-top: 1rem; }
.routine-card-heading { color: var(--routine-ink); font-size: .9rem; font-weight: 800; letter-spacing: .025em; margin: 0; text-transform: uppercase; }

.routine-task-list { display: grid; gap: .65rem; }
.routine-task-row { align-items: center; background: #fff; border: 1px solid #edf0f4; border-radius: 10px; color: inherit; display: flex; gap: 1rem; justify-content: space-between; padding: .85rem; text-decoration: none; }
.routine-task-row:hover { border-color: #c9c5ff; box-shadow: 0 3px 10px rgba(80,70,229,.07); }
.routine-task-row small { color: var(--routine-muted); display: block; margin-top: .25rem; }
.routine-task-card { background: #fff; border: 1px solid var(--routine-border); border-left: 3px solid var(--routine-primary); border-radius: 9px; color: inherit; display: block; margin-bottom: .45rem; padding: .65rem; text-decoration: none; }
.routine-task-card.priority-urgent { border-left-color: #ef4444; }
.routine-task-card.priority-high { border-left-color: #f97316; }
.routine-task-card small { color: var(--routine-muted); display: block; margin-top: .25rem; }

.routine-week { display: grid; gap: .8rem; grid-template-columns: repeat(7, minmax(190px, 1fr)); overflow-x: auto; padding-bottom: .5rem; }
.routine-day-column { background: #f6f7fb; border: 1px solid #edf0f4; border-radius: 12px; min-height: 280px; overflow: hidden; }
.routine-day-column > header { align-items: center; background: #fff; border-bottom: 1px solid #edf0f4; display: flex; justify-content: space-between; padding: .75rem; }
.routine-day-column > div { padding: .65rem; }
.routine-calendar { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; }
.routine-calendar-day { background: #fff; border: 1px solid #edf0f4; min-height: 120px; padding: .65rem; }
.routine-calendar-day > header { align-items: center; display: flex; justify-content: space-between; margin-bottom: .55rem; }

.routine-table-card { overflow: hidden; }
.routine-table-card table { margin: 0; min-width: 720px; }
.routine-table-card th { background: #f8f9fc; color: var(--routine-muted); font-size: .74rem; letter-spacing: .02em; text-transform: uppercase; }
.routine-table-card td, .routine-table-card th { border-color: #edf0f4; padding: .9rem 1rem; }
.routine-action-box { border: 1px solid var(--routine-border); border-radius: 10px; padding: .8rem; }

@media (max-width: 1100px) {
    .routine-shell .data-kpis, .routine-shell .data-kpis-5, .routine-shell .data-kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .routine-week { grid-template-columns: repeat(7, 260px); }
}
@media (max-width: 700px) {
    .routine-shell .data-kpis, .routine-shell .data-kpis-5, .routine-shell .data-kpis-6 { grid-template-columns: 1fr; }
    .routine-nav { flex-wrap: nowrap; overflow-x: auto; }
    .routine-task-row { align-items: flex-start; flex-direction: column; }
}
