/* =============================================================
   align-today.css  -  the task-first Align screens:
   Today (dashboard), Timeline (fullscreen Gantt) and the loop frame.
   Classes are prefixed at- . Uses logical properties so RTL locales work.
   ============================================================= */

:root {
    --at-ink: #1b2430;
    --at-muted: #566170;
    --at-line: #dcdcd4;
    --at-surface: #ffffff;
    --at-late: #b42318;
    --at-late-soft: #fde8e8;
    --at-warn: #7a4a00;
    --at-warn-soft: #fff1d6;
    --at-ease: cubic-bezier(.2, .7, .2, 1);
}

@keyframes at-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.at-sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Page ─────────────────────────────────────────────────── */
.at-page { max-inline-size: 1280px; margin-inline: auto; padding: 1.5rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1.5rem; color: var(--at-ink); }
.at-page > * { animation: at-rise .5s var(--at-ease) both; }
.at-page > *:nth-child(2) { animation-delay: .05s; }
.at-page > *:nth-child(3) { animation-delay: .1s; }
.at-page > *:nth-child(4) { animation-delay: .15s; }

.at-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; }
.at-head__date { font-size: .9rem; color: var(--at-muted); }
.at-head__title { margin: .2rem 0 0; font-size: 2rem; line-height: 1.15; font-weight: 700; }
.at-head__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.at-h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.at-h2__sub { font-weight: 400; font-size: .95rem; color: var(--at-muted); margin-inline-start: .35rem; }

/* ── Buttons, chips, inputs ───────────────────────────────── */
.at-btn { display: inline-flex; align-items: center; gap: .4rem; min-block-size: 44px; padding: .55rem 1.1rem; border-radius: .5rem; border: 1px solid #b9c4c2; background: var(--at-surface); color: var(--at-ink); font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .15s; }
.at-btn:hover { background: #f3f6f5; color: var(--at-ink); transform: translateY(-1px); }
.at-btn--primary { background: var(--tone-primary); border-color: var(--tone-primary); color: #fff; }
.at-btn--primary:hover { background: var(--tone-primary-dark); border-color: var(--tone-primary-dark); color: #fff; }
.at-btn--accent { background: var(--tone-primary-soft-bg); border-color: var(--tone-primary); color: var(--tone-primary-dark); }
.at-btn--accent:hover { background: color-mix(in srgb, var(--tone-primary-soft-bg) 75%, var(--tone-primary) 25%); color: var(--tone-primary-dark); }
.at-btn--small { min-block-size: 40px; padding: .4rem .9rem; }

.at-link { color: var(--tone-primary); font-weight: 600; text-decoration: none; }
.at-link:hover { color: var(--tone-primary-dark); text-decoration: underline; }

.at-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.at-chip { min-block-size: 44px; padding: .4rem .9rem; border-radius: 999px; border: 1px solid #cfd6d4; background: var(--at-surface); color: #33404d; cursor: pointer; font-size: .9rem; }
.at-chip--on { border-color: var(--tone-primary); background: var(--tone-primary-soft-bg); color: var(--tone-primary-dark); font-weight: 700; }

.at-input { min-block-size: 44px; padding: .5rem .8rem; border: 1px solid #cfd6d4; border-radius: .5rem; background: var(--at-surface); color: var(--at-ink); font-size: .95rem; min-inline-size: 11rem; }
.at-seg { display: inline-flex; border: 1px solid #cfd6d4; border-radius: .5rem; overflow: hidden; }
.at-seg__btn { min-block-size: 44px; padding: .4rem 1rem; border: 0; background: var(--at-surface); color: #33404d; cursor: pointer; }
.at-seg__btn + .at-seg__btn { border-inline-start: 1px solid #cfd6d4; }
.at-seg__btn--on { background: var(--tone-primary-soft-bg); color: var(--tone-primary-dark); font-weight: 700; }

.at-more { background: none; border: 0; padding: .6rem 0; color: var(--tone-primary); font-weight: 600; cursor: pointer; }
.at-more:hover { text-decoration: underline; }

.at-focus { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-radius: .5rem; background: var(--at-warn-soft); color: var(--at-warn); font-size: .92rem; }
.at-note { padding: .5rem .8rem; border-radius: .5rem; font-size: .9rem; }
.at-note--ok { background: var(--tone-primary-soft-bg); color: var(--tone-primary-dark); }
.at-note--error { background: var(--at-late-soft); color: var(--at-late); }

/* ── Cards and the Needs-you list ─────────────────────────── */
.at-card { background: var(--at-surface); border: 1px solid var(--at-line); border-radius: .75rem; overflow: hidden; }
.at-needs__head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-block-end: 1px solid #e8e8e1; }
.at-list { list-style: none; margin: 0; padding: 0; }
.at-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 1rem 1.25rem; border-block-end: 1px solid #eeeee8; }
.at-row:last-child { border-block-end: 0; }
.at-row__main { flex: 1 1 18rem; min-inline-size: 0; }
.at-row__title { font-weight: 600; }
.at-row__sub { font-size: .88rem; color: var(--at-muted); }
.at-empty { padding: 2rem 1.25rem; color: var(--at-muted); text-align: center; }
.at-needs .at-more { padding-inline: 1.25rem; }

.at-badge { flex: 0 0 6.25rem; text-align: center; border-radius: .4rem; padding: .25rem .5rem; font-size: .8rem; font-weight: 700; }
.at-badge--late { background: var(--at-late-soft); color: #9a1c1c; }
.at-badge--warn { background: var(--at-warn-soft); color: var(--at-warn); }
.at-badge--info { background: var(--tone-primary-soft-bg); color: var(--tone-primary-dark); }
.at-badge--muted { background: #ecefee; color: #33404d; }

/* ── Property cards ───────────────────────────────────────── */
.at-props__head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; margin-block-end: .9rem; }
.at-props__tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr)); gap: .9rem; }
.at-grid > * { animation: at-rise .45s var(--at-ease) both; }
.at-grid > *:nth-child(2) { animation-delay: .04s; }
.at-grid > *:nth-child(3) { animation-delay: .08s; }
.at-grid > *:nth-child(4) { animation-delay: .12s; }
.at-grid > *:nth-child(n+5) { animation-delay: .16s; }
.at-board { padding: .5rem; }

.at-pcard { display: block; padding: 1.1rem 1.15rem; background: var(--at-surface); border: 1px solid var(--at-line); border-radius: .75rem; color: inherit; text-decoration: none; transition: transform .18s var(--at-ease), box-shadow .18s var(--at-ease), border-color .18s; }
.at-pcard:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(20, 48, 46, .1); border-color: #b9c4c2; color: inherit; }
.at-pcard__name { font-weight: 700; }
.at-pcard__addr { font-size: .88rem; color: var(--at-muted); margin-block-end: .9rem; }
.at-steps { display: flex; gap: 4px; margin-block-end: .55rem; }
.at-steps__seg { flex: 1; block-size: 6px; border-radius: 3px; background: #d9dedc; }
.at-steps__seg--on { background: var(--tone-primary); }
.at-pcard__foot { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.at-pcard__stage { font-weight: 600; }
.at-flag--late { color: #9a1c1c; font-weight: 600; }
.at-flag--warn { color: var(--at-warn); font-weight: 600; }
.at-flag--info { color: var(--tone-primary-dark); font-weight: 600; }
.at-flag--ok { color: var(--at-muted); }

/* ── Timeline (fullscreen Gantt) ──────────────────────────── */
.at-timeline { min-block-size: 100vh; background: #f6f6f2; color: var(--at-ink); display: flex; flex-direction: column; }
.at-timeline__head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: var(--at-surface); border-block-end: 1px solid var(--at-line); animation: at-rise .4s var(--at-ease) both; }
.at-timeline__title { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.at-timeline__h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.at-timeline__sub { color: var(--at-muted); font-size: .9rem; }
.at-timeline__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.at-legend { display: flex; flex-wrap: wrap; gap: 1.1rem; padding: .75rem 1.5rem; font-size: .9rem; color: #33404d; animation: at-rise .4s var(--at-ease) .05s both; }
.at-key { display: inline-block; inline-size: 14px; block-size: 14px; border-radius: 3px; vertical-align: -2px; }
.at-key--active { background: var(--tone-primary); }
.at-key--done { background: color-mix(in srgb, var(--tone-primary) 35%, white); }
.at-key--late { background: #b42318; }
.at-timeline__chart { margin: 0 1.5rem 1.5rem; background: var(--at-surface); border: 1px solid var(--at-line); border-radius: .75rem; overflow: hidden; animation: at-rise .5s var(--at-ease) .1s both; }
.at-tl-name { color: var(--at-ink); }
.at-tl-name--property { font-weight: 700; }
.at-timeline .e-gantt .e-taskbar-main-container { transition: opacity .3s; }

/* ── Motion ───────────────────────────────────────────────── */
@supports (animation-timeline: view()) {
    .at-grid > * { animation: at-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}

@media (prefers-reduced-motion: reduce) {
    .at-page > *, .at-grid > *, .at-timeline__head, .at-legend, .at-timeline__chart { animation: none !important; }
    .at-btn, .at-pcard { transition: none !important; }
}

.at-tl-phase { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--tone-primary-soft-bg); color: var(--tone-primary-dark); }
.at-tl-phase--late { background: var(--at-late-soft); color: #9a1c1c; }
.at-tl-phase--done { background: #ecefee; color: #33404d; }

/* ── Property page: the frame for loops ───────────────────── */
.at-prop__head { max-inline-size: 1280px; margin-inline: auto; padding: 1.25rem 1.25rem 0; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; color: var(--at-ink); animation: at-rise .45s var(--at-ease) both; }
.at-prop__crumbs { display: flex; gap: 1.1rem; font-size: .9rem; margin-block-end: .35rem; }
.at-prop__sub { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; color: var(--at-muted); margin-block-start: .2rem; }
.at-linkbtn { background: none; border: 0; padding: 0; color: var(--tone-primary); font-weight: 600; cursor: pointer; }
.at-linkbtn:hover { color: var(--tone-primary-dark); text-decoration: underline; }
.page-content-surface.at-prop { max-inline-size: 1280px; margin-inline: auto; padding: 1.25rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
.at-prop > * { animation: at-rise .5s var(--at-ease) both; }
.at-prop > *:nth-child(2) { animation-delay: .05s; }
.at-prop > *:nth-child(3) { animation-delay: .1s; }

.at-next { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem; background: var(--at-surface); border: 2px solid var(--tone-primary); border-radius: .75rem; }
.at-next__text { flex: 1 1 22rem; min-inline-size: 0; }
.at-next__kicker { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tone-primary-dark); }
.at-next__title { font-size: 1.2rem; font-weight: 700; margin-block: .15rem; }
.at-next__meta { color: var(--at-muted); font-size: .92rem; }

.at-frame { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.at-loops { flex: 0 0 18.5rem; display: flex; flex-direction: column; gap: .5rem; }
.at-loops__title { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--at-muted); padding-inline: .25rem; }
.at-loops__empty { padding: .75rem; color: var(--at-muted); font-size: .9rem; }
.at-loop { display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; text-align: start; inline-size: 100%; padding: .75rem .9rem; background: var(--at-surface); border: 1px solid var(--at-line); border-radius: .6rem; cursor: pointer; color: var(--at-ink); transition: border-color .15s, transform .15s var(--at-ease), background-color .15s; animation: at-rise .4s var(--at-ease) both; }
.at-loop:hover { border-color: #b9c4c2; transform: translateY(-1px); }
.at-loop--on { background: var(--tone-primary-soft-bg); border: 2px solid var(--tone-primary); padding: calc(.75rem - 1px) calc(.9rem - 1px); }
.at-loop--quiet { grid-template-columns: 1fr; background: #f3f5f4; border-style: dashed; }
.at-loop__name { font-weight: 600; }
.at-loop__state { font-size: .75rem; font-weight: 700; color: var(--tone-primary-dark); align-self: center; }
.at-loop__state--ready { color: var(--tone-primary-dark); }
.at-loop__state--done, .at-loop__state--waiting { color: var(--at-muted); }
.at-loop__sub { grid-column: 1 / -1; font-size: .85rem; color: var(--at-muted); }
.at-loops__group { background: var(--at-surface); border: 1px solid var(--at-line); border-radius: .6rem; padding: .25rem .6rem .6rem; }
.at-loops__group > summary { cursor: pointer; padding: .55rem .3rem; font-weight: 600; min-block-size: 44px; display: flex; align-items: center; gap: .4rem; }
.at-loops__group .at-loop { margin-block-start: .4rem; }
.at-loops__count { font-weight: 400; color: var(--at-muted); }

.at-bench { flex: 1 1 34rem; min-inline-size: 0; background: var(--at-surface); border: 1px solid var(--at-line); border-radius: .75rem; overflow: hidden; }
.at-bench__head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem; border-block-end: 1px solid #e8e8e1; }
.at-bench__title { font-size: 1.35rem; }
.at-bench__sub { color: var(--at-muted); font-size: .92rem; }
.at-bench__body { padding: 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 1.25rem; }
.at-bench__reason { margin: 0; color: var(--at-muted); }
.at-tool__head { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; margin-block-end: .75rem; }
.at-h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.at-more-details { background: var(--at-surface); border: 1px solid var(--at-line); border-radius: .75rem; padding: .25rem 1rem 1rem; }
.at-more-details > summary { cursor: pointer; font-weight: 700; padding: .8rem 0; min-block-size: 44px; }
.at-due .at-row__main { flex-basis: 12rem; }

@media (prefers-reduced-motion: reduce) {
    .at-prop__head, .at-prop > *, .at-loop { animation: none !important; transition: none !important; }
}

/* ── Fill the width ───────────────────────────────────────────
   .app-shell-main is a flex child with no sizing, so it shrinks to its content.
   These pages are fluid with a max width, so let their wrapper take the room. */
.app-shell-main:has(.at-page, .at-prop, .at-prop__head, .at-timeline) { flex: 1 1 auto; min-inline-size: 0; }
.at-page, .page-content-surface.at-prop, .at-prop__head, .at-timeline { inline-size: 100%; box-sizing: border-box; }

/* ── Photo bulk drop zone ─────────────────────────────────── */
.pg-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-block-size: 9rem; padding: 1.25rem 1rem; text-align: center; background: var(--at-surface); border: 2px dashed #9fb1ae; border-radius: .75rem; color: var(--at-ink); transition: border-color .15s, background-color .15s, transform .15s var(--at-ease); }
.pg-drop:hover, .pg-drop:focus-within { border-color: var(--tone-primary); background: var(--tone-primary-soft-bg); }
.pg-drop--over { border-color: var(--tone-primary); background: var(--tone-primary-soft-bg); transform: scale(1.01); }
.pg-drop--busy { opacity: .7; pointer-events: none; }
.pg-drop__icon { font-size: 1.8rem; color: var(--tone-primary); }
.pg-drop__title { font-weight: 700; }
.pg-drop__hint { font-size: .88rem; color: var(--at-muted); max-inline-size: 28rem; }
/* The real file input covers the whole zone, so a drop or a tap anywhere opens/accepts files. */
.pg-drop__input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; opacity: 0; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .pg-drop { transition: none; } .pg-drop--over { transform: none; } }

/* ── Slate tone from the top-most wrapper ─────────────────────
   app.css sets --tone-surface-gradient once on :root, so it resolves against the root theme color
   and a nested .page-tone-* never changes it. Re-evaluate the same formula where the tone is applied,
   so every color below comes from the page tone (--tone-primary and friends) and no overrides are needed. */
.at-tone,
.page-tone.align-shell,
.page-tone.crm-theme {
    --tone-surface-gradient: linear-gradient(175deg, color-mix(in srgb, var(--tone-primary) 40%, white) 0%, #ffffff 65%, #ffffff 100%);
    /* The other derived tokens are also set once on :root (teal) and never follow the tone: strong hover/active states and the Bootstrap bridge. */
    --tone-primary-strong: var(--tone-primary-dark);
    --bs-primary: var(--tone-primary);
    --bs-primary-dark: var(--tone-primary-dark);
    --bs-secondary: var(--tone-primary-light);
}
.at-tone { background: var(--tone-surface-gradient); min-block-size: 100vh; }
/* One continuous background: the inner surfaces stay transparent so the tone runs from the top edge. */
.at-tone .page-content-surface,
.at-tone .at-root,
.at-tone .align-page-surface { background: transparent; }
.at-tone .align-page-surface { max-inline-size: none; padding: 0; }
.at-root { min-inline-size: 0; }

/* ── Use the room that's there ────────────────────────────── */
.at-page, .page-content-surface.at-prop, .at-prop__head { max-inline-size: none; padding-inline: clamp(1rem, 2.5vw, 2.5rem); }
.at-bench, .at-next, .at-card, .at-loops, .at-frame > * { min-inline-size: 0; }
.at-row__title, .at-row__sub, .at-next__title, .at-next__meta, .at-bench__sub, .at-bench__reason { overflow-wrap: anywhere; }
.at-timeline { max-inline-size: none; }

.at-prop .at-prop__head { padding: 0; margin: 0; max-inline-size: none; }

/* .page-tone is a flex column, so a child with margin auto shrinks to its content. Make the wrappers fill. */
.at-tone > .align-page-surface, .at-tone > .at-root, .at-tone > .property-shell-main { inline-size: 100%; margin-inline: 0; box-sizing: border-box; }
.at-tone .align-page-surface { margin-inline: 0; inline-size: 100%; }

.at-list--flush { border: 1px solid #e8e8e1; border-radius: .5rem; overflow: hidden; }

/* Syncfusion outline buttons inside the dark Align hero header were dark-on-dark. */
.align-hero .e-btn.e-outline,
.align-hero .e-btn.e-outline:not(:disabled) { color: #fff; border-color: rgba(255, 255, 255, .65); background: transparent; }
.align-hero .e-btn.e-outline:hover,
.align-hero .e-btn.e-outline:focus-visible { background: rgba(255, 255, 255, .14); color: #fff; border-color: #fff; }
.align-hero .e-btn.e-primary { background: #fff; color: var(--tone-primary-dark); border-color: #fff; }
