/* fsq-global.css: FSQ global + non-shell dark-mode base - Adapted from the mERP shell; provenance in the FSQ Brain (brain/ui/fsq_shell_guide.md). */

/* Always show scrollbar track to prevent flash when panels shift content width */
html { overflow-y: scroll; }
body {
    padding-top: calc(70px + var(--merp-env-h, 0px)); /* space for fixed-top navbar + env banner */
}
.page-header-bar {
    margin-bottom: 1.5rem;
}
.badge {
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* =============================================================
   GLOBAL DARK MODE (non-shell pages)
   Shell pages get more detailed overrides via fsq-shell.css.
   These base rules ensure non-shell pages (CRUD forms, detail
   views, doc upload) respect the saved dark mode preference.
   ============================================================= */
[data-merp-theme="dark"] body {
    background: #15171c !important;
    color: #d1d5db;
}
[data-merp-theme="dark"] .navbar {
    background: #1e2128 !important;
    border-bottom-color: #2d3039 !important;
}
[data-merp-theme="dark"] .card {
    background: #1e2128 !important;
    border-color: #2d3039 !important;
}
[data-merp-theme="dark"] .card-header {
    background: #252830 !important;
    border-bottom-color: #2d3039 !important;
    color: #e4e6ea !important;
}
[data-merp-theme="dark"] .card-body { color: #d1d5db; }
[data-merp-theme="dark"] .form-control,
[data-merp-theme="dark"] .form-select {
    background: #2a2d35 !important;
    border-color: #3d414b !important;
    color: #d1d5db !important;
}
[data-merp-theme="dark"] .form-control::placeholder { color: #9ca3af !important; }
[data-merp-theme="dark"] .form-label { color: #8b919a !important; }
[data-merp-theme="dark"] .form-text { color: #9ca3af !important; }
[data-merp-theme="dark"] .text-muted { color: #9ca3af !important; }
[data-merp-theme="dark"] .btn-outline-secondary {
    color: #9ca3af; border-color: #3d414b;
}
[data-merp-theme="dark"] .btn-outline-secondary:hover {
    background: #3d414b; color: #e4e6ea;
}
/* dark .btn-outline-primary: set by fsq-brand.css through --bs-btn-* (a plain color rule here broke hover/focus, #181 review F1) */
[data-merp-theme="dark"] .table { color: #d1d5db; }
[data-merp-theme="dark"] .table > :not(caption) > * > * {
    background-color: #1e2128 !important;
    color: #d1d5db;
    border-bottom-color: #2d3039 !important;
}
[data-merp-theme="dark"] .border-top { border-color: #2d3039 !important; }
[data-merp-theme="dark"] footer { border-color: #2d3039 !important; }
[data-merp-theme="dark"] footer .text-muted { color: #9ca3af !important; } /* FSQ: was #4b5563 (2.37:1 on #15171c); now 7.06:1 */
[data-merp-theme="dark"] .alert-danger {
    background: #5f1e1e !important; color: #fca5a5 !important;
    border-color: #7f2d2d !important;
}
[data-merp-theme="dark"] .alert-success {
    background: #1e4d2b !important; color: #86efac !important;
    border-color: #2d6b3f !important;
}
[data-merp-theme="dark"] h1, [data-merp-theme="dark"] h2,
[data-merp-theme="dark"] h3, [data-merp-theme="dark"] h4 {
    color: #e4e6ea;
}
[data-merp-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.merp-sidebar-link):not(.merp-admin-name) {
    color: var(--fsq-link);
}
[data-merp-theme="dark"] .container-xl { color: #d1d5db; }
[data-merp-theme="dark"] .shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,.3) !important; }
[data-merp-theme="dark"] textarea {
    background: #2a2d35 !important;
    border-color: #3d414b !important;
    color: #d1d5db !important;
}
