/* بوابة عملاء كريميديا — RTL */
.portal-body {
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  background: var(--color-bg, #0a0a0a);
  color: var(--color-text, #f5f5f5);
  min-height: 100vh;
}

.portal-body--minimal {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.portal-shell {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.portal-card {
  background: #141414;
  border: 1px solid rgba(198, 167, 94, 0.35);
  border-radius: 0.75rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.portal-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.portal-brand__title {
  color: #c6a75e;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.portal-brand__sub {
  color: #a3a3a3;
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}

.portal-form .form-field {
  margin-bottom: 1rem;
}

.portal-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.portal-form input[type="email"],
.portal-form input[type="password"],
.portal-form input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #333;
  border-radius: 0.5rem;
  background: #0f0f0f;
  color: #f5f5f5;
}

.portal-form__hint {
  font-size: 0.85rem;
  color: #a3a3a3;
  margin-top: 0.35rem;
}

.portal-form__hint.text-center {
  text-align: center;
}

.portal-form__hint--register {
  margin-top: 1.25rem;
}

/* شعار الرئيسية (نفس karimedia-logo-gold-nav) — مصغّر أسفل نموذج الدخول */
.portal-login-home {
  margin: 1rem 0 0;
  text-align: center;
}

.portal-login-home__brand.brand.brand--home-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  max-width: none;
  min-width: 0;
  text-decoration: none;
}

.portal-login-home__brand.brand.brand--home-gold:hover,
.portal-login-home__brand.brand.brand--home-gold:focus-visible {
  box-shadow: none;
}

.portal-login-home__brand:focus-visible {
  outline: 2px solid #c6a75e;
  outline-offset: 4px;
  border-radius: 0.35rem;
}

.portal-login-home__brand .brand__logo--home-gold {
  display: block;
  width: 120px;
  max-width: 100%;
  height: auto;
  min-width: 0;
  opacity: 1;
  filter: none;
  mix-blend-mode: normal;
}

.portal-form__error {
  color: #f87171;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.portal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* رأس البوابة: يعيد استخدام .nav-bar من style.css (خلفية كحلية + زخارف + خط ذهبي) */
.portal-body {
  --portal-header-compact-max: 1160px;
}

.portal-site-header.site-header--compact {
  position: static;
  width: 100%;
  max-width: 100vw;
  z-index: 1;
  box-sizing: border-box;
}

body.portal-body:not(.portal-body--minimal):has(> .portal-site-header) {
  padding-top: 0;
}

.portal-site-header .portal-nav-toggle {
  display: none;
}

.portal-header__welcome-bar {
  width: min(100% - 2rem, var(--max-width));
  max-width: 100%;
  margin: 0 auto;
  padding: 0.25rem 0.5rem 0.4rem;
  box-sizing: border-box;
  text-align: right;
}

.portal-header__welcome {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  color: #d8d8d8;
}

.portal-header__welcome-name {
  color: #c59b27;
  font-weight: 700;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.portal-page-heading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(100% - 2rem, var(--max-width));
  max-width: 100%;
  margin: 0.35rem auto 20px;
  padding: 0 0.5rem;
  box-sizing: border-box;
  text-align: center;
}

.portal-page-heading__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  color: #c59b27;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: normal;
}

.portal-page-heading__rule {
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: rgba(197, 155, 39, 0.42);
}

@media (max-width: 720px) {
  .portal-page-heading {
    margin: 0.25rem auto 20px;
    padding-inline: 0.65rem;
  }

  .portal-page-heading__title {
    font-size: 22px;
    line-height: 1.4;
  }
}

.portal-site-header .nav-bar.portal-header__bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(var(--nav-height), auto);
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  overflow-x: clip;
  box-sizing: border-box;
}

.portal-site-header .nav-bar .container.header-inner.header-inner--portal {
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, max-content);
  grid-template-areas: "brand title nav";
  align-items: center;
  width: min(100% - 2rem, var(--max-width));
  max-width: 100%;
  min-width: 0;
  min-height: var(--nav-height);
  margin-inline: auto;
  box-sizing: border-box;
  column-gap: clamp(0.5rem, 1.5vw, 1.25rem);
  row-gap: 0.35rem;
}

.portal-site-header .portal-header__brand.brand.brand--home-gold {
  grid-area: brand;
  justify-self: start;
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: min(148px, calc(100vw - 3.5rem));
  width: auto;
}

.portal-site-header .header-inner--portal .brand__logo--home-gold {
  width: min(148px, 100%);
  max-width: 100%;
  height: auto;
  display: block;
}

.portal-site-header .portal-nav {
  grid-area: nav;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
  min-width: 0;
  gap: clamp(0.55rem, 1.2vw, 0.9rem);
}

.portal-site-header .portal-header__label {
  grid-area: title;
  position: static;
  transform: none;
  margin: 0;
  padding: 0 0.35rem;
  font-size: clamp(16px, 2.6vw, 20px);
  font-weight: 700;
  line-height: 1.35;
  color: #c59b27;
  text-align: center;
  justify-self: center;
  align-self: center;
  width: auto;
  min-width: max-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
}

.portal-site-header .portal-nav__links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  max-width: 100%;
}

.portal-site-header .portal-nav__links > .portal-nav__link + .portal-nav__link::before {
  content: "|";
  color: rgba(198, 167, 94, 0.62);
  font-weight: 400;
  font-size: 0.92em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  padding-inline: clamp(0.45rem, 0.95vw, 0.7rem);
}

.portal-site-header .portal-nav__link--cta {
  font-weight: 600;
}

@media (min-width: 1161px) {
  .portal-site-header .nav-bar .container.header-inner.header-inner--portal {
    grid-template-columns: auto minmax(min-content, 1fr) minmax(0, max-content);
  }

  .portal-site-header .portal-nav__links {
    flex-wrap: nowrap;
  }

  .portal-site-header .portal-nav__link {
    white-space: nowrap;
  }
}

.portal-site-header .portal-nav__logout .portal-nav__logout-btn.btn {
  min-height: 2.05rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.86rem;
  line-height: 1.25;
}

@media (max-width: 1160px) {
  .portal-site-header .nav-bar.portal-header__bar {
    grid-template-rows: auto;
    row-gap: 0;
    padding-block-end: 0.35rem;
  }

  .portal-site-header .nav-bar .container.header-inner.header-inner--portal {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "title title"
      "nav nav";
    min-height: 0;
    padding-block: 0.35rem 0;
    position: relative;
    row-gap: 0.35rem;
    padding-inline-end: max(0.5rem, env(safe-area-inset-right, 0px));
  }

  .portal-site-header .portal-header__brand.brand.brand--home-gold {
    grid-area: brand;
    max-width: min(132px, calc(100% - 7.5rem));
  }

  .portal-site-header .header-inner--portal .brand__logo--home-gold {
    width: min(132px, 100%);
  }

  .portal-site-header .portal-nav-toggle {
    grid-area: toggle;
    display: inline-flex;
    justify-self: end;
    align-self: start;
    margin-top: 0.15rem;
  }

  .portal-site-header .portal-header__label {
    grid-area: title;
    justify-self: center;
    width: auto;
    max-width: 100%;
    padding-inline: 0.5rem;
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: 1.35;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: normal;
    word-break: keep-all;
    min-width: max-content;
  }

  .portal-site-header .portal-nav {
    grid-area: nav;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.35rem;
    margin: 0;
    padding: 0.35rem 0 0.5rem;
    border-top: 1px solid rgba(197, 155, 39, 0.35);
  }

  .portal-site-header .portal-nav.is-open {
    display: flex;
  }

  .portal-site-header .portal-nav__logout {
    position: static;
    margin: 0.25rem 0 0;
    width: 100%;
  }

  .portal-site-header .portal-nav__links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
  }

  .portal-site-header .portal-nav__links > .portal-nav__link + .portal-nav__link::before {
    display: none;
  }

  .portal-site-header .portal-nav__link {
    display: block;
    width: 100%;
    padding: 0.65rem 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .portal-header__welcome-bar {
    padding-top: 0.15rem;
    padding-bottom: 0.5rem;
  }
}

@media (min-width: 1161px) {
  .portal-site-header.site-header--compact {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 110;
  }

  body.portal-body:not(.portal-body--minimal):has(> .portal-site-header) {
    padding-top: var(--public-nav-offset);
  }

  .portal-site-header .portal-nav-toggle {
    display: none !important;
  }

  .portal-site-header .portal-nav {
    display: flex !important;
  }
}

@media (max-width: 1160px) and (max-height: 520px) {
  .portal-site-header .portal-header__brand.brand.brand--home-gold {
    max-width: min(118px, calc(100% - 7.5rem));
  }

  .portal-site-header .header-inner--portal .brand__logo--home-gold {
    width: min(118px, 100%);
  }

  .portal-site-header .portal-header__label {
    font-size: clamp(15px, 3.8vw, 18px);
  }
}

.portal-requests__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.portal-requests__title {
  margin: 0;
  font-size: 1.35rem;
  color: #c6a75e;
}

.portal-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.25rem;
  justify-content: center;
}

.portal-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(198, 167, 94, 0.35);
  border-radius: 0.35rem;
  color: #e8e8e8;
  text-decoration: none;
}

.portal-pagination__link.is-current {
  background: rgba(197, 155, 39, 0.2);
  border-color: #c59b27;
}

.portal-request-view__back {
  margin: 0 0 1rem;
}

.portal-request-view__header {
  margin-bottom: 1.25rem;
}

.portal-request-view__ref,
.portal-request-view__date,
.portal-request-view__status,
.portal-request-view__hint {
  margin: 0.35rem 0;
}

.portal-request-dl {
  display: grid;
  gap: 0.65rem 1rem;
  margin: 0;
}

.portal-request-dl div {
  display: grid;
  gap: 0.2rem;
}

.portal-request-dl dt {
  color: #c6a75e;
  font-size: 0.88rem;
}

.portal-request-dl__full {
  grid-column: 1 / -1;
}

.portal-request-dl__pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.portal-request-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.portal-request-msg {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
}

.portal-request-msg--admin {
  background: rgba(79, 156, 210, 0.1);
}

.portal-request-msg--client {
  background: rgba(61, 154, 95, 0.1);
}

.portal-request-msg__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
  color: #b0b0b0;
  margin-bottom: 0.35rem;
}

.portal-request-msg__body {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.portal-request-reply {
  margin-top: 1rem;
}

.portal-request-status-log {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.portal-request-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.portal-request-pager__link {
  padding: 0.15rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.35rem;
  color: #e8e8e8;
  text-decoration: none;
  font-size: 0.88rem;
}

.portal-request-pager__link--current {
  background: rgba(197, 155, 39, 0.2);
  border-color: #c59b27;
}

.portal-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.portal-requests-new__intro {
  margin-bottom: 1rem;
  color: #c4c4c4;
}

.portal-dash {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.portal-dash__greeting {
  font-size: 1.35rem;
  font-weight: 700;
  color: #c6a75e;
}

.portal-dash__placeholder {
  color: #d4d4d4;
  margin-top: 1rem;
  line-height: 1.7;
}

.btn--portal {
  background: linear-gradient(135deg, #c6a75e, #a0823d);
  color: #0a0a0a;
  border: none;
  font-weight: 700;
}

.btn--portal:hover {
  filter: brightness(1.05);
}

.portal-form--wide {
  max-width: 36rem;
}

.portal-textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #333;
  border-radius: 0.5rem;
  background: #0f0f0f;
  color: #f5f5f5;
  font-family: inherit;
  resize: vertical;
}

.portal-required {
  color: #c6a75e;
  font-size: 0.85rem;
  font-weight: 600;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.portal-site-header .portal-nav__link {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.portal-site-header .portal-nav__link:hover,
.portal-site-header .portal-nav__link:focus-visible {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
}

.portal-nav__link {
  color: #e5e5e5;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.portal-nav__link:hover {
  color: #c6a75e;
}

.portal-nav__logout {
  margin: 0;
}

.portal-dash__intro,
.portal-dash__business,
.portal-dash__empty {
  color: #d4d4d4;
  line-height: 1.7;
  margin-top: 0.5rem;
}

.portal-section {
  margin-top: 2rem;
}

.portal-section__header h2 {
  font-size: 1.1rem;
  color: #c6a75e;
  margin: 0 0 1rem;
}

.portal-table-wrap {
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.portal-table th,
.portal-table td {
  border-bottom: 1px solid #2a2a2a;
  padding: 0.65rem 0.5rem;
  text-align: right;
  vertical-align: top;
}

.portal-table th {
  color: #c6a75e;
  font-weight: 700;
}

.portal-table th.portal-table__col-action,
.portal-table td.portal-table__col-action {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.portal-table__project-view.btn {
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
  min-height: 2.2rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.portal-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(198, 167, 94, 0.45);
  background: rgba(198, 167, 94, 0.12);
  color: #f5f5f5;
  font-size: 0.8rem;
  font-weight: 600;
}

.portal-badge--muted {
  border-color: #444;
  background: #1a1a1a;
  color: #e5e5e5;
}

.portal-meta {
  margin: 1.5rem 0;
}

.portal-meta__row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #262626;
}

.portal-meta__row dt {
  color: #a3a3a3;
  font-weight: 600;
}

.portal-meta__row dd {
  margin: 0;
}

.portal-project-detail__title {
  color: #c6a75e;
  margin: 0 0 0.5rem;
}

.portal-project-detail__summary {
  line-height: 1.7;
  color: #e5e5e5;
}

.portal-back {
  margin-top: 2rem;
}

.portal-version-card {
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #141414;
}

.portal-version-card__head h3 {
  margin: 0 0 0.35rem;
  color: #c6a75e;
  font-size: 1rem;
}

.portal-file-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.portal-file-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid #262626;
}

.portal-form--upload {
  margin-bottom: 1.25rem;
}

.portal-notes {
  margin-top: 0.75rem;
}

.portal-notes__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-notes__item {
  border-bottom: 1px solid #2a2a2a;
  padding: 0.65rem 0;
}

.portal-notes__meta {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: #a3a3a3;
}

.portal-notes__body {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.portal-notes__pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.75rem;
}

.portal-form--note {
  margin-top: 0.75rem;
}

.portal-approval-disclaimer {
  margin-bottom: 1rem;
}

.portal-approval-status {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.portal-approval-form {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #3a3020;
  border-radius: 0.5rem;
  background: #1a1710;
  overflow-wrap: anywhere;
  min-width: 0;
}

.portal-approval-form__title {
  margin: 0 0 0.65rem;
  color: #c6a75e;
  font-size: 1rem;
  font-weight: 700;
}

.portal-approval-form__line {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #e5e5e5;
  line-height: 1.55;
  overflow-wrap: anywhere;
  min-width: 0;
}

.portal-approval-form__line--project {
  font-weight: 600;
}

.portal-approval-form__line--version {
  margin-bottom: 0.65rem;
  color: #d4d4d4;
}

.portal-approval-form__files {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.portal-approval-form__file-name {
  padding: 0.35rem 0;
  border-bottom: 1px solid #2a2a2a;
  font-size: 0.9rem;
  color: #e5e5e5;
  overflow-wrap: anywhere;
  min-width: 0;
  word-break: break-word;
}

.portal-approval-form__files li:last-child {
  border-bottom: none;
}

.portal-form--approval {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  margin-top: 0;
}

.portal-approval-form__consent {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #3a3020;
  border-radius: 0.45rem;
  background: #14110c;
  cursor: pointer;
  font-weight: 400;
  line-height: 1.55;
  min-width: 0;
}

.portal-approval-form__consent-input {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  max-width: 1.125rem;
  margin: 0.15rem 0 0;
  padding: 0;
  accent-color: #c6a75e;
  cursor: pointer;
}

.portal-approval-form .portal-approval-form__consent-input {
  width: 1.125rem;
  background: #0f0f0f;
  border: 1px solid #555;
  border-radius: 0.2rem;
}

.portal-approval-form__consent-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #e5e5e5;
}

.portal-approval-form__submit {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  margin-inline-start: auto;
  min-height: auto;
}

@media (max-width: 480px) {
  .portal-approval-form__submit {
    width: 100%;
    margin-inline-start: 0;
  }
}

.portal-file-list--compact li {
  border: none;
  padding: 0.15rem 0;
}

@media (max-width: 640px) {
  .portal-table thead {
    display: none;
  }

  .portal-table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #2a2a2a;
    border-radius: 0.5rem;
    padding: 0.5rem;
  }

  .portal-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: none;
  }

  .portal-table td::before {
    content: attr(data-label);
    color: #a3a3a3;
    font-weight: 600;
    flex-shrink: 0;
  }

  .portal-table td.portal-table__col-action {
    align-items: center;
    flex-wrap: nowrap;
  }

  .portal-table__project-view.btn {
    margin-inline-start: auto;
  }
}