/* Giti Pay — desktop admin shell (>=1200px), Fix Prompt #30 rebuild.

   This file exists because trying to retrofit the mobile-first component
   system (`.card`, `.drawer`, `.topbar`, etc. in style.css) to also match
   the 12 approved desktop reference mockups pixel-for-pixel, one CSS
   property at a time, turned out to be slow and only ever "close." Every
   rule below is copied LITERALLY out of the reference files' own <style>
   blocks (identical across all 12 — this is their shared shell), not
   re-derived or approximated. Selectors are namespaced `dsk-` so nothing
   here can ever collide with an existing mobile class name.

   This stylesheet is loaded on every page but is entirely inert unless
   BOTH conditions hold: `.dsk-shell` is present in the DOM (added only to
   admin pages, see `_layout.html`) AND the viewport is >=1200px (every
   selector lives inside a min-width media query, or targets `.dsk-*`
   elements that are `display:none` below it) — mobile/tablet and every
   non-admin page are structurally unable to be affected by this file. */

.dsk-shell { display: none; }

@media (min-width: 1200px) {
  .dsk-shell {
    display: flex; min-height: 100vh; font-family: var(--font-body);
    color: var(--text); background: var(--bg);
  }
  .dsk-mono { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
  .dsk-card { background: #fff; border-radius: 14px; box-shadow: 0 2px 14px rgba(110, 117, 136, .06); }

  /* ===== persistent sidebar (right) =====
     `position: fixed` (not `sticky`) — pinned to the viewport outright
     rather than depending on `.dsk-shell`/`.app-shell` having no
     scroll-affecting ancestor (overflow, transform, etc. anywhere up the
     tree breaks `sticky` silently); `fixed` can't be broken that way, so
     it's the more robust choice for a shell-level sidebar meant to never
     move. It's taken out of the flex flow entirely (same as any
     fixed-position element), so `.dsk-main` below reserves its width
     with `margin-inline-end` instead of `.dsk-shell`'s flex distribution. */
  .dsk-sidebar {
    position: fixed; top: 0; right: 0; z-index: 5;
    width: 260px; flex-shrink: 0; background: #fff; border-left: 1px solid rgba(164, 169, 174, .18);
    padding: 28px 22px; display: flex; flex-direction: column; justify-content: safe center; height: 100vh;
    overflow-y: auto;
  }
  .dsk-sidebar-user {
    display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-bottom: 20px;
    border-bottom: 1px solid rgba(164, 169, 174, .18);
  }
  .dsk-sidebar-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(145deg, var(--ink), var(--ink-2));
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
  }
  .dsk-sidebar-user-name { font-size: 14px; font-weight: 700; color: var(--text); }
  .dsk-sidebar-user-role { font-size: 12px; color: var(--muted-text); }
  /* no `flex: 1` here (unlike the reference, which pins logout to the
     bottom via that push) — the user asked for the whole sidebar block
     (brand/user/nav/logout) centered as a group within the 100vh height
     instead, via `justify-content: center` on `.dsk-sidebar` above. */
  .dsk-sidebar-nav { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
  .dsk-sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 9px;
    text-decoration: none; color: var(--text-soft); font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .dsk-sidebar-link.active { background: var(--ink-tint-soft); color: var(--ink-2); }
  /* Fix Prompt 9 — the same nav icon box as the mobile drawer (.drawer-item-icon):
     38px, muted icon; active = --ink on --ink-tint */
  .dsk-sidebar-link .dsk-icon {
    width: 38px; height: 38px; border-radius: var(--radius-card); display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; background: var(--neutral-tint); color: var(--muted);
  }
  .dsk-sidebar-link.active .dsk-icon { background: var(--ink-tint); color: var(--ink); }
  /* `margin-top` replaces the gap that used to come from `.dsk-sidebar-
     nav`'s `flex:1` push — without it, logout would sit flush against
     the last nav link with no separation at all. */
  .dsk-sidebar-logout {
    display: flex; align-items: center; gap: 12px; padding: 11px 8px; color: var(--danger-text); margin-top: 16px;
    font-size: 14px; font-weight: 600; text-decoration: none; border: none; background: none; cursor: pointer; width: 100%; text-align: right;
  }

  /* ===== main content ===== */
  /* `margin-right` reserves the space the fixed-position sidebar used to
     claim as a flex item (260px width + its 1px border-left). */
  .dsk-main { flex: 1; padding: 32px 40px; min-width: 0; margin-right: 261px; }
  /* margin-bottom isn't uniform across the 12 references: 24px on
     customers/history/invoices-list/loan-requests/new-invoice-form/
     notifications/settings, 28px on dashboard/debtor-creditor/fund/
     invoice-detail/partner-accounts — 24 is the majority default, set
     via `{% block dsk_topbar_class %}` on the 5 pages that want 28. */
  .dsk-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
  .dsk-topbar.dsk-topbar-28 { margin-bottom: 28px; }
  .dsk-topbar-title { font-size: 20px; font-weight: 800; }
  .dsk-topbar-icons { display: flex; align-items: center; gap: 10px; }
  .dsk-icon-btn {
    width: 40px; height: 40px; border-radius: 12px; background: rgba(164, 169, 174, .12);
    display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative;
    border: none; font-size: 16px; color: inherit; text-decoration: none;
  }
  /* Fix Prompt 24.2 — one width for every admin page: the content (and the
     title bar above it, so the bell sits at the block's edge, not the
     screen's) fills `.dsk-main` up to 1320px, then stays centred, so the
     spare width on a wide screen is split evenly on both sides. It used to
     be a per-page cap (1120 / 1080 / 1000) with no centring: in RTL the
     block hugged the sidebar and every spare pixel piled up on the left.
     The notifications feed keeps its narrow 760px reading column, centred
     the same way (`{% block dsk_content_class %} dsk-content-760`). */
  .dsk-content, .dsk-topbar { max-width: 1320px; margin-inline: auto; }
  .dsk-content.dsk-content-760,
  .dsk-main:has(.dsk-content-760) .dsk-topbar { max-width: 760px; }

  .dsk-small-muted { font-size: 12px; color: var(--muted-text); }
  .dsk-pad { padding: 22px; }
}
