/**
 * Intelleqt Platform v2 — Board refit (a0.39.0)
 *
 * Visual alignment of the board page with the v2 work screen: system
 * font stack, slate/indigo light palette, segmented tab pills, ghost
 * toolbar buttons, lighter sidebar cards. Loaded AFTER platform-style
 * so these rules win the cascade without !important wars (used only
 * where a parent theme is known to interfere).
 *
 * Scope: the board page renders standalone AND inside the work screen's
 * Board-mode iframe (embed=1 → body.ip-chrome-modal). Both get the
 * refit — the board should look v2 everywhere it appears.
 */

/* ─── Typography ──────────────────────────────────────────────── */

body.ip-page .ip-wrap,
body.ip-page .ip-board-layout,
body.ip-page .ip-board-tabs {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}
body.ip-page .ip-board-layout input,
body.ip-page .ip-board-layout textarea,
body.ip-page .ip-board-layout select,
body.ip-page .ip-board-layout button,
body.ip-page .ip-board-tabs button {
    font-family: inherit !important;
}

/* ─── Tab bar → segmented pill group (match the band control) ──── */

body.ip-page .ip-board-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 10px 16px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #fdfdfe 0%, #f6f7fa 100%);
}
body.ip-page .ip-board-tab {
    background: transparent;
    border: 0;
    color: #475569;
    padding: 5px 14px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
    box-shadow: none;
}
body.ip-page .ip-board-tab:hover { color: #0f172a; background: rgba(15, 23, 42, 0.04); }
body.ip-page .ip-board-tab.ip-board-tab-active,
body.ip-page .ip-board-tab.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.06);
}
body.ip-page .ip-board-tab-spacer { flex: 1; }
body.ip-page .ip-board-tab-hint { display: none; }

/* ─── Toolbar → ghost buttons ──────────────────────────────────── */

body.ip-page .ip-board-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
body.ip-page .ip-board-tool-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
body.ip-page .ip-board-tool-btn:hover:not([disabled]) {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}
body.ip-page .ip-board-tool-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
body.ip-page .ip-board-tool-btn.active,
body.ip-page .ip-board-tool-btn.is-active {
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.32);
    color: #6366f1;
}
body.ip-page .ip-board-tool-sep {
    width: 1px;
    height: 18px;
    background: #e2e8f0;
    margin: 0 4px;
}

/* ─── Sidebar (entity palette) ─────────────────────────────────── */

body.ip-page .ip-board-sidebar {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}
body.ip-page .ip-board-sidebar-search { padding: 10px 10px 6px; }
body.ip-page .ip-board-sidebar-search .ip-text-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    color: #0f172a;
    padding: 7px 11px;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
body.ip-page .ip-board-sidebar-search .ip-text-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}
body.ip-page .ip-board-sidebar-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 10px 8px;
    border-bottom: 1px solid #e2e8f0;
}
body.ip-page .ip-board-sidebar-tab {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
body.ip-page .ip-board-sidebar-tab:hover { border-color: #cbd5e1; color: #0f172a; }
body.ip-page .ip-board-sidebar-tab.active {
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.36);
    color: #6366f1;
}
body.ip-page .ip-board-sidebar-list { padding: 8px; }

/* Sidebar entity cards — match the work rail's card language. */
body.ip-page .ip-board-sidebar-list > div,
body.ip-page .ip-board-sidebar-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: none !important;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
body.ip-page .ip-board-sidebar-list > div:hover,
body.ip-page .ip-board-sidebar-card:hover {
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07) !important;
}

/* ─── Canvas chrome ────────────────────────────────────────────── */

body.ip-page .ip-board-canvas-wrap {
    background: #fbfcfe;
    border: 0;
}

/* ─── Empty state ──────────────────────────────────────────────── */

body.ip-page .ip-board-empty h3 { color: #0f172a; }
body.ip-page .ip-board-empty p  { color: #64748b; }

/* ─── Timeline + Scratchpad panes — light pass for consistency ─── */

body.ip-page .ip-board-tl-header h3 { color: #0f172a; }
body.ip-page .ip-scratchpad-toolbar {
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}
body.ip-page .ip-scratchpad-tool {
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
}
body.ip-page .ip-scratchpad-tool:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

/* ─── Embedded mode (work screen iframe) ───────────────────────── */
/* Tuck everything tighter when iframed — the work screen's band
   already provides identity, so the board page's own header rows
   are redundant chrome (most are already stripped by embed CSS). */
body.ip-chrome-modal .ip-board-tabs { padding-top: 8px; }
body.ip-chrome-modal .ip-wrap { padding: 0 !important; margin: 0 !important; max-width: none !important; }
body.ip-chrome-modal .ip-main-card {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}
