/* ============================================================================
   InSpecX Shared Shell — styles
   One file, loaded by every page via <link rel="stylesheet" href="shell.css">.
   Sidebar width, header height, and colors are all defined ONCE here.
   Nothing in this file measures or assumes another element's size — the
   layout is real flexbox, not position:fixed + a guessed pixel offset.
   ============================================================================ */

:root {
    --ix-sidebar-w: 256px;
    --ix-accent: #0F6E56;
    --ix-accent-light: #5DCAA5;
    --ix-accent-bg: #EAF6F1;
    --ix-sidebar-bg: #171717;
    --ix-sidebar-text: rgba(255,255,255,0.65);
    --ix-sidebar-text-active: #5DCAA5;
    --ix-sidebar-active-bg: rgba(93,202,165,0.14);
    --ix-sidebar-section: rgba(255,255,255,0.35);
    --ix-border: #e5e7eb;
    --ix-warn-bg: #FEF3C7;
    --ix-warn-text: #92400E;
}

/* ── Overall layout: one real flex row, sidebar + main column ────────────── */
.ix-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #f9fafb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.ix-sidebar {
    width: var(--ix-sidebar-w);
    flex-shrink: 0;
    background: var(--ix-sidebar-bg);
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
    /* sticky, not fixed: no top offset to guess, it just tracks scroll
       within the flex row it's already correctly positioned in */
    position: sticky;
    top: 0;
    height: 100vh;
}
.ix-sidebar::-webkit-scrollbar { width: 4px; }
.ix-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.ix-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ix-sidebar-brand-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    margin: 0;
}
.ix-sidebar-brand-tagline {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin: 0;
}

.ix-nav-section {
    padding: 14px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--ix-sidebar-section);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0;
}

.ix-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    color: var(--ix-sidebar-text);
    border-left: 3px solid transparent;
    transition: background .12s, color .12s;
}
.ix-nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.ix-nav-link.active {
    color: var(--ix-sidebar-text-active);
    background: var(--ix-sidebar-active-bg);
    border-left-color: var(--ix-sidebar-text-active);
    font-weight: 600;
}
.ix-nav-link svg { flex-shrink: 0; }

/* ── Main column: header + content, stacked, sidebar-agnostic ────────────── */
.ix-main-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* allows wide tables to scroll instead of pushing layout */
    height: 100vh;
    overflow: hidden;
}

.ix-header {
    background: var(--ix-sidebar-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}
.ix-header-inner {
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.ix-header-left {
    width: var(--ix-sidebar-w);
    flex-shrink: 0;
}
.ix-header-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}
.ix-header-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
}
.ix-header-icon {
    background: var(--ix-accent);
    color: #fff;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ix-header-right {
    width: var(--ix-sidebar-w);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.ix-content {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    padding: 24px;
}
.ix-content-flush {
    padding: 0;
}

/* ── Shared pill/badge style (status, flags) ──────────────────────────────── */
.ix-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.ix-pill-warn {
    background: var(--ix-warn-bg);
    color: var(--ix-warn-text);
}

/* ── Print: hide the app chrome entirely, let content flow naturally ─────── */
@media print {
    .ix-sidebar, .ix-header { display: none !important; }
    .ix-shell, .ix-main-col { height: auto !important; overflow: visible !important; display: block !important; }
    .ix-content { padding: 0 !important; overflow: visible !important; }
}
