:root {
    --wm-bg: #0f172a;
    --wm-sidebar-bg: #0b1120;
    --wm-card-bg: #1e293b;
    --wm-border: #334155;
    --wm-text: #e2e8f0;
    --wm-text-secondary: #94a3b8;
    --wm-accent: #6366f1;
}

body {
    background-color: var(--wm-bg);
    color: var(--wm-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wm-app {
    display: flex;
    min-height: 100vh;
}

.wm-sidebar {
    width: 250px;
    background: var(--wm-sidebar-bg);
    border-right: 1px solid var(--wm-border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.wm-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.wm-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.wm-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--wm-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.wm-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--wm-text);
}

.wm-sidebar-link.active {
    background: var(--wm-accent);
    color: #fff;
}

.wm-sidebar-footer {
    border-top: 1px solid var(--wm-border);
    padding-top: 1rem;
}

.wm-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wm-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.wm-user-name { font-size: 0.85rem; font-weight: 600; }
.wm-user-role { font-size: 0.75rem; color: var(--wm-text-secondary); text-transform: capitalize; }

.wm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wm-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--wm-border);
    position: relative;
}

.wm-page-title { font-size: 1.25rem; font-weight: 700; margin: 0; }

.wm-topbar-actions { position: relative; }

.btn-icon {
    background: transparent;
    border: 1px solid var(--wm-border);
    color: var(--wm-text);
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
    position: relative;
}

.wm-badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

.wm-notif-panel {
    position: absolute;
    right: 0;
    top: 110%;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 50;
}

.wm-notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--wm-border);
}

.wm-notif-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--wm-border);
    font-size: 0.85rem;
}
.wm-notif-title { font-weight: 600; }
.wm-notif-msg { color: var(--wm-text-secondary); }
.wm-notif-time { color: var(--wm-text-secondary); font-size: 0.75rem; margin-top: 0.25rem; }
.wm-notif-error .wm-notif-title { color: #f87171; }
.wm-notif-warning .wm-notif-title { color: #fbbf24; }

.wm-content {
    padding: 1.5rem;
    flex: 1;
}

.wm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.wm-section-title { font-size: 1.15rem; font-weight: 700; margin: 0; }

.wm-card {
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: 0.75rem;
}

.wm-stat-card {
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: 0.75rem;
    padding: 1rem;
}

.wm-stat-label { font-size: 0.8rem; color: var(--wm-text-secondary); margin-bottom: 0.25rem; }
.wm-stat-value { font-size: 1.6rem; font-weight: 700; }

.wm-status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 4px;
}
.wm-status-connected { background: #22c55e; }
.wm-status-disconnected { background: #ef4444; }
.wm-status-attention { background: #f59e0b; }
.wm-status-connecting { background: #38bdf8; }

.wm-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: wm-live-pulse 1.6s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes wm-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.75); }
}

.wm-actions .btn { margin-left: 2px; }

.wm-wizard-steps {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    border-bottom: 1px solid var(--wm-border);
    flex-wrap: wrap;
}
.wm-wizard-steps li {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--wm-text-secondary);
    border-bottom: 2px solid transparent;
}
.wm-wizard-steps li.active { color: #fff; border-color: var(--wm-accent); font-weight: 600; }
.wm-wizard-steps li.done { color: #22c55e; }

.wm-contact-picker {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--wm-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.wm-auth-body {
    background: var(--wm-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-auth-card {
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.wm-auth-brand { text-align: center; margin-bottom: 1.5rem; }
.wm-auth-logo {
    width: 56px; height: 56px; border-radius: 1rem; background: var(--wm-accent);
    display: flex; align-items: center; justify-content: center; font-weight: 800;
    margin: 0 auto 0.75rem; font-size: 1.2rem;
}

.table { color: var(--wm-text); }
.table > :not(caption) > * > * { background-color: transparent; color: var(--wm-text); border-color: var(--wm-border); }
.form-control, .form-select {
    background-color: #0f172a; border-color: var(--wm-border); color: var(--wm-text);
}
.form-control:focus, .form-select:focus {
    background-color: #0f172a; color: var(--wm-text); border-color: var(--wm-accent);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}
.modal-content { background-color: var(--wm-card-bg); color: var(--wm-text); }
.nav-tabs .nav-link { color: var(--wm-text-secondary); }
.nav-tabs .nav-link.active { background: var(--wm-card-bg); color: #fff; border-color: var(--wm-border); }

@media (max-width: 900px) {
    .wm-sidebar { position: fixed; z-index: 100; transform: translateX(-100%); transition: transform 0.2s; }
    .wm-sidebar.open { transform: translateX(0); }
}
