/* Edge IT Desk — employee portal (help center, forms, my requests).
   Token-only (edge-shell.css --e-*): identical design in light and dark. DOM (nav, hero, tones, requisition
   panel) is built by employee.js; GLPI behaviour is unchanged. Width rule: pages use >= 50% of the screen. */
html.edge-employee { scroll-padding-top: 80px; }
.edge-employee body:not(.edge-login) { background: var(--e-glow), var(--e-canvas) !important; background-attachment: fixed !important; color: var(--e-ink-2); overflow: auto !important; }
.edge-employee body:not(.edge-login) :is(#navbar-menu, .navbar-vertical, header.navbar, .page > .navbar, .edge-screen-heading) { display: none !important; }
.edge-employee .page-wrapper { margin-left: 0 !important; padding-left: 0 !important; padding-top: 0 !important; min-height: 0 !important; }
.edge-employee .page { min-height: 0 !important; background: transparent !important; }
.edge-employee .edge-inline-overview { display: none !important; }

/* page width: one rule for every portal page */
html.edge-employee body :is(.container, .container-xl, .container-narrow, .container-fluid):not(.edge-keep-width) {
  max-width: var(--e-page-width) !important; width: 100% !important; padding-left: 24px !important; padding-right: 24px !important;
}
@media (min-width: 1200px) {
  .edge-employee :is(.page-body, .page-header) > :is(.container, .container-xl, .container-narrow) { min-width: 50vw; }
}

/* ---------- top bar ---------- */
.edge-portal-nav {
  position: sticky; top: 0; z-index: 100; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px max(24px, calc((100vw - var(--e-page-width)) / 2 + 24px)); background: var(--e-topbar); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--e-line); color: var(--e-ink); flex-wrap: wrap;
}
.edge-portal-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--e-ink) !important; white-space: nowrap; }
.edge-portal-brand img { width: 100px; height: 28px; object-fit: contain; content: url("/branding/edge-purple.svg"); }
:root[data-glpi-theme-dark="1"] .edge-portal-brand img { content: url("/branding/edge-white.svg"); }
.edge-portal-brand span {
  font: 600 11px/1 var(--e-font); letter-spacing: .02em; color: var(--e-brand-700); background: var(--e-brand-50);
  border: 1px solid var(--e-brand-100); padding: 4px 9px; border-radius: var(--e-radius-pill);
}
.edge-portal-nav nav { display: flex; align-items: center; flex-wrap: wrap; column-gap: 4px; row-gap: 6px; }
.edge-portal-nav nav a { color: var(--e-muted); font-size: 13.5px; font-weight: 600; text-decoration: none; padding: 8px 14px; border-radius: var(--e-radius-pill); }
.edge-portal-nav nav a:hover { background: var(--e-surface-2); color: var(--e-ink); }
.edge-portal-nav nav a[aria-current="page"] { background: var(--e-brand-50); color: var(--e-brand-700); }
.edge-portal-nav nav .edge-backend-link { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--e-line-strong); background: var(--e-surface); color: var(--e-ink-2); }
.edge-portal-nav nav .edge-backend-link:hover { background: var(--e-surface-2); }
.edge-portal-nav nav a:focus-visible, .edge-portal-nav .edge-theme-toggle:focus-visible { outline: 2px solid var(--e-brand-400); outline-offset: 2px; }
.edge-portal-nav .edge-theme-toggle { margin: 0 0 0 6px; }

/* ---------- hero (onedge.co hero gradient) ---------- */
.edge-portal-hero {
  position: relative; overflow: hidden; isolation: isolate; text-align: center; color: #fff; padding: 44px 24px 48px;
  background: var(--e-hero);
}
.edge-portal-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .7;
  background-image: radial-gradient(#ffffff14 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 30%, transparent 75%);
}
.edge-portal-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #e5d9f9; margin-bottom: 10px; }
.edge-spark { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #c6aafc; margin: 0 7px 1px 0; box-shadow: 0 0 12px #c6aafc; }
.edge-portal-hero h1 { font-size: clamp(28px, 3vw, 40px); font-weight: 700; letter-spacing: -.03em; margin: 0 0 8px; color: #fff; }
.edge-portal-hero p { color: #e5d9f9; margin: 0 0 24px; font-size: 15px; }
.edge-portal-search { max-width: 720px; margin: auto; }
.edge-portal-search .input-icon { margin: 0 !important; }
.edge-portal-search input {
  height: 52px !important; border-radius: var(--e-radius-pill) !important; border: 1px solid transparent !important; background: var(--e-surface) !important;
  color: var(--e-ink) !important; box-shadow: 0 12px 34px #2a074347 !important; font-size: 15px !important; padding-left: 22px !important;
}
.edge-portal-search input::placeholder { color: var(--e-subtle); }
.edge-portal-search .input-icon-addon { color: var(--e-brand-600); right: 8px; }

/* ---------- catalog ---------- */
.edge-catalog .page-header { padding-top: 28px !important; margin-bottom: 0 !important; }
.edge-catalog .page-header h1 { font-size: 16px !important; font-weight: 650; color: var(--e-ink) !important; }
.edge-catalog .page-header h1 > .d-flex { gap: 12px; align-items: center; flex-wrap: wrap; }
.edge-catalog .page-header .breadcrumb { margin: 0; font-size: 15px; }
.edge-catalog .page-header :is(label, .text-muted, span) { color: var(--e-muted) !important; }
.edge-catalog [data-glpi-service-catalog-items] > .row, .edge-catalog .service-catalog-items { row-gap: 4px; }
.edge-catalog .service-catalog-item {
  position: relative; overflow: hidden; min-height: 116px; margin: 8px 0 !important; background: var(--e-surface) !important; color: var(--e-ink-2) !important;
  border: 1px solid var(--e-line) !important; border-radius: var(--e-radius-lg) !important; box-shadow: var(--e-shadow-1) !important;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.edge-catalog .service-catalog-item:hover { border-color: var(--e-brand-200) !important; box-shadow: var(--e-shadow-lilac) !important; transform: translateY(-2px); }
.edge-catalog .service-catalog-item:focus-within { outline: 2px solid var(--e-brand-400); outline-offset: 2px; }
.edge-catalog .service-catalog-item .card-body { padding: 20px 44px 20px 20px !important; }
.edge-catalog .service-catalog-item .ms-4 { margin-left: 16px !important; }
.edge-catalog .service-catalog-item h2 { font-size: 15.5px !important; font-weight: 650 !important; color: var(--e-ink) !important; line-height: 1.3; }
.edge-catalog .service-catalog-description, .edge-catalog .service-catalog-description * { font-size: 13px !important; line-height: 1.55; color: var(--e-muted) !important; }
.edge-catalog .service-catalog-description { margin-top: 6px; }
.edge-portal-icon {
  width: 44px; height: 44px; min-width: 44px; display: grid; place-items: center; border-radius: 12px; font-size: 22px;
  background: var(--e-brand-50); color: var(--e-brand-600); border: 1px solid var(--e-brand-100);
}
:root[data-glpi-theme-dark="1"] .edge-portal-icon { color: var(--e-brand-700); }
.edge-card-arrow { position: absolute; right: 18px; top: 20px; font-size: 18px; color: var(--e-subtle); transition: transform .18s, color .18s; }
.service-catalog-item:hover .edge-card-arrow { transform: translate(2px, -2px); color: var(--e-brand-600); }
/* category tones: tinted chip in both themes (alpha tints read on light and dark surfaces) */
.edge-catalog [data-edge-tone] .edge-portal-icon { background: color-mix(in srgb, var(--tone) 12%, transparent); border-color: color-mix(in srgb, var(--tone) 26%, transparent); color: var(--tone); }
.edge-catalog [data-edge-tone=purple] { --tone: #7c3aed; }
.edge-catalog [data-edge-tone=blue] { --tone: #0284c7; }
.edge-catalog [data-edge-tone=rose] { --tone: #db2777; }
.edge-catalog [data-edge-tone=green] { --tone: #059669; }
.edge-catalog [data-edge-tone=amber] { --tone: #d97706; }
.edge-catalog [data-edge-tone=cyan] { --tone: #0d9488; }
:root[data-glpi-theme-dark="1"] .edge-catalog [data-edge-tone=purple] { --tone: #c6aafc; }
:root[data-glpi-theme-dark="1"] .edge-catalog [data-edge-tone=blue] { --tone: #7dd3fc; }
:root[data-glpi-theme-dark="1"] .edge-catalog [data-edge-tone=rose] { --tone: #f9a8d4; }
:root[data-glpi-theme-dark="1"] .edge-catalog [data-edge-tone=green] { --tone: #6ee7b7; }
:root[data-glpi-theme-dark="1"] .edge-catalog [data-edge-tone=amber] { --tone: #fcd34d; }
:root[data-glpi-theme-dark="1"] .edge-catalog [data-edge-tone=cyan] { --tone: #5eead4; }

/* ---------- requisition feature card ---------- */
.edge-catalog .edge-requisition-column { width: 100% !important; order: -1; }
.edge-catalog .edge-requisition-feature { min-height: 116px; border: 0 !important; background: var(--e-hero) !important; box-shadow: var(--e-shadow-lilac) !important; }
.edge-catalog .edge-requisition-feature :is(h2, h2 *) { color: #fff !important; font-size: 19px !important; }
.edge-catalog .edge-requisition-feature :is(.service-catalog-description, .service-catalog-description *) { color: #e5d9f9 !important; }
.edge-catalog .edge-requisition-feature .edge-portal-icon { background: #ffffff24; color: #fff; border-color: #ffffff40; width: 52px; height: 52px; min-width: 52px; font-size: 26px; }
.edge-catalog .edge-requisition-feature .edge-card-arrow { color: #fff; font-size: 24px; }
.edge-requisition-route { font-size: 12px; color: #e5d9f9 !important; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- approval & fulfilment panel ---------- */
.edge-requisition-process {
  background: var(--e-surface); border: 1px solid var(--e-brand-200); border-radius: var(--e-radius-lg); padding: 18px 20px; margin: 0 0 20px;
  box-shadow: var(--e-shadow-1); color: var(--e-ink-2);
}
.edge-process-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--e-ink); }
.edge-process-top strong { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--e-ink); }
.edge-process-top strong i { color: var(--e-brand-600); font-size: 18px; }
:root[data-glpi-theme-dark="1"] .edge-process-top strong i { color: var(--e-brand-700); }
.edge-process-top span { font-size: 12px; font-weight: 600; background: var(--e-brand-50); color: var(--e-brand-700); border: 1px solid var(--e-brand-200); padding: 3px 10px; border-radius: var(--e-radius-pill); }
.edge-process-top span.is-warning { background: var(--e-warning-50); color: var(--e-warning-700); border-color: var(--e-warning-200); }
.edge-process-top span.is-success { background: var(--e-success-50); color: var(--e-success-700); border-color: var(--e-success-200); }
.edge-process-top span.is-danger { background: var(--e-danger-50); color: var(--e-danger-700); border-color: var(--e-danger-200); }
.edge-requisition-process ol { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 0; margin: 16px 0 12px; }
.edge-requisition-process li {
  font-size: 13px; color: var(--e-ink-2); background: var(--e-surface-2); border: 1px solid var(--e-line); border-radius: var(--e-radius); padding: 10px 12px;
}
.edge-requisition-process li.is-done { border-color: var(--e-success-200); background: var(--e-success-50); }
.edge-requisition-process li.is-current { border-color: var(--e-brand-300); background: var(--e-brand-50); box-shadow: inset 3px 0 0 var(--e-brand-600); }
.edge-requisition-process li.is-refused { border-color: var(--e-danger-200); background: var(--e-danger-50); }
.edge-requisition-process b { display: block; font-size: 11.5px; letter-spacing: .04em; color: var(--e-brand-600); margin-bottom: 3px; }
:root[data-glpi-theme-dark="1"] .edge-requisition-process b { color: var(--e-brand-700); }
.edge-requisition-process p { font-size: 12.5px; color: var(--e-muted); margin: 0; line-height: 1.55; }

/* ---------- forms (GLPI form renderer) ---------- */
.edge-employee .form-renderer, .form-renderer {
  margin: 28px 0 !important; background: var(--e-surface); border: 1px solid var(--e-line); border-radius: var(--e-radius-xl);
  padding: 28px 32px; box-shadow: var(--e-shadow-2); color: var(--e-ink-2);
}
.form-renderer .form-title { font-size: 28px !important; font-weight: 700; color: var(--e-ink) !important; letter-spacing: -.025em; }
.form-renderer .form-description, .form-renderer .form-description * { color: var(--e-muted) !important; font-size: 14px; line-height: 1.6; max-width: 110ch; }
.form-renderer [data-glpi-form-renderer-section] > .card { background: transparent; border: 0 !important; box-shadow: none; }
.form-renderer [data-glpi-form-renderer-section] > .card > .card-body {
  padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); column-gap: 24px; row-gap: 6px;
}
/* long text, rich text, uploads and multi-block rows take the full row */
.form-renderer [data-glpi-form-renderer-horizontal-blocks]:is(:has(.tox, textarea, input[type=file], .fileupload, [data-glpi-form-renderer-comment]), :has(> section + section)),
.form-renderer .card-body > :not([data-glpi-form-renderer-horizontal-blocks]) { grid-column: 1 / -1; }
.form-renderer [data-glpi-form-renderer-horizontal-blocks] { display: flex; gap: 24px; min-width: 0; }
.form-renderer [data-glpi-form-renderer-question] h3 { font-size: 13.5px; font-weight: 650; color: var(--e-ink) !important; margin-bottom: 8px !important; }
.form-renderer .block-description, .form-renderer .block-description * { color: var(--e-subtle) !important; font-size: 12.5px; }
.form-renderer [data-glpi-form-renderer-actions] .btn { min-height: 42px; padding: 0 22px; }
.form-renderer .bg-primary.rounded-top { background: var(--e-brand-50) !important; color: var(--e-brand-700) !important; border-radius: var(--e-radius) var(--e-radius) 0 0 !important; }

/* requisition panel beside the form on wide screens */
@media (min-width: 1400px) {
  .form-renderer:has(> .edge-requisition-process) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); column-gap: 32px; align-items: start; }
  .form-renderer:has(> .edge-requisition-process) > * { grid-column: 1; }
  .form-renderer:has(> .edge-requisition-process) > [data-glpi-form-renderer-form-header] { grid-column: 1 / -1; }
  .form-renderer > .edge-requisition-process { grid-column: 2 !important; grid-row: 2 / span 30; position: sticky; top: 84px; margin: 0; }
  .form-renderer > .edge-requisition-process ol { grid-template-columns: 1fr; }
}

/* ---------- my requests ---------- */
.edge-requests-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 28px max(24px, calc((100vw - var(--e-page-width)) / 2 + 24px)) 10px;
}
.edge-requests-heading h1 { font-size: 28px; font-weight: 700; color: var(--e-ink); margin-bottom: 6px; letter-spacing: -.025em; }
.edge-requests-heading p { color: var(--e-muted); margin: 0; font-size: 14px; }

@media (max-width: 700px) {
  .edge-portal-nav { padding: 10px 16px; }
  .edge-portal-hero { padding: 28px 16px 32px; }
  .edge-employee :is(.container, .container-xl, .container-narrow, .container-fluid) { padding-left: 16px !important; padding-right: 16px !important; }
  .edge-employee .form-renderer, .form-renderer { padding: 18px; margin: 12px 0 !important; border-radius: var(--e-radius-lg); }
  .edge-requests-heading { padding: 20px 16px 6px; flex-direction: column; align-items: flex-start; }
  .edge-process-top { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .edge-catalog .service-catalog-item, .edge-card-arrow { transition: none !important; transform: none !important; } }

/* no dead space above portal content */
.edge-employee .page-body { margin-top: 0 !important; padding-top: 0 !important; }
.edge-employee .page-header:empty { display: none; }
.edge-employee .form-renderer.mt-n5, .edge-employee .form-renderer { margin-top: 24px !important; }
