/* ============================================================
   Channel dashboard — shares the WhatsApp Flows Studio design
   system (deep teal + vivid green, soft rounded surfaces).
   Signature: the double-tick read receipt encodes metric health.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

.wad-app {
    --teal: #075e54;
    --teal-700: #0a7163;
    --green: #25d366;
    --green-700: #14a44d;
    --read: #34b7f1;
    --ink: #0c211d;
    --muted: #6b7c79;
    --faint: #9aa8a4;
    --line: #e7edea;
    --line-strong: #d6e0dc;
    --surface: #ffffff;
    --surface-2: #f7faf9;
    --canvas: #eef3f1;
    --danger: #d1453b;
    --amber: #d98a00;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(10, 40, 35, .06), 0 1px 3px rgba(10, 40, 35, .04);
    --shadow-md: 0 4px 14px rgba(10, 40, 35, .08);

    --font-display: "Bricolage Grotesque", system-ui, sans-serif;
    --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

    font-family: var(--font-ui);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1180px;
    margin: 0 auto;
}

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

.wad-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ---------------- Hero ---------------- */
.wad-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-700) 70%, #0c7c6c 100%);
    color: #eafff6;
    box-shadow: var(--shadow-md);
}
/* faint chat-bubble motif, kept very quiet */
.wad-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 50% 50% 50% 4px;
    background: rgba(255, 255, 255, .05);
}
.wad-hero__copy { position: relative; z-index: 1; }
.wad-hero .wad-eyebrow { color: rgba(234, 255, 246, .7); }
.wad-hero__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 30px;
    line-height: 1.1;
    margin: 6px 0 8px;
    color: #fff;
}
.wad-hero__sub {
    margin: 0;
    max-width: 46ch;
    font-size: 14px;
    color: rgba(234, 255, 246, .82);
}
.wad-status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 6px 13px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .14);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
}
.wad-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #cfe9df;
}
.wad-status--scheduled .wad-dot { background: #ffd27a; }
.wad-status--ended .wad-dot { background: #9fb8b1; }

/* ---------------- Grid ---------------- */
.wad-grid {
    display: grid;
    grid-template-columns: 1fr 1.45fr;
    gap: 16px;
}
.wad-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
}
.wad-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

/* ---------------- Reach ---------------- */
.wad-reach { display: flex; flex-direction: column; }
.wad-reach__big {
    margin: 14px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wad-reach__big strong {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 56px;
    line-height: 1;
    color: var(--teal);
    letter-spacing: -.02em;
}
.wad-reach__big span { font-size: 14px; color: var(--muted); }
.wad-reach__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.wad-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--r-pill);
    font-size: 12.5px;
    font-weight: 600;
}
.wad-chip--good { background: rgba(37, 211, 102, .14); color: var(--green-700); }
.wad-chip--delivered { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.wad-chip--attention { background: rgba(217, 138, 0, .12); color: var(--amber); }
.wad-reach__total { font-size: 12.5px; color: var(--faint); }
.wad-reach__note {
    margin: auto 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}

/* ---------------- Conversation funnel ---------------- */
.wad-funnel__hint, .wad-funnel__foot { color: var(--faint); }
.wad-funnel__hint { font-size: 11.5px; }
.wad-bars { display: flex; flex-direction: column; gap: 16px; }
.wad-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.wad-bar__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
}
.wad-bar__value {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
}
.wad-bar__track {
    height: 8px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}
.wad-bar__fill {
    height: 100%;
    border-radius: var(--r-pill);
    transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.wad-bar__fill--teal { background: linear-gradient(90deg, var(--teal-700), var(--teal)); }
.wad-bar__fill--green { background: linear-gradient(90deg, var(--green-700), var(--green)); }
.wad-bar__fill--ink { background: var(--ink); }
.wad-funnel__foot {
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    line-height: 1.5;
}

/* ---------------- Tick (signature) ---------------- */
.wad-tick { width: 22px; height: 13px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wad-tick--read { stroke: var(--read); }
.wad-tick--delivered { stroke: var(--faint); }
.wad-tick--attention { width: 15px; stroke: var(--amber); }

/* ---------------- Live pulse ---------------- */
.wad-pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, .5);
    animation: wad-ping 1.8s ease-out infinite;
}
.wad-pulse--on-teal { background: #6ff0b0; box-shadow: 0 0 0 0 rgba(111, 240, 176, .5); }
@keyframes wad-ping {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .45); }
    70% { box-shadow: 0 0 0 7px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------------- Inventory tiles ---------------- */
.wad-inventory {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}
.wad-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.wad-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
}
.wad-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--teal);
    font-size: 15px;
}
.wad-tile__num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    color: var(--ink);
}
.wad-tile--date .wad-tile__num { font-size: 21px; letter-spacing: -.01em; }
.wad-tile__label { font-size: 13px; color: var(--muted); }

/* Number health tile — status word in place of a number, with a status dot */
.wad-health__num {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 22px;
}
.wad-health__dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex: none;
}
.wad-tile--health-good .wad-health__num { color: var(--green-700); }
.wad-tile--health-good .wad-health__dot { background: var(--green); box-shadow: 0 0 0 4px rgba(37, 211, 102, .16); }
.wad-tile--health-attention .wad-health__num { color: var(--amber); }
.wad-tile--health-attention .wad-health__dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(217, 138, 0, .14); }
.wad-tile--health-danger .wad-health__num { color: var(--danger); }
.wad-tile--health-danger .wad-health__dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(209, 69, 59, .14); }
.wad-tile--health .wad-tile__icon { color: var(--teal); }
.wad-tile__go {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 12px;
    color: var(--faint);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
}
a.wad-tile:hover .wad-tile__go { opacity: 1; transform: translateX(2px); }

/* ---------------- Loading / error ---------------- */
.wad-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 40px 24px;
    justify-content: center;
    color: var(--muted);
    font-size: 14px;
}
.wad-typing { display: inline-flex; gap: 4px; }
.wad-typing i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--faint);
    animation: wad-typing 1.4s ease-in-out infinite;
}
.wad-typing i:nth-child(2) { animation-delay: .2s; }
.wad-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes wad-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-5px); opacity: 1; }
}
.wad-error {
    padding: 16px 20px;
    border-radius: var(--r-md);
    background: rgba(209, 69, 59, .08);
    border: 1px solid rgba(209, 69, 59, .2);
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
}

/* ---------------- Insights chart ---------------- */
.wad-insights { margin-top: 18px; }
.wad-insights__hint {
    font-size: 12px;
    color: var(--faint);
    text-transform: lowercase;
    letter-spacing: .01em;
}
.wad-insights__chart {
    position: relative;
    height: 280px;
    margin-top: 14px;
}
.wad-insights__empty {
    margin: 16px 0 4px;
    color: var(--muted);
    font-size: 14px;
}

/* ---------------- Skeleton loading ---------------- */
.wad-skel {
    display: block;
    background: var(--surface-2);
    background-image: linear-gradient(90deg, var(--surface-2) 0%, #eef4f1 40%, #d9ebe3 60%, var(--surface-2) 100%);
    background-size: 220% 100%;
    border-radius: var(--r-sm);
    animation: wad-shimmer 1.25s ease-in-out infinite;
}
.wad-skel-bars {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.wad-skel-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
@keyframes wad-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -120% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .wad-skel { animation: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .wad-grid { grid-template-columns: 1fr; }
    .wad-inventory { grid-template-columns: 1fr; }
    .wad-hero { flex-direction: column; }
}
@media (max-width: 520px) {
    .wad-inventory { grid-template-columns: 1fr; }
    .wad-reach__big strong { font-size: 46px; }
    .wad-hero__title { font-size: 24px; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
    .wad-pulse, .wad-typing i { animation: none; }
    .wad-bar__fill, .wad-tile, .wad-tile__go { transition: none; }
}
