/* ============================================================================
   Nila CRM — combined brand logo (icon + wordmark in one image)
   ----------------------------------------------------------------------------
   Two source files ship the full lock-up, and their names describe the
   background they were exported on, not the ink:

     logo_name_black.jpg  -> BLACK background  -> use on DARK surfaces
     logo_name_white.jpg  -> WHITE background  -> use on LIGHT surfaces

   Both are JPEGs, so they carry an opaque rectangle instead of transparency.
   Pairing each with a matching surface is not enough on its own — an exact
   colour match is impossible across the app's many shades — so the blend mode
   does the real work:

     multiply on a white-backed image  -> white (255) x surface = surface
     screen   on a black-backed image  -> black (0)   + surface = surface

   Either way the rectangle disappears into whatever sits behind it and only the
   artwork remains. Browsers without mix-blend-mode still render a correct logo,
   just with a visible edge, so this degrades safely.

   The lock-up replaces the old icon + separate "نیلا CRM" text everywhere, so
   the brand name must NOT be repeated next to it. The bare icon
   (logoholo/logo.png) stays only where there is genuinely no room for the
   wordmark — the collapsed sidebar and favicons.
   ========================================================================== */

.nila-logo {
  display: block;
  /* Intrinsic ratio is ~2.6:1; height drives the size and width follows, so the
     lock-up is never stretched. */
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.nila-logo--on-light {
  mix-blend-mode: multiply;
}

.nila-logo--on-dark {
  mix-blend-mode: screen;
}

/* --- Placement sizes ----------------------------------------------------- */

/* Classic app: top bar and expanded sidebar. */
.topbar-brand-logo.nila-logo {
  height: 30px;
  max-height: 30px;
}

.sidebar-brand-logo.nila-logo {
  height: 38px;
  max-height: 38px;
  max-width: 170px;
}

/* Landing page header / footer. */
.lp-brand__logo.nila-logo {
  height: 38px;
  max-height: 38px;
  max-width: 190px;
}

/* Auth screens (login, password recovery). */
.nila-logo--auth {
  height: 52px;
  max-height: 52px;
  max-width: 230px;
  margin-inline: auto;
}

/* Modern (v2) shell sidebar. */
.dv2-brand__logo.nila-logo {
  height: 32px;
  max-height: 32px;
  max-width: 150px;
}

/* --- Responsive ---------------------------------------------------------- */
/* Tablet/phone: the classic shell shows the top bar, so the drawer's copy of
   the same lock-up is redundant. The whole .sidebar-header is dropped in
   app.css; this keeps the brand sheet honest about it (and is what wins if the
   drawer ever renders the logo outside that header). */
@media (max-width: 1024px) {
  #sidebar .sidebar-header,
  .sidebar .sidebar-brand-logo.nila-logo { display: none; }
  /* Matches app.css's mobile tweak, but id-scoped so it beats the
     `#sidebar .glass-content` padding nila_classic.css sets. Without the brand
     block there is nothing above the first menu item to pad away from. */
  #sidebar .glass-content { padding-top: 12px; }
}

@media (max-width: 768px) {
  .topbar-brand-logo.nila-logo { height: 26px; max-height: 26px; }
  .lp-brand__logo.nila-logo { height: 32px; max-height: 32px; max-width: 150px; }
  .nila-logo--auth { height: 44px; max-height: 44px; max-width: 190px; }
}

@media (max-width: 480px) {
  .lp-brand__logo.nila-logo { height: 28px; max-height: 28px; max-width: 130px; }
  .nila-logo--auth { height: 40px; max-height: 40px; max-width: 170px; }
}

/* --- Collapsed sidebar (modern shell only) ------------------------------- */
/* The v2 rail collapses via `body.darya-v2.dv2-sidebar-collapsed`; the classic
   layout has no collapse state. Collapsed leaves no room for a wordmark, so the
   icon-only mark takes over — the one case the brief allows it to remain. */
.dv2-brand__icon {
  display: none;
  width: 24px;
  height: 33px;
  object-fit: contain;
}

body.darya-v2.dv2-sidebar-collapsed .dv2-brand__logo {
  display: none;
}

body.darya-v2.dv2-sidebar-collapsed .dv2-brand__icon {
  display: block;
  margin-inline: auto;
}

/* --- Dark mode ----------------------------------------------------------- */
/* When a surface flips to dark, the light-surface lock-up must flip with it.
   Markup ships both files and lets CSS choose, so the switch needs no JS. */
.nila-logo--auto-dark { display: none; }
.nila-logo--auto-light { display: block; }

[data-theme='dark'] .nila-logo--auto-dark,
html.dark-mode .nila-logo--auto-dark,
body.dark-mode .nila-logo--auto-dark { display: block; }

[data-theme='dark'] .nila-logo--auto-light,
html.dark-mode .nila-logo--auto-light,
body.dark-mode .nila-logo--auto-light { display: none; }

/* --- Cross-brand redirect link (removed) ---------------------------------
   The login form no longer renders one. A "sign in on Darya's panel instead"
   link answered the question "does this phone number belong to a Darya or a
   Nila account?" for anyone who asked, so sign-in now has a single failure
   message and no redirect. Nothing carries this class any more. */
