/* Customer panel: Mobile drawer isolation, sidebar and mobile touch targets. */
/* ===== IT4Y_PRA_DRAWER_ISO_2026_07_02 — enterprise mobile drawer isolation: while the drawer is
   open (body.p360-bodylock) the sidebar is the ONLY visible layer; underlying
   header/content are hidden so no navigation items or controls remain visible.
   Backdrop (z1190, above everything except the drawer at z1200) still handles
   tap-to-close over the vacated area. ===== */
body.is-mobile.p360-bodylock .app-shell > .app-header,
body.is-mobile.p360-bodylock .app-shell > .app-main{ visibility:hidden; }

/* IT4Y_LOGOUT_NAVCHROME_GATE_2026_07_06 — hide persisted body-level mobile nav chrome (the p360 hamburger pill +
   backdrop that _injectHamburger appends to <body> once and never removes) whenever the portal is
   UNAUTHENTICATED, i.e. no .app-sidebar exists in the DOM (login screen / auth splash / after logout).
   Self-correcting: the chrome reappears the instant an authenticated sidebar is rendered. This fixes
   'sidebar/nav visible after logout' on mobile with zero node-lifecycle or re-login regression. */
body.it4y-unauth .p360-hamburger.p360-hamburger,
body.it4y-unauth .p360-backdrop.p360-backdrop{display:none !important}

/* IT4Y_SIDEBAR_REDESIGN_2026_07_06 — enterprise sidebar restyle. Existing DOM classes only
   (.app-sidebar / .nav-group / .nav-label / .nav-item / .nav-item.active / .icon). Fully token-driven so
   dark mode recolours automatically. Appended at EOF so it wins source order; .app-sidebar-scoped for
   specificity over the base rule and the later .nav-item override. No structural or nav-IA change;
   mobile touch sizing (min-height:48px) and safe-area padding from the responsive layer still win by
   their higher specificity. */
.app-sidebar{padding:12px 10px 18px;background:var(--bg-2);border-right:1px solid var(--border-soft)}
.app-sidebar .nav-group{margin-bottom:2px;padding-bottom:2px}
.app-sidebar .nav-group + .nav-group{border-top:1px solid var(--border-soft);margin-top:8px;padding-top:10px}
.app-sidebar .nav-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.11em;color:var(--muted);padding:6px 12px 4px;margin:0}
.app-sidebar .nav-item{display:flex; align-items:center; gap:11px; min-height:40px; padding:8px 12px; margin:2px 6px; border-radius:9px; font-size:13px;
  font-weight:500; line-height:1.2; color:var(--text-dim); cursor:pointer; user-select:none; position:relative;
  transition:background .13s ease,color .13s ease,box-shadow .13s ease}
.app-sidebar .nav-item:hover{background:var(--panel-2);color:var(--text)}
.app-sidebar .nav-item.active{background:var(--accent-soft);color:var(--accent);font-weight:600;box-shadow:inset 3px 0 0 var(--accent)}
.app-sidebar .nav-item .icon{width:20px; min-width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; font-size:15px;
  line-height:1; opacity:.82; transition:opacity .13s ease}
.app-sidebar .nav-item:hover .icon,.app-sidebar .nav-item.active .icon{opacity:1}

/* IT4Y_LIVEPILL_REMOVED_2026_07_06 — header real-time status pill permanently removed (markup + JS-insert also stripped; this is defense-in-depth so no
   "● LIVE" badge can ever render). */
#rt-status-pill{display:none !important}

/* IT4Y_UI_TOUCH_TARGETS_2026_07_24
   Mobile compact actions now meet the same 44px touch-target contract as the
   portal navigation and primary actions. Desktop density is unchanged. */
@media (max-width: 900px) {
  .btn.small {
    min-height: 44px !important;
    padding: 10px 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Design proposals 22, 28 and 30 (owner order 2026-11-28): nav items are real links with line icons; a link keeps the
   item's own colour, and an item the billing lock makes unavailable is drawn disabled (aria-disabled). */
a.nav-item, a.nav-item:hover, a.nav-item:focus-visible { text-decoration: none; }
.app-sidebar a.nav-item:not(.active) { color: var(--text-dim); }
.nav-item .icon .ic-svg { inline-size: 17px; block-size: 17px; display: block; }
.nav-item[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.nav-item[aria-disabled="true"]:hover { background: transparent; color: var(--text-dim); }

/* The billing lock banner above every view: why the services are paused, the invoice and its amount, Pay and Support. */
.billing-lock-banner { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 14px 16px;
  border: 1px solid var(--danger); border-radius: 12px; background: var(--danger-soft, var(--panel-2)); color: var(--text); }
.billing-lock-icon { color: var(--danger); flex: 0 0 auto; }
.billing-lock-icon .ic-svg { inline-size: 22px; block-size: 22px; display: block; }
.billing-lock-text { flex: 1 1 260px; min-inline-size: 0; }
.billing-lock-text p { margin: 4px 0 0; color: var(--text-dim); line-height: 1.5; }
.billing-lock-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* The rate-limit countdown (design proposal 1): one quiet status line at the bottom of the page. */
.rate-limit-notice { position: fixed; inset-block-end: 16px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 9000;
  max-inline-size: calc(100vw - 32px); padding: 8px 14px; border-radius: 999px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: 13px; }
html[dir="rtl"] .rate-limit-notice { transform: translateX(50%); }
.rate-limit-notice[hidden] { display: none; }

/* A language change (design proposal 23): the view is dimmed and busy until it is drawn in the chosen language. */
html[data-locale-pending] #view-root, #view-root.is-relocalizing { opacity: .35; pointer-events: none; transition: opacity .12s ease; }
html[data-locale-pending] body { cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  html[data-locale-pending] #view-root, #view-root.is-relocalizing { transition: none; }
}

/* The one failure state of every view (design proposal 29). */
.failure-state .failure-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-block-start: 10px; }
.failure-state > .msg.error { margin-block-end: 6px; }

/* The Balance page tabs (design proposal 30). */
.balance-tabs { display: flex; gap: 4px; margin: 0 0 14px; border-block-end: 1px solid var(--border-soft); overflow-x: auto; }
.balance-tabs .tab { padding: 9px 14px; color: var(--text-dim); text-decoration: none; font-weight: 600; font-size: 13.5px;
  border-block-end: 2px solid transparent; margin-block-end: -1px; white-space: nowrap; }
.balance-tabs .tab:hover { color: var(--text); text-decoration: none; }
.balance-tabs .tab.active { color: var(--text); border-block-end-color: var(--accent); }

/* Payment methods (design proposal 26): the page intro and the short link card on the Subscriptions page. */
.billing-page-intro { margin: 0 0 12px; line-height: 1.55; }
.billing-pm-link { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.billing-pm-link-icon { color: var(--accent); }
.billing-pm-link-icon .ic-svg { inline-size: 22px; block-size: 22px; display: block; }
.billing-pm-link-text { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }

/* The invoice list search, tabs and pager, and the invoice page (design proposal 31). */
.inv-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.inv-search input[type="search"] { flex: 1 1 220px; min-inline-size: 0; max-inline-size: 360px; }
.inv-tab { display: inline-flex; align-items: center; gap: 7px; }
.inv-tab-count { font-weight: 700; opacity: .65; font-variant-numeric: tabular-nums; }
.inv-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-block-start: 12px; }
.inv-pager .muted { margin-inline-end: auto; }
.inv-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.inv-page-head .page-title { margin: 0 0 6px; }
.inv-page-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inv-page-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin: 16px 0; }
.inv-page-dates dt { font-size: 12px; color: var(--muted); }
.inv-page-dates dd { margin: 2px 0 0; font-weight: 600; }
.inv-page-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0 0 8px;
  padding: 14px 0; border-block: 1px solid var(--border-soft); }
.inv-page-parties h3, .inv-page-section { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.inv-page-section { margin-block-start: 18px; }
.inv-page-parties p { margin: 0; line-height: 1.6; }
/* Arabic letters join: spacing them out or changing their case breaks the words. */
html[lang="ar"] .inv-page-parties h3, html[lang="ar"] .inv-page-section { letter-spacing: normal; text-transform: none; }
.inv-page-parties-note { margin: 0 0 8px; }
/* The line icons of the Invoices page (design proposals 30 and 31): one size beside a button label, one in an empty state. */
.card-toolbar .btn .ic-svg, #inv-table .btn .ic-svg, .inv-page-actions .btn .ic-svg {
  inline-size: 14px; block-size: 14px; display: inline-block; vertical-align: -2px; }
.empty-state .ico .ic-svg { inline-size: 44px; block-size: 44px; display: inline-block; }
.inv-back { margin: 0 0 10px; }
