/* ARICO Binoc — Arico Caliber's look over Horilla.
   Loaded last from index.html and login.html, so Horilla's own files stay as
   upstream ships them and an upstream merge touches only those two includes.
   Values mirror Caliber's design tokens (~/projects/CRM ui/src/styles/tokens.css):
   royal blue #06389f, orange #f7670e, a navy rail, a light grey workspace and
   the system font. The colour palette proper is the "Arico Theme" row
   (horilla_theme/models.py THEMES_DATA); this file covers what the palette
   cannot reach. Selectors start "html body #sidebar" so they outrank the
   id-scoped !important rules in sidebar.html's own <style>, which sits later
   in the page. */
:root {
  --binoc-accent: #06389f;
  --binoc-accent-hover: #052e82;
  --binoc-accent-soft: #e8eefb;
  --binoc-accent-2: #f7670e;
  --binoc-rail-bg: #0b1e4a;
  --binoc-rail-active: #06389f;
  --binoc-rail-hover: #13295c;
  --binoc-rail-text: #c9d3ea;
  --binoc-rail-text-strong: #ffffff;
  --binoc-rail-muted: #8796b8;
  --binoc-rail-line: #1c3266;
  --binoc-bg: #f4f6fa;
  --binoc-border: #e3e7ee;
  --binoc-text: #1f2937;
  --binoc-muted: #6b7280;
  --binoc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Type: Caliber uses the system face, so nothing is downloaded. */
html body,
html body button,
html body input,
html body select,
html body textarea {
  font-family: var(--binoc-font) !important;
}

/* ── The rail ─────────────────────────────────────────────────────────── */
html body #sidebar {
  background-color: var(--binoc-rail-bg) !important;
  border-right-color: var(--binoc-rail-line) !important;
}
html body #sidebar .sideboxmain:not(.sidebox-current) {
  background-color: transparent !important;
  box-shadow: none !important;
}
html body #sidebar .sideboxmain .oh-sidebar-label,
html body #sidebar .sideboxmain .sidebar-chevron {
  color: var(--binoc-rail-text) !important;
}
html body #sidebar .sideboxmain:hover:not(.sidebox-current),
html body #sidebar .sideboxmain.sidebox-active:not(.sidebox-current) {
  background-color: var(--binoc-rail-hover) !important;
}
html body #sidebar .sideboxmain:hover .oh-sidebar-label,
html body #sidebar .sideboxmain.sidebox-active .oh-sidebar-label,
html body #sidebar .sideboxmain.sidebox-current .oh-sidebar-label,
html body #sidebar .sideboxmain.sidebox-current .sidebar-chevron {
  color: var(--binoc-rail-text-strong) !important;
}
html body #sidebar .sideboxmain.sidebox-current {
  background-color: var(--binoc-rail-active) !important;
  box-shadow: none !important;
}
/* Icons are dark glyphs; on the navy rail they go light, white when current. */
html body #sidebar nav .sideboxmain img,
html body #sidebar nav .sideboxmain svg:not(.sidebar-chevron) {
  filter: brightness(0) invert(1) opacity(0.7) !important;
}
html body #sidebar nav .sideboxmain:hover img,
html body #sidebar nav .sideboxmain:hover svg:not(.sidebar-chevron),
html body #sidebar nav .sideboxmain.sidebox-current img,
html body #sidebar nav .sideboxmain.sidebox-current svg:not(.sidebar-chevron) {
  filter: brightness(0) invert(1) opacity(1) !important;
}
/* Sub-menu links opened inside the rail (pinned rail, accordion): light on navy.
   Scoped to "nav" because the hover flyout below also sits inside #sidebar. */
html body #sidebar nav .sidebar-subnav-link {
  color: var(--binoc-rail-text) !important;
}
html body #sidebar nav .sidebar-subnav-link:hover {
  background-color: var(--binoc-rail-hover) !important;
  color: var(--binoc-rail-text-strong) !important;
}
html body #sidebar nav .oh-sidebar-active-link {
  background-color: var(--binoc-rail-active) !important;
  color: var(--binoc-rail-text-strong) !important;
  box-shadow: none !important;
}
/* The hover flyout is a white menu, like Caliber's popovers: dark text,
   a soft blue hover, solid blue for the current page. Light mode only;
   Horilla's own body.dark rules keep the dark-mode flyout. */
html body:not(.dark) #sidebarFlyout {
  border-color: var(--binoc-border) !important;
  border-radius: 6px !important;
}
html body:not(.dark) #sidebarFlyout a.sidebar-subnav-link {
  color: var(--binoc-text) !important;
}
html body:not(.dark) #sidebarFlyout a.sidebar-subnav-link:hover {
  background-color: var(--binoc-accent-soft) !important;
  color: var(--binoc-accent) !important;
}
html body:not(.dark) #sidebarFlyout a.sidebar-subnav-link.oh-sidebar-active-link {
  background-color: var(--binoc-accent) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
/* Header: company name and the pin button. */
html body #sidebar .oh-sidebar__company-title {
  color: var(--binoc-rail-text-strong) !important;
}
html body #sidebar .oh-sidebar__company-link {
  color: var(--binoc-rail-muted) !important;
}
html body #sidebar #sidebarPinBtn {
  color: var(--binoc-rail-muted) !important;
}
html body #sidebar #sidebarPinBtn:hover,
html body #sidebar.sidebar-pinned #sidebarPinBtn {
  background-color: var(--binoc-rail-hover) !important;
  color: var(--binoc-rail-text-strong) !important;
}
/* Footer: the product name in place of Horilla's version line. */
html body #sidebar .sidebar-version {
  border-top-color: var(--binoc-rail-line) !important;
  color: var(--binoc-rail-muted) !important;
}
/* Thin scrollbar that reads on navy. */
html body #sidebar nav::-webkit-scrollbar-thumb {
  background-color: var(--binoc-rail-line);
}

/* ── The wordmark (templates/binoc/wordmark.html), as Caliber's Wordmark.vue ── */
.binoc-wordmark {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; line-height: 1; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
}
.binoc-wordmark__a { color: var(--binoc-accent); }
.binoc-wordmark__b { color: var(--binoc-muted); font-weight: 600; letter-spacing: 0; }
.binoc-wordmark__dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--binoc-accent-2); }
.binoc-wordmark--lg { font-size: 20px; }
.binoc-wordmark--dark .binoc-wordmark__a { color: var(--binoc-rail-text-strong); }
.binoc-wordmark--dark .binoc-wordmark__b { color: var(--binoc-rail-text); }

/* In the rail: the full lockup when open, "A" and the dot when collapsed. */
html body #sidebar .binoc-brand { height: 28px; }
html body #sidebar .binoc-brand-mini {
  display: none; align-items: center; gap: 3px;
  color: var(--binoc-rail-text-strong); font-size: 18px; font-weight: 800; line-height: 1;
}
html body #sidebar:not(:hover):not(.sidebar-pinned) .binoc-brand-full { display: none; }
html body #sidebar:not(:hover):not(.sidebar-pinned) .binoc-brand-mini { display: inline-flex; }

/* ── Sign-in: Caliber's card — white, a 1px border, 6px corners, no shadow ── */
body:has(.binoc-login-card) { background: var(--binoc-bg) !important; }
.binoc-login-card {
  width: 100% !important; max-width: 380px !important;
  padding: 24px !important; border: 1px solid var(--binoc-border);
  border-radius: 6px !important; box-shadow: none !important;
}
.binoc-login-brand { margin: 0 0 8px; }
.binoc-login-card a[href*="forgot"] { color: var(--binoc-accent) !important; }
.binoc-login-card button[type="submit"] { border-radius: 6px !important; }
.binoc-login-card .binoc-login-brand { margin-bottom: 16px; }

/* ── Confirm dialogs (SweetAlert2) ──────────────────────────────────────
   Horilla colours their buttons inline: green #008000 to confirm, red #d33
   or grey to cancel. Caliber has one blue primary and a plain secondary, so:
   green confirm -> blue, every cancel -> plain. A red confirm is a destructive
   one (delete) and stays red. The inline style is matched on its serialised
   rgb() value, and !important outranks it. */
html body .swal2-popup .swal2-styled { border-radius: 6px !important; box-shadow: none !important; }
html body .swal2-popup .swal2-confirm[style*="0, 128, 0"] {
  background-color: var(--binoc-accent) !important;
  border-color: var(--binoc-accent) !important;
}
html body .swal2-popup .swal2-cancel {
  background-color: #ffffff !important;
  color: var(--binoc-text) !important;
  border: 1px solid #c8ced8 !important;
}
html body .swal2-popup .swal2-cancel:hover { background-color: #f9fafc !important; }
