* { box-sizing: border-box; }

:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #76808d;
    --border: #e4e8ee;
    --navy: #111c2e;
    --blue: #2f6fec;
    --blue-light: #edf4ff;
    --purple: #6f4bd8;
    --purple-light: #f2edff;
    --green: #157f5b;
    --green-light: #eaf8f1;
    --red: #b42318;
    --red-light: #fff0ee;
    --amber: #9a6700;
    --amber-light: #fff7db;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.topbar {
    background: var(--navy);
    color: white;
    padding: 28px max(24px, calc((100vw - 1120px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: clamp(26px, 4vw, 38px);
    letter-spacing: -0.03em;
}

.eyebrow, .section-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.eyebrow { color: #9eb4d1; }

.container {
    width: min(1120px, calc(100% - 28px));
    margin: 24px auto 50px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 22px;
    box-shadow: 0 6px 22px rgba(17, 28, 46, 0.045);
    overflow: hidden;
}

.add-panel { padding: 0 20px 22px; }

.panel-heading {
    padding: 19px 20px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.add-panel .panel-heading { padding-left: 0; padding-right: 0; }

.panel-heading h2 {
    margin: 3px 0 0;
    font-size: 19px;
}

.section-kicker.work { color: var(--blue); }
.section-kicker.personal { color: var(--purple); }
.section-kicker.completed { color: var(--green); }

.count-badge {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f3f6;
    color: #46505d;
    font-weight: 700;
    font-size: 13px;
}

.add-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 190px 240px 120px;
    gap: 12px;
    align-items: end;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="date"] {
    width: 100%;
    height: 44px;
    border: 1px solid #cfd6de;
    border-radius: 10px;
    background: white;
    padding: 0 12px;
    font: inherit;
    color: var(--text);
    outline: none;
}

input:focus {
    border-color: #7598e7;
    box-shadow: 0 0 0 3px rgba(47, 111, 236, .12);
}

.toggle-row {
    display: flex;
    gap: 8px;
}

.radio-pill {
    position: relative;
    margin: 0 !important;
}

.radio-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 15px;
    border: 1px solid #d6dce4;
    border-radius: 10px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    color: #495463;
    transition: .15s ease;
}

.radio-pill input:checked + span {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    min-height: 40px;
    padding: 0 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    height: 44px;
    background: var(--blue);
    color: white;
}

.btn.primary:hover { filter: brightness(.96); }

.btn.complete {
    background: var(--green-light);
    color: var(--green);
    white-space: nowrap;
}

.btn.ghost {
    color: white;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.07);
}

.btn.danger {
    color: var(--red);
    background: transparent;
    min-height: 34px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 0 22px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 15px 17px;
    display: flex;
    flex-direction: column;
}

.stat-card strong {
    font-size: 24px;
    line-height: 1;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.task-list,
.completed-list {
    border-top: 1px solid var(--border);
}

.task-row,
.completed-row {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.task-row:last-child,
.completed-row:last-child { border-bottom: 0; }

.task-main { min-width: 0; }

.task-text {
    font-size: 15px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.completed-text {
    color: #667085;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.task-meta {
    margin-top: 7px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.tag {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 750;
}

.tag.work {
    background: var(--blue-light);
    color: var(--blue);
}

.tag.personal {
    background: var(--purple-light);
    color: var(--purple);
}

.due {
    color: #687283;
}

.due.overdue {
    color: var(--red);
    font-weight: 700;
}

.due.today,
.due.soon {
    color: var(--amber);
    font-weight: 700;
}

.empty {
    padding: 23px 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
}

.alert {
    border-radius: 11px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 650;
}

.alert.success {
    background: #ecfdf3;
    color: #067647;
    border: 1px solid #abefc6;
}

.alert.error {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.muted {
    color: var(--muted);
    font-weight: 500;
}

footer {
    padding: 25px;
    text-align: center;
    color: #98a2b3;
    font-size: 11px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(47,111,236,.16), transparent 34%),
        var(--bg);
}

.login-card {
    width: min(420px, 100%);
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 18px 55px rgba(17,28,46,.10);
}

.login-card h1 {
    margin: 14px 0 6px;
    font-size: 28px;
}

.login-card p {
    color: var(--muted);
    margin: 0 0 24px;
}

.login-card label {
    display: block;
    font-size: 12px;
    color: #475467;
    font-weight: 700;
    margin-bottom: 7px;
}

.login-card .full {
    width: 100%;
    margin-top: 14px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: white;
    font-weight: 800;
    font-size: 19px;
}

@media (max-width: 880px) {
    .add-form {
        grid-template-columns: 1fr 1fr;
    }
    .field-description {
        grid-column: 1 / -1;
    }
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 22px 16px;
    }
    .container {
        width: min(100% - 18px, 1120px);
        margin-top: 14px;
    }
    .add-form {
        grid-template-columns: 1fr;
    }
    .field-description {
        grid-column: auto;
    }
    .toggle-row {
        width: 100%;
    }
    .radio-pill {
        flex: 1;
    }
    .radio-pill span {
        width: 100%;
    }
    .stats {
        grid-template-columns: 1fr 1fr;
    }
    .task-row,
    .completed-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .task-row form,
    .task-row .btn.complete {
        width: 100%;
    }
}


.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-actions form {
    margin: 0;
}

.btn.email-now {
    background: #ffffff;
    color: #111c2e;
    border: 1px solid rgba(255,255,255,.85);
}

.btn.email-now:hover {
    background: #edf4ff;
}

@media (max-width: 560px) {
    .topbar {
        align-items: flex-start;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions .btn {
        width: 100%;
    }
}


.task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.task-actions form {
    margin: 0;
}

.btn.edit {
    background: #f2f4f7;
    color: #344054;
}

.btn.edit:hover {
    background: #e4e7ec;
}

.btn.secondary {
    background: #f2f4f7;
    color: #344054;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 28, 46, .48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 1000;
}

.modal-backdrop.show {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(17, 28, 46, .22);
    padding: 22px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.modal-header h2 {
    margin: 4px 0 0;
    font-size: 22px;
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #667085;
}

.edit-form {
    display: grid;
    gap: 14px;
}

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

@media (max-width: 560px) {
    .task-actions {
        width: 100%;
    }

    .task-actions .btn,
    .task-actions form {
        flex: 1;
    }

    .task-actions form .btn {
        width: 100%;
    }

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

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }
}


.section-kicker.overdue {
    color: var(--red);
}

.overdue-panel {
    border-color: #f1b4ae;
    box-shadow: 0 6px 22px rgba(180, 35, 24, 0.06);
}

.overdue-panel .panel-heading {
    background: #fff8f7;
}

.overdue-count {
    background: var(--red-light);
    color: var(--red);
}

.overdue-row {
    background: #fffafa;
}

.overdue-row .task-text {
    color: #7a271a;
}

.overdue-row .due.overdue {
    color: var(--red);
    font-weight: 800;
}


/* Recurring reminders + Items Today */
.recurring-form {
    grid-template-columns: minmax(260px, 1fr) 190px 220px 135px 120px;
}

.check-pill {
    position: relative;
    display: block;
    margin: 0 !important;
}

.check-pill input,
.day-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-pill span {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid #d6dce4;
    border-radius: 10px;
    background: white;
    color: #495463;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.check-pill input:checked + span {
    background: #eef4ff;
    border-color: #84adff;
    color: #175cd3;
}

.recurring-options {
    display: none;
    grid-column: 1 / -2;
    grid-template-columns: 1fr 160px;
    gap: 14px;
    padding: 14px;
    border: 1px solid #dbe7fb;
    border-radius: 12px;
    background: #f8fbff;
}

.recurring-options.show {
    display: grid;
}

.hidden-field {
    display: none !important;
}

.day-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.day-pill {
    position: relative;
    margin: 0 !important;
}

.day-pill span {
    min-width: 48px;
    height: 38px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d6dce4;
    border-radius: 9px;
    background: white;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.day-pill input:checked + span {
    background: #175cd3;
    color: #fff;
    border-color: #175cd3;
}

input[type="time"] {
    width: 100%;
    height: 44px;
    border: 1px solid #cfd6de;
    border-radius: 10px;
    background: white;
    padding: 0 12px;
    font: inherit;
    color: var(--text);
    outline: none;
}

.today-panel {
    border-color: #b2ccff;
    box-shadow: 0 7px 24px rgba(23, 92, 211, .07);
}

.today-panel .panel-heading {
    background: #f5f8ff;
}

.today-kicker {
    color: #175cd3;
}

.today-count {
    background: #eaf2ff;
    color: #175cd3;
}

.today-row {
    background: #fbfdff;
}

.today-time {
    display: inline-block;
    min-width: 50px;
    margin-right: 8px;
    color: #175cd3;
    font-weight: 800;
}

.due.recurring {
    color: #175cd3;
    font-weight: 700;
}

.today-stat strong {
    color: #175cd3;
}

.overdue-stat strong {
    color: var(--red);
}

@media (max-width: 980px) {
    .recurring-form {
        grid-template-columns: 1fr 1fr;
    }
    .recurring-options {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .recurring-form,
    .recurring-options {
        grid-template-columns: 1fr;
    }
    .recurring-options {
        grid-column: auto;
    }
    .day-picker {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    .day-pill span {
        width: 100%;
        min-width: 0;
    }
}


/* Compact horizontal weekday picker */
.day-picker {
    display: grid;
    grid-template-columns: repeat(7, minmax(48px, 1fr));
    gap: 6px;
    width: 100%;
}

.day-pill {
    width: 100%;
}

.day-pill span {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 8px;
}

@media (max-width: 560px) {
    .day-picker {
        grid-template-columns: repeat(7, minmax(38px, 1fr));
        gap: 4px;
    }

    .day-pill span {
        height: 34px;
        padding: 0 4px;
        font-size: 11px;
    }
}


/* Polished recurring time picker */
.time-picker {
    cursor: pointer;
    background: #fff;
}

.flatpickr-calendar {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(17, 28, 46, .16);
    border: 1px solid #e4e8ee;
}

.flatpickr-time {
    border-radius: 14px;
}

.quick-times {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.quick-times button {
    border: 1px solid #d6dce4;
    background: #fff;
    color: #475467;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.quick-times button:hover {
    background: #f2f4f7;
}

.quick-times button.active {
    background: #175cd3;
    border-color: #175cd3;
    color: #fff;
}

@media (max-width: 560px) {
    .quick-times {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .quick-times button {
        width: 100%;
        padding: 7px 4px;
    }
}


/* Edit modal polish */
.modal-close {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f8fafc;
    color: #475467;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    flex: 0 0 38px;
}

.modal-close:hover {
    background: #f2f4f7;
    color: #101828;
}

.modal-header {
    align-items: center;
}

.modal-actions-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-actions-right {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.delete-task-btn {
    background: #fff1f0;
    color: #b42318;
    border: 1px solid #f3c1bc;
}

.delete-task-btn:hover {
    background: #ffe4e1;
}

@media (max-width: 560px) {
    .modal-actions-split {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions-right {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-left: 0;
    }

    .delete-task-btn {
        width: 100%;
    }
}


/* Fix recurring controls specifically inside Edit modal */
#editRecurringOptions {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    overflow: hidden;
}

#editRecurringOptions .day-picker {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
}

#editRecurringOptions .day-pill {
    width: 100%;
    min-width: 0;
}

#editRecurringOptions .day-pill span {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 4px;
    font-size: 11px;
}

#editRecurringOptions .time-field {
    width: 100%;
}

#editRecurringOptions .quick-times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
}

#editRecurringOptions .quick-times button {
    width: 100%;
    min-width: 0;
}

.modal-card {
    overflow: hidden;
}

.edit-form,
.edit-form .field,
.edit-form .edit-grid {
    min-width: 0;
}

@media (max-width: 560px) {
    #editRecurringOptions .day-picker {
        grid-template-columns: repeat(4, 1fr);
    }

    #editRecurringOptions .day-pill:nth-child(n+5) {
        /* lets the last 3 wrap neatly onto row two */
    }
}


/* Put Edit modal actions in one clean row below all fields */
.modal-actions-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    margin-top: 14px;
}

.modal-actions-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-left: 0;
}

.delete-task-btn {
    width: 100%;
    order: 1;
}

.modal-actions-right {
    order: 2;
}

.modal-actions-split .btn {
    min-height: 44px;
}

@media (min-width: 561px) {
    .modal-actions-split {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .delete-task-btn {
        grid-column: 1;
        order: 1;
    }

    .modal-actions-right {
        display: contents;
    }

    .modal-actions-right .btn.secondary {
        grid-column: 2;
    }

    .modal-actions-right .btn.primary {
        grid-column: 3;
    }
}


/* =========================================================
   FINAL EDIT MODAL LAYOUT FIX
   Keeps all edit content in a single clean vertical flow.
   ========================================================= */

#editModal .modal-card {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
}

#editModal .edit-form {
    display: block;
    width: 100%;
}

#editModal .edit-form > .field,
#editModal .edit-grid,
#editModal #editRecurringOptions,
#editModal .modal-actions-split {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Description stays full width */
#editModal .edit-form > .field {
    margin-bottom: 14px;
}

/* Due date + Type can share a row for ordinary reminders */
#editModal .edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

/* When due date is hidden for recurring items, Type spans the full row */
#editModal .edit-grid:has(#editDueField.hidden-field) {
    grid-template-columns: 1fr;
}

/* Recurring toggle */
#editModal .check-pill {
    width: 100%;
    max-width: 220px;
}

/* Critical fix: remove the add-form grid-column rule from edit recurring block */
#editModal #editRecurringOptions {
    display: none;
    grid-column: auto !important;
    margin: 0 0 18px 0;
    padding: 16px;
    border: 1px solid #dbe7fb;
    border-radius: 12px;
    background: #f8fbff;
    box-sizing: border-box;
    overflow: visible;
}

#editModal #editRecurringOptions.show {
    display: block;
}

/* Days always use the full width of recurring panel */
#editModal #editRecurringOptions .field {
    width: 100%;
    margin: 0 0 14px 0;
}

#editModal #editRecurringOptions .day-picker {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
}

#editModal #editRecurringOptions .day-pill {
    display: block;
    width: 100%;
    min-width: 0;
}

#editModal #editRecurringOptions .day-pill span {
    display: flex;
    width: 100%;
    height: 40px;
    min-width: 0;
    padding: 0 4px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 12px;
}

/* Time gets its own clean row below weekdays */
#editModal #editRecurringOptions .time-field {
    width: 100%;
    margin-bottom: 0;
}

#editModal #editRecurringOptions .time-picker {
    width: 100%;
    max-width: 180px;
}

/* Only 3 quick buttons: 8am / 12pm / 5pm */
#editModal #editRecurringOptions .quick-times {
    display: flex;
    gap: 7px;
    width: auto;
    margin-top: 8px;
}

#editModal #editRecurringOptions .quick-times button {
    width: auto;
    min-width: 64px;
    padding: 7px 12px;
}

/* Actions are ALWAYS below everything */
#editModal .modal-actions-split {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 10px;
    align-items: stretch;
    margin-top: 18px;
    clear: both;
}

#editModal .modal-actions-right {
    display: contents !important;
}

#editModal .modal-actions-split .delete-task-btn,
#editModal .modal-actions-split .btn.secondary,
#editModal .modal-actions-split .btn.primary {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    grid-row: 1;
    margin: 0;
}

#editModal .modal-actions-split .delete-task-btn {
    grid-column: 1;
}

#editModal .modal-actions-split .btn.secondary {
    grid-column: 2;
}

#editModal .modal-actions-split .btn.primary {
    grid-column: 3;
}

/* Close button stays compact and square */
#editModal .modal-close {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    padding: 0;
}

/* Smaller screens */
@media (max-width: 600px) {
    #editModal .modal-card {
        width: calc(100vw - 20px);
        padding: 18px;
    }

    #editModal .edit-grid {
        grid-template-columns: 1fr;
    }

    #editModal #editRecurringOptions .day-picker {
        grid-template-columns: repeat(4, 1fr);
    }

    #editModal .modal-actions-split {
        grid-template-columns: 1fr !important;
    }

    #editModal .modal-actions-split .delete-task-btn,
    #editModal .modal-actions-split .btn.secondary,
    #editModal .modal-actions-split .btn.primary {
        grid-column: 1;
        grid-row: auto;
    }
}


/* Shared reminders */
.tag.shared {
    background: #fff4e8;
    color: #b54708;
}

.share-field {
    margin-top: 4px;
}

.share-pill {
    max-width: 260px !important;
}

.share-pill input:checked + span {
    background: #fff4e8;
    border-color: #f7b27a;
    color: #b54708;
}

.share-help {
    margin-top: 7px;
    color: #7a8491;
    font-size: 11px;
    line-height: 1.45;
}


/* Shared icon + ordinary reminder time */
.tag.shared {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag.shared span {
    line-height: 1;
}

.due-time-wrap {
    margin-top: 10px;
}

.due-time-wrap > label {
    margin-top: 0;
}

.due-time-wrap .time-picker {
    width: 100%;
}

.due-time-wrap .quick-times {
    margin-top: 7px;
}


/* =========================================================
   ADD REMINDER FORM - CLEAN TWO ROW LAYOUT
   ========================================================= */

.add-panel {
    padding-bottom: 24px;
}

.add-form.recurring-form {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) minmax(220px, 1.15fr) minmax(220px, auto) minmax(170px, auto) 130px;
    grid-template-areas:
        "description description description description description"
        "due         due         type        repeat      button";
    gap: 16px 18px;
    align-items: end;
}

.add-form.recurring-form .field-description {
    grid-area: description;
}

.add-form.recurring-form .due-field {
    grid-area: due;
}

.add-form.recurring-form > .field:nth-of-type(3) {
    grid-area: type;
}

.add-form.recurring-form .recurring-toggle-field {
    grid-area: repeat;
}

.add-form.recurring-form .button-field {
    grid-area: button;
}

.add-form.recurring-form .field-description input {
    width: 100%;
}

.add-form.recurring-form .due-field {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr);
    gap: 12px;
    align-items: end;
}

.add-form.recurring-form .due-field > label {
    grid-column: 1;
    margin-bottom: 7px;
}

.add-form.recurring-form .due-field > input[type="date"] {
    grid-column: 1;
}

.add-form.recurring-form .due-time-wrap {
    grid-column: 2;
    margin-top: 0;
}

.add-form.recurring-form .due-time-wrap > label {
    margin-bottom: 7px;
}

.add-form.recurring-form .due-time-wrap .quick-times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 7px;
}

.add-form.recurring-form .due-time-wrap .quick-times button {
    width: 100%;
    min-width: 0;
    padding: 7px 6px;
}

.add-form.recurring-form .toggle-row {
    min-width: 210px;
}

.add-form.recurring-form .recurring-toggle-field .check-pill {
    width: 100%;
    max-width: none;
}

.add-form.recurring-form .button-field .btn {
    width: 100%;
    min-width: 120px;
}

.add-form.recurring-form .recurring-options {
    grid-area: recurring;
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0;
}

.add-form.recurring-form:has(#addRecurring:checked) {
    grid-template-areas:
        "description description description description description"
        "type        repeat      button      button      button"
        "recurring   recurring   recurring   recurring   recurring";
}

.add-form.recurring-form:has(#addRecurring:checked) .due-field {
    display: none !important;
}

.add-form.recurring-form:has(#addRecurring:checked) .button-field {
    justify-self: end;
    width: 130px;
}

@media (max-width: 980px) {
    .add-form.recurring-form {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "description description"
            "due         due"
            "type        repeat"
            "button      button";
    }

    .add-form.recurring-form .button-field {
        justify-self: stretch;
    }

    .add-form.recurring-form .button-field .btn {
        width: 100%;
    }

    .add-form.recurring-form:has(#addRecurring:checked) {
        grid-template-areas:
            "description description"
            "type        repeat"
            "recurring   recurring"
            "button      button";
    }

    .add-form.recurring-form:has(#addRecurring:checked) .button-field {
        justify-self: stretch;
        width: auto;
    }
}

@media (max-width: 620px) {
    .add-form.recurring-form {
        grid-template-columns: 1fr;
        grid-template-areas:
            "description"
            "due"
            "type"
            "repeat"
            "button";
    }

    .add-form.recurring-form .due-field {
        grid-template-columns: 1fr;
    }

    .add-form.recurring-form .due-field > label,
    .add-form.recurring-form .due-field > input[type="date"],
    .add-form.recurring-form .due-time-wrap {
        grid-column: 1;
    }

    .add-form.recurring-form .toggle-row {
        min-width: 0;
    }

    .add-form.recurring-form:has(#addRecurring:checked) {
        grid-template-areas:
            "description"
            "type"
            "repeat"
            "recurring"
            "button";
    }
}


/* =========================================================
   FINAL ADD REMINDER STRUCTURE
   Description on top, then one aligned control row.
   ========================================================= */

.add-form.recurring-form {
    display: grid !important;
    grid-template-columns:
        minmax(180px, 1.15fr)
        minmax(180px, 1.15fr)
        minmax(210px, 1fr)
        minmax(170px, .9fr)
        130px;
    grid-template-areas:
        "description description description description description"
        "due time type repeat button";
    gap: 16px 18px;
    align-items: start;
}

.add-form.recurring-form .field-description {
    grid-area: description !important;
}

.add-form.recurring-form .due-field {
    grid-area: due !important;
    display: block !important;
}

.add-form.recurring-form .due-time-field {
    grid-area: time !important;
}

.add-form.recurring-form > .field:nth-of-type(4) {
    grid-area: type !important;
}

.add-form.recurring-form .recurring-toggle-field {
    grid-area: repeat !important;
}

.add-form.recurring-form .button-field {
    grid-area: button !important;
    align-self: end;
}

.add-form.recurring-form .field > label,
.add-form.recurring-form .due-time-field > label {
    min-height: 18px;
    margin-bottom: 7px;
}

.add-form.recurring-form input[type="text"],
.add-form.recurring-form input[type="date"],
.add-form.recurring-form .time-picker,
.add-form.recurring-form .radio-pill span,
.add-form.recurring-form .check-pill span,
.add-form.recurring-form .button-field .btn {
    height: 44px;
}

.add-form.recurring-form .quick-times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 7px;
}

.add-form.recurring-form .quick-times button {
    width: 100%;
    min-width: 0;
    padding: 7px 4px;
}

.add-form.recurring-form .toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-width: 0;
}

.add-form.recurring-form .radio-pill,
.add-form.recurring-form .radio-pill span,
.add-form.recurring-form .check-pill,
.add-form.recurring-form .check-pill span {
    width: 100%;
}

.add-form.recurring-form .button-field .btn {
    width: 100%;
    min-width: 0;
}

.add-form.recurring-form .recurring-options {
    grid-column: 1 / -1 !important;
    width: 100%;
    margin-top: 2px;
}

/* recurring mode */
.add-form.recurring-form:has(#addRecurring:checked) {
    grid-template-areas:
        "description description description description description"
        "type repeat button button button"
        "recurring recurring recurring recurring recurring";
}

.add-form.recurring-form:has(#addRecurring:checked) .button-field {
    width: 130px;
    justify-self: end;
}

@media (max-width: 1100px) {
    .add-form.recurring-form {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "description description"
            "due time"
            "type repeat"
            "button button";
    }

    .add-form.recurring-form .button-field {
        justify-self: stretch;
    }

    .add-form.recurring-form:has(#addRecurring:checked) {
        grid-template-areas:
            "description description"
            "type repeat"
            "recurring recurring"
            "button button";
    }

    .add-form.recurring-form:has(#addRecurring:checked) .button-field {
        width: auto;
        justify-self: stretch;
    }
}

@media (max-width: 620px) {
    .add-form.recurring-form {
        grid-template-columns: 1fr;
        grid-template-areas:
            "description"
            "due"
            "time"
            "type"
            "repeat"
            "button";
    }

    .add-form.recurring-form:has(#addRecurring:checked) {
        grid-template-areas:
            "description"
            "type"
            "repeat"
            "recurring"
            "button";
    }
}


/* Add Item button sizing/alignment */
.add-form.recurring-form .button-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-self: stretch;
}

.add-form.recurring-form .button-field label {
    min-height: 18px;
    margin-bottom: 7px;
}

.add-form.recurring-form .button-field .btn {
    height: 52px;
    min-height: 52px;
    font-size: 15px;
    font-weight: 800;
    padding: 0 20px;
    border-radius: 12px;
    width: 100%;
}

@media (min-width: 1101px) {
    .add-form.recurring-form {
        grid-template-columns:
            minmax(180px, 1.1fr)
            minmax(180px, 1.1fr)
            minmax(210px, 1fr)
            minmax(170px, .9fr)
            160px;
    }
}


/* Top-align Add Item button with neighbouring fields */
.add-form.recurring-form .button-field {
    justify-content: flex-start;
    align-self: start;
}

.add-form.recurring-form .button-field label {
    min-height: 18px;
    margin-bottom: 7px;
}

.add-form.recurring-form .button-field .btn {
    margin-top: 0;
}


/* Add Reminder sharing control */
.add-form.recurring-form {
    grid-template-columns:
        minmax(170px, 1.05fr)
        minmax(170px, 1.05fr)
        minmax(200px, 1fr)
        minmax(160px, .85fr)
        minmax(140px, .75fr)
        160px !important;
    grid-template-areas:
        "description description description description description description"
        "due time type repeat share button" !important;
}

.add-form.recurring-form .add-share-field {
    grid-area: share;
}

.add-form.recurring-form .add-share-field .check-pill {
    width: 100%;
    max-width: none !important;
}

.add-form.recurring-form .add-share-field .check-pill span {
    width: 100%;
    height: 44px;
}

.add-form.recurring-form:has(#addRecurring:checked) {
    grid-template-areas:
        "description description description description description description"
        "type repeat share button button button"
        "recurring recurring recurring recurring recurring recurring" !important;
}

@media (max-width: 1100px) {
    .add-form.recurring-form {
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas:
            "description description"
            "due time"
            "type repeat"
            "share button" !important;
    }

    .add-form.recurring-form:has(#addRecurring:checked) {
        grid-template-areas:
            "description description"
            "type repeat"
            "share button"
            "recurring recurring" !important;
    }
}

@media (max-width: 620px) {
    .add-form.recurring-form {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "description"
            "due"
            "time"
            "type"
            "repeat"
            "share"
            "button" !important;
    }

    .add-form.recurring-form:has(#addRecurring:checked) {
        grid-template-areas:
            "description"
            "type"
            "repeat"
            "share"
            "recurring"
            "button" !important;
    }
}


/* Match Add item button to neighbouring controls */
.add-form.recurring-form .button-field .btn {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 13px !important;
    font-weight: 750 !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
}


/* Professional calendar view */
.btn.calendar-btn {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
}
.btn.calendar-btn:hover,
.btn.calendar-btn.active {
    background: #fff;
    color: #111c2e;
}
.calendar-container { margin-top: 22px; }
.calendar-toolbar { padding: 18px 20px; }
.calendar-toolbar-main {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: end;
}
.calendar-month-heading h2 {
    margin: 3px 0 0;
    font-size: 26px;
    letter-spacing: -0.02em;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.calendar-nav-btn {
    width: 42px;
    min-width: 42px;
    padding: 0;
    background: #f2f4f7;
    color: #344054;
    font-size: 24px;
    font-weight: 500;
}
.month-jump-form { min-width: 180px; }
.month-jump-form label {
    display: block;
    margin-bottom: 7px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
}
.month-jump-form select {
    width: 100%;
    height: 42px;
    border: 1px solid #cfd6de;
    border-radius: 10px;
    background: #fff;
    padding: 0 36px 0 12px;
    color: #17202a;
    font: inherit;
    outline: none;
}
.calendar-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.calendar-summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.calendar-summary-card span {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}
.calendar-summary-card strong { font-size: 22px; }
.calendar-summary-card.overdue-summary strong { color: var(--red); }
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 0 2px 14px;
    color: #667085;
    font-size: 11px;
    font-weight: 650;
}
.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.legend-dot.work { background: #2f6fec; }
.legend-dot.personal { background: #7f56d9; }
.legend-dot.overdue { background: #b42318; }
.calendar-shell { overflow: hidden; }
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.calendar-weekdays div {
    padding: 11px 12px;
    text-align: center;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-day {
    min-height: 152px;
    padding: 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #fff;
    min-width: 0;
}
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside-month { background: #fafbfc; }
.calendar-day.outside-month .calendar-day-number { color: #c3c9d1; }
.calendar-day.is-today {
    background: #f8fbff;
    box-shadow: inset 0 0 0 2px #b2ccff;
}
.calendar-day-number {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
}
.calendar-day.is-today .calendar-day-number {
    background: #175cd3;
    color: #fff;
}
.calendar-events { display: grid; gap: 5px; }
.calendar-event {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 5px;
    align-items: center;
    padding: 6px 7px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 10px;
    line-height: 1.25;
    border: 1px solid transparent;
    transition: .15s ease;
}
.calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(17,28,46,.08);
}
.calendar-event.work {
    background: #edf4ff;
    border-color: #cfe0ff;
    color: #175cd3;
}
.calendar-event.personal {
    background: #f3efff;
    border-color: #ded4ff;
    color: #6f4bd8;
}
.calendar-event.overdue {
    background: #fff1f0;
    border-color: #f3c1bc;
    color: #b42318;
}
.calendar-event-time { font-weight: 800; white-space: nowrap; }
.calendar-event-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}
.calendar-event-icons { white-space: nowrap; font-size: 10px; }
.mobile-agenda { display: none; }
.calendar-empty-state { padding: 42px 24px; text-align: center; }
.calendar-empty-icon { font-size: 34px; color: #98a2b3; }
.calendar-empty-state h3 { margin: 10px 0 5px; }
.calendar-empty-state p { color: #667085; margin: 0; }

@media (max-width: 900px) {
    .calendar-toolbar-main {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .calendar-nav { order: 3; }
    .month-jump-form { min-width: 0; }
    .desktop-calendar { display: none; }
    .mobile-agenda { display: grid; gap: 12px; }
    .agenda-day {
        display: grid;
        grid-template-columns: 72px 1fr;
        overflow: hidden;
    }
    .agenda-date {
        padding: 16px 10px;
        background: #f8fafc;
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }
    .agenda-date span,
    .agenda-date small {
        color: #667085;
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
    }
    .agenda-date strong {
        font-size: 26px;
        line-height: 1;
        margin: 5px 0 4px;
    }
    .agenda-items { display: grid; }
    .agenda-item {
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
        text-decoration: none;
        color: inherit;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    .agenda-item:last-child { border-bottom: 0; }
    .agenda-item.work { border-left: 4px solid #2f6fec; }
    .agenda-item.personal { border-left: 4px solid #7f56d9; }
    .agenda-item.overdue { border-left: 4px solid #b42318; }
    .agenda-item-main { min-width: 0; }
    .agenda-item-main strong {
        display: block;
        font-size: 14px;
        line-height: 1.35;
    }
    .agenda-item-main span {
        display: block;
        margin-top: 4px;
        color: #667085;
        font-size: 11px;
    }
    .agenda-chevron {
        color: #98a2b3;
        font-size: 22px;
    }
}
@media (max-width: 560px) {
    .calendar-summary { grid-template-columns: 1fr 1fr 1fr; }
    .calendar-summary-card {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .calendar-summary-card strong { font-size: 20px; }
    .calendar-legend { gap: 10px; }
}


/* Remember-me login */
.remember-row {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin: 14px 0 2px !important;
    color: #475467 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #2f6fec;
    flex: 0 0 auto;
}

.remember-row span {
    line-height: 1.35;
}

/* =========================================================
   PRODUCTIVITY PULSE
   ========================================================= */
.performance-pulse {
    margin-bottom: 18px;
    padding: 0;
    overflow: hidden;
    border: 2px solid #bcd2ff;
    border-radius: 28px;
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
    box-shadow: 0 10px 26px rgba(17, 28, 46, .035);
}

.performance-pulse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 26px 34px 22px;
    border-bottom: 1px solid #dbe7ff;
    background: linear-gradient(180deg, rgba(46, 111, 236, .035) 0%, rgba(46, 111, 236, .015) 100%);
}

.performance-pulse-header h2 {
    margin: 6px 0 0;
    font-size: 24px;
    letter-spacing: -.03em;
    color: #17202a;
}

.performance-count-badge {
    flex: 0 0 auto;
    min-width: 56px;
    height: 56px;
    padding: 0 16px;
    border-radius: 999px;
    background: #edf4ff;
    color: #2f6fec;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}

.performance-pulse-body {
    display: grid;
}

.performance-row {
    padding: 20px 34px;
    border-bottom: 1px solid #eef2f7;
}

.performance-row:last-child {
    border-bottom: 0;
}

.performance-main {
    min-width: 0;
}

.performance-value {
    color: #2f6fec;
    font-size: 20px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.02em;
}

.performance-title {
    margin-top: 2px;
    color: #17202a;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
}

.performance-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.performance-tag {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 15px;
    border-radius: 999px;
    background: #edf4ff;
    color: #2f6fec;
    font-size: 12px;
    font-weight: 750;
}

.performance-tag.muted {
    background: #f3f4f6;
    color: #475467;
}

@media (max-width: 760px) {
    .performance-pulse-header {
        padding: 20px 20px 18px;
    }

    .performance-row {
        padding: 18px 20px;
    }

    .performance-pulse-header h2 {
        font-size: 22px;
    }

    .performance-count-badge {
        min-width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .performance-title {
        font-size: 16px;
    }
}

@media (max-width: 560px) {
    .performance-pulse-header {
        align-items: flex-start;
    }

    .performance-count-badge {
        margin-top: 2px;
    }

    .performance-tags {
        gap: 8px;
    }

    .performance-tag {
        min-height: 32px;
        padding: 0 12px;
        font-size: 11px;
    }
}



/* Compact horizontal Productivity Pulse */
.performance-pulse {
    border-radius: 22px;
    margin-bottom: 16px;
}

.performance-pulse-header {
    padding: 16px 24px 14px;
}

.performance-pulse-header h2 {
    margin-top: 3px;
    font-size: 20px;
}

.performance-count-badge {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    font-size: 15px;
}

.performance-pulse-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.performance-row {
    padding: 14px 22px 16px;
    border-bottom: 0;
    border-right: 1px solid #e8eef7;
}

.performance-row:last-child {
    border-right: 0;
}

.performance-value {
    font-size: 19px;
}

.performance-title {
    margin-top: 3px;
    font-size: 14px;
}

.performance-tags {
    gap: 6px;
    margin-top: 8px;
}

.performance-tag {
    min-height: 28px;
    padding: 0 10px;
    font-size: 10px;
}

@media (max-width: 860px) {
    .performance-pulse-body {
        grid-template-columns: 1fr;
    }

    .performance-row {
        border-right: 0;
        border-bottom: 1px solid #e8eef7;
    }

    .performance-row:last-child {
        border-bottom: 0;
    }
}


/* =========================================================
   IN PROGRESS STATUS + SEARCH/FILTERS + EMAIL ACTION PAGE
   ========================================================= */
.stats {
    grid-template-columns: repeat(5, 1fr);
}

.in-progress-stat strong {
    color: #b54708;
}

.tag.in-progress {
    background: #fff4e8;
    color: #b54708;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn.progress {
    background: #fff7ed;
    color: #b54708;
    white-space: nowrap;
}

.btn.progress:hover {
    background: #ffedd5;
}

.btn.progress.active {
    background: #fef0c7;
    color: #93370d;
    box-shadow: inset 0 0 0 1px #f7b27a;
}

.task-tools {
    margin-bottom: 18px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.task-search {
    position: relative;
    flex: 1 1 260px;
    min-width: 220px;
}

.task-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #98a2b3;
    font-size: 17px;
    pointer-events: none;
}

.task-search input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 38px;
    border: 1px solid #d0d5dd;
    border-radius: 11px;
    background: #fff;
    color: #17202a;
    font: inherit;
    outline: none;
}

.task-search input:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 3px rgba(47, 111, 236, .10);
}

.task-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.filter-chip {
    min-height: 34px;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #f8fafc;
    color: #475467;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.filter-chip:hover {
    background: #f2f4f7;
}

.filter-chip.active {
    border-color: #b2ccff;
    background: #edf4ff;
    color: #175cd3;
}

.filter-chip.progress-filter.active {
    border-color: #f7b27a;
    background: #fff4e8;
    color: #b54708;
}

.filter-chip.overdue-filter.active {
    border-color: #f3c1bc;
    background: #fff1f0;
    color: #b42318;
}

.filter-no-results {
    display: none;
    width: 100%;
    padding: 10px 4px 2px;
    color: #667085;
    font-size: 12px;
}

.filter-no-results.show {
    display: block;
}

.email-action-page {
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    display: grid;
    place-items: center;
    background: #f4f6f8;
}

.email-action-card {
    width: min(520px, 100%);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(17, 28, 46, .10);
}

.email-action-card h1 {
    margin: 6px 0 10px;
    font-size: 25px;
    color: #17202a;
}

.email-action-card p {
    margin: 0 0 22px;
    color: #475467;
    font-size: 15px;
    line-height: 1.55;
}

.email-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 880px) {
    .stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .task-tools {
        align-items: stretch;
    }

    .task-search {
        flex-basis: 100%;
    }
}

@media (max-width: 560px) {
    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .task-tools {
        padding: 12px;
    }

    .task-filter-chips {
        gap: 6px;
    }

    .filter-chip {
        min-height: 32px;
        padding: 0 10px;
        font-size: 10px;
    }

    .task-actions {
        flex-wrap: wrap;
    }

    .task-actions .progress-form {
        flex: 1;
    }

    .email-action-buttons .btn {
        width: 100%;
    }
}


/* =========================================================
   MONTHLY RECURRENCE
   ========================================================= */
.recurrence-type-field {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.recurrence-type-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 160px));
    gap: 8px;
}

.recurrence-type-picker .radio-pill,
.recurrence-type-picker .radio-pill span {
    width: 100%;
}

.recurrence-monthly {
    display: none;
}

.recurrence-hidden {
    display: none !important;
}

.recurrence-monthly:not(.recurrence-hidden) {
    display: block;
}

.recurrence-day-select {
    width: 100%;
    height: 44px;
    border: 1px solid #cfd6de;
    border-radius: 10px;
    background: #fff;
    color: #17202a;
    padding: 0 12px;
    font: inherit;
    outline: none;
}

.recurrence-day-select:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 3px rgba(47, 111, 236, .10);
}

.recurrence-help {
    display: block;
    margin-top: 7px;
    color: #7a8491;
    font-size: 10px;
    line-height: 1.4;
}

/* Add form recurring panel: frequency spans the panel, schedule + time below. */
#addRecurringOptions.show {
    grid-template-columns: minmax(0, 1fr) 180px;
}

#addRecurringOptions .recurrence-weekly,
#addRecurringOptions .recurrence-monthly {
    grid-column: 1;
}

#addRecurringOptions .time-field {
    grid-column: 2;
    grid-row: 2;
}

/* Edit modal uses the same visual hierarchy in a single vertical flow. */
#editRecurringOptions .recurrence-type-field,
#editRecurringOptions .recurrence-weekly,
#editRecurringOptions .recurrence-monthly,
#editRecurringOptions .time-field {
    width: 100%;
}

#editRecurringOptions .recurrence-type-picker {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 620px) {
    #addRecurringOptions.show {
        grid-template-columns: 1fr;
    }

    #addRecurringOptions .recurrence-weekly,
    #addRecurringOptions .recurrence-monthly,
    #addRecurringOptions .time-field {
        grid-column: 1;
        grid-row: auto;
    }

    .recurrence-type-picker {
        grid-template-columns: 1fr 1fr;
    }
}


/* =========================================================
   WHATSAPP MANUAL SEND
   ========================================================= */
.btn.whatsapp-now {
    background: #eaf7ef;
    color: #18794e;
    border: 1px solid #b7dfc7;
}

.btn.whatsapp-now:hover {
    background: #dff2e7;
    color: #11623e;
    border-color: #9fd0b2;
}

.topbar-actions form {
    margin: 0;
}
