/* ═══════════════════════════════════════════════════════════════
   OpsCenter — App shell styles
   Imports design-system.css for tokens/components.
   This file owns: sidebar, topbar, content layout.
═══════════════════════════════════════════════════════════════ */

/* ── Layout shell ────────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: linear-gradient(180deg, #0c2d5c 0%, #0b2957 55%, #091f40 100%);
    position: fixed;
    top: 0; left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    padding: 16px 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-logo {
    height: 34px; width: 34px;
    object-fit: contain;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.10);
    padding: 3px;
    flex-shrink: 0;
}

.sidebar-brand {
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
}
.sidebar-brand span {
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.sidebar-brand small {
    display: block;
    font-size: 9.5px;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
}

/* Nav */
.sidebar-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
    color: rgba(255,255,255,0.28);
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 14px 16px 4px;
    pointer-events: none;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.62);
    padding: 8px 12px;
    margin: 1px 8px;
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--r-md);
    transition: background 130ms, color 130ms;
    white-space: nowrap;
}
.sidebar-nav .nav-link i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-link:hover  { color: #fff; background: rgba(255,255,255,0.09); }
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.14);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--c-cyan);
}

/* Sidebar footer — user dropdown area */
.sidebar-footer {
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.sidebar-footer .dropdown-menu {
    bottom: calc(100% + 6px);
    top: auto;
    left: 8px;
    right: 8px;
    min-width: 0;
}

.avatar-initials {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(30,91,184,0.6), rgba(41,182,246,0.5));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 700;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ── Content wrapper ─────────────────────────────────────────── */
#content-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-w));
    display: flex;
    flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 1030;
    gap: 12px;
}

.topbar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-navy);
    letter-spacing: -0.01em;
    margin: 0;
}

/* ── Content area ────────────────────────────────────────────── */
.content-area {
    padding: var(--content-px);
    flex: 1;
}

/* ── Search box ──────────────────────────────────────────────── */
.search-box .form-control {
    background: rgba(11,41,87,0.04);
    border-color: var(--c-border);
    font-size: 13px;
    width: 220px;
    transition: width 250ms ease, background 150ms;
}
.search-box .form-control:focus { width: 300px; background: #fff; }
.search-box .input-group-text {
    background: rgba(11,41,87,0.04);
    border-color: var(--c-border);
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: 0 8px 28px rgba(11,41,87,0.10);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1200;
    display: none;
}
.search-results.show { display: block; }
.search-result-item {
    padding: 9px 14px;
    font-size: 13px;
    color: var(--c-body);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--c-border);
    cursor: pointer;
    transition: background 120ms;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--c-surface); color: var(--c-navy); }

/* ── Sidebar overlay (mobile) ────────────────────────────────── */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(11,41,87,0.35);
    backdrop-filter: blur(3px);
    z-index: 1039;
    display: none;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    #content-wrapper { margin-left: 0; width: 100%; }
    .content-area { padding: 16px; }
    .search-box .form-control { width: 160px; }
    .search-box .form-control:focus { width: 220px; }
}

@media (max-width: 575.98px) {
    .topbar-title { display: none; }
    .content-area { padding: 12px; }
}
