/* ============================================================
   Secretary — Component styling
   Nav active state, section labels, PageHeader, ProfileMenu.
   ============================================================ */

/* -----------------------------
   NavMenu refinements
   ----------------------------- */
fluent-nav-menu {
    background: transparent !important;
    --nav-menu-collapsed-width: var(--sidebar-width-collapsed);
}

/* Section labels above grouped nav items */
.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
    padding: var(--space-4) var(--space-3) var(--space-1);
    user-select: none;
}

.app-sidebar.is-collapsed .nav-section-label {
    display: none;
}

/* Nav links — calm, rounded, accent only on active */
fluent-nav-link {
    border-radius: 8px;
    margin: 2px var(--space-2);
    transition: background-color 120ms ease;
}

fluent-nav-link:hover {
    background: var(--neutral-layer-3);
}

fluent-nav-link[aria-current="page"],
fluent-nav-link.active {
    background: var(--brand-tint);
    color: var(--accent-foreground-rest);
}

fluent-nav-link[aria-current="page"] fluent-icon,
fluent-nav-link.active fluent-icon,
fluent-nav-link[aria-current="page"] svg,
fluent-nav-link.active svg {
    color: var(--accent-fill-rest);
    fill: var(--accent-fill-rest);
}

/* Group headers */
fluent-nav-group {
    margin-top: var(--space-2);
}

fluent-nav-group::part(expander) {
    border-radius: 8px;
    margin: 2px var(--space-2);
}

/* -----------------------------
   PageHeader
   ----------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin: 0 0 var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

.page-header__main {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1 1 auto;
    min-width: 0;
}

.page-header__titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.page-header__title {
    font-size: 20px !important;
    line-height: 26px !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.page-header__subtitle {
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    line-height: 18px;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* -----------------------------
   ProfileMenu — sidebar-footer placement
   ----------------------------- */
.sidebar-profile-menu {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-profile-menu fluent-profile-menu {
    width: 100%;
}

.app-sidebar.is-collapsed .sidebar-profile-menu fluent-profile-menu::part(header),
.app-sidebar.is-collapsed .sidebar-profile-menu fluent-profile-menu::part(footer-link) {
    display: none;
}

/* Fluent's anchored-region auto-centers the popover horizontally on the
   anchor — but the avatar sits in the bottom-left corner, so the popover
   clips off-screen. Pin it to start near the sidebar's left edge and pop
   above the anchor instead. */
.sidebar-profile-menu fluent-anchored-region {
    left: 8px !important;
    right: auto !important;
    transform: translateY(calc(-100% - 8px)) !important;
}

/* The profile-menu popover's header puts an "Abmelden" pill button at the
   right edge — give the popover enough room so the button doesn't clip. */
.sidebar-profile-menu fluent-anchored-region fluent-card {
    min-width: 360px;
}

/* -----------------------------
   Theme toggle button
   ----------------------------- */
.theme-toggle {
    --theme-toggle-size: 36px;
    width: var(--theme-toggle-size);
    height: var(--theme-toggle-size);
    border-radius: 8px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--neutral-layer-3);
}

/* -----------------------------
   Card containers — match modern SaaS feel
   ----------------------------- */
.card-container,
.card-container-simple {
    max-width: 1400px;
    width: 100%;
}

/* -----------------------------
   Sidebar collapse trigger
   ----------------------------- */
.sidebar-collapse-toggle {
    margin-left: auto;
}

/* -----------------------------
   StatCard — KPI tile (reusable)
   ----------------------------- */
.stat-card {
    flex: 1 1 0;
    min-width: 160px;
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.stat-card__icon {
    margin-bottom: var(--space-1);
}

.stat-card__value {
    font-size: 24px;
    line-height: 28px;
    font-weight: 600;
    color: var(--accent-fill-rest);
}

.stat-card__label {
    font-size: 13px;
    line-height: 16px;
    color: var(--neutral-foreground-hint);
}

.stat-card-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
    width: 100%;
}

@media (max-width: 1024px) {
    .stat-card-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .stat-card-row {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------
   StatusBadge — consistent status pill (theme-aware)
   ----------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge--neutral { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.status-badge--info    { background: var(--status-info-bg);    color: var(--status-info-fg); }
.status-badge--success { background: var(--status-success-bg); color: var(--status-success-fg); }
.status-badge--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.status-badge--danger  { background: var(--status-danger-bg);  color: var(--status-danger-fg); }

/* -----------------------------
   Text utilities (replace inline color/size)
   ----------------------------- */
.text-hint   { color: var(--neutral-foreground-hint); }
.text-muted  { color: var(--neutral-foreground-disabled); }
.text-sm     { font-size: 12px; line-height: 16px; }
.text-base   { font-size: var(--type-ramp-base-font-size); line-height: var(--type-ramp-base-line-height); }
.text-lg     { font-size: var(--type-ramp-plus-1-font-size); line-height: var(--type-ramp-plus-1-line-height); }

/* -----------------------------
   Plain data table (hand-rolled tables — match the DataGrid look)
   ----------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--type-ramp-base-font-size);
}

.data-table th {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    font-weight: 600;
    color: var(--neutral-foreground-hint);
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.data-table td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

/* -----------------------------
   EmptyState — placeholder for empty lists/grids
   ----------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    color: var(--neutral-foreground-hint);
}

.empty-state__icon {
    color: var(--neutral-foreground-disabled);
    margin-bottom: var(--space-1);
}

.empty-state__icon svg {
    width: 28px;
    height: 28px;
}

.empty-state__title {
    font-size: var(--type-ramp-plus-1-font-size);
    line-height: var(--type-ramp-plus-1-line-height);
    font-weight: 600;
    color: var(--neutral-foreground-rest);
}

.empty-state__message {
    font-size: 13px;
    max-width: 420px;
}

.empty-state__actions {
    margin-top: var(--space-2);
}
