/* ===========================================================================
   Amyx Pulse — global brand theme
   Palette: purple #663E95, gold #FFBE00, deep purple #340E5D, ink #292929
   Fonts:   Raleway (headings), Open Sans (body)
   =========================================================================== */
:root {
    --amyx-purple: #663E95;
    --amyx-purple-dark: #340E5D;
    --amyx-purple-deep: #2A0B4A;
    --amyx-gold: #FFBE00;
    --amyx-gold-dark: #E0A600;
    --amyx-ink: #292929;
    --amyx-gray: #666666;
    --amyx-line: #e2e0e6;
    --amyx-bg: #f6f5f8;
    --amyx-surface: #ffffff;

    --bs-primary: var(--amyx-purple);
    --bs-link-color: var(--amyx-purple);
    --bs-link-hover-color: var(--amyx-purple-dark);

    --heading-font: "Raleway", "Segoe UI", Tahoma, Arial, sans-serif;
    --body-font: "Open Sans", "Segoe UI", Tahoma, Arial, sans-serif;
}

html, body {
    font-family: var(--body-font);
    color: var(--amyx-ink);
    background-color: var(--amyx-bg);
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: var(--heading-font);
    color: var(--amyx-purple-dark);
    font-weight: 700;
}

a { color: var(--amyx-purple); }
a:hover { color: var(--amyx-purple-dark); }

.focus-ring:focus, a:focus, .btn:focus, .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 62, 149, 0.25);
    border-color: var(--amyx-purple);
}

/* ---- Buttons ---- */
.btn-primary {
    --bs-btn-bg: var(--amyx-purple);
    --bs-btn-border-color: var(--amyx-purple);
    --bs-btn-hover-bg: var(--amyx-purple-dark);
    --bs-btn-hover-border-color: var(--amyx-purple-dark);
    --bs-btn-active-bg: var(--amyx-purple-deep);
    --bs-btn-active-border-color: var(--amyx-purple-deep);
    --bs-btn-disabled-bg: var(--amyx-purple);
    --bs-btn-disabled-border-color: var(--amyx-purple);
}

.btn-outline-primary {
    --bs-btn-color: var(--amyx-purple);
    --bs-btn-border-color: var(--amyx-purple);
    --bs-btn-hover-bg: var(--amyx-purple);
    --bs-btn-hover-border-color: var(--amyx-purple);
    --bs-btn-active-bg: var(--amyx-purple-dark);
}

.btn-gold {
    --bs-btn-color: var(--amyx-ink);
    --bs-btn-bg: var(--amyx-gold);
    --bs-btn-border-color: var(--amyx-gold);
    --bs-btn-hover-color: var(--amyx-ink);
    --bs-btn-hover-bg: var(--amyx-gold-dark);
    --bs-btn-hover-border-color: var(--amyx-gold-dark);
    font-weight: 600;
}

/* ---- Brand wordmark (no external image dependency) ---- */
.brand-wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    font-family: var(--heading-font);
    text-decoration: none;
    line-height: 1;
}
.brand-wordmark .brand-amyx {
    font-weight: 800;
    font-style: italic;
    color: #fff;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 3px;
    background-image: linear-gradient(var(--amyx-gold), var(--amyx-gold));
    background-size: 100% 4px;
    background-position: 0 100%;
    background-repeat: no-repeat;
}
.brand-wordmark .brand-pulse {
    font-weight: 700;
    color: var(--amyx-gold);
    font-size: 1.5rem;
    letter-spacing: .5px;
    /* White EKG heartbeat line behind "Pulse", aligned to the gold line under "Amyx" (4px, flush bottom). */
    padding-bottom: 3px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M0 10 H88 L94 10 L98 12 L103 5 L108 12 L112 9 L118 10 H200' fill='none' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 100% 12px;
}
.brand-tagline {
    color: rgba(255,255,255,.7);
    font-family: var(--body-font);
    font-size: .68rem;
    letter-spacing: .4px;
    text-transform: uppercase;
}

/* ---- Cards / surfaces ---- */
.card { border: 1px solid var(--amyx-line); border-radius: 10px; }
.card .card-header {
    background: var(--amyx-surface);
    border-bottom: 2px solid var(--amyx-gold);
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--amyx-purple-dark);
}
.dash-tile {
    display: block; height: 100%; text-decoration: none; color: inherit;
    border: 1px solid var(--amyx-line); border-radius: 12px; background: var(--amyx-surface);
    padding: 1.25rem 1.25rem 1.1rem; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.dash-tile:hover {
    box-shadow: 0 6px 22px rgba(52,14,93,.12); transform: translateY(-2px);
    border-color: var(--amyx-purple); color: inherit;
}
.dash-tile .tile-title { font-family: var(--heading-font); font-weight: 700; color: var(--amyx-purple-dark); margin: .35rem 0 .25rem; }
.dash-tile .tile-icon { font-size: 1.5rem; }

/* ---- Tables ---- */
.table thead th {
    font-family: var(--heading-font);
    color: var(--amyx-purple-dark);
    border-bottom: 2px solid var(--amyx-gold);
}

/* ---- Badges / status ---- */
.badge-active { background: #1f9d55; }
.badge-inactive { background: var(--amyx-gray); }
.badge-closed { background: #9a3412; }

/* ---- Page heading accent ---- */
.page-title {
    border-left: 5px solid var(--amyx-gold);
    padding-left: .75rem;
    margin-bottom: 1.25rem;
}

/* ---- Identity / forms baseline from template ---- */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.btn-primary.border-0:focus,
.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 62, 149, 0.4);
}

/* ---- Health report (RAG) ---- */
.hr-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0; }
.hr-tile { background: var(--amyx-surface); border: 1px solid var(--amyx-line); border-radius: 10px; padding: 12px 14px; }
.hr-tile .n { font-family: var(--heading-font); font-weight: 800; font-size: 1.7rem; line-height: 1; }
.hr-tile .l { font-size: .68rem; color: var(--amyx-gray); text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; font-weight: 700; }
.hr-tile.red .n { color: #C62828; } .hr-tile.amber .n { color: #B26A00; } .hr-tile.green .n { color: #1E7E45; }
.hr-tile.none .n { color: #6B7280; } .hr-tile.total .n { color: var(--amyx-purple-dark); }

.hr-item { display: flex; gap: 12px; padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--amyx-line); border-left-width: 4px; background: #fff; }
.hr-item .dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.hr-item .name { font-weight: 700; color: var(--amyx-purple-dark); }
.hr-item .txt { font-size: .9rem; color: #33353a; white-space: pre-wrap; }
.hr-item.green { border-left-color: #2E9E5B; } .hr-item.green .dot { background: #2E9E5B; }
.hr-item.amber { border-left-color: #F2A900; background: #FFF6E5; } .hr-item.amber .dot { background: #F2A900; }
.hr-item.red { border-left-color: #C62828; background: #FDECEA; } .hr-item.red .dot { background: #C62828; }
.hr-item.none { border-left-color: #6B7280; background: #eef0f3; } .hr-item.none .dot { background: #6B7280; }

.hr-pill { display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.hr-pill.green { background: #2E9E5B; color: #fff; } .hr-pill.amber { background: #F2A900; color: #3a2b00; }
.hr-pill.red { background: #C62828; color: #fff; } .hr-pill.none { background: #6B7280; color: #fff; }

.hr-grp { font-family: var(--heading-font); font-weight: 700; color: var(--amyx-purple); font-size: .95rem; margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--amyx-line); }
.hr-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--amyx-gray); margin-top: 8px; }
.hr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hr-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

@media (max-width: 820px) { .hr-tiles { grid-template-columns: repeat(3, 1fr); } }
@media print { .no-print { display: none !important; } body { background: #fff; } .card, .hr-item, .hr-tile { break-inside: avoid; } }
