/* =====================================================
   Methadone Dispenser Portal — Light Clinical Theme
   Light gray background + subtle lavender header/footer
   Orange accent for controls
   Small radius, rounded pill nav buttons
   Sidebar bottom section pinned (Session + Message)
   Footer pinned to bottom when content is short
   ===================================================== */

:root {
    /* Backgrounds */
    --bg: #f3f4f6;
    --bg-soft: #eff1f7;

    --surface: #ffffff;
    --surface-soft: #f7f7fb;

    /* Text */
    --text: #111827;
    --muted: #6b7280;

    /* Borders & shadows */
    --border: rgba(17, 24, 39, .10);
    --border-soft: rgba(17, 24, 39, .06);
    --shadow: 0 12px 22px rgba(17, 24, 39, .08);
    --shadow-soft: 0 7px 14px rgba(17, 24, 39, .06);

    /* Lavender (SUBTLE) */
    --lav-ink: #4c1d95;
    --lav-bg1: rgba(124, 58, 237, .10);
    --lav-bg2: rgba(167, 139, 250, .12);
    --lav-border: rgba(124, 58, 237, .16);

    /* Orange accent (dispenser control) */
    --orange: #f97316;
    --orange-tint: rgba(249, 115, 22, .10);
    --orange-border: rgba(249, 115, 22, .22);

    /* Layout */
    --radius: 10px;
    /* smaller corners everywhere */
    --radius-sm: 8px;
    --topbar-h: 72px;
    --sidebar-w: 300px;
    --gap: 16px;
    --pad: 16px;

    /* Fonts */
    --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(1100px 600px at 12% -10%, rgba(167, 139, 250, .10), transparent 60%),
        radial-gradient(900px 600px at 110% 0%, rgba(249, 115, 22, .06), transparent 60%),
        linear-gradient(180deg, var(--bg), var(--bg-soft));
}

a {
    color: inherit;
    text-decoration: none;
}

.mono {
    font-family: var(--mono);
}

.muted {
    color: var(--muted);
}

/* =====================================================
   TOPBAR (Lavender hue like footer)
   ===================================================== */

.topbar {
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;

    background: linear-gradient(90deg, var(--lav-bg1), var(--lav-bg2));
    border-bottom: 1px solid var(--lav-border);
    color: var(--lav-ink);

    box-shadow: var(--shadow-soft);
}

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

.logo {
    width: 36px;
    height: 36px;
    display: block;
}

.brand-title {
    font-weight: 950;
    letter-spacing: .2px;
    line-height: 1.1;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: rgba(76, 29, 149, .75);
}

.topbar-right {
    display: flex;
    vertical-align: middle;
    align-items: center;
    gap: 12px;
}

.chip {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .65);
    border: 1px solid rgba(124, 58, 237, .14);
    font-size: 12px;
    color: rgba(76, 29, 149, .85);
}

/* =====================================================
   APP LAYOUT
   ===================================================== */

.app {
    height: calc(100vh - var(--topbar-h));
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: var(--gap);
    padding: var(--pad);
}

/* =====================================================
   SIDEBAR — compact clinical layout
   ===================================================== */

.sidebar {
    height: 100%;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* single padded scroll area */
.sidebar-inner {
    flex: 1;
    overflow: auto;
    padding: 14px;
    /* real padding */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* NAV */
.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* tighter */
}

/* =====================================================
   NAV ITEMS — light lavender system
   ===================================================== */

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 12px;
    border-radius: 10px;

    background: rgba(124, 58, 237, .06);
    /* very light lavender */
    border: 1px solid rgba(124, 58, 237, .10);

    font-weight: 800;
    font-size: 13px;
    color: var(--lav-ink);

    transition: 150ms ease;
}

/* Hover — slightly darker */
.nav-item:hover {
    background: rgba(124, 58, 237, .12);
    border-color: rgba(124, 58, 237, .18);
}

/* Active — darker still */
.nav-item.active {
    background: rgba(124, 58, 237, .18);
    border-color: rgba(124, 58, 237, .26);
    color: var(--lav-ink);
}

/* Optional subtle orange indicator dot */
.nav-item.active::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--orange);
}

/* Bottom dock section pinned */
.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
}

/* Session card: compact */
.sidebar-card {
    padding: 12px;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
}

.sidebar-card-title {
    font-weight: 950;
    font-size: 12px;
    letter-spacing: .2px;
    margin-bottom: 8px;
    color: var(--muted);
    text-transform: uppercase;
}

.sidebar-kv {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-kv-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.sidebar-k {
    font-size: 12px;
    color: var(--muted);
}

.sidebar-v {
    font-size: 12px;
    font-family: var(--mono);
    color: var(--text);
    text-align: right;
    word-break: break-word;
}

/* Message: smaller + calmer */
.sidebar-note {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(249, 115, 22, .08);
    border: 1px solid rgba(249, 115, 22, .18);
    color: #7c2d12;
    font-size: 12px;
    line-height: 1.35;
}

/* =====================================================
   CONTENT (footer pinned)
   ===================================================== */

.content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: auto;

    /* readable */
    max-width: 1200px;
}

/* =====================================================
   HERO / CARDS
   ===================================================== */

.hero {
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .08);
    border: 1px solid rgba(124, 58, 237, .14);
    color: var(--lav-ink);
}

.hero-title {
    margin-top: 10px;
    font-size: 20px;
    font-weight: 950;
    letter-spacing: .2px;
}

.hero-subtitle {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.card {
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.card-title {
    font-weight: 950;
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 20px;
    font-weight: 950;
}

.kpi-label {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 12px;
    border-radius: 999px;

    border: 1px solid rgba(124, 58, 237, .18);
    background: linear-gradient(135deg, rgba(124, 58, 237, .90), rgba(167, 139, 250, .78));
    color: white;

    font-weight: 900;
    box-shadow: var(--shadow-soft);

    cursor: pointer;
    user-select: none;
    transition: 140ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0px);
}

.btn.secondary {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--border-soft);
    box-shadow: none;
}

.btn.orange {
    border-color: rgba(249, 115, 22, .22);
    background: linear-gradient(135deg, rgba(249, 115, 22, .92), rgba(251, 146, 60, .82));
}

/* =====================================================
   FOOTER (Lavender hue like header) pinned to bottom
   ===================================================== */

.footer {
    margin-top: auto;

    padding: 12px 14px;
    border-radius: var(--radius);

    background: linear-gradient(90deg, var(--lav-bg1), var(--lav-bg2));
    border: 1px solid var(--lav-border);
    color: var(--lav-ink);

    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;

    box-shadow: var(--shadow-soft);
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 1024px) {
    .app {
        grid-template-columns: 1fr;
        height: auto;
    }

    .sidebar {
        height: auto;
    }

    .content {
        height: auto;
    }

    .content-inner {
        max-width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   ABOUT PAGE BUTTONS (match sidebar style)
   ===================================================== */

.about-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    /* center horizontally */
    gap: 14px;
}

.about-btn {
    padding: 10px 18px;
    /* slightly narrower */
    border-radius: 10px;
    /* same small radius */
    background: rgba(124, 58, 237, .08);
    /* same light lavender */
    border: 1px solid rgba(124, 58, 237, .16);
    color: var(--lav-ink);
    font-weight: 800;
    font-size: 13px;

    min-width: 160px;
    /* prevents full width */
    text-align: center;

    transition: 150ms ease;
}

.about-btn:hover {
    background: rgba(124, 58, 237, .14);
    border-color: rgba(124, 58, 237, .24);
    transform: translateY(-1px);
}


/* =====================================================
   CONTACT HIGHLIGHT CARDS
   ===================================================== */

.contact-highlight {
    background: var(--surface);
    border: 1px solid var(--border);
}

.contact-link-strong {
    font-weight: 950;
    font-size: 16px;
    color: var(--lav-ink);
    text-decoration: none;
    transition: 150ms ease;
}

.contact-link-strong:hover {
    color: rgba(76, 29, 149, .85);
}


/* =====================================================
   FOOTER COPYRIGHT STYLE
   ===================================================== */

.footer-copy {
    font-size: 12px;
    /* smaller text */
    color: rgba(124, 58, 237, .75);
    /* soft lavender */
    font-weight: 600;
}