:root {
    --color-bg: #f4f6f8;
    --color-surface: #ffffff;
    --color-border: #e1e5ea;
    --color-text: #1f2933;
    --color-text-muted: #6b7684;
    --color-primary: #2a6f6f;
    --color-primary-dark: #1f5555;
    --color-danger: #c0392b;
    --color-success: #2e7d55;
    --sidebar-width: 230px;
    --topbar-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.5;
}

/* Auth pages (no sidebar) */
.app-content-plain {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Shell with sidebar */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-primary-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 20px;
}

.brand-mark {
    width: 32px; height: 32px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}

.brand-name { font-weight: 600; }

.nav-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.55);
    padding: 16px 20px 6px;
}

.nav-link {
    display: block;
    padding: 9px 20px;
    color: rgba(255,255,255,0.85);
    border-left: 3px solid transparent;
}

.nav-link:hover { background: rgba(255,255,255,0.06); }

.nav-link.active {
    background: rgba(255,255,255,0.1);
    border-left-color: #fff;
    font-weight: 600;
}

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

.app-topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
}

.topbar-spacer { flex: 1; }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
}

.company-switch-form select {
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}

.company-name { font-weight: 600; color: var(--color-text-muted); }
.user-name { color: var(--color-text-muted); }

.app-content { padding: 24px; }

@media (max-width: 900px) {
    .app-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 40;
        transition: left 0.2s ease;
        width: 240px;
    }
    .app-sidebar.open { left: 0; }
    .sidebar-toggle { display: block; }
    .app-content { padding: 16px; }
}
