/* Landing page (plan 019 refresh of the plan-006 bootstrap stub). */
.portal-landing {
    max-width: 40rem;
    margin: 4rem auto;
    padding: 0 1.5rem;
    font-family: "Roboto", system-ui, sans-serif;
}

.portal-lead {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}

.portal-cta {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.4rem;
    background: #ffb81c;
    color: #1b1b1b;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

.portal-cta:hover {
    background: #e0a512;
}

/* Minor owner-area overrides layered on top of the MudBlazor theme (plan 018). */
.owner-status-chip {
    text-transform: capitalize;
}

.owner-stale-hint {
    margin-left: 0.5rem;
}

/* Dashboard toolbar: the search field flexes to fill all width left of the
   sort dropdown + view toggle, so the row reads as one uniform bar. */
.tenant-toolbar {
    width: 100%;
}

.tenant-toolbar .tenant-search {
    flex: 1 1 auto !important;
    max-width: none !important;
}

/* Dashboard tenant search — white field so it stands out from the page bg. */
.dashboard-search .mud-input,
.dashboard-search .mud-input-root,
.dashboard-search .mud-input-slot,
.dashboard-search .mud-input.mud-input-outlined {
    background-color: #fff !important;
    border-radius: 4px;
}

/* Accountant dashboard tile state accents (plan 019). */
.tenant-tile {
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tenant-tile:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

.tenant-tile-pending {
    opacity: 0.7;
}

.tenant-tile-failed {
    border-color: var(--mud-palette-error);
}

.tenant-tile-suspended {
    border-color: var(--mud-palette-warning);
}

/* ── DCQMS branding (ERPNext-style dark chrome + amber accent) ───────────── */

/* Logo in the app bar. */
.portal-logo {
    height: 32px;
    width: auto;
    max-height: 32px;
    margin-right: 1.75rem;
    display: block;
}

.portal-appbar-title {
    font-weight: 500;
}

/* Drawer nav: dark background (from the theme) with ERPNext-style pill items —
   light text, subtle hover, amber fill on the active item with dark text. */
.mud-drawer .mud-navmenu {
    padding: 0.5rem 0;
}

.mud-drawer .mud-nav-link {
    color: #e8e8e8;
    border-radius: 6px;
    margin: 2px 8px;
}

.mud-drawer .mud-nav-link .mud-nav-link-icon {
    color: #cfcfcf;
}

.mud-drawer .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.mud-drawer .mud-nav-link.active {
    background-color: #ffb81c !important;
    color: #1b1b1b !important;
    font-weight: 600;
}

.mud-drawer .mud-nav-link.active .mud-nav-link-icon {
    color: #1b1b1b !important;
}

/* Mini (collapsed) rail: hide the labels and centre the icon + active amber pill
   so each item is a centered icon, not a left-aligned shrunk row. */
.mud-drawer--closed .mud-nav-link-text {
    display: none !important;
}

.mud-drawer--closed .mud-nav-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 6px;
    margin-right: 6px;
}

.mud-drawer--closed .mud-nav-link .mud-nav-link-icon {
    margin: 0 !important;
}

/* Drawer footer: collapse toggle + signed-in user pinned to the bottom. */
.drawer-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.drawer-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
}

.drawer-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 8px 10px;
    overflow-x: hidden;
}

/* The menu activator must span the drawer so the long email truncates within it
   instead of forcing a horizontal scrollbar. */
.drawer-user-menu-activator,
.drawer-user-menu-activator .mud-menu-activator {
    width: 100%;
    min-width: 0;
}

.drawer-collapse-btn {
    width: 100%;
    justify-content: flex-start;
    color: #cfcfcf;
    text-transform: none;
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
}

.drawer-user:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.drawer-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow: hidden;
    min-width: 0;
}

.drawer-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.drawer-user-email {
    color: #b0b0b0;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-user-menu {
    min-width: 12rem;
}

/* Mini rail: centre the collapse button + avatar, and stop the default MudButton
   min-width (64px) from overflowing the narrow rail (which caused a scrollbar). */
.mud-drawer--closed .drawer-collapse-btn,
.mud-drawer--closed .drawer-user {
    justify-content: center;
}

.mud-drawer--closed .drawer-collapse-btn {
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* No label in the rail, so drop the icon's trailing margin and flip the arrow to
   point the opposite way ("expand"). */
.mud-drawer--closed .drawer-collapse-btn .mud-button-icon-start {
    margin: 0 !important;
    transform: scaleX(-1);
}

.mud-drawer--closed .drawer-foot {
    overflow-x: hidden;
}

.language-selector {
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
}

.language-selector-icon {
    margin-right: 0.25rem;
}

/* Collapsed disclosure: only the active language shows; clicking reveals the rest. */
.language-menu {
    position: relative;
}

.language-current {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: inherit;
    list-style: none;
    user-select: none;
}

/* Hide the native disclosure triangle (we use our own caret icon). */
.language-current::-webkit-details-marker {
    display: none;
}

.language-current:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.language-current:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 7rem;
    padding: 4px;
    background-color: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 1200;
}

.language-option {
    all: unset;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #e8e8e8;
}

.language-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.language-option:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}
