/*
 * INT shared component library — reusable primitives built on int-tokens.css,
 * matching the real INT.sa Webflow patterns documented in int-patterns.md.
 * Loaded after the page's existing stylesheet(s): intentionally overrides
 * parts of the old purple/dark theme as pages adopt these classes.
 */

/* ---- base chrome: header/nav/footer/body, shared across all shell pages ---- */
body {
  background: var(--int-color-black);
  color: var(--int-color-white);
  font-family: var(--int-font-body);
}
html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] button {
  font-family: var(--int-font-arabic);
}
header,
footer {
  background: var(--int-color-black);
  border-color: var(--int-color-stroke);
}
footer {
  background: var(--int-color-black-lite);
  padding-block: var(--int-space-8xl);
}
.brand {
  color: var(--int-color-white);
}
.brand-logo {
  display: block;
  block-size: 34px;
  inline-size: auto;
}
.brand i,
.brand .dot {
  background: var(--int-color-green) !important;
  box-shadow: none !important;
}
a {
  color: var(--int-color-green);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--int-color-green);
  outline-offset: 3px;
}
button:hover {
  border-color: var(--int-color-green);
}

/* ---- buttons ---- */
/* button-01/02 pattern: green pill, two-layer hover text+icon swap. Markup
   shape (do not simplify — single-layer icon/text breaks the shared hover
   transform, see int-patterns.md):
   <a class="int-btn-primary">
     <span class="int-btn-primary-text-mask"><span class="int-btn-primary-text-wrap">
       <span class="int-btn-primary-title-1">Label</span><span class="int-btn-primary-title-2">Label</span>
     </span></span>
     <span class="int-btn-primary-arrow-mask"><span class="int-btn-primary-arrow-wrap">
       <img class="int-btn-primary-arrow"/><img class="int-btn-primary-arrow"/>
     </span></span>
   </a> */
.int-btn-primary,
.primary {
  display: inline-flex;
  align-items: center;
  gap: var(--int-space-s);
  background: var(--int-color-green) !important;
  color: var(--int-color-dark) !important;
  border: 0 !important;
  border-radius: var(--int-radius-8xl);
  padding: var(--int-space-xl) var(--int-space-xxl);
  font-weight: var(--int-font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--int-motion-slow), opacity var(--int-motion-slow);
}
.int-btn-primary:hover,
.primary:hover {
  opacity: .88;
}
.int-btn-primary-text-mask,
.int-btn-primary-arrow-mask {
  display: inline-block;
  overflow: hidden;
  position: relative;
}
.int-btn-primary-text-wrap,
.int-btn-primary-arrow-wrap {
  display: flex;
  flex-direction: column;
  transition: transform var(--int-motion-slow);
}
.int-btn-primary:hover .int-btn-primary-text-wrap,
.int-btn-primary:hover .int-btn-primary-arrow-wrap {
  transform: translate3d(0, -100%, 0);
}
.int-btn-primary-arrow {
  width: 16px;
  height: 16px;
  display: block;
}

/* button-03 pattern: plain inline text+arrow link, no pill/background. */
.int-btn-secondary,
.quiet {
  display: inline-flex;
  align-items: center;
  gap: var(--int-space-xs);
  color: var(--int-color-white) !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  font-weight: var(--int-font-weight-medium);
  text-decoration: none;
  cursor: pointer;
}
.int-btn-secondary::after {
  content: "→";
  color: var(--int-color-green);
}
html[dir="rtl"] .int-btn-secondary::after {
  content: "←";
}
.int-btn-secondary:hover {
  color: var(--int-color-green) !important;
}

/* ---- cards ---- */
.int-card,
.portal article,
.estimate {
  background: var(--int-color-black-lite);
  border: 1px solid var(--int-color-stroke);
  border-radius: var(--int-radius-l);
  padding: var(--int-space-6xl);
}
.int-card-pricing {
  background: var(--int-color-black);
  border: 1px solid var(--int-color-stroke);
  border-radius: var(--int-radius-xl);
  padding: var(--int-space-7xl);
  text-align: center;
}
.int-card-pricing .int-card-accent {
  color: var(--int-color-green);
}
.int-card-service {
  background: var(--int-color-black-lite);
  border-radius: var(--int-radius-xl);
  padding: var(--int-space-6xl);
  border-inline-start: 3px solid var(--int-color-green);
}

/* ---- form controls ---- */
.int-input,
.int-select {
  width: 100%;
  background: var(--int-color-black-lite);
  color: var(--int-color-white);
  border: 1px solid var(--int-color-stroke);
  border-radius: var(--int-radius-s);
  padding: var(--int-space-xxl);
  font: inherit;
}
.int-input:focus-visible,
.int-select:focus-visible {
  outline: 3px solid var(--int-color-green);
  outline-offset: 2px;
  border-color: var(--int-color-green);
}
.int-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--int-color-green) 50%),
    linear-gradient(135deg, var(--int-color-green) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
html[dir="rtl"] .int-select {
  background-position: 20px center, 15px center;
}

/* ---- progress indicator ---- */
.int-progress {
  width: 100%;
  height: 4px;
  background: var(--int-color-stroke);
  border-radius: var(--int-radius-xxxs);
  overflow: hidden;
}
.int-progress > span {
  display: block;
  height: 100%;
  background: var(--int-color-green);
  transition: width var(--int-motion-base);
}

/* ---- modal ---- */
.int-modal-backdrop {
  position: fixed;
  inset: 0;
  background: #000000b3;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.int-modal {
  background: var(--int-color-black-lite);
  border: 1px solid var(--int-color-stroke);
  border-radius: var(--int-radius-xl);
  box-shadow: var(--int-shadow-lifted);
  padding: var(--int-space-7xl);
  max-width: 480px;
  width: calc(100% - 2 * var(--int-space-6xl));
}

/* ---- notification ---- */
.int-notification {
  display: flex;
  align-items: center;
  gap: var(--int-space-l);
  background: var(--int-color-black-lite);
  border: 1px solid var(--int-color-stroke);
  border-inline-start: 3px solid var(--int-color-green);
  border-radius: var(--int-radius-s);
  padding: var(--int-space-xxl) var(--int-space-4xl);
}
.int-notification.is-error {
  border-inline-start-color: var(--int-color-red);
}
.int-notification.is-warning {
  border-inline-start-color: var(--int-color-yellow);
  color: var(--int-color-black);
  background: var(--int-color-yellow);
}

/* ---- dashboard nav (portal/admin header acting as a lightweight dashboard bar) ---- */
.int-dash-nav {
  display: flex;
  align-items: center;
  gap: var(--int-space-xxl);
}
.int-dash-nav a {
  color: var(--int-color-grey);
  text-decoration: none;
  padding: var(--int-space-s) var(--int-space-l);
  border-radius: var(--int-radius-s);
}
.int-dash-nav a:hover,
.int-dash-nav a[aria-current="page"] {
  color: var(--int-color-green);
  background: var(--int-color-black-lite);
}

@media (max-width: 767px) {
  .int-card,
  .int-card-pricing,
  .int-card-service {
    padding: var(--int-space-4xl);
  }
}

.int-error {
  background: var(--int-color-error-bg);
  color: var(--int-color-error-ink);
  border: 1px solid var(--int-color-error-border);
  border-radius: var(--int-radius-s);
  padding: var(--int-space-l) var(--int-space-xxl);
  font-size: var(--int-p4-size);
}

#locale-toggle {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 9px 13px;
  border-radius: var(--int-radius-8xl);
  color: inherit;
  background: rgba(136, 142, 158, .13);
  border: 1px solid rgba(136, 142, 158, .28);
  cursor: pointer;
}

header.nav {
  display: block;
  padding: 10px 0 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
footer.footer {
  display: block;
  padding: 72px 0 34px;
  border-bottom: 0;
}
.int-logo-nav { width: 80px; height: auto; display: block; }
.int-logo-foot { width: 92px; height: auto; display: block; }
.int-foot-intro { margin-top: 16px; max-width: 320px; }
.int-foot-meta-block { margin-top: 22px; }
.int-foot-contact { max-width: 280px; margin-bottom: 14px; }

nav.nav-links {
  margin-top: 0;
  align-items: center;
}
.portal h1,
section[role="main"] h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -.02em;
}

html,body{overflow-x:hidden;overflow-x:clip}
header.nav .row{flex-wrap:wrap;row-gap:8px}
header.nav .nav-right{flex-wrap:wrap;justify-content:flex-end;gap:12px}
header.nav{height:auto;min-height:0}
header.nav .row{height:auto;padding-block:12px}

.int-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  margin-block: 24px;
}
.int-overview-card h3 { margin-block-start: 0; }
.int-overview-card p { margin-block: 6px; overflow-wrap: anywhere; }

.customers-filter {
  display: grid;
  gap: 8px;
  margin-block: 16px;
}
@media (min-width: 640px) {
  .customers-filter { grid-template-columns: 1fr 180px auto; align-items: end; }
}
.customers-filter input,
.customers-filter select {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #ffffff26;
  background: transparent;
  color: inherit;
  font: inherit;
  width: 100%;
}
.customers-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-block: 16px;
}
.customers-pager button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid #ffffff26;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.customers-pager button:disabled { opacity: .4; cursor: default; }
.customers-pager button:focus-visible { outline: 2px solid #c8ff3d; outline-offset: 2px; }

.audit-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}
.audit-row {
  width: 100%;
  min-height: 44px;
  display: grid;
  gap: 4px;
  text-align: start;
  padding: 12px 16px;
  border: 1px solid #ffffff26;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.audit-row:hover { border-color: #c8ff3d; }
.audit-row:focus-visible { outline: 2px solid #c8ff3d; outline-offset: 2px; }
.audit-row .audit-when { opacity: .7; font-size: 0.9em; }
@media (min-width: 720px) {
  .audit-row { grid-template-columns: 2fr 1.5fr 2fr 1.5fr; align-items: center; }
}
#audit-detail dl { display: grid; gap: 8px; margin: 0; }
#audit-detail dt { opacity: .7; font-size: 0.9em; }
#audit-detail dd { margin: 0 0 8px; overflow-wrap: anywhere; }
.audit-failed { color: #ff8a8a; font-weight: 600; }

.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(100%, 420px); display: grid; gap: 12px; }
.login-form { display: grid; gap: 8px; }
.login-form input {
  min-height: 44px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid #ffffff26; background: transparent; color: inherit; font: inherit; width: 100%;
}
.login-form input:focus-visible { outline: 2px solid #c8ff3d; outline-offset: 2px; }
.login-form button { min-height: 44px; margin-block-start: 8px; }
.login-error { color: #ff8a8a; margin: 0; }

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
  align-items: start;
}
.admin-side { position: sticky; top: 16px; display: grid; gap: 4px; }
.admin-side a, .admin-side button {
  display: block;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.admin-side a:hover, .admin-side button:hover { border-color: #ffffff26; }
.admin-side a[aria-current="page"] { background: #c8ff3d1f; border-color: #c8ff3d66; color: #c8ff3d; }
.admin-side a:focus-visible, .admin-side button:focus-visible { outline: 2px solid #c8ff3d; outline-offset: 2px; }
.admin-side .admin-side-sep { height: 1px; background: #ffffff1a; margin: 8px 0; }
.admin-shell > .portal { min-width: 0; }
@media (max-width: 767px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; grid-auto-flow: column; overflow-x: auto; padding-bottom: 4px; }
  .admin-side a, .admin-side button { white-space: nowrap; }
  .admin-side .admin-side-sep { display: none; }
}

.quote-panel { display: grid; gap: 12px; margin-block: 24px; }
.quote-controls { display: grid; gap: 8px; }
.quote-controls input, .quote-controls select {
  min-height: 44px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid #ffffff26; background: transparent; color: inherit; font: inherit; width: 100%;
}
.table-scroll { overflow-x: auto; max-width: 100%; }
.quote-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.quote-table th, .quote-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid #ffffff1a; vertical-align: top; }
.quote-table th { opacity: .7; font-weight: 600; font-size: .9em; }
.quote-table td button { min-height: 44px; margin: 2px 0; }
@media (min-width: 720px) { .quote-controls { grid-template-columns: 2fr 1fr 1fr; } }

/* Operations center: existing INT tokens, contained tables and native disclosure forms. */
.ops-jumps { display:flex; flex-wrap:wrap; gap:8px; margin-block:16px 24px; }
.ops-jumps a { padding:10px 14px; border:1px solid var(--int-border, #ffffff26); border-radius:24px; min-height:44px; color:inherit; text-decoration:none; }
.ops-jumps a:hover { color:var(--int-accent, #c8ff3d); }
.ops-section { margin-block:24px; padding:clamp(12px,2vw,24px); background:#ffffff04; border:1px solid #ffffff18; border-radius:16px; min-width:0; scroll-margin-block-start:20px; }
.ops-section h2 { font-size:clamp(1.3rem,2vw,1.8rem); margin-block:0 16px; }
.ops-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:12px; margin-block:16px; }
.ops-grid .int-card { min-width:0; padding:18px; overflow-wrap:anywhere; }
.ops-grid strong { font-size:2rem; color:var(--int-accent, #c8ff3d); }
body[data-admin-page="operations"] form { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:12px; padding-block:16px; }
body[data-admin-page="operations"] form h3, body[data-admin-page="operations"] form small { grid-column:1/-1; }
body[data-admin-page="operations"] label { display:grid; gap:6px; min-width:0; }
body[data-admin-page="operations"] input:not([type="checkbox"]), body[data-admin-page="operations"] select, body[data-admin-page="operations"] textarea { width:100%; min-width:0; min-height:44px; box-sizing:border-box; }
body[data-admin-page="operations"] summary { min-height:44px; padding-block:10px; cursor:pointer; }
body[data-admin-page="operations"] td { overflow-wrap:anywhere; max-width:320px; }
body[data-admin-page="operations"] td small { display:block; opacity:.75; margin-block-start:6px; }
body[data-admin-page="operations"] button { min-height:44px; }
body[data-admin-page="operations"] section { min-width:0; }
body[data-admin-page="operations"] .table-scroll:focus-visible { outline:2px solid #c8ff3d; outline-offset:2px; }
body[data-admin-page="operations"] .quote-controls { margin-block:12px; }
body[data-admin-page="operations"] .customers-pager { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-block:12px; }
body[data-admin-page="operations"] td small { opacity:1; color:#bdc6d6; }
/* Grid items with auto margins otherwise retain their table's intrinsic width. */
body[data-admin-page="operations"] .admin-shell > .portal { width:100%; max-width:100%; margin:0; box-sizing:border-box; }
body[data-admin-page="operations"] .quote-panel { grid-template-columns:minmax(0,1fr); }
body[data-admin-page="operations"] .table-scroll { min-width:0; width:100%; }

@media (max-width: 767px) {
  details.ops-section,
  details:has(> form.question-editor) {
    padding-inline: 0 !important;
    margin-inline: 0 !important;
    border-width: 0 !important;
  }
  form.question-editor article {
    padding-inline: 12px !important;
  }
}

@media (max-width: 767px) {
  .quote-table {
    min-width: 0;
  }
  .quote-table thead {
    display: none;
  }
  .quote-table,
  .quote-table tbody,
  .quote-table tr,
  .quote-table td {
    display: block;
    width: 100%;
  }
  .quote-table tr {
    border: 1px solid #ffffff26;
    border-radius: 12px;
    padding: 8px 12px;
    margin-block: 8px;
  }
  .quote-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 0;
  }
  .quote-table td::before {
    content: attr(data-label);
    opacity: 0.7;
    font-size: 0.9em;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .quote-table td:last-child {
    flex-direction: column;
    align-items: stretch;
  }
  .quote-table td:last-child::before {
    content: none;
  }
}

.portal form {
  min-width: 0;
  max-width: min(520px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 767px) {
  .portal input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }
}
