/*
 * LAFEX web design standard
 * Brand: #FE4C04 | Action: #D03E03 | Canvas: #F6F7F9 | Ink: #172033
 * Type: IBM Plex Sans Arabic 400 body / 600-700 headings and actions
 * Spacing: 4px base | Controls: >= 44px | Radius: 12-24px
 * The darker orange is reserved for text/actions to maintain WCAG contrast;
 * the original brand orange remains the primary visual identifier.
 */
:root {
  color-scheme: light;
  --lafex-brand: #fe4c04;
  --lafex-brand-strong: #d03e03;
  --lafex-brand-soft: #fff7f3;
  --lafex-ink: #172033;
  --lafex-muted: #667085;
  --lafex-line: #e6e9ef;
  --lafex-canvas: #f6f7f9;
  --lafex-surface: #ffffff;
  --lafex-radius: 1rem;
  --lafex-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --lafex-shadow-raised: 0 16px 40px rgba(16, 24, 40, .12);
}

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  background: var(--lafex-canvas);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-synthesis: none;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--lafex-canvas);
  color: var(--lafex-ink);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
img, video, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

::selection {
  color: #762708;
  background: #ffd5c6;
}

:focus-visible {
  outline: 3px solid rgba(254, 76, 4, .34) !important;
  outline-offset: 3px !important;
}

.lafex-skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  right: .75rem;
  transform: translateY(-180%);
  border-radius: .75rem;
  background: var(--lafex-ink);
  color: #fff;
  padding: .7rem 1rem;
  font-weight: 700;
  transition: transform .2s ease;
}

.lafex-skip-link:focus { transform: translateY(0); }

.lafex-network-banner {
  position: fixed;
  inset-inline: .75rem;
  top: .75rem;
  z-index: 90;
  margin-inline: auto;
  display: flex;
  max-width: 42rem;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  border: 1px solid #f59e0b;
  border-radius: .9rem;
  background: #fffbeb;
  color: #92400e;
  padding: .75rem 1rem;
  box-shadow: var(--lafex-shadow-raised);
  font-size: .875rem;
  font-weight: 700;
}

.lafex-request-progress {
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  z-index: 110;
  height: 3px;
  width: 0;
  opacity: 0;
  background: linear-gradient(90deg, #ffae91, var(--lafex-brand), #d03e03);
  transition: width .35s ease, opacity .2s ease;
}

.lafex-request-progress.is-active { width: 72%; opacity: 1; }
.lafex-request-progress.is-done { width: 100%; opacity: 0; }

.lafex-app-shell { min-height: 100dvh; }
.lafex-content { min-width: 0; }
.lafex-main { width: 100%; min-width: 0; }
.lafex-main-inner { width: 100%; max-width: 96rem; margin-inline: auto; }

.lafex-sidebar {
  background: linear-gradient(180deg, #fff 0%, #fff9f7 100%);
  border-color: #eceff3;
}

.lafex-sidebar-brand {
  min-height: 4.75rem;
  border-bottom: 1px solid #f0f1f3;
}

.lafex-sidebar nav a {
  min-height: 2.75rem;
  border-radius: .8rem;
  transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.lafex-sidebar nav a:hover { transform: translateX(-2px); }

.lafex-topbar {
  min-width: 0;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .05);
  backdrop-filter: blur(14px);
}

.lafex-icon-button {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: .8rem;
  color: #475467;
  transition: background-color .18s ease, color .18s ease;
}

.lafex-icon-button:hover { color: var(--lafex-brand-strong); background: var(--lafex-brand-soft); }

.lafex-main [class*="rounded-xl"][class*="bg-white"][class*="ring-gray-200"],
.lafex-main [class*="rounded-xl"][class*="bg-white"][class*="shadow"] {
  border: 1px solid var(--lafex-line);
  box-shadow: var(--lafex-shadow);
}

.lafex-main h1 { letter-spacing: -.02em; }
.lafex-main h2, .lafex-main h3 { color: var(--lafex-ink); }

.lafex-main nav[aria-label="Breadcrumb"],
.lafex-main nav:not([aria-label="Pagination"]) > ol {
  max-width: 100%;
  overflow-x: auto;
  padding-block: .25rem;
  scrollbar-width: none;
}

.lafex-main nav > ol::-webkit-scrollbar { display: none; }

.lafex-main table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.lafex-main thead { background: #f8fafc; }
.lafex-main th { color: #475467; letter-spacing: .025em; }
.lafex-main tbody tr { transition: background-color .15s ease; }
.lafex-main tbody tr:hover { background: #fff9f7; }
.lafex-main .overflow-x-auto { overscroll-behavior-inline: contain; scrollbar-color: #d0d5dd transparent; }

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 3rem;
  max-width: 100%;
  border-color: #d0d5dd !important;
  background-color: #fff !important;
  color: var(--lafex-ink) !important;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

textarea { min-height: 7.5rem; resize: vertical; }

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover { border-color: #98a2b3 !important; }

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--lafex-brand) !important;
  box-shadow: 0 0 0 4px rgba(254, 76, 4, .12) !important;
  outline: none !important;
}

input::placeholder, textarea::placeholder { color: #98a2b3; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; background: #f2f4f7 !important; color: #667085 !important; }

button[type="submit"],
input[type="submit"],
.lafex-main a[class*="px-4"][class*="py-2"] { min-height: 2.75rem; }

a[class*="bg-primary-"][class*="text-white"],
button[class*="bg-primary-"][class*="text-white"],
input[type="submit"][class*="bg-primary-"] {
  background-color: var(--lafex-brand-strong) !important;
}

a[class*="bg-primary-"][class*="text-white"]:hover,
button[class*="bg-primary-"][class*="text-white"]:hover,
input[type="submit"][class*="bg-primary-"]:hover {
  background-color: #b63502 !important;
}

a[class*="text-primary-500"],
a[class*="text-primary-600"],
button[class*="text-primary-500"],
button[class*="text-primary-600"] {
  color: var(--lafex-brand-strong) !important;
}

form[data-submitting="true"] button[type="submit"] {
  pointer-events: none;
  opacity: .78;
}

form[data-submitting="true"] button[type="submit"]::before {
  content: "";
  width: 1rem;
  height: 1rem;
  margin-inline-end: .5rem;
  border: 2px solid currentColor;
  border-inline-start-color: transparent;
  border-radius: 999px;
  animation: lafex-spin .7s linear infinite;
}

.lafex-auth-shell {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow: hidden;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 92% 8%, rgba(254,76,4,.15), transparent 34rem),
    radial-gradient(circle at 4% 92%, rgba(254,76,4,.08), transparent 28rem),
    #f8fafc;
}

.lafex-auth-shell::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: .22;
  background-image: radial-gradient(#fe4c04 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.lafex-auth-card {
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 1.5rem;
  background: rgba(255,255,255,.96);
  box-shadow: 0 24px 70px rgba(41, 23, 12, .11);
}

.lafex-password-field { position: relative; }
.lafex-password-field input { padding-inline-end: 3.25rem !important; }
.lafex-password-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: .45rem;
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  border-radius: .65rem;
  color: #667085;
}
.lafex-password-toggle:hover { color: var(--lafex-brand-strong); background: var(--lafex-brand-soft); }

.lafex-marketing { width: 100%; max-width: 100%; overflow-x: clip; }
.lafex-marketing article { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.lafex-marketing article:hover { transform: translateY(-3px); border-color: #ffae91; box-shadow: var(--lafex-shadow); }

@keyframes lafex-spin { to { transform: rotate(360deg); } }

@media (max-width: 639px) {
  .lafex-auth-shell { padding: 1.25rem 1rem 2rem; }
  .lafex-auth-card { border-radius: 1.25rem; padding: 1.5rem !important; }
  .lafex-main { padding: 1rem !important; }
  .lafex-main .sm\:flex { min-width: 0; }
  .lafex-main table { font-size: .875rem; }
  .lafex-main th, .lafex-main td { padding-inline: .85rem !important; }
  .lafex-marketing h1 { font-size: clamp(1.95rem, 8.8vw, 2.55rem); line-height: 1.24; }
  .lafex-marketing h2 { font-size: clamp(1.65rem, 8vw, 2.1rem); line-height: 1.3; }
  .lafex-marketing header img { max-width: 8.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .lafex-sidebar, .lafex-topbar, .lafex-network-banner, .lafex-skip-link, button { display: none !important; }
  .lafex-content { margin: 0 !important; }
  body, .lafex-main { background: #fff !important; }
}
