/* Clinic topbar: brand, tenant, clock, user */

.fi-topbar {
    min-height: 3.85rem;
    gap: 0.85rem;
    padding-block: 0.45rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.dark .fi-topbar {
    background: #111827;
    border-bottom-color: #1f2937;
}

.fi-topbar-start {
    align-items: center;
    gap: 0.75rem;
}

.fi-logo {
    height: auto !important;
    max-height: none;
}

.am-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    line-height: 1.15;
}

.am-mark {
    display: inline-flex;
    height: 2.35rem;
    width: 2.35rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    box-shadow: 0 6px 14px rgba(15, 118, 110, 0.28);
}

.am-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.am-brand-name {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #0f172a;
}

.am-brand-tagline {
    margin-top: 0.12rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: #0f766e;
    white-space: nowrap;
}

.dark .am-brand-name {
    color: #f8fafc;
}

.dark .am-brand-tagline {
    color: #5eead4;
}

.am-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-inline-end: 0.35rem;
}

.am-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 16rem;
    padding: 0.28rem 0.7rem 0.28rem 0.45rem;
    border-radius: 0.75rem;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    color: #134e4a;
}

.am-pill--clock {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

.am-pill--user {
    background: #ecfeff;
    border-color: #a5f3fc;
    color: #155e75;
}

.am-pill--ip {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
    font-variant-numeric: tabular-nums;
}

.am-pill--lang {
    position: relative;
    padding: 0;
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
    overflow: visible;
    max-width: none;
}

.am-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.28rem 0.55rem 0.28rem 0.45rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.am-lang-caret {
    width: 0.85rem;
    height: 0.85rem;
    opacity: 0.65;
    flex-shrink: 0;
}

.am-lang-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 60;
    min-width: 11.5rem;
    padding: 0.3rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.am-lang-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.55rem;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.am-lang-option:hover {
    background: #f0fdfa;
    color: #0f766e;
}

.am-lang-option.is-active {
    background: #ccfbf1;
    color: #115e59;
}

.am-lang-code {
    display: inline-flex;
    width: 1.85rem;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #0f766e;
}

[x-cloak] {
    display: none !important;
}

.dark .am-pill {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(45, 212, 191, 0.25);
    color: #99f6e4;
}

.dark .am-pill--clock,
.dark .am-pill--user,
.dark .am-pill--lang {
    background: rgba(15, 23, 42, 0.55);
    border-color: #334155;
    color: #e2e8f0;
}

.dark .am-lang-menu {
    background: #0f172a;
    border-color: #334155;
}

.dark .am-lang-option {
    color: #e2e8f0;
}

.dark .am-lang-option:hover,
.dark .am-lang-option.is-active {
    background: rgba(20, 184, 166, 0.16);
    color: #99f6e4;
}

.am-pill-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.am-pill-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.am-pill-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
    line-height: 1;
}

.am-pill-value {
    margin-top: 0.12rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1100px) {
    .am-brand-tagline {
        display: none;
    }

    .am-pill-label {
        display: none;
    }

    .am-pill {
        max-width: 11rem;
        padding-block: 0.4rem;
    }

    .am-pill--lang {
        padding-block: 0;
    }

    .am-lang-btn {
        padding-block: 0.4rem;
    }
}

@media (max-width: 820px) {
    .am-pill--clinic,
    .am-pill--user {
        display: none;
    }
}

.fi-sidebar:not(.fi-sidebar-open) .am-brand-text {
    display: none;
}

.fi-sidebar .am-brand {
    padding-inline: 0.15rem;
}
