/*
 * Dealer portal variant B: shared look.
 * Loaded after each page's inline <style>, and every rule is scoped to body.ui-b
 * so variant A is never affected. Page-specific fixes live in <page>.css.
 */

body.ui-b {
    --orange: #ff7801;
    --orange-hover: #ff8a24;
    --orange-soft: rgba(255, 120, 1, 0.12);
    --uib-bg: #111214;
    --uib-surface: #1a1b1e;
    --uib-surface-2: #222327;
    --uib-line: #2e3035;
    --uib-input-line: #3a3c42;
    --uib-text: #f4f4f5;
    --uib-muted: #a1a1aa;
    --uib-green: #22c55e;
    --uib-red: #ef4444;
    --uib-radius: 14px;

    /* old page variables, remapped so existing rules pick up the new palette */
    --dark: var(--uib-surface);
    --card-bg: var(--uib-surface);
    --border: var(--uib-line);
    --text: var(--uib-text);
    --text-dim: var(--uib-muted);

    background: var(--uib-bg) !important;
    color: var(--uib-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 17px;
    line-height: 1.55;
}

body.ui-b *,
body.ui-b *::before,
body.ui-b *::after { box-sizing: border-box; }

body.ui-b button,
body.ui-b input,
body.ui-b textarea,
body.ui-b select { font-family: inherit; }

/* ---------- Shared top navigation ---------- */
body.ui-b .uib-topbar {
    background: var(--uib-surface);
    border-bottom: 1px solid var(--uib-line);
    position: sticky;
    top: 0;
    z-index: 1000;
}
body.ui-b .uib-topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 28px;
}
body.ui-b .uib-logo img { height: 34px; display: block; }
body.ui-b .uib-nav { display: flex; gap: 4px; flex: 1; }
body.ui-b .uib-nav a {
    color: var(--uib-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 9px 14px;
    border-radius: 8px;
    white-space: nowrap;
}
body.ui-b .uib-nav a:hover,
body.ui-b .uib-nav a.active { color: var(--uib-text); background: var(--uib-surface-2); }
body.ui-b .uib-count {
    background: var(--orange);
    color: #000;
    font-size: 12px;
    font-weight: 800;
    border-radius: 10px;
    padding: 1px 7px;
    margin-left: 6px;
}
body.ui-b .uib-logout {
    color: var(--uib-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}
body.ui-b .uib-logout:hover { color: var(--uib-text); }

@media (max-width: 900px) {
    body.ui-b .uib-topbar-inner { flex-wrap: wrap; padding-top: 12px; gap: 10px 20px; }
    body.ui-b .uib-logout { margin-left: auto; }
    body.ui-b .uib-nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 8px; }
}

/* The shared nav replaces each logged-in page's own header. */
body.ui-b.page-projects > header.header,
body.ui-b.page-media > nav.navbar-custom,
body.ui-b.page-blog > header.header { display: none !important; }

/* ---------- Page title area ---------- */
body.ui-b .uib-page-head {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 8px;
}
body.ui-b .uib-page-head h1 { margin: 0; font-size: 26px; font-weight: 750; color: var(--uib-text); }
body.ui-b .uib-page-head p { margin: 4px 0 0; color: var(--uib-muted); font-size: 16px; }

/* ---------- Form controls (old pages use !important, so we must too) ---------- */
body.ui-b .form-control,
body.ui-b .form-select,
body.ui-b .form-input,
body.ui-b input:not([type]),
body.ui-b input[type="text"],
body.ui-b input[type="email"],
body.ui-b input[type="number"],
body.ui-b input[type="tel"],
body.ui-b input[type="password"],
body.ui-b input[type="url"],
body.ui-b textarea,
body.ui-b select {
    background: var(--uib-bg) !important;
    color: var(--uib-text) !important;
    border: 1px solid var(--uib-input-line) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
body.ui-b .form-control:focus,
body.ui-b .form-select:focus,
body.ui-b .form-input:focus,
body.ui-b input:focus,
body.ui-b textarea:focus,
body.ui-b select:focus {
    outline: none !important;
    border-color: var(--orange) !important;
    box-shadow: 0 0 0 3px var(--orange-soft) !important;
}
body.ui-b ::placeholder { color: #71717a !important; }
body.ui-b .form-label { color: var(--uib-text); font-weight: 600; }
body.ui-b .text-muted { color: var(--uib-muted) !important; }
body.ui-b hr { border-color: var(--uib-line) !important; opacity: 1; }

/* ---------- Buttons ---------- */
body.ui-b .uib-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.2;
}
body.ui-b .uib-btn-primary { background: var(--orange); color: #000; }
body.ui-b .uib-btn-primary:hover { background: var(--orange-hover); color: #000; }
body.ui-b .uib-btn-primary:disabled { opacity: .6; cursor: not-allowed; }
body.ui-b .uib-btn-ghost { background: transparent; color: var(--uib-text); border-color: var(--uib-line); }
body.ui-b .uib-btn-ghost:hover { border-color: var(--uib-muted); color: var(--uib-text); }
body.ui-b .uib-btn-lg { padding: 16px 26px; font-size: 18px; }
body.ui-b .uib-btn-block { width: 100%; }

/* Calm down hover jumps and glow used across old pages */
body.ui-b [class*="btn"]:hover { transform: none !important; }

/* ---------- Bootstrap bits used on several pages ---------- */
body.ui-b .btn-primary,
body.ui-b .btn-warning {
    background: var(--orange) !important;
    border-color: var(--orange) !important;
    color: #000 !important;
    font-weight: 700;
    border-radius: 10px;
}
body.ui-b .btn-outline-danger,
body.ui-b .btn-outline-secondary,
body.ui-b .btn-secondary {
    background: transparent !important;
    border: 1px solid var(--uib-line) !important;
    color: var(--uib-text) !important;
    border-radius: 10px;
}
body.ui-b .modal-content {
    background: var(--uib-surface) !important;
    border: 1px solid var(--uib-line) !important;
    border-radius: var(--uib-radius) !important;
    color: var(--uib-text);
}
body.ui-b .badge { font-weight: 700; border-radius: 999px; }

/* ---------- Alerts and toasts ---------- */
body.ui-b .alert-success {
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.45) !important;
    color: #86efac !important;
    border-radius: 12px !important;
}
body.ui-b .alert-error,
body.ui-b .alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #fca5a5 !important;
    border-radius: 12px !important;
}
body.ui-b .toast-notification { border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* ---------- Ask-PM modal shared by dashboard and projects ---------- */
body.ui-b .ask-box {
    background: var(--uib-surface);
    border: 1px solid var(--uib-line);
    border-radius: var(--uib-radius);
}
body.ui-b .ask-box textarea { min-height: 140px; }

/* No pulsing or glowing animations in B */
body.ui-b .pending-alert.show { animation: none; }
