/* ==========================================================================
   ASTRA AI Sales & Marketing System — design tokens and components
   One central theme definition; every screen uses these tokens.
   ========================================================================== */

:root {
    /* Brand palette (measured from the reference screens) */
    --astra-yellow:      #FFDC00;
    --astra-yellow-dark: #E6C600;
    --astra-dark:        #181818;
    --astra-dark-soft:   #262626;
    --astra-dark-field:  #2E2E2E;
    --page-bg:           #F7F6F0;
    --surface:           #FFFFFF;
    --surface-muted:     #F1F0EA;
    --border:            #E2E8F0;
    --border-strong:     #CBD5E1;

    --text:              #111827;
    --text-secondary:    #4B5563;   /* darkened from #64748B for contrast */
    --text-muted-dark:   #CBD5E1;

    --success:           #047857;
    --success-bg:        #ECFDF5;
    --warning:           #B45309;
    --warning-bg:        #FFFBEB;
    --error:             #B91C1C;
    --error-bg:          #FEF2F2;
    --info:              #1D4ED8;
    --info-bg:           #EFF6FF;

    /* Layout */
    --sidebar-width:     320px;
    --radius-card:       20px;
    --radius-nav:        15px;
    --radius-field:      12px;
    --shadow-card:       0 1px 2px rgba(17, 24, 39, .04), 0 4px 16px rgba(17, 24, 39, .04);
    --shadow-raised:     0 8px 30px rgba(17, 24, 39, .10);
    --shadow-modal:      0 24px 60px rgba(17, 24, 39, .28);

    --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
            Arial, "Noto Sans", "Noto Sans Malayalam", "Noto Sans Arabic", sans-serif;

    color-scheme: light;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--page-bg);
    overflow-x: hidden;               /* the document never scrolls sideways */
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p  { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

img { max-width: 100%; height: auto; }

:focus-visible {
    outline: 3px solid var(--astra-yellow);
    outline-offset: 2px;
    border-radius: 6px;
}
.on-dark :focus-visible { outline-color: var(--astra-yellow); }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 200;
    background: var(--astra-yellow); color: #000; padding: 10px 16px;
    border-radius: 10px; font-weight: 700; text-decoration: none;
    transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Application shell
   -------------------------------------------------------------------------- */

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

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    background: var(--astra-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.sidebar__brand {
    display: flex; align-items: center; gap: 14px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
    flex: 0 0 auto;
}
.sidebar__logo {
    width: 56px; height: 56px; border-radius: 12px;
    object-fit: contain; background: var(--astra-yellow);
    flex: 0 0 auto;
}
.sidebar__logo-fallback {
    width: 56px; height: 56px; border-radius: 12px;
    background: var(--astra-yellow); color: #000;
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px; letter-spacing: .04em;
    flex: 0 0 auto;
}
.sidebar__wordmark { min-width: 0; display: block; }
.sidebar__title {
    display: block;
    color: var(--astra-yellow);
    font-size: 19px; font-weight: 800; letter-spacing: .06em; line-height: 1.1;
}
.sidebar__descriptor {
    display: block;
    color: #fff; font-size: 12.5px; font-weight: 700;
    letter-spacing: .04em; line-height: 1.25; margin-top: 3px;
    text-transform: uppercase;
}

.sidebar__scroll { flex: 1 1 auto; overflow-y: auto; padding: 18px 16px 8px; }
.sidebar__scroll::-webkit-scrollbar { width: 8px; }
.sidebar__scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }

.sidebar__label {
    color: #94A3B8; font-size: 11.5px; font-weight: 800;
    letter-spacing: .14em; text-transform: uppercase;
    padding: 6px 10px 10px;
}

.nav { display: flex; flex-direction: column; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__link {
    display: flex; align-items: center; gap: 14px;
    min-height: 54px; padding: 0 16px;
    border-radius: var(--radius-nav);
    color: #E5E7EB; text-decoration: none;
    font-size: 15px; font-weight: 600;
    transition: background .15s ease, color .15s ease;
}
.nav__link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav__link[aria-current="page"] {
    background: var(--astra-yellow);
    color: #000;
    font-weight: 700;
}
.nav__link svg { flex: 0 0 auto; }

.sidebar__divider { border: 0; border-top: 1px solid rgba(255,255,255,.10); margin: 18px 6px; }

.sidebar__section-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 10px 8px;
}
.sidebar__section-head .sidebar__label { padding: 0; color: var(--astra-yellow); }

.icon-button--pin {
    background: transparent; border: 1px solid rgba(255,255,255,.22);
    color: var(--astra-yellow); width: 30px; height: 30px; border-radius: 9px;
    font-size: 18px; line-height: 1; cursor: pointer;
    display: grid; place-items: center; padding: 0;
}
.icon-button--pin:hover { background: rgba(255,255,255,.10); }

.shortcuts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.shortcut {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 12px;
    color: #E5E7EB; text-decoration: none; font-size: 14px; font-weight: 600;
}
.shortcut:hover { background: rgba(255,255,255,.07); color: #fff; }
.shortcut__initials {
    width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
    background: rgba(255,255,255,.12); color: #fff;
    display: grid; place-items: center; font-size: 11px; font-weight: 800;
}
.shortcut__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut__external { flex: 0 0 auto; opacity: .6; }
.sidebar__empty { color: #94A3B8; font-size: 13.5px; padding: 6px 12px 2px; }

.account {
    flex: 0 0 auto;
    border-top: 1px solid rgba(255,255,255,.10);
    padding: 12px 16px 16px;
    background: var(--astra-dark);
}
.account__row { display: flex; align-items: center; gap: 11px; }
.account__avatar {
    width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
    background: var(--astra-yellow); color: #000;
    display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.account__meta { min-width: 0; flex: 1 1 auto; }
.account__name { font-size: 14px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__role { font-size: 12px; color: #94A3B8; }
.account__actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.account__action {
    flex: 1 1 auto; text-align: center; text-decoration: none;
    font-size: 12.5px; font-weight: 700; color: #E5E7EB;
    background: rgba(255,255,255,.08); border: 0; cursor: pointer;
    padding: 8px 10px; border-radius: 10px; font-family: inherit;
}
.account__action:hover { background: rgba(255,255,255,.16); color: #fff; }

/* Mobile drawer */
.sidebar__close { display: none; }
.topbar-mobile { display: none; }
.scrim { display: none; }

/* --------------------------------------------------------------------------
   Main area
   -------------------------------------------------------------------------- */

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.page { padding: 32px 40px 56px; max-width: 1400px; width: 100%; }

.page-strip {
    background: var(--astra-dark);
    color: #fff;
    padding: 18px 40px;
    min-height: 80px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
}
.page-strip__eyebrow {
    color: var(--astra-yellow); font-size: 12.5px; font-weight: 800;
    letter-spacing: .14em; text-transform: uppercase;
}
.page-strip h1 { color: #fff; font-size: 25px; margin-top: 2px; }
.page-strip__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin-bottom: 26px;
}
.page-head__text { min-width: 240px; flex: 1 1 260px; }
.page-head__subtitle { color: var(--text-secondary); margin-top: 6px; }
.page-head__tools {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    flex: 1 1 480px; justify-content: flex-end; min-width: 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-size: 14.5px; font-weight: 700;
    padding: 11px 20px; border-radius: 12px;
    border: 1px solid transparent; cursor: pointer;
    text-decoration: none; white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--astra-yellow); color: #000; }
.btn--primary:hover { background: var(--astra-yellow-dark); }

.btn--dark { background: var(--astra-dark); color: #fff; }
.btn--dark:hover { background: #000; }

.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-muted); }

.btn--outline-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn--outline-dark:hover { background: rgba(255,255,255,.10); }

.btn--danger { background: var(--error-bg); color: var(--error); border-color: #FECACA; }
.btn--danger:hover { background: #FEE2E2; }

.btn--small { font-size: 13px; padding: 8px 14px; border-radius: 10px; }
.btn--block { width: 100%; }

.btn--link {
    background: none; border: 0; padding: 0; color: var(--info);
    font-weight: 700; cursor: pointer; text-decoration: underline;
    text-underline-offset: 3px; font-size: 14px; font-family: inherit;
}

.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 16px; height: 16px;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: astra-spin .7s linear infinite;
    color: #000;
}
.btn--dark.is-loading::after, .btn--outline-dark.is-loading::after { color: #fff; }
@keyframes astra-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --------------------------------------------------------------------------
   Cards, stats, tables
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}
.card__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card__body { padding: 22px 24px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 22px; }
.grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--two    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--main   { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 22px 24px;
    box-shadow: var(--shadow-card);
    display: block; text-decoration: none; color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.stat__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
/* The label, value and hint always stack, whether or not the card has an
   icon row wrapping them. */
.stat__label { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.stat__head .stat__label { display: inline; }
.stat__icon {
    width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; background: var(--surface-muted);
}
.stat__value { display: block; font-size: 36px; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; }
.stat__value--success { color: var(--success); }
.stat__value--warning { color: var(--warning); }
.stat__hint { display: block; color: var(--text-secondary); font-size: 13.5px; margin-top: 8px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
table.data th, table.data td { padding: 15px 24px; text-align: left; vertical-align: middle; }
table.data thead th {
    font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data tbody tr + tr td { border-top: 1px solid var(--border); }
table.data tbody tr:hover { background: #FAFAF7; }
table.data td.right, table.data th.right { text-align: right; }

.cell-primary { font-weight: 700; }
.cell-secondary { color: var(--text-secondary); font-size: 13.5px; }

.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; font-weight: 800; font-size: 14px;
    background: #FEF3C7; color: #78350F;
}
.avatar--small { width: 30px; height: 30px; font-size: 11.5px; border-radius: 9px; }
.identity { display: flex; align-items: center; gap: 12px; min-width: 0; }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
    background: var(--surface-muted); color: var(--text-secondary);
    border: 1px solid var(--border);
}
.badge--info    { background: var(--info-bg);    color: var(--info);    border-color: #BFDBFE; }
.badge--success { background: var(--success-bg); color: var(--success); border-color: #A7F3D0; }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: #FDE68A; }
.badge--error   { background: var(--error-bg);   color: var(--error);   border-color: #FECACA; }
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

.empty {
    text-align: center; padding: 52px 24px; color: var(--text-secondary);
}
.empty__title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty__actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { margin-bottom: 18px; }
.field__label {
    display: block; font-size: 13.5px; font-weight: 700;
    margin-bottom: 7px; color: var(--text);
}
.field__hint { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }
.field__error { font-size: 12.5px; color: var(--error); margin-top: 6px; font-weight: 600; }

.input, .select, .textarea {
    width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-field); padding: 11px 14px;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--astra-yellow);
    box-shadow: 0 0 0 3px rgba(255, 220, 0, .35);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
    border-color: var(--error);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234B5563' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}

.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--astra-yellow); flex: 0 0 auto; }

.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }

.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

.search {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px 6px 4px 18px;
    min-width: 260px; flex: 1 1 320px; max-width: 560px;
}
.search input {
    border: 0; background: none; flex: 1 1 auto; font-family: inherit;
    font-size: 15px; padding: 9px 0; color: var(--text); min-width: 0;
}
.search input:focus { outline: none; }
.search svg { flex: 0 0 auto; color: var(--text-secondary); }

fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 700; font-size: 15px; padding: 0 0 10px; }

details.expandable > summary {
    cursor: pointer; font-weight: 700; font-size: 14.5px;
    padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px;
    color: var(--text);
}
details.expandable > summary::-webkit-details-marker { display: none; }
details.expandable > summary::before {
    content: "▸"; color: var(--text-secondary); transition: transform .15s ease;
}
details.expandable[open] > summary::before { transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */

.filters {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 14px 16px;
    box-shadow: var(--shadow-card); margin-bottom: 22px;
}
.filters__row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filters__row .select { width: auto; min-width: 165px; flex: 0 1 auto; border-radius: 999px; }
.filters__advanced { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.filters__active { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

/* --------------------------------------------------------------------------
   Kanban board
   -------------------------------------------------------------------------- */

.board {
    display: flex; gap: 20px; align-items: flex-start;
    overflow-x: auto; padding-bottom: 18px;
    scroll-snap-type: x proximity;
}
.board__column {
    flex: 0 0 320px; width: 320px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px; scroll-snap-align: start;
}
.board__column.is-drop-target {
    border-color: var(--astra-yellow);
    box-shadow: 0 0 0 3px rgba(255, 220, 0, .35);
}
.board__column-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
}
.board__column-title { font-size: 16px; font-weight: 700; flex: 1 1 auto; }
.board__column-count {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; min-width: 30px; padding: 2px 9px;
    text-align: center; font-size: 13px; font-weight: 700;
}
.board__cards { display: flex; flex-direction: column; gap: 12px; min-height: 90px; }

.board__placeholder {
    border: 2px dashed var(--border-strong); border-radius: 14px;
    padding: 30px 16px; text-align: center;
    color: var(--text-secondary); font-size: 13.5px;
}

.lead-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 15px; padding: 14px; box-shadow: var(--shadow-card);
}
.lead-card:focus-within { border-color: var(--border-strong); }
.lead-card[draggable="true"] { cursor: grab; }
.lead-card.is-dragging { opacity: .45; }
.lead-card.is-saving { opacity: .6; pointer-events: none; }
.lead-card__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lead-card__title {
    font-weight: 700; font-size: 15px; text-decoration: none; color: var(--text);
    overflow-wrap: anywhere;
}
.lead-card__title:hover { text-decoration: underline; }
.lead-card__meta { color: var(--text-secondary); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.lead-card__excerpt { color: var(--text-secondary); font-size: 13px; margin-top: 10px; }
.lead-card__foot {
    display: flex; align-items: center; gap: 10px; justify-content: space-between;
    border-top: 1px solid var(--border); margin-top: 12px; padding-top: 11px;
}
.lead-card__owner { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); min-width: 0; }
.lead-card__actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.stage-menu { position: relative; }
.stage-menu__list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-raised);
    min-width: 216px; padding: 6px; list-style: none; margin: 0;
}
.stage-menu__list[hidden] { display: none; }
.stage-menu__item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    background: none; border: 0; font-family: inherit; font-size: 14px;
    padding: 9px 11px; border-radius: 9px; cursor: pointer; text-align: left;
    color: var(--text);
}
.stage-menu__item:hover { background: var(--surface-muted); }
.stage-menu__item[aria-current="true"] { font-weight: 700; }

/* --------------------------------------------------------------------------
   Pipeline overview
   -------------------------------------------------------------------------- */

.pipeline-row { padding: 14px 0; }
.pipeline-row + .pipeline-row { border-top: 1px solid var(--border); }
.pipeline-row__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pipeline-row__name { font-size: 16px; font-weight: 700; text-decoration: none; color: var(--text); }
.pipeline-row__name:hover { text-decoration: underline; }
.pipeline-row__count { color: var(--text-secondary); font-size: 14px; }
.pipeline-row__bar { height: 8px; border-radius: 999px; background: var(--surface-muted); margin-top: 9px; overflow: hidden; }
.pipeline-row__fill { height: 100%; border-radius: 999px; background: var(--astra-yellow); min-width: 2px; }

/* --------------------------------------------------------------------------
   Greeting panel
   -------------------------------------------------------------------------- */

.greeting {
    background: var(--astra-dark); color: #fff;
    border-radius: var(--radius-card); padding: 30px 34px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; flex-wrap: wrap; margin-bottom: 24px;
}
.greeting__date { color: var(--astra-yellow); font-weight: 700; font-size: 14.5px; }
.greeting h2 { font-size: 32px; margin: 8px 0 6px; color: #fff; }
.greeting p { color: var(--text-muted-dark); margin: 0; }

/* --------------------------------------------------------------------------
   Detail pages
   -------------------------------------------------------------------------- */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }

.definition { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px 18px; font-size: 14.5px; }
.definition dt { color: var(--text-secondary); font-weight: 600; }
.definition dd { margin: 0; overflow-wrap: anywhere; }

.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.note { padding: 16px 0; }
.note + .note { border-top: 1px solid var(--border); }
.note__head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.note__author { font-weight: 700; font-size: 14px; }
.note__time { color: var(--text-secondary); font-size: 12.5px; }
.note__body { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note__actions { display: flex; gap: 10px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; padding: 13px 0; }
.timeline li + li { border-top: 1px solid var(--border); }
.timeline__dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--astra-yellow);
    margin-top: 7px; flex: 0 0 auto;
}
.timeline__text { font-size: 14px; }
.timeline__meta { color: var(--text-secondary); font-size: 12.5px; margin-top: 3px; }

.task { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; }
.task + .task { border-top: 1px solid var(--border); }
.task__body { flex: 1 1 auto; min-width: 0; }
.task__title { font-weight: 700; font-size: 14.5px; }
.task__meta { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.task--done .task__title { text-decoration: line-through; color: var(--text-secondary); }
.task__actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

dialog.modal {
    border: 0; padding: 0; background: transparent;
    max-width: 100%; max-height: 100%;
}
dialog.modal::backdrop { background: rgba(17, 24, 39, .55); }

.modal__panel {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    width: min(640px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.modal__panel--wide { width: min(880px, calc(100vw - 32px)); }

.modal__head {
    padding: 22px 26px 16px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    flex: 0 0 auto;
}
.modal__eyebrow {
    color: var(--warning); font-size: 12px; font-weight: 800;
    letter-spacing: .14em; text-transform: uppercase;
}
.modal__title { font-size: 24px; font-weight: 800; margin-top: 4px; }
.modal__subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }
.modal__close {
    background: none; border: 0; cursor: pointer; padding: 6px;
    color: var(--text-secondary); border-radius: 8px; line-height: 0;
    flex: 0 0 auto;
}
.modal__close:hover { background: var(--surface-muted); color: var(--text); }

.modal__body { padding: 6px 26px 22px; overflow-y: auto; flex: 1 1 auto; }
.modal__foot {
    padding: 18px 26px; background: #FFFDF2;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: flex-end; gap: 14px;
    flex: 0 0 auto; flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Toasts and alerts
   -------------------------------------------------------------------------- */

.toasts {
    position: fixed; right: 20px; bottom: 20px; z-index: 300;
    display: flex; flex-direction: column; gap: 10px;
    width: min(400px, calc(100vw - 40px));
}
.toast {
    background: var(--surface); border: 1px solid var(--border);
    border-left: 5px solid var(--info);
    border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-raised);
    font-size: 14px; display: flex; gap: 12px; align-items: flex-start;
}
.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--error   { border-left-color: var(--error); }
.toast__text { flex: 1 1 auto; }
.toast__close { background: none; border: 0; cursor: pointer; color: var(--text-secondary); padding: 0 2px; font-size: 18px; line-height: 1; }

.alert {
    border-radius: 14px; padding: 15px 18px; font-size: 14.5px;
    border: 1px solid var(--border); background: var(--surface-muted);
    margin-bottom: 20px;
}
.alert--info    { background: var(--info-bg);    border-color: #BFDBFE; color: #1E3A8A; }
.alert--success { background: var(--success-bg); border-color: #A7F3D0; color: #065F46; }
.alert--warning { background: var(--warning-bg); border-color: #FDE68A; color: #78350F; }
.alert--error   { background: var(--error-bg);   border-color: #FECACA; color: #7F1D1D; }
.alert__title { font-weight: 700; margin-bottom: 5px; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 16px 24px; border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pagination__info { color: var(--text-secondary); font-size: 13.5px; }
.pagination__links { display: flex; gap: 8px; align-items: center; }

/* --------------------------------------------------------------------------
   Guest pages (login, setup, invitation)
   -------------------------------------------------------------------------- */

.guest {
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    padding: 56px 20px 64px;
    position: relative; overflow-x: hidden;
}
.guest::before {
    content: ""; position: absolute; left: -180px; top: -220px;
    width: 620px; height: 620px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 220, 0, .55) 0%, rgba(255, 220, 0, 0) 68%);
    pointer-events: none;
}
.guest__inner { position: relative; width: 100%; max-width: 560px; }

.guest__brand {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-bottom: 30px; text-decoration: none;
}
.guest__logo { width: 68px; height: 68px; border-radius: 14px; object-fit: contain; background: var(--astra-yellow); }
.guest__wordmark { text-align: left; display: block; }
.guest__title {
    display: block;
    color: #EAB308; font-size: 26px; font-weight: 800; letter-spacing: .12em; line-height: 1;
}
.guest__descriptor {
    display: block;
    color: var(--text-secondary); font-size: 13px; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase; margin-top: 5px;
}

.guest__card {
    background: var(--astra-dark); color: #fff;
    border-radius: 24px; padding: 38px 40px 34px;
    box-shadow: 0 20px 50px rgba(17, 24, 39, .18);
}
.guest__card h1 { color: #fff; font-size: 31px; }
.guest__lede { color: #9CA3AF; margin: 10px 0 26px; font-size: 15px; }

.guest__card .field__label { color: #fff; }
.guest__card .input {
    background: var(--astra-dark-field); border-color: #3F3F46; color: #fff;
    padding: 13px 15px; font-size: 15.5px; border-radius: 13px;
}
.guest__card .input::placeholder { color: #8A8A8A; }
.guest__card .input:focus { border-color: var(--astra-yellow); box-shadow: 0 0 0 3px rgba(255, 220, 0, .28); }
.guest__card .field__hint { color: #9CA3AF; }
.guest__card .field__error { color: #FCA5A5; }
.guest__card .checkbox { color: #E5E7EB; }
.guest__card .select, .guest__card .textarea {
    background: var(--astra-dark-field); border-color: #3F3F46; color: #fff; border-radius: 13px;
}

.field__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field__link { color: var(--astra-yellow); font-size: 13.5px; font-weight: 700; text-decoration: none; }
.field__link:hover { text-decoration: underline; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 74px; }
.password-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: #9CA3AF; font-family: inherit;
    font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 7px 9px; border-radius: 8px;
}
.password-toggle:hover { color: #fff; background: rgba(255,255,255,.08); }

.guest__foot { text-align: center; color: #9CA3AF; margin-top: 24px; font-size: 14.5px; }
.guest__foot a { color: var(--astra-yellow); font-weight: 700; text-decoration: none; }
.guest__foot a:hover { text-decoration: underline; }

.guest__note {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 20px 22px; margin-top: 22px;
    font-size: 14.5px; color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.stack   { display: flex; flex-direction: column; }
.stack-8  > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-22 > * + * { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.scroll-y { max-height: 420px; overflow-y: auto; }

.code-block {
    background: var(--surface-muted); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px; font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap; overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1400px) {
    :root { --sidebar-width: 272px; }
    .sidebar__logo, .sidebar__logo-fallback { width: 48px; height: 48px; }
    .sidebar__title { font-size: 17px; }
}

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

@media (max-width: 1023px) {
    .app { display: block; }

    .topbar-mobile {
        display: flex; align-items: center; gap: 12px;
        background: var(--astra-dark); color: #fff;
        padding: 12px 16px; position: sticky; top: 0; z-index: 60;
    }
    .topbar-mobile__logo { width: 36px; height: 36px; border-radius: 9px; background: var(--astra-yellow); object-fit: contain; }
    .topbar-mobile__title { color: var(--astra-yellow); font-weight: 800; letter-spacing: .08em; font-size: 16px; }
    .menu-button {
        background: rgba(255,255,255,.10); border: 0; color: #fff;
        width: 42px; height: 42px; border-radius: 11px; cursor: pointer;
        display: grid; place-items: center; flex: 0 0 auto;
    }

    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 90;
        width: min(320px, 86vw); flex-basis: auto;
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-modal);
    }
    .sidebar.is-open { transform: none; }
    .sidebar__close {
        display: grid; place-items: center;
        position: absolute; right: 12px; top: 12px; z-index: 2;
        width: 38px; height: 38px; border-radius: 10px;
        background: rgba(255,255,255,.12); border: 0; color: #fff; cursor: pointer;
    }

    .scrim {
        display: block; position: fixed; inset: 0; z-index: 80;
        background: rgba(17, 24, 39, .5); border: 0; padding: 0;
    }
    .scrim[hidden] { display: none; }

    .page { padding: 24px 20px 48px; }
    .page-strip { padding: 16px 20px; }
}

@media (max-width: 700px) {
    h1 { font-size: 25px; }
    .greeting { padding: 24px 22px; }
    .greeting h2 { font-size: 25px; }
    .grid--stats, .grid--three, .grid--two { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .form-grid--three { grid-template-columns: minmax(0, 1fr); }
    .definition { grid-template-columns: minmax(0, 1fr); gap: 3px; }
    .definition dt { margin-top: 12px; }
    .definition dt:first-child { margin-top: 0; }
    .search { max-width: none; flex-basis: 100%; }
    .filters__row .select { flex: 1 1 100%; min-width: 0; width: 100%; }
    .page-head__tools { width: 100%; }
    .page-head__tools > * { flex: 1 1 auto; }
    .modal__head, .modal__body, .modal__foot { padding-left: 18px; padding-right: 18px; }
    .guest { padding: 32px 16px 48px; }
    .guest__card { padding: 28px 22px 26px; border-radius: 20px; }
    .guest__card h1 { font-size: 26px; }
    .board__column { flex-basis: 84vw; width: 84vw; }
    .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
    table.data th, table.data td { padding: 13px 16px; }
}

/* Mobile list alternative to the Kanban board */
.board-list { display: none; }
@media (max-width: 700px) {
    .board.is-mobile-hidden { display: none; }
    .board-list.is-mobile-shown { display: block; }
}

@media print {
    .sidebar, .topbar-mobile, .page-head__tools, .btn { display: none !important; }
    .page { padding: 0; }
}
