:root {
    --wt-navy:   #14213d;
    --wt-blue:   #2563eb;
    --wt-bg:     #f6f8fc;
    --wt-border: #e5e7eb;
}

/* ── Base shell ──────────────────────────────────────────── */
body { background: var(--wt-bg); color: #172033; }

.wt-shell { min-height: 100vh; display: flex; }

/* ── Sidebar ─────────────────────────────────────────────── */
.wt-sidebar {
    width: 250px;
    background: var(--wt-navy);
    padding: 1.25rem 1rem;
    color: #fff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.wt-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    display: block;
    margin-bottom: 1.75rem;
    letter-spacing: -.01em;
}
.wt-brand span { color: #93c5fd; }

/* Nav */
.wt-nav { display: flex; flex-direction: column; gap: 2px; }

.wt-nav-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #64748b;
    padding: .9rem .75rem .35rem;
}

.wt-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #cbd5e1;
    padding: .6rem .75rem;
    border-radius: .5rem;
    text-decoration: none;
    font-size: .875rem;
    transition: background .15s, color .15s;
}
.wt-nav-link:hover { background: #263654; color: #fff; }
.wt-nav-link.is-active {
    background: var(--wt-blue);
    color: #fff;
    font-weight: 600;
}
.wt-nav-link .bi { font-size: 1rem; flex-shrink: 0; }

/* Sidebar footer */
.wt-sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid #263654;
    margin-top: .5rem;
}

.wt-user-badge {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.wt-initials {
    width: 32px;
    height: 32px;
    background: var(--wt-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: .02em;
}

.wt-user-info { min-width: 0; }
.wt-user-name {
    font-size: .8rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wt-user-tenant {
    font-size: .7rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Workspace ───────────────────────────────────────────── */
.wt-workspace { min-width: 0; flex: 1; display: flex; flex-direction: column; }

/* ── Topbar ──────────────────────────────────────────────── */
.wt-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--wt-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.wt-topbar-tenant {
    font-size: .9rem;
    color: #64748b;
}

/* Icon-only button (notification bell, etc.) */
.wt-icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    border: none;
    background: none;
}
.wt-icon-btn:hover { background: #f1f5f9; color: #172033; }

/* Avatar / dropdown button */
.wt-avatar-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem .25rem .25rem;
    border: 1px solid var(--wt-border);
    border-radius: 2rem;
    background: #fff;
    color: #172033;
}
.wt-avatar-btn:hover { background: #f1f5f9; }
.wt-avatar-btn::after { margin-left: .15rem; }

.wt-avatar {
    width: 30px;
    height: 30px;
    background: var(--wt-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .02em;
    flex-shrink: 0;
}

.wt-topbar-name { font-size: .875rem; font-weight: 500; }

/* User dropdown */
.wt-user-dropdown { min-width: 220px; }

.wt-dropdown-header {
    padding: .6rem 1rem;
    line-height: 1.35;
}

/* ── Main content area ───────────────────────────────────── */
.wt-main { padding: 2rem; flex: 1; }

.wt-page-header { margin-bottom: 1.5rem; }
.wt-page-header h1 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.wt-page-header p  { color: #64748b; margin: .25rem 0 0; }

/* ── Auth pages ──────────────────────────────────────────── */
.wt-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}
.wt-auth > div { max-width: 460px; width: 100%; }

/* ── Sidebar overlay (mobile) ────────────────────────────── */
.wt-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1039;
}
.wt-sidebar-overlay.is-visible { display: block; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
    .wt-sidebar {
        display: none;
        position: fixed;
        z-index: 1040;
        inset: 0 30% 0 0;
        height: 100%;
        overflow-y: auto;
    }
    .wt-sidebar.is-open { display: flex; }
    .wt-main { padding: 1.25rem; }
    .wt-topbar { padding: 0 1rem; }
}

/* ── Dashboard KPI cards ─────────────────────────────────── */
.wt-kpi-card {
    border: 1px solid var(--wt-border);
    border-radius: .75rem;
    transition: box-shadow .15s, border-color .15s;
    color: inherit;
}
.wt-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border-color: #c7d2fe;
}
.wt-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: .6rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.wt-kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    color: #172033;
}
.wt-kpi-label {
    font-size: .75rem;
    color: #64748b;
    margin-top: .15rem;
}
