/* Keep maintenance's reusable class names from changing other screens. */
@scope (.maintenance-page) {

.maintenance-page {
    padding: 2rem;
    max-width: 1480px;
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.75rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #17332f, #1d5b4f, #df6843);
    color: white;
    box-shadow: 0 18px 45px rgba(18, 69, 60, 0.25);
}

.eyebrow {
    margin: 0 0 .35rem 0;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .9;
}

.hero h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.subtext {
    margin: .5rem 0 0 0;
    max-width: 760px;
    opacity: .95;
}

.hero-actions {
    display: flex;
    gap: .75rem;
}

.refresh-btn,
.complete-btn,
.secondary-btn,
.link-btn {
    border: none;
    border-radius: 12px;
    padding: .8rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .15s ease;
}

.refresh-btn {
    background: rgba(255,255,255,.15);
    color: white;
    backdrop-filter: blur(8px);
}

.complete-btn {
    background: #1d5b4f;
    color: white;
}

.secondary-btn {
    background: #edf3ea;
    color: #12453c;
}

.secondary-btn-alt {
    background: #f6e4db;
    color: #bd4f31;
}

.secondary-btn-warn {
    background: #fff7ed;
    color: #92400e;
    border: 1px solid #fdba74;
}

.link-btn {
    border: 1px solid #dbe4f0;
    background: white;
    color: #334155;
}

.amazon-btn {
    background: #f3a847;
    color: #0f1111;
    border: none;
}

    .amazon-btn:hover {
        background: #e47911;
        color: #0f1111;
        transform: translateY(-1px);
    }

    .refresh-btn:hover,
    .complete-btn:hover,
    .secondary-btn:hover,
    .link-btn:hover {
        transform: translateY(-1px);
    }

    .refresh-btn:disabled,
    .complete-btn:disabled,
    .secondary-btn:disabled,
    .link-btn:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none;
    }

.message-box {
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    border-radius: 14px;
    background: #edf3ea;
    color: #17332f;
    border: 1px solid #cbdcc8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card,
.panel {
    background: white;
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f7;
}

.stat-label {
    display: block;
    color: #64748b;
    font-size: .9rem;
    margin-bottom: .35rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
}

.grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem;
    align-items: start;
}

.grid > .panel {
    min-width: 0;
}

.add-task-btn { background:#df6843 !important; color:#fff !important; border-color:#df6843 !important; font-weight:800; }
.custom-task-modal { width:min(94vw,680px); }
.custom-task-grid { display:grid; grid-template-columns:1fr 1fr; gap:.8rem; }
.repeat-toggle { display:flex; align-items:center; gap:.65rem; min-height:44px; padding:.7rem; border:1px solid #d6dfdb; border-radius:10px; background:#f8faf8; }
.repeat-toggle input { width:1.1rem; height:1.1rem; }
.repeat-toggle span { display:grid; }
.repeat-toggle small,.form-row label span { color:#71817c; font-size:.72rem; }
@media(max-width:640px){.custom-task-grid{grid-template-columns:1fr}.custom-task-modal{max-height:92vh;overflow:auto}}

.filter-panel {
    position: sticky;
    top: 1rem;
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #0f172a;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-subtext {
    margin: .35rem 0 0 0;
    color: #64748b;
}

.results-count {
    color: #64748b;
    font-size: .9rem;
    white-space: nowrap;
}

.form-row {
    margin-bottom: 1rem;
}

    .form-row label {
        display: block;
        margin-bottom: .4rem;
        font-weight: 700;
        color: #334155;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        width: 100%;
        box-sizing: border-box;
        padding: .85rem .95rem;
        border-radius: 12px;
        border: 1px solid #dbe4f0;
        background: #f8fafc;
        font: inherit;
    }

.group-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-card {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #fcfdff;
}

.group-header {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    text-align: left;
    touch-action: pan-y;
}

.group-header-left {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

    .group-header-left h3 {
        margin: 0;
        color: #0f172a;
        font-size: 1.05rem;
    }

    .group-header-left p {
        margin: .25rem 0 0 0;
        color: #64748b;
        font-size: .92rem;
    }

.group-header-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.group-chevron,
.row-chevron {
    width: 1.5rem;
    flex: 0 0 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #1d5b4f;
}

.mini-pill,
.status-badge,
.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .35rem .7rem;
    font-size: .75rem;
    font-weight: 800;
    white-space: nowrap;
}

    .mini-pill.overdue,
    .status-badge.overdue {
        background: #fee2e2;
        color: #b91c1c;
    }

    .mini-pill.duesoon,
    .status-badge.duesoon {
        background: #fef3c7;
        color: #92400e;
    }

    .mini-pill.upcoming,
    .status-badge.upcoming {
        background: #d7e8e8;
        color: #12453c;
    }

    .mini-pill.neutral,
    .status-badge.snoozed {
        background: #edf3ea;
        color: #12453c;
    }

    .status-badge.skipped {
        background: #e5e7eb;
        color: #374151;
    }

    .priority-badge.high {
        background: #f6e4db;
        color: #bd4f31;
    }

    .priority-badge.medium {
        background: #e0f2fe;
        color: #0369a1;
    }

    .priority-badge.low {
        background: #ecfccb;
        color: #4d7c0f;
    }

.group-body {
    padding: 0 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.maintenance-row {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: white;
    overflow: hidden;
}

    .maintenance-row.overdue {
        border-color: #fecaca;
        background: #fff7f7;
    }

    .maintenance-row.duesoon {
        border-color: #fde68a;
        background: #fffbeb;
    }

    .maintenance-row.upcoming {
        border-color: #d7e8e8;
        background: #f8faff;
    }

    .maintenance-row.snoozed {
        border-color: #cbdcc8;
        background: #f8faff;
    }

    .maintenance-row.skipped {
        border-color: #e5e7eb;
        background: #fafafa;
        opacity: .95;
    }

.maintenance-row-main {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    text-align: left;
    touch-action: pan-y;
}

.row-title-block {
    min-width: 0;
}

.row-title-line {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .2rem;
}

.row-title {
    color: #0f172a;
    font-weight: 800;
}

.row-subtitle {
    color: #64748b;
    font-size: .92rem;
    padding-left: 1.85rem;
}

.row-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.row-summary-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .15rem;
}

.summary-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
}

.summary-value {
    font-weight: 700;
    color: #0f172a;
}

.badge-group {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.maintenance-row-details {
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid rgba(226, 232, 240, .9);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-top: .9rem;
    margin-bottom: .85rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.meta-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
}

.meta-value {
    color: #0f172a;
    font-weight: 600;
}

.status-detail {
    margin-bottom: .9rem;
    padding: .75rem .9rem;
    border-radius: 12px;
    font-weight: 600;
}

.status-detail-neutral {
    background: #edf3ea;
    color: #12453c;
    border: 1px solid #cbdcc8;
}

.status-detail-warn {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.maintenance-description {
    margin-bottom: .9rem;
    color: #475569;
    line-height: 1.45;
}

.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.secondary-actions,
.maintenance-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.history-panel {
    margin-top: 1rem;
    border: 1px solid #e2e8f0;
    background: #fafbff;
    border-radius: 16px;
    padding: 1rem;
}

.history-header h4 {
    margin: 0 0 .75rem 0;
    color: #0f172a;
    font-size: 1rem;
}

.history-list {
    display: grid;
    gap: .75rem;
}

.history-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    padding: .9rem;
}

.history-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .35rem;
}

.history-meta {
    color: #64748b;
    margin-bottom: .5rem;
    line-height: 1.45;
}

.history-notes {
    white-space: pre-wrap;
    color: #334155;
    line-height: 1.45;
    margin-bottom: .5rem;
}

.history-links {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.guidance-panel {
    margin-top: 1rem;
    border: 1px solid #dbe4f0;
    background: #fafbff;
    border-radius: 16px;
    padding: 1rem;
}

.guidance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .guidance-header h4 {
        margin: 0;
        color: #0f172a;
        font-size: 1rem;
    }

    .guidance-header p {
        margin: .35rem 0 0 0;
        color: #475569;
        line-height: 1.45;
    }

.guidance-badges {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.guidance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.guidance-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    padding: .9rem;
}

.warning-card {
    background: #fffaf0;
    border-color: #fde68a;
}

.guidance-text {
    white-space: pre-wrap;
    line-height: 1.45;
}

.steps-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    padding: .9rem;
    margin-bottom: 1rem;
}

.steps-list {
    margin: .6rem 0 0 1.1rem;
    padding: 0;
    color: #334155;
    line-height: 1.55;
}

    .steps-list li + li {
        margin-top: .45rem;
    }

.guidance-footer {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.yt-search-btn {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.yt-search-btn:hover {
    background: #fee2e2;
    color: #9b2c2c;
    border-color: #fca5a5;
    transform: translateY(-1px);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23, 51, 47, 0.58);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    overflow-y: auto;
}

.completion-modal {
    width: min(950px, 95%);
    max-height: min(850px, 90dvh);
    background: #fffdf8;
    color: #17332f;
    border: 1px solid #d8d5c9;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    padding: 1.5rem;
    outline: none;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    isolation: isolate;
}

.completion-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.modal-close-btn {
    border: none;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.completion-form {
    display: grid;
    gap: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    padding-right: 0.5rem;
    margin-bottom: 0.5rem;
}

    .completion-form .form-row {
        display: grid;
        gap: 0.4rem;
    }

    .completion-form input,
    .completion-form textarea,
    .completion-form select {
        width: 100%;
        border: 1px solid #d0d7e2;
        border-radius: 12px;
        padding: 0.8rem 0.9rem;
        font: inherit;
        background: #fffefb;
        color: #17332f;
        box-sizing: border-box;
    }

.completion-field-help {
    display: block;
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
}

.completion-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-shrink: 0;
}

.upload-help {
    color: #475569;
    font-size: .92rem;
    margin-top: .35rem;
}

.upload-error {
    color: #b91c1c;
    font-size: .92rem;
    margin-top: .35rem;
}

/* Collapsible Filters Header & Button */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-toggle-filters {
    display: none;
    background: rgba(29, 91, 79, 0.08);
    color: #1d5b4f;
    border: 1px solid rgba(29, 91, 79, 0.18);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.btn-toggle-filters:hover {
    background: rgba(29, 91, 79, 0.15);
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        position: static;
    }

    .detail-grid,
    .guidance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .btn-toggle-filters {
        display: inline-block;
    }

    .filter-panel-content.collapsed {
        display: none;
    }

    .filter-panel-content.expanded {
        display: block;
        margin-top: 1rem;
    }
}

@media (max-width: 760px) {
    .maintenance-page {
        padding: 16px;
        gap: 0.85rem;
    }

    .hero {
        padding: 24px 20px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .panel, .stat-card {
        padding: 20px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .hero,
    .panel-header,
    .maintenance-row-main,
    .group-header,
    .guidance-header,
    .completion-modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .group-header {
        padding: 0.85rem 1rem;
    }

    .maintenance-row-main {
        padding: 0.85rem 1rem;
    }

    .row-subtitle {
        padding-left: 0;
        margin-top: 0.2rem;
    }

    .row-chevron {
        margin-right: 0.25rem;
    }

    .maintenance-row-details {
        padding: 0 0.85rem 0.85rem 0.85rem;
    }

    .detail-grid,
    .guidance-grid {
        grid-template-columns: 1fr;
    }

    .row-summary,
    .group-header-right,
    .completion-modal-actions {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .row-summary-item {
        align-items: flex-start;
    }

    .results-count {
        white-space: normal;
    }

    /* Compress stats grid into 2x2 on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 0 8px;
    }

    .stats-grid .stat-card {
        padding: 12px 10px !important;
        text-align: center !important;
        border-radius: 12px !important;
        border: 1px solid #eef2f7 !important;
    }

    .stats-grid .stat-label {
        font-size: 0.8rem !important;
        margin-bottom: 2px !important;
    }

    .stats-grid .stat-value {
        font-size: 1.4rem !important;
    }

    /* Convert action buttons into 2-column grid */
    .action-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-top: 1rem !important;
    }

    .secondary-actions,
    .maintenance-actions {
        display: contents !important;
    }

    .action-row button,
    .action-row .secondary-btn,
    .action-row .complete-btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px 8px !important;
        font-size: 0.85rem !important;
        height: 40px !important;
    }

    .action-row .complete-btn {
        grid-column: span 2 !important;
        height: 44px !important;
        font-size: 0.95rem !important;
    }
}

.asset-subgroup-header {
    font-size: 0.85rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.75rem 0.5rem 0.35rem 0.5rem;
    margin-top: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.group-body > .asset-subgroup-header:first-of-type {
    margin-top: 0;
}

.asset-subgroup-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}

/* Calendar View Styles */
.view-switcher-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.view-switch-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-switch-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.view-switch-btn.active {
    background: #1d5b4f;
    color: #ffffff;
    border-color: #1d5b4f;
    box-shadow: 0 4px 12px rgba(29, 91, 79, 0.2);
}

.calendar-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-month-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.calendar-info-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.calendar-grid-container {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    font-weight: 800;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-grid-header > div {
    padding: 0.75rem 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(110px, auto);
    background: #e2e8f0;
    gap: 1px;
}

.calendar-day-cell {
    background: #ffffff;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 110px;
    position: relative;
    transition: background-color 0.15s ease;
    min-width: 0;
}

.calendar-day-cell:hover {
    background-color: #f8fafc;
}

.calendar-day-cell.other-month {
    background-color: #fafbfc;
    color: #94a3b8;
}

.calendar-day-cell.is-today {
    background-color: #f0fdf4;
}

.calendar-day-cell.is-today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #10b981;
}

.calendar-day-number-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.calendar-day-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.calendar-day-cell.other-month .calendar-day-number {
    color: #cbd5e1;
}

.calendar-day-cell.is-today .calendar-day-number {
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.today-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #15803d;
    background: #dcfce7;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.calendar-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-task-badge {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 2px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    background: #f1f5f9;
    color: #334155;
    font-family: inherit;
}

.calendar-task-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.calendar-task-badge.priority-high {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.calendar-task-badge.priority-medium {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}

.calendar-task-badge.priority-low {
    background: #ecfccb;
    color: #4d7c0f;
    border-color: #bef264;
}

.calendar-task-badge.status-skipped {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    text-decoration: line-through;
}

.calendar-task-badge.status-snoozed {
    background: #fff5dc;
    color: #12453c;
    border-color: #e2b454;
    border-style: dashed;
}

.calendar-task-badge.status-overdue {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
    box-shadow: 0 0 0 1px #fee2e2;
}

.unscheduled-tasks-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.unscheduled-tasks-section h4 {
    margin: 0 0 0.75rem 0;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 800;
}

.unscheduled-tasks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.unscheduled-tasks-list .calendar-task-badge {
    width: auto;
    display: inline-flex;
    white-space: normal;
}

/* Calendar Task Details Modal Specific */
.calendar-detail-modal {
    width: min(950px, 95%);
    max-height: min(900px, 90dvh);
    background: #fffdf8;
    color: #17332f;
    border: 1px solid #d8d5c9;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    padding: 1.5rem;
    outline: none;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    isolation: isolate;
}

.calendar-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.calendar-detail-body {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.calendar-detail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

@media (max-width: 760px) {
    .calendar-grid {
        grid-auto-rows: minmax(60px, auto);
    }
    
    .calendar-day-cell {
        min-height: 60px;
        padding: 0.25rem;
        align-items: center;
    }
    
    .calendar-day-number-bar {
        justify-content: center;
        width: 100%;
    }
    
    .today-label {
        display: none;
    }
    
    .calendar-day-tasks {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
        max-height: none;
    }
    
    .calendar-task-badge {
        width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 999px;
        text-indent: -9999px;
        min-width: 8px;
        overflow: hidden;
        margin-top: 0;
        border: none !important;
    }
    
    .unscheduled-tasks-list .calendar-task-badge {
        width: auto;
        text-indent: 0;
        height: auto;
        padding: 6px 12px;
        border-radius: 8px;
    }
}

}
