/* ==========================================================================
   forgetbrooke.com — design system
   Warm paper background, white cards, seafoam green accent, sidebar app shell.
   No external fonts (the Content-Security-Policy only allows same-origin
   assets), so we lean on the high-quality system font stack.
   ========================================================================== */

:root {
    /* surfaces */
    --bg: #f6f4f0;
    --card: #ffffff;
    --card-soft: #fbfaf8;
    --line: #e8e4dd;
    --line-soft: #f0ece6;

    /* text (turquoise-tinted neutrals) */
    --ink: #1c2927;
    --muted: #667a76;
    --faint: #97aca8;

    /* brand (seafoam green) */
    --accent: #2fb08f;
    --accent-dark: #1e8f72;
    --accent-soft: #e7f6f0;
    --accent-border: #c4e8da;

    /* status */
    --green: #178a60;
    --green-soft: #e4f5ec;
    --amber: #a16207;
    --amber-soft: #fdf3dd;
    --red: #c0392b;
    --red-soft: #fdefec;

    /* effects */
    --shadow-sm: 0 1px 2px rgba(28, 41, 39, 0.05);
    --shadow-md: 0 2px 6px rgba(28, 41, 39, 0.06), 0 12px 32px rgba(28, 41, 39, 0.06);
    --shadow-lg: 0 24px 70px rgba(28, 41, 39, 0.3);
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 28px; margin: 0; letter-spacing: -0.6px; font-weight: 750; }
h2 { font-size: 17px; margin: 0 0 6px; letter-spacing: -0.2px; font-weight: 700; }
.subtitle { color: var(--muted); margin: 5px 0 0; font-size: 14.5px; }

a { color: var(--accent-dark); }

/* ==========================================================================
   App shell: sidebar + main column
   ========================================================================== */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 18px 16px;
    background: var(--card);
    border-right: 1px solid var(--line);
}

.main { flex: 1; min-width: 0; }

.content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 40px 90px;
}

/* --- brand block at the top of the sidebar --- */

.brand {
    display: block;
    padding: 0 6px 14px;
    text-decoration: none;
    color: var(--ink);
}

.brand-logo {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    object-fit: cover;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}

/* --- nav links --- */

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    font-weight: 570;
    font-size: 14.5px;
    transition: background 0.12s ease, color 0.12s ease;
}
.side-nav a:hover { background: var(--card-soft); color: var(--ink); }
.side-nav a.active {
    background: var(--accent-soft);
    color: var(--accent-dark);
}
.side-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }

/* --- user chip pinned to the bottom --- */

.side-footer {
    margin-top: auto;
    border-top: 1px solid var(--line-soft);
    padding-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7fd6bb);
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.side-user { min-width: 0; flex: 1; }
.side-user .name {
    font-weight: 650;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-user .email {
    font-size: 12px;
    color: var(--faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-button {
    background: transparent;
    border: none;
    color: var(--faint);
    padding: 7px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    line-height: 1;
}
.icon-button:hover { background: var(--card-soft); color: var(--ink); }
.icon-button svg { width: 17px; height: 17px; }

/* red-tinted icon buttons (the little trash cans) */
.icon-button.danger:hover { background: var(--red-soft); color: var(--red); }

/* --- shell collapses to a top bar on small screens --- */

@media (max-width: 880px) {
    .shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        padding: 10px 16px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .brand { padding: 0 8px 0 0; }
    .brand-logo {
        width: 54px;
        height: 54px;
        border-radius: 15px;
    }
    .side-nav { flex-direction: row; }
    .side-footer {
        margin-top: 0;
        margin-left: auto;
        border-top: none;
        padding-top: 0;
    }
    .side-user { display: none; }
    .content { padding: 24px 18px 70px; }
}

/* ==========================================================================
   Page header
   ========================================================================== */

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 14px;
}
.back-link:hover { color: var(--accent-dark); }
.back-link svg { width: 15px; height: 15px; }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.card-title h2 { margin: 0; }
.card-title svg { width: 19px; height: 19px; color: var(--accent); flex-shrink: 0; }

/* ==========================================================================
   Stat tiles (dashboard)
   ========================================================================== */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}
@media (max-width: 880px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.stat .label {
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--faint);
}
.stat .value {
    font-size: 27px;
    font-weight: 750;
    letter-spacing: -0.8px;
    margin-top: 2px;
    line-height: 1.15;
}
.stat .value.good { color: var(--green); }
.stat .value.brand { color: var(--accent-dark); }

/* ==========================================================================
   Dashboard layout: campaigns column + activity aside
   ========================================================================== */

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr);
    gap: 20px;
    align-items: start;
}
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

.section-label {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--faint);
    margin: 0 0 12px 2px;
}

/* --- campaign cards --- */

.campaign-card {
    display: block;
    position: relative;   /* anchors the stretched link and delete button */
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.campaign-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Invisible link stretched over the whole card, so clicking anywhere
   opens the campaign. Real buttons (delete) sit above it via z-index. */
.campaign-card .card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.campaign-card .top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.campaign-card .name {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.2px;
    flex: 1;
    min-width: 0;
}

/* The per-card delete button: invisible until the card is hovered (or the
   button itself is focused with the keyboard), so the cards stay clean. */
.campaign-card .card-delete {
    position: relative;
    z-index: 2;   /* above the stretched link */
}
.campaign-card .card-delete .icon-button {
    opacity: 0;
    transition: opacity 0.12s ease;
}
.campaign-card:hover .card-delete .icon-button,
.campaign-card .card-delete .icon-button:focus-visible {
    opacity: 1;
}
/* Touch screens have no hover, so keep the button visible there. */
@media (hover: none) {
    .campaign-card .card-delete .icon-button { opacity: 1; }
}

.campaign-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13.5px;
}
.campaign-meta strong { color: var(--ink); font-weight: 650; }

/* thin reply-rate progress bar at the bottom of each campaign card */
.progress {
    height: 5px;
    background: var(--line-soft);
    border-radius: 999px;
    margin-top: 14px;
    overflow: hidden;
}
.progress .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7fd6bb);
    border-radius: 999px;
    min-width: 0;
}

/* --- activity feed --- */

.activity-card { padding: 20px; }

.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li {
    position: relative;
    padding: 8px 0 8px 20px;
    font-size: 13px;
    color: var(--muted);
    border-bottom: 1px solid var(--line-soft);
    word-break: break-word;
}
.activity-list li:last-child { border-bottom: none; }
/* little timeline dot */
.activity-list li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 15px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-border);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 17px;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(30, 143, 114, 0.35);
    transition: background 0.12s ease, transform 0.05s ease, box-shadow 0.12s ease;
}
button:hover, .button:hover { background: var(--accent-dark); }
button:active, .button:active { transform: translateY(1px); }
button svg, .button svg { width: 16px; height: 16px; }

button.secondary, .button.secondary {
    background: var(--card);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
}
button.secondary:hover, .button.secondary:hover { background: var(--card-soft); border-color: #d8d3ca; }

button.ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
    box-shadow: none;
}
button.ghost:hover { background: var(--card-soft); color: var(--ink); }

button.danger {
    background: transparent;
    color: var(--red);
    border-color: #f2d5cf;
    box-shadow: none;
}
button.danger:hover { background: var(--red-soft); }

/* solid red — only for the final "yes, really delete" button in the
   confirmation dialog */
button.danger-solid {
    background: var(--red);
    color: #fff;
    box-shadow: 0 1px 2px rgba(192, 57, 43, 0.35);
}
button.danger-solid:hover { background: #a93226; }

button.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

button:focus-visible, .button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.inline-form { display: inline; }

/* ==========================================================================
   Forms
   ========================================================================== */

label {
    display: block;
    font-size: 13px;
    font-weight: 650;
    color: var(--ink);
    margin: 14px 0 5px;
}
label .optional { color: var(--faint); font-weight: 500; }

input[type="text"], input[type="email"], input[type="number"],
input[type="password"], input[type="search"], textarea, select {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--card);
    color: var(--ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; min-height: 150px; line-height: 1.6; }

input[type="file"] {
    width: 100%;
    padding: 9px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--card-soft);
    color: var(--muted);
    font: inherit;
    font-size: 13.5px;
}

.form-row { display: flex; gap: 14px; }
.form-row > div { flex: 1; min-width: 0; }
@media (max-width: 620px) { .form-row { flex-direction: column; gap: 0; } }

/* The "wait between emails" row on the test modal: a number box next to a
   seconds/minutes dropdown. */
.gap-row { display: flex; gap: 10px; align-items: center; }
.gap-row input[type=number] { width: 90px; }
.gap-row select { width: auto; }

.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }

.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* ==========================================================================
   Inline flash banner (top of the page content)
   ========================================================================== */

.flash-banner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 18px;
}
.flash-banner:empty { display: none; }

.flash {
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    border: 1px solid transparent;
    animation: flash-in 0.2s ease;
}
@keyframes flash-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash.fade-out { opacity: 0; transition: opacity 0.4s ease; }

.flash-success {
    background: var(--green-soft);
    border-color: #c7e8d6;
    color: var(--green);
}
.flash-error {
    background: var(--red-soft);
    border-color: #f2d5cf;
    color: var(--red);
}

/* ==========================================================================
   Callout banners (e.g. "connect Gmail first")
   ========================================================================== */

.callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--amber-soft);
    border: 1px solid #f0e0b8;
    color: #7c5410;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 22px;
    font-size: 14px;
}
.callout svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.callout a { color: inherit; font-weight: 700; }
.callout strong { font-weight: 700; }

/* ==========================================================================
   Status pills
   ========================================================================== */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
/* the little status dot */
.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.pill.active   { background: var(--green-soft); color: var(--green); }
.pill.engaged  { background: var(--accent-soft); color: var(--accent-dark); }

/* The "Your turn" flag in the contacts table's Engaged column: shown for
   contacts who replied, so the owner can spot at a glance who's waiting
   on a personal answer now that the automation stopped. */
.engaged-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid var(--accent-border);
}
.engaged-flag svg { width: 13px; height: 13px; }
.pill.finished { background: var(--line-soft); color: var(--muted); }
.pill.paused   { background: var(--amber-soft); color: var(--amber); }

/* ==========================================================================
   Tabs (segmented control on the campaign page)
   ========================================================================== */

.tabs {
    display: inline-flex;
    gap: 4px;
    background: #edeae3;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 22px;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 650;
    font-size: 14px;
    transition: color 0.12s ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.tab .count {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 8px;
}

/* ==========================================================================
   Email sequence timeline
   ========================================================================== */

.sequence { position: relative; }

/* Each email is a <details> element so it can collapse to just its header. */
.step {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.step-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    cursor: pointer;
    user-select: none;
    list-style: none;   /* hide the browser's default triangle marker */
}
.step-heading::-webkit-details-marker { display: none; }
.step-heading:hover { background: var(--card-soft); }

/* our own chevron; points down when the card is open */
.step-chevron {
    width: 16px;
    height: 16px;
    color: var(--faint);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
details[open] > .step-heading .step-chevron { transform: rotate(90deg); }

/* greyed-out subject preview shown in the header row */
.summary-subject {
    flex: 1;
    min-width: 0;
    color: var(--faint);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-body {
    padding: 2px 22px 20px;
    border-top: 1px solid var(--line-soft);
}

/* The Save button in an email card's header row. Only useful while the
   card is open (that's when the fields are visible), so it's hidden on
   collapsed cards. */
.step-heading .step-save { flex-shrink: 0; }
details:not([open]) > .step-heading .step-save { display: none; }

/* the trash can in an email card's header row */
.step-heading .step-delete {
    flex-shrink: 0;
    color: var(--faint);
}
.step-heading .step-delete:hover { color: var(--red); }
.step-heading .step-delete svg { width: 16px; height: 16px; }

/* forms with no visible parts of their own (submitted by a button
   elsewhere, e.g. the trash can in an email card's header) */
.hidden-form { display: none; }

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 750;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-heading .title { font-weight: 700; font-size: 15.5px; }

.step-empty-warning {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--amber);
    background: var(--amber-soft);
    font-size: 12.5px;
    font-weight: 650;
    padding: 3px 11px;
    border-radius: 999px;
}
.step-ready {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 12.5px;
    font-weight: 650;
    padding: 3px 11px;
    border-radius: 999px;
}

/* the "waits N days" connector between step cards */
.step-connector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 6px 36px;
    position: relative;
}
.step-connector::before {
    content: "";
    position: absolute;
    left: 15px;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: var(--line);
}
.step-connector .chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 13px;
}
.step-connector .chip svg { width: 13px; height: 13px; }

/* The "waits N days" chip is a tiny form: the number is a real input you
   can click and edit in place. It's dressed down to blend into the chip,
   with just an underline hinting that it's editable. */
.chip-editable .chip-days {
    width: 44px;
    padding: 0 2px;
    border: none;
    border-bottom: 1px dashed var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--accent-dark);
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    font-family: inherit;
}
.chip-editable .chip-days:focus {
    outline: none;
    border-bottom: 1px solid var(--accent);
}

/* The quiet "it saved" signal (added by app.js for a moment after a
   background save, then removed): the component itself turns green. */
.step-connector .chip { transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease; }
.chip-editable.just-saved {
    background: var(--green-soft);
    border-color: var(--green);
    color: var(--green);
}
.chip-editable.just-saved .chip-days {
    color: var(--green);
    border-bottom-color: var(--green);
}
button.just-saved {
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 1px 2px rgba(23, 138, 96, 0.35);
}
button.just-saved:hover { background: var(--green); }

/* The red "that didn't work" twin of .just-saved: the chip, save button, or
   email card flashes red for a moment when a background save/delete/add
   fails -- the feedback lives on the thing you clicked, not a pop-up. */
.chip-editable.just-failed {
    background: var(--red-soft);
    border-color: var(--red);
    color: var(--red);
}
.chip-editable.just-failed .chip-days {
    color: var(--red);
    border-bottom-color: var(--red);
}
button.just-failed {
    background: var(--red);
    border-color: var(--red);
    box-shadow: 0 1px 2px rgba(192, 57, 43, 0.35);
}
button.just-failed:hover { background: var(--red); }
details.step.just-failed {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

/* placeholder chips shown in the helper strip */
code.placeholder {
    background: var(--accent-soft);
    color: var(--accent-dark);
    padding: 2px 8px;
    border-radius: 7px;
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--faint);
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    font-size: 14px;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--card-soft); }

.cell-main { font-weight: 620; }
.cell-sub { color: var(--faint); font-size: 12.5px; }
.cell-muted { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* name + avatar in the contacts table */
.person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.person .avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
    background: linear-gradient(135deg, #a5e3cc, #52c3a2);
}

.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }

/* toolbar above the contacts table */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar .search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 330px;
}
.toolbar .search svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--faint);
    pointer-events: none;
}
.toolbar .search input { padding-left: 34px; }
.toolbar .spacer { flex: 1; }

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 44px 24px;
    color: var(--muted);
}
.empty-state .empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.empty-state .empty-icon svg { width: 24px; height: 24px; }
.empty-state h3 { margin: 0 0 4px; font-size: 15.5px; color: var(--ink); }
.empty-state p { margin: 0 0 16px; font-size: 13.5px; }

/* ==========================================================================
   Settings page
   ========================================================================== */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-grid .card { margin-bottom: 0; }
.settings-full { grid-column: 1 / -1; }

/* connection status row (Gmail card) */
.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    margin-bottom: 14px;
}
.status-row .status-text { font-size: 14px; }
.status-row .status-text strong { font-weight: 700; }

/* the Mon–Sun schedule strip */
.day-strip { display: flex; gap: 7px; margin: 14px 0 10px; flex-wrap: wrap; }
.day {
    flex: 1;
    min-width: 44px;
    text-align: center;
    padding: 9px 0;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    background: var(--line-soft);
    color: var(--faint);
}
/* The day pills are clickable checkbox labels: the box itself is hidden
   and the pill lights up whenever its checkbox is checked. */
.day { cursor: pointer; }
.day input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}
.day.on,
.day:has(input:checked) {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid var(--accent-border);
    padding: 8px 0;
}
.day:has(input:not(:checked)) {
    background: var(--line-soft);
    color: var(--faint);
    border: none;
    padding: 9px 0;
}
.window-note {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13.5px;
}
.window-note svg { width: 15px; height: 15px; color: var(--accent); }

hr.divider { border: none; border-top: 1px solid var(--line-soft); margin: 22px 0; }

/* ==========================================================================
   Auth pages (login / first-time setup)
   ========================================================================== */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(700px 420px at 15% 0%, #ddf3ea 0%, rgba(221, 243, 234, 0) 60%),
        radial-gradient(700px 420px at 90% 100%, #ffeede 0%, rgba(255, 238, 222, 0) 55%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px 32px 30px;
    box-shadow: var(--shadow-md);
}

.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand img {
    width: min(260px, 82vw);
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    object-fit: cover;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}
.auth-brand .auth-sub {
    color: var(--muted);
    font-size: 14px;
    margin: 14px auto 0;
    max-width: 320px;
}

.auth-card button[type="submit"] { width: 100%; margin-top: 20px; padding: 11px; }

/* flashes on auth pages sit above the card as an inline message */
.auth-flash {
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.auth-flash-error {
    background: var(--red-soft);
    border-color: #f2d5cf;
    color: var(--red);
}
.auth-flash-success {
    background: var(--green-soft);
    border-color: #c7e8d6;
    color: var(--green);
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 38, 35, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
}
/* "hidden" must beat the display:flex above */
.modal-overlay[hidden] { display: none; }

.modal {
    background: var(--card);
    border-radius: 16px;
    padding: 24px 26px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.18s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.modal-header h2 { margin: 0; font-size: 17px; }

.modal-close {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--faint);
    font-size: 21px;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
}
.modal-close:hover { background: var(--card-soft); color: var(--ink); }

/* segmented switcher inside the Add-contact modal */
.modal-tabs {
    display: flex;
    gap: 4px;
    background: #edeae3;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 6px;
}
.modal-tabs button {
    flex: 1;
    background: transparent;
    color: var(--muted);
    border: none;
    box-shadow: none;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 650;
}
.modal-tabs button:hover { color: var(--ink); background: transparent; }
.modal-tabs button.active {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

/* --- the shared "are you sure?" dialog --- */

.modal-confirm {
    max-width: 420px;
    text-align: center;
}
.modal-confirm .confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--red-soft);
    color: var(--red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.modal-confirm .confirm-icon svg { width: 22px; height: 22px; }
.modal-confirm h2 { margin-bottom: 4px; }
.modal-confirm .hint { font-size: 13.5px; line-height: 1.5; }
.modal-confirm .modal-actions { justify-content: center; }
