/* === App Layout === */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === Sidebar (style HaloPSA) === */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(to bottom, #111827, #030712);
    color: var(--white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width var(--transition-slow);
    z-index: 50;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo { height: 32px; }

.sidebar-brand {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--teal-500);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-group { margin-bottom: 8px; }

.nav-group-label {
    padding: 6px 12px 6px;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.25);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin: 2px 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    border-radius: 8px;
    border-left: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(71, 153, 163, 0.85);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(71, 153, 163, 0.25);
}

.nav-item.disabled {
    color: rgba(255,255,255,0.15);
    cursor: default;
    pointer-events: none;
}

.nav-item-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.nav-item.active .nav-item-icon { stroke-width: 2.5; }

.nav-badge-soon {
    margin-left: auto;
    font-size: 0.5rem;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.25);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

.sidebar-footer .btn-ghost {
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    width: 100%;
    justify-content: center;
    border-radius: 8px;
}
.sidebar-footer .btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
}

/* === Main area === */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--gray-100);
}

/* === Header (style HaloPSA) === */
.header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    background: var(--gray-100, #f3f4f6);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.15s;
}
.sync-btn:hover { background: var(--gray-200); color: var(--gray-900); }
.sync-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.sync-btn .sync-icon { width: 14px; height: 14px; }
.sync-btn.syncing .sync-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sync-status {
    font-size: 0.75rem;
    color: var(--gray-400);
    white-space: nowrap;
}
.sync-status.fresh { color: var(--teal-700, #4799a3); }
.sync-status.stale { color: #c9302c; }

@media (max-width: 768px) {
    .sync-btn-label { display: none; }
    .sync-status { display: none; }
}

.hamburger {
    display: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
}

.hamburger:hover { background: var(--gray-200); }
.hamburger svg { width: 20px; height: 20px; }

/* === Content area === */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* === Login screen === */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card img { height: 40px; margin-bottom: 24px; }

.login-card h1 {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-card p {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 32px;
    line-height: 1.6;
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 0.9375rem;
}

/* === Overlay (mobile sidebar) === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.sidebar-overlay.active { display: block; }
