/* ================================================================
   Flora.UI — App Layout (Carbon theme)
   ================================================================ */

/* ── Root layout ───────────────────────────────────────────────── */
.flora-layout,
.adm-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--flora-bg);
    color: var(--flora-text-hi);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ── Main area ─────────────────────────────────────────────────── */
.flora-layout__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── AppBar ────────────────────────────────────────────────────── */
.flora-appbar {
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--flora-surface);
    border-bottom: 1px solid var(--flora-border);
    gap: 12px;
}
.flora-appbar__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.flora-appbar__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--flora-text-hi);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.flora-appbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Company button ────────────────────────────────────────────── */
.flora-company-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--flora-border);
    background: var(--flora-surface-2);
    color: var(--flora-text-mid);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.flora-company-btn:hover {
    border-color: var(--flora-accent);
    color: var(--flora-accent);
    background: var(--flora-accent-dim);
}

/* ── Content ───────────────────────────────────────────────────── */
.flora-layout__content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

/* ── Loading ───────────────────────────────────────────────────── */
.flora-layout__loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60vh;
}
.flora-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--flora-border);
    border-top-color: var(--flora-accent);
    border-radius: 50%;
    animation: flora-spin 0.7s linear infinite;
}
@keyframes flora-spin { to { transform: rotate(360deg); } }

/* ── User chip in nav footer ───────────────────────────────────── */
.flora-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.flora-user-chip:hover { background: var(--flora-surface-2); }
.flora-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--flora-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.flora-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.flora-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--flora-text-hi);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.flora-user-company {
    font-size: 10px;
    color: var(--flora-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Overlay ───────────────────────────────────────────────────── */
.flora-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
    animation: flora-fade-in 0.15s ease;
}

/* ── Right drawer ──────────────────────────────────────────────── */
.flora-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 300px;
    background: var(--flora-surface);
    border-left: 1px solid var(--flora-border);
    z-index: 51;
    display: flex;
    flex-direction: column;
    animation: flora-slide-drawer 0.2s cubic-bezier(0.4,0,0.2,1);
}
.flora-drawer--right { right: 0; }

@keyframes flora-slide-drawer {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.flora-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--flora-border);
    font-size: 14px;
    font-weight: 700;
    color: var(--flora-text-hi);
    flex-shrink: 0;
}
.flora-drawer__search {
    padding: 12px 16px 8px;
    flex-shrink: 0;
}
.flora-drawer__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.flora-drawer__footer {
    padding: 12px 16px;
    border-top: 1px solid var(--flora-border);
    flex-shrink: 0;
}

/* ── Company list item ─────────────────────────────────────────── */
.flora-company-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.12s;
    text-align: left;
}
.flora-company-item:hover { background: var(--flora-surface-2); }
.flora-company-item.active { background: var(--flora-accent-dim); }

.flora-company-item__avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--flora-surface-2);
    border: 1px solid var(--flora-border);
    color: var(--flora-text-mid);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.flora-company-item.active .flora-company-item__avatar {
    background: var(--flora-accent-dim);
    border-color: var(--flora-accent);
    color: var(--flora-accent);
}
.flora-company-item__info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.flora-company-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--flora-text-hi);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.flora-company-item__role {
    font-size: 11px;
    color: var(--flora-text-dim);
}

/* ── Theme toggle in nav ───────────────────────────────────────── */
.flora-theme-toggle {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    flex-shrink: 0;
    justify-content: center;
}
