﻿:root {
    --color-primary: #16b0b6;
    --color-primary-dark: #0f8d92;
    --color-primary-light: #e8f8f8;
    --color-text-dark: #102126;
    --color-text-muted: #5d7278;
    --color-border-soft: #dce7ea;
    --color-bg: #f5fafb;
    --color-white: #ffffff;
    --color-gray-50: #f8fbfc;
    --color-gray-100: #f1f6f7;
    --color-gray-200: #e2ecef;
    --color-gray-300: #cbdade;
    --color-gray-400: #92a9b0;
    --color-gray-500: #5d7278;
    --color-gray-600: #495f65;
    --color-gray-700: #2f474e;
    --color-gray-800: #1c3137;
    --color-gray-900: #102126;
    --color-success: #2cae86;
    --color-warning: #f0b24a;
    --color-night: #6a74d8;
    --color-danger: #d4606b;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 20px;
    --shadow-soft: 0 8px 24px rgba(16, 33, 38, 0.06);
    --shadow-subtle: 0 1px 2px rgba(16, 33, 38, 0.08);
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.875rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.75rem;
    --spacing-2xl: 2.25rem;
    --spacing-3xl: 3rem;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.375rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2rem;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-text-dark);
    background: linear-gradient(180deg, #f8ffff 0%, var(--color-bg) 42%, #f3f8fa 100%);
    line-height: 1.5;
}

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { color: var(--color-primary); }

.app-shell { display: block; }
.app-container { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border-soft);
}
.header-content {
    width: min(100%, 1280px);
    margin: 0 auto;
    padding: 0.62rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--color-primary-dark); }
.brand-name { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); letter-spacing: 0.1px; }

.app-main {
    flex: 1;
    width: min(100%, 1280px);
    margin: 0 auto;
    padding: 0.75rem;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.container, .section { display: flex; flex-direction: column; gap: var(--spacing-lg); }
.page-section { margin-bottom: 0.55rem; }

h1 { font-size: clamp(1.5rem, 2vw, 2rem); line-height: 1.2; }
h2 { font-size: clamp(1.1rem, 1.6vw, 1.45rem); line-height: 1.25; }
h3 { font-size: 1.03rem; }
p, small { color: var(--color-text-muted); }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.card {
    background: var(--color-white);
    border: 1px solid var(--color-border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-subtle);
    padding: 0.82rem;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: 0.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #edf3f5;
}
.card-body { display: flex; flex-direction: column; gap: var(--spacing-md); }
.card-title { font-weight: var(--font-weight-semibold); }

.form-group { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-bottom: var(--spacing-md); }
.form-label { font-size: var(--font-size-sm); color: var(--color-text-muted); font-weight: var(--font-weight-medium); }
input,
select,
textarea,
button,
.form-control,
.form-input,
.form-select,
.input,
.select,
input[type="text"],
input[type="date"],
input[type="time"],
input[type="color"] {
    font-size: 16px;
}
input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    padding: 0.62rem 0.72rem;
    background: #fff;
    color: var(--color-text-dark);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #7dd9dc;
    box-shadow: 0 0 0 3px rgba(22, 176, 182, 0.12);
}
input[type="date"],
input[type="time"] {
    min-height: 48px;
    height: 48px;
    line-height: 48px;
    padding: 0 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 16px;
}
select {
    min-height: 48px;
    height: 48px;
    line-height: normal;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}
input[type="color"] {
    min-height: 48px;
    height: 48px;
    padding: 6px 12px;
    border-radius: 16px;
}
.form-hint { font-size: var(--font-size-xs); color: var(--color-text-muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: var(--radius-md);
    padding: 0.62rem 0.95rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    border: 1px solid transparent;
    transition: 0.18s ease;
}
.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 6px 14px rgba(22, 176, 182, 0.24);
}
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.btn-secondary {
    background: var(--color-primary-light);
    border-color: #c9eeef;
    color: var(--color-primary-dark);
}
.btn-secondary:hover { background: #dcf4f4; }
.btn-outline { background: #fff; border-color: var(--color-border-soft); color: var(--color-text-dark); }
.btn-small { padding: 0.48rem 0.75rem; font-size: 0.8rem; }
.btn-large { padding: 0.82rem 1.08rem; }
.btn-full { width: 100%; }
.btn.is-loading {
    opacity: 0.75;
    cursor: wait;
}

.flash-stack {
    display: grid;
    gap: 0.4rem;
}
.flash-item {
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    font-size: 0.84rem;
    border: 1px solid transparent;
}
.flash-success {
    background: #edf9f3;
    color: #1f7e5f;
    border-color: #cbeede;
}
.flash-error {
    background: #fff1f2;
    color: #9f1239;
    border-color: #ffd6dd;
}
.flash-info {
    background: #eef6ff;
    color: #1e4f8a;
    border-color: #d3e6ff;
}
.skeleton {
    position: relative;
    overflow: hidden;
    background: #edf3f6;
    border-radius: 10px;
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
    animation: skeletonMove 1.1s infinite;
}
@keyframes skeletonMove {
    to { transform: translateX(100%); }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}
.badge-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-success { background: #e8f7f1; color: #21785e; }
.badge-warning { background: #fff3df; color: #9a640f; }
.badge-night { background: #eaecff; color: #4f58ac; }
.badge-gray { background: #f0f5f6; color: var(--color-text-muted); }
.badge-premium {
    background: linear-gradient(135deg, #ffe5a8 0%, #f6c26b 100%);
    color: #5d3d00;
    border: 1px solid rgba(93, 61, 0, 0.18);
}
.premium-link-inline {
    font-size: var(--font-size-sm);
    color: #a66500;
    font-weight: var(--font-weight-semibold);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid var(--color-border-soft);
    padding: 0.4rem 0.72rem;
    background: #fff;
    color: var(--color-text-muted);
    cursor: pointer;
}
.chip.active {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border-color: #b8e7e8;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--color-border-soft);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-content {
    height: 60px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: min(100%, 1280px);
    margin: 0 auto;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    color: var(--color-text-muted);
    font-size: 0.68rem;
}
.nav-item.active { color: var(--color-primary-dark); font-weight: var(--font-weight-semibold); }
.nav-item.active .nav-label { color: var(--color-primary-dark); }
.nav-icon { display: flex; align-items: center; justify-content: center; }

.desktop-nav { display: none; }

.welcome-hero {
    background: linear-gradient(145deg, var(--color-primary) 0%, #20c3ca 100%);
    color: #fff;
    border-radius: 14px;
    padding: 0.85rem;
    box-shadow: var(--shadow-soft);
}
.welcome-hero h1, .welcome-hero p { color: #fff; margin-bottom: 0.35rem; }
.routine-home { gap: var(--spacing-md); }
.clean-page {
    gap: 0.8rem;
}
.home-hero-premium {
    background: linear-gradient(145deg, #0f8d92 0%, #18adb2 55%, #57cdbd 100%);
    color: #fff;
    border-radius: 18px;
    padding: 0.95rem;
    box-shadow: 0 10px 24px rgba(15, 141, 146, 0.22);
    display: grid;
    gap: 0.42rem;
}
.home-hero-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.home-hero-date {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.86);
}
.home-hero-title {
    margin: 0;
    font-size: clamp(1.3rem, 5.3vw, 1.7rem);
    line-height: 1.15;
    color: #fff;
}
.home-hero-shift {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
}
.home-hero-time {
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.9rem;
}
.home-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.26rem 0.62rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
}
.home-hero-meta {
    margin-top: 0.35rem;
    display: grid;
    gap: 0.45rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-hero-meta-item {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    display: grid;
    gap: 0.12rem;
}
.home-hero-meta-item span,
.home-hero-meta-item small {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.72rem;
}
.home-hero-meta-item strong {
    color: #fff;
    font-size: 0.95rem;
}
.home-timeline-card {
    padding-top: 0.78rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.home-timeline-list {
    gap: 0.62rem;
    position: relative;
}
.home-timeline-list::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 2px;
    bottom: 2px;
    width: 1px;
    background: #e5eef2;
}
.home-timeline-item small {
    color: #1f7e5f;
    font-weight: 600;
    font-size: 0.74rem;
}
.home-timeline-item {
    position: relative;
}
.home-monthly-insight {
    padding: 0.68rem 0.74rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fcfd 100%);
}
.home-monthly-insight p {
    font-size: 0.86rem;
    color: #35525a;
}
.home-smart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}
.home-smart-card {
    display: grid;
    gap: 0.28rem;
}
.home-smart-card h3 {
    font-size: 0.97rem;
    color: var(--color-text-dark);
}
.home-smart-card p {
    margin: 0;
    color: var(--color-text-dark);
}
.home-smart-card small {
    color: var(--color-text-muted);
}
.smart-alert.good {
    border-color: #bfe9dd;
    background: #f2fbf8;
}
.smart-alert.warn {
    border-color: #ffe0b2;
    background: #fff8ee;
}
.smart-alert.neutral {
    border-color: var(--color-border-soft);
    background: #fff;
}
.clean-actions .action-card {
    min-height: 62px;
    border-radius: 12px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.clean-actions .action-card:hover {
    transform: translateY(-1px);
    border-color: #cce6ea;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.clean-actions .action-card:active {
    transform: scale(0.985);
}
.clean-hero {
    display: grid;
    gap: 0.35rem;
    padding: 0.3rem 0.1rem;
}
.clean-greeting {
    font-size: 0.88rem;
    color: #ffffff;
}
.clean-title {
    margin: 0;
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    line-height: 1.15;
}
.clean-subtitle {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.92rem;
}
.clean-tags {
    margin-top: 0.3rem;
}
.routine-hero {
    background: linear-gradient(135deg, #0f8d92 0%, #1cb6be 58%, #52cfb9 100%);
    border-radius: 18px;
    padding: 1rem;
    color: #fff;
    box-shadow: var(--shadow-soft);
}
.routine-kicker {
    color: rgba(255, 255, 255, 0.88);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.routine-subtitle { color: rgba(255, 255, 255, 0.92); }
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}
.hero-tags .chip {
    color: #0f8d92;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.96);
}
.routine-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
.routine-card {
    background: #fff;
    border: 1px solid var(--color-border-soft);
    border-radius: 14px;
    padding: 0.85rem;
}
.clean-main-card {
    padding: 0.95rem;
    box-shadow: var(--shadow-subtle);
}
.clean-compact-card {
    padding: 0.72rem;
    box-shadow: none;
}
.clean-head {
    margin-bottom: 0.3rem;
}
.routine-card-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 0.45rem;
}
.routine-big {
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-dark);
}
.routine-muted {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: 0.5rem;
}
.highlight-rest {
    border-color: #b9e9d5;
    background: linear-gradient(180deg, #ffffff 0%, #f4fcf8 100%);
}
.family-spotlight {
    background: linear-gradient(150deg, #f6fcff 0%, #eaf8ff 100%);
    border: 1px solid #cde7f8;
    border-radius: 16px;
    padding: 0.95rem;
    display: grid;
    gap: 0.5rem;
}
.family-spotlight-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.action-card-strong {
    border-color: #bfe8ea;
    background: linear-gradient(180deg, #ffffff 0%, #f6fcfc 100%);
}
.action-card-family {
    border-color: #cde7f8;
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}
.family-page .family-hero {
    background: linear-gradient(135deg, #f4fcff 0%, #e8f6ff 100%);
    border-color: #cae3f3;
}
.family-empty .card-body {
    align-items: flex-start;
}
.family-actions {
    display: grid;
    gap: var(--spacing-sm);
    width: 100%;
}
.family-compare-form {
    display: grid;
    gap: var(--spacing-sm);
}
.family-default-row {
    margin-top: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.highlight-common {
    border-color: #9fdcc7;
    background: linear-gradient(180deg, #ffffff 0%, #edf9f3 100%);
}
.family-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.family-day-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #2cae86;
}
.family-day-item.weekend {
    border-left-color: #f0b24a;
    background: #fffaf1;
}
.family-microcopy {
    border-color: #d9e9f4;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.premium-page { gap: var(--spacing-md); }
.premium-hero {
    border-color: #f2d6a2;
    background: linear-gradient(145deg, #fffdf8 0%, #fff4df 100%);
}
.premium-price-block {
    display: grid;
    gap: 3px;
}
.premium-price {
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: var(--font-weight-bold);
    color: #8a4f00;
}
.premium-cta-row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: wrap;
}
.premium-plans {
    display: grid;
    gap: var(--spacing-sm);
}
.premium-plan.free {
    border-color: #dfeaec;
}
.premium-plan.pro {
    border-color: #f2d6a2;
    background: linear-gradient(180deg, #ffffff 0%, #fffaef 100%);
}
.premium-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 6px;
    color: var(--color-text-dark);
}
.premium-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.premium-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.42rem 0.62rem;
    border-radius: 999px;
    border: 1px solid #dae8ef;
    background: #f9fdff;
    font-size: var(--font-size-xs);
    color: var(--color-text-dark);
}
.premium-emotional {
    border-color: #d7e7f5;
    background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
}
.premium-reason-card {
    border-color: #f3d9ab;
    background: #fff8ea;
}
.premium-lock-card {
    border-color: #f3d9ab;
    background: linear-gradient(180deg, #ffffff 0%, #fff8ec 100%);
}
.premium-lock-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.dev-plan-page {
    align-items: center;
}
.dev-plan-card {
    width: min(100%, 520px);
}
.dev-plan-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}
.clean-stats-grid {
    gap: 0.45rem;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    padding: 0.58rem 0.62rem;
    box-shadow: none;
}
.stat-value { font-size: 1.2rem; font-weight: var(--font-weight-bold); color: var(--color-text-dark); line-height: 1.1; }
.stat-label { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: 0.2rem; }

.grid, .grid-2, .grid-3, .grid-4 { display: grid; gap: var(--spacing-md); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr; }

.action-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border: 1px solid var(--color-border-soft);
    background: #fff;
    border-radius: 12px;
    padding: 0.68rem;
    color: var(--color-text-dark);
    box-shadow: none;
}
.clean-actions .action-card-description {
    font-size: 0.78rem;
}
.clean-summary-card .card-header {
    margin-bottom: 0.35rem;
}
.family-page-clean .clean-form-area {
    gap: 0.72rem;
}
.family-filter-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.family-filter-row .chip {
    font-size: 0.8rem;
    padding: 0.34rem 0.62rem;
}
.compare-chip-row {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}
.compare-chip-removable {
    white-space: nowrap;
}
.period-form {
    width: 100%;
}
.period-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.45rem;
}
.period-selector {
    gap: 0.42rem;
}
.period-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.period-selector-row strong {
    font-size: 0.96rem;
    color: var(--color-text-dark);
}
.family-day-content {
    display: grid;
    gap: 0.14rem;
}
.family-shift-line {
    display: block;
    line-height: 1.35;
}
.family-state-line {
    margin-top: 0.28rem;
    padding-top: 0.28rem;
    border-top: 1px dashed #edf2f5;
    display: grid;
    gap: 0.1rem;
}
.family-date-strong {
    font-size: 0.98rem;
}
.family-relation-badge {
    align-self: center;
    white-space: nowrap;
}
.status-common-off {
    border-color: #bfe9dd;
    background: #e7f8ef;
    color: #1f7e5f;
}
.status-conflict {
    border-color: #ffd4b2;
    background: #fff2e8;
    color: #a24a1a;
}
.status-simultaneous {
    border-color: #cfe3ff;
    background: #e8f1ff;
    color: #2c5da8;
}
.status-same-shift {
    border-color: #dfd4ff;
    background: #f1ecff;
    color: #5f4ab7;
}
.family-relation-badge.status-common-off,
.family-relation-badge.status-conflict,
.family-relation-badge.status-simultaneous,
.family-relation-badge.status-same-shift {
    border: 1px solid transparent;
}
.family-filter-row .chip.status-common-off.active,
.family-filter-row .chip.status-conflict.active,
.family-filter-row .chip.status-simultaneous.active,
.family-filter-row .chip.status-same-shift.active {
    font-weight: 700;
}
.compact-hero {
    padding-bottom: 0;
}
.insights-clean .routine-kicker {
    color: var(--color-text-muted);
}
.insights-period-chips {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
}
.insights-period-chips::-webkit-scrollbar { display: none; }
.insights-human-grid .card {
    display: grid;
    gap: 0.15rem;
}
.insights-summary-card {
    background: linear-gradient(145deg, #f6fcff 0%, #eef8fb 100%);
    border-color: #dcecf3;
}
.insights-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem;
}
.insights-summary-text {
    margin-top: 0.2rem;
    font-size: 0.97rem;
    line-height: 1.45;
    color: #15333c;
}
.insights-inline-meta {
    margin-top: 0.32rem;
    font-size: 0.82rem;
    color: #4a646c;
}
.insights-quick-grid {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.insights-quick-grid .card {
    padding: 0.65rem;
    box-shadow: none;
    border-color: #e4edf2;
}
.insights-quick-grid .routine-big {
    font-size: 1.15rem;
}
.insights-alerts-list {
    display: grid;
    gap: 0.42rem;
}
.insights-alert-item {
    padding: 0.48rem 0.6rem;
    border-radius: 10px;
    background: #f8fcff;
    border: 1px solid #e6f1f5;
    color: #274750;
    font-size: 0.88rem;
}
.insights-weekend-line {
    margin-top: 0.35rem;
}
.insights-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.clean-bars {
    gap: 0.55rem;
}
.bar-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.86rem;
    color: var(--color-text-muted);
}
.bar-track {
    height: 7px;
    border-radius: 999px;
    background: #edf3f5;
}
.bar-fill {
    height: 100%;
    border-radius: 999px;
}
.bar-morning { background: var(--color-primary); }
.bar-afternoon { background: var(--color-warning); }
.bar-night { background: var(--color-night); }
.app-fade-in {
    animation: appFadeIn .28s ease;
}
@keyframes appFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.timeline-card h3 {
    margin-bottom: 0.55rem;
}
.timeline-list {
    display: grid;
    gap: 0.48rem;
}
.timeline-item {
    display: flex;
    gap: 0.62rem;
    align-items: flex-start;
}
.timeline-item p { margin: 0.1rem 0 0; }
.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 0.35rem;
    flex-shrink: 0;
}
.timeline-dot.work { background: #16b0b6; }
.timeline-dot.rest { background: #2cae86; }
.timeline-dot.juntos { background: #f0b24a; }
.calendar-day {
    transition: transform .14s ease, box-shadow .18s ease, opacity .18s ease;
}
.calendar-day:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15,23,42,.1); }
.calendar-day:active { transform: scale(0.97); }
.day-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    z-index: 130;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 0.75rem 0.8rem calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -16px 34px rgba(15,23,42,.18);
    transition: bottom .24s ease;
}
.day-sheet.open { bottom: 0; }
.sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(10,18,34,.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet-grabber {
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: #d7e0e6;
    margin: 0 auto 0.65rem;
}
.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.sheet-kpi {
    display: inline-flex;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}
.sheet-kpi.work { background: #e8f8f8; color: #0f8d92; }
.sheet-kpi.rest { background: #ecf9f2; color: #21785e; }
.sheet-lines {
    display: grid;
    gap: 0.35rem;
}
.profile-minimal-card {
    border-radius: 18px;
}
.schedule-visual-card {
    border-radius: 16px;
}
.schedule-group {
    display: grid;
    gap: 0.55rem;
}
.schedule-group-title {
    margin: 0.1rem 0 0;
    font-size: 0.88rem;
    color: #5a6f77;
    font-weight: 600;
}
.schedule-app-card {
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    background: #fff;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.schedule-app-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    border-color: rgba(22, 176, 182, 0.22);
}
.schedule-app-card.is-active {
    border-color: rgba(44, 174, 134, 0.28);
    box-shadow: 0 10px 24px rgba(44, 174, 134, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
}
.schedule-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 16px;
}
.schedule-app-card .card-body {
    position: relative;
    z-index: 2;
}
.schedule-card-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
}
.schedule-ghost-btn {
    opacity: 0.75;
}
.insights-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-weight: var(--font-weight-semibold);
}
.insights-details summary::-webkit-details-marker { display: none; }
.clean-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.3rem;
    color: var(--color-text-dark);
    font-size: 0.9rem;
}

.day-summary-page {
    gap: 0.75rem;
    padding-bottom: calc(6.2rem + env(safe-area-inset-bottom, 0px));
}
.day-summary-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.day-summary-kicker {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}
.day-summary-title {
    margin: 0.1rem 0 0;
    font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    line-height: 1.2;
}
.day-card {
    border-color: #e3ecef;
    box-shadow: none;
}
.day-card-main {
    background: linear-gradient(180deg, #ffffff 0%, #f9fcfc 100%);
}
.day-badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.25rem 0.62rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.55rem;
}
.day-badge-work {
    background: #e8f8f8;
    color: #0f8d92;
}
.day-badge-rest {
    background: #ecf9f2;
    color: #1f7e5f;
}
.day-badge-neutral {
    background: #f1f6f7;
    color: #4f646b;
}
.day-shift-name {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-size: 1.08rem;
}
.day-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.day-icon svg {
    width: 16px;
    height: 16px;
}
.day-icon-rest {
    background: #ecf9f2;
    color: #1f7e5f;
}
.day-main-info {
    margin: 0.52rem 0 0;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-dark);
}
.day-sub-info {
    margin: 0.3rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.day-events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}
.day-section-title {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-dark);
}
.day-event-line {
    margin: 0.3rem 0 0.22rem;
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-dark);
}
.action-card-content { flex: 1; }
.action-card-title { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); }
.action-card-description { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

.icon-container {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-soft);
    background: #f3fafb;
    color: var(--color-primary-dark);
}
.icon-container-sm { width: 30px; height: 30px; border-radius: 10px; }
.icon-container-lg { width: 44px; height: 44px; border-radius: 14px; }
.icon-container-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.icon-container-success { background: #e8f7f1; color: #21785e; }
.icon-container-warning { background: #fff3df; color: #9a640f; }
.icon-container-night { background: #eaecff; color: #4f58ac; }

.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 12px;
    background: transparent;
}
.calendar-header { display: flex; justify-content: space-between; gap: var(--spacing-md); align-items: center; }
.calendar-nav { display: flex; align-items: center; gap: var(--spacing-sm); }
.calendar-weekday { text-align: center; font-size: 0.73rem; color: var(--color-text-muted); font-weight: var(--font-weight-semibold); }
.calendar-day {
    min-height: 44px;
    border: 1px solid var(--color-border-soft);
    border-radius: 10px;
    color: var(--color-text-dark);
    background: #fff;
    transition: 0.18s ease;
}
.calendar-day:hover { border-color: #a8dfe1; }
.calendar-day.today { outline: 2px solid #9ae4e7; border-color: #86dbde; }
.calendar-day.morning { border-top: 3px solid var(--color-primary); }
.calendar-day.afternoon { border-top: 3px solid var(--color-warning); }
.calendar-day.night { border-top: 3px solid var(--color-night); }
.calendar-day.rest { border-top: 3px solid var(--color-success); }
.calendar-legend-clean { display: flex; flex-wrap: wrap; gap: var(--spacing-md); }
.legend-item-clean { display: flex; align-items: center; gap: 0.4rem; color: var(--color-text-muted); font-size: var(--font-size-xs); }
.shift-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.shift-dot-morning { background: var(--color-primary); }
.shift-dot-afternoon { background: var(--color-warning); }
.shift-dot-night { background: var(--color-night); }
.shift-dot-rest { background: var(--color-success); }

.alert {
    border: 1px solid #bfe9eb;
    background: #f1fbfb;
    border-radius: 12px;
    padding: 0.72rem;
    display: flex;
    gap: var(--spacing-md);
}
.alert-icon { color: var(--color-primary-dark); }

.auth-container {
    min-height: calc(100vh - 5.6rem);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.15rem;
}
.auth-card { width: min(100%, 440px); }
.auth-logo { text-align: center; margin-bottom: var(--spacing-lg); }
.auth-logo-icon { width: 52px; height: 52px; margin: 0 auto var(--spacing-sm); color: var(--color-primary-dark); }

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border: 1px solid #bde7e8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-lg { width: 82px; height: 82px; }

.calendar-shell {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.shift-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.compact-item {
    padding: 0.58rem 0.62rem;
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    background: #fff;
}

.compact-list {
    display: grid;
    gap: 0.45rem;
}

.wizard-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
}
.wizard-tabs::-webkit-scrollbar { display: none; }
.wizard-tab {
    flex: 0 0 auto;
    padding: 0.45rem 0.62rem;
    border-radius: 999px;
    border: 1px solid var(--color-border-soft);
    background: #fff;
    font-size: 0.74rem;
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}
.wizard-tab.active {
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    border-color: #bfe7e9;
}

.shift-row-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 90px 48px;
    gap: 6px;
    align-items: end;
}

.cycle-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 48px;
    gap: 6px;
    align-items: end;
}

.form-actions-mobile {
    display: flex;
    gap: var(--spacing-sm);
}

.hidden { display: none !important; }

.form-card,
.card,
.form-section,
.schedule-form,
.shift-card {
    max-width: 100%;
    overflow: hidden;
}
.schedule-clean-form .card {
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.045);
    border-radius: 18px;
    background: #ffffff;
}
.schedule-clean-form .card-header {
    border-bottom: none;
    margin-bottom: 0.35rem;
    padding-bottom: 0;
}
.schedule-clean-form .compact-item {
    border: 1px solid rgba(15, 23, 42, 0.045);
    box-shadow: none;
    background: #ffffff;
    border-radius: 14px;
}
.schedule-clean-form .form-input,
.schedule-clean-form .form-select,
.schedule-clean-form .form-textarea {
    border-color: rgba(15, 23, 42, 0.08);
    background: #ffffff;
    box-shadow: none;
    border-radius: 14px;
}
.schedule-clean-form .form-input:focus,
.schedule-clean-form .form-select:focus,
.schedule-clean-form .form-textarea:focus {
    border-color: rgba(22, 176, 182, 0.35);
    box-shadow: 0 0 0 2px rgba(22, 176, 182, 0.12);
}
.schedule-clean-form .shift-card {
    border-color: rgba(15, 23, 42, 0.04);
    background: #fdfefe;
}
.custom-cycle-block {
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-radius: 14px;
    padding: 0.7rem;
    background: #fcfeff;
}
.custom-cycle-grid {
    display: grid;
    gap: 0.62rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cycle-stepper-card {
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-radius: 14px;
    padding: 0.65rem;
    background: #fff;
}
.cycle-stepper {
    margin-top: 0.3rem;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 0.45rem;
}
.stepper-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f6fafb;
    color: #2d4953;
    font-weight: 700;
    line-height: 1;
}
.stepper-btn.plus {
    background: linear-gradient(160deg, #16b0b6, #13979c);
    border-color: rgba(19, 151, 156, 0.85);
    color: #fff;
    box-shadow: 0 6px 14px rgba(22, 176, 182, 0.25);
}
.stepper-value {
    text-align: center;
    font-size: 1.22rem;
    font-weight: 700;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 12px;
    background: #ffffff;
    min-height: 42px;
    padding: 0.25rem;
    -moz-appearance: textfield;
}
.stepper-value::-webkit-outer-spin-button,
.stepper-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cycle-preview-box {
    background: #f7fcfd;
    border-color: rgba(15, 23, 42, 0.04);
}
.shift-remove-btn {
    min-height: 40px;
    font-size: 0.76rem;
    color: #4f636b;
}
.schedule-page {
    background: linear-gradient(180deg, #f5f9fb 0%, #f2f7fa 100%);
    border-radius: 22px;
    padding: 0.45rem;
}
.schedule-clean-form {
    gap: 0.4rem;
}
.schedule-clean-form .page-section {
    margin-bottom: 0.35rem;
}
.schedule-clean-form .card-title {
    font-size: 0.98rem;
    letter-spacing: 0.01em;
}
.schedule-clean-form .form-label {
    color: #536871;
    font-size: 0.82rem;
}
.schedule-clean-form small {
    color: #69818a;
}
.schedule-actions {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 14px;
    padding: 0.5rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}
.schedule-actions .btn-secondary {
    background: #f7fbfc;
    border-color: rgba(15, 23, 42, 0.08);
    color: #41555e;
}

@media (max-width: 640px) {
    .app-main { padding: 0.62rem; padding-bottom: calc(4.9rem + env(safe-area-inset-bottom, 0px)); gap: 0.7rem; }
    .header-content { padding: 0.56rem 0.62rem; }
    .brand-name { font-size: 1rem; }
    .page-header { gap: 0.5rem; }
    .container, .section { gap: 0.7rem; }
    .card { padding: 0.75rem; box-shadow: none; border-color: #e5eff1; }
    .card-header { margin-bottom: 0.45rem; padding-bottom: 0.35rem; }
    .btn { padding: 0.52rem 0.72rem; }
    .btn-large { padding: 0.62rem 0.78rem; }
    .calendar-day { min-height: 40px; }
    .calendar-weekday { font-size: 0.66rem; }
    .icon-container { width: 32px; height: 32px; border-radius: 10px; }
    .icon-container-sm { width: 26px; height: 26px; }
    .avatar-lg { width: 64px; height: 64px; }
    .alert { padding: 0.62rem; }
    .time-grid,
    .shift-time-grid,
    .form-row,
    .field-row,
    .shift-row-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .shift-row-grid button {
        grid-column: auto;
        align-self: end;
        min-height: 40px;
        width: 100%;
    }
    .cycle-row-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .cycle-row-grid button {
        min-height: 38px;
    }
    .form-actions-mobile {
        flex-direction: column;
    }
    .form-actions-mobile .btn {
        width: 100%;
    }
    .family-summary-grid {
        grid-template-columns: 1fr;
    }
    .premium-audience-grid {
        grid-template-columns: 1fr;
    }
    .insights-metrics {
        grid-template-columns: 1fr 1fr;
    }
    .schedule-card-actions .btn {
        min-height: 40px;
    }
    .family-day-item {
        align-items: flex-start;
        gap: 0.4rem;
    }
    .family-relation-badge {
        align-self: flex-start;
    }
    .day-summary-head {
        align-items: flex-start;
    }
    .day-summary-head .btn {
        min-height: 40px;
    }
    .custom-cycle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .schedule-page {
        border-radius: 16px;
        padding: 0.35rem;
    }
    .schedule-actions {
        padding: 0.45rem;
    }
    .home-hero-meta {
        grid-template-columns: 1fr;
    }
    .home-hero-premium {
        padding: 0.9rem;
    }
    .home-hero-title {
        font-size: 1.35rem;
    }
    .insights-summary-head {
        flex-direction: column;
    }
    .insights-summary-head .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .app-main {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        padding-top: 0.7rem;
        padding-bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px));
        gap: 0.62rem;
    }
    .container,
    .section {
        width: 100%;
        max-width: none;
        padding-left: 0;
        padding-right: 0;
        margin: 0;
        gap: 0.62rem;
    }
    .app-header {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }
    .header-content {
        width: 100%;
        max-width: none;
        padding: 0.68rem 0.85rem;
    }
    .bottom-nav {
        width: 100%;
        margin: 0;
        left: 0;
        right: 0;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
    }
    .bottom-nav-content {
        width: 100%;
        max-width: none;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    .card,
    .form-card,
    .dashboard-card,
    .family-card,
    .insight-card,
    .page-section {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: none;
        border: none;
        border-radius: 14px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    }
    .schedule-page {
        width: 100%;
        max-width: none;
        border-radius: 0;
        padding: 0;
        background: linear-gradient(180deg, #f4f8fb 0%, #f2f6fa 100%);
    }
    .schedule-clean-form .card,
    .schedule-clean-form .compact-item,
    .schedule-clean-form .shift-card,
    .custom-cycle-block,
    .cycle-stepper-card {
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: none;
        border-color: transparent;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    }
    .schedule-clean-form .page-section {
        margin-bottom: 0.45rem;
    }
    .cycle-stepper {
        gap: 0.38rem;
    }
    .stepper-btn {
        width: 40px;
        height: 40px;
    }
    .stepper-value {
        min-height: 40px;
    }
    .form-actions-mobile,
    .schedule-actions {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: none;
        border-radius: 12px;
    }
    .form-actions-mobile .btn {
        width: 100%;
    }
}

@media (max-width: 359px) {
    .custom-cycle-grid {
        grid-template-columns: 1fr;
    }
}

/* Escala Premium */
.escala-head-card {
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);
}
.escala-head-top {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    align-items: flex-start;
}
.escala-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.escala-controls-row {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-sm);
    align-items: center;
    margin-top: var(--spacing-sm);
}
.view-segment {
    display: inline-flex;
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.seg-btn {
    padding: 0.48rem 0.78rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    border-right: 1px solid var(--color-border-soft);
}
.seg-btn:last-child { border-right: none; }
.seg-btn.active {
    background: var(--color-primary);
    color: #fff;
}
.period-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}
.period-label {
    min-width: 160px;
    text-align: center;
    font-weight: var(--font-weight-semibold);
    font-size: 0.9rem;
}
.rest-color-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
}
.rest-color-label {
    font-size: 0.84rem;
    color: var(--color-text-muted);
    margin-right: 4px;
}
.rest-swatch {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid #d8e4e8;
    cursor: pointer;
}
.rest-swatch.active {
    box-shadow: 0 0 0 2px #0f8d92 inset;
    border-color: #0f8d92;
}
.compare-inline-block {
    margin-top: var(--spacing-sm);
}
.compare-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.compare-select {
    min-width: 220px;
    max-width: 360px;
}
.common-summary-card {
    border: 1px solid #f7d9a8;
    background: linear-gradient(180deg, #fffdf8 0%, #fff7ea 100%);
}
.legend-common-rest {
    background: #f6c26b;
}

.escala-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    background: #fff;
}
.legend-square-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83rem;
    color: var(--color-text-muted);
}
.legend-square {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.calendar-multi-grid {
    display: grid;
    gap: 10px;
}
.calendar-multi-grid.view-month { grid-template-columns: 1fr; }
.calendar-month-card {
    border: 1px solid var(--color-border-soft);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}
.month-title {
    margin-bottom: 8px;
    text-align: center;
    font-size: 1.05rem;
}
.premium-calendar {
    background: transparent;
    gap: 4px;
    padding: 0;
}
.premium-calendar .calendar-day {
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid #e8eef1;
    text-decoration: none;
    position: relative;
}
.premium-calendar .calendar-day.common-rest {
    box-shadow: inset 0 0 0 2px rgba(240, 178, 74, 0.75);
}
.common-rest-pill {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    background: #f0b24a;
    color: #3d2a0a;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
}
.common-rest-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    right: 4px;
    bottom: 4px;
    background: #f0b24a;
    border: 1px solid rgba(61, 42, 10, 0.22);
}
.day-empty {
    background: #f1f5f7;
    border-color: #eef3f6;
}
.day-filled {
    display: flex;
    align-items: center;
    justify-content: center;
}
.day-number {
    font-weight: var(--font-weight-semibold);
    color: #0f172a;
    font-size: 0.85rem;
}
.day-filled.today {
    outline: 2px solid #0f8d92;
    outline-offset: -2px;
}

.turno-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eef3f6;
}
.turno-row:last-child { border-bottom: none; }
.turno-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 640px) {
    .escala-head-top,
    .escala-controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    .period-label {
        min-width: 0;
        flex: 1;
    }
    .period-nav { width: 100%; }
    .period-nav .btn { min-width: 40px; }
    .view-segment { width: 100%; }
    .seg-btn { flex: 1; text-align: center; }
    .compare-inline-form {
        flex-direction: column;
        align-items: stretch;
    }
    .compare-select {
        min-width: 0;
        max-width: none;
    }
    .calendar-multi-grid.view-semester,
    .calendar-multi-grid.view-year { grid-template-columns: 1fr; }
    .turno-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (min-width: 768px) {
    .calendar-multi-grid.view-semester { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-multi-grid.view-year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-smart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .calendar-multi-grid.view-semester { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .calendar-multi-grid.view-year { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .home-smart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .app-main { padding: 1rem; padding-bottom: 6rem; }
    .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .routine-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .routine-grid .highlight-rest { grid-column: span 2; }
    .premium-plans {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .family-actions {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
    }
    .calendar-day { min-height: 66px; }
    .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
}

@media (min-width: 1024px) {
    .app-shell {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        min-height: 100vh;
    }
    .desktop-nav {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
        padding: 1.25rem 0.85rem;
        border-right: 1px solid var(--color-border-soft);
        background: #f7fcfc;
        position: sticky;
        top: 0;
        height: 100vh;
    }
    .desktop-nav-item {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.62rem 0.7rem;
        border-radius: 12px;
        color: var(--color-text-muted);
        font-weight: var(--font-weight-medium);
    }
.desktop-nav-item.active {
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    border: 1px solid #c8ebed;
}
    .desktop-nav-item:hover {
        background: #eef9f9;
        color: var(--color-primary-dark);
    }
    .app-main {
        width: min(100%, 1240px);
        padding: 1.2rem;
        padding-bottom: 1.4rem;
    }
    .bottom-nav { display: none; }
}

@media (min-width: 1280px) {
    .app-main { width: min(100%, 1280px); padding: 1.4rem 1.6rem; }
}
