.portal-settings-page {
  color: #20332e;
  background: #f6f7f5;
  font-family: Cairo, "IBM Plex Sans Arabic", Tahoma, sans-serif;
}
.portal-settings-main { max-width: 1200px; margin: auto; padding: 32px 24px 64px; }
.portal-settings-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-bottom: 24px;
}
.portal-settings-heading h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 8px 0; }
.portal-settings-heading p { color: #52635e; line-height: 1.9; margin: 0; }
.portal-settings-heading a { white-space: nowrap; }
.portal-settings-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
.portal-settings-toolbar p { flex: 1; min-width: 220px; margin: 0; line-height: 1.7; }
.portal-settings-version { font-size: .8rem; background: #e7eeeb; border-radius: 8px; padding: 8px 12px; }
.portal-hr-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: #193e33; color: #fff; border-radius: 16px; padding: 22px 28px; margin-bottom: 24px;
}
.portal-hr-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.portal-hr-card p { color: #d5e7e0; margin: 0; line-height: 1.8; }
.portal-settings-card { background: #fff; border: 1px solid #dce4df; border-radius: 16px; padding: 28px; margin-bottom: 22px; }
.portal-settings-page fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.portal-section-title {
  display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 22px; margin-bottom: 18px; border-bottom: 1px solid #edf0ee;
}
.portal-section-title > span { font-size: .9rem; color: #557b67; font-weight: 700; background: #eff5f1; padding: 10px; border-radius: 10px; }
.portal-section-title h2 { margin: 0 0 5px; font-size: 1.2rem; }
.portal-section-title p { margin: 0; color: #68766f; font-size: .88rem; line-height: 1.8; }
.portal-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.portal-wide { grid-column: 1 / -1; }
.portal-settings-page .employee-field { margin: 0; }
.portal-settings-page .employee-field small { line-height: 1.9; color: #67796e; margin-top: 7px; }
.portal-settings-page input:disabled { opacity: 1; background: #f4f6f4; color: #415449; cursor: default; }
.portal-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.portal-image-card { border: 1px solid #e1e7e2; border-radius: 12px; padding: 18px; min-width: 0; }
.portal-image-card h3 { font-size: 1rem; margin: 0 0 14px; }
.portal-image-preview {
  height: 150px; background: #f1f4f1; display: flex; align-items: center;
  justify-content: center; border-radius: 8px; margin-bottom: 14px; overflow: hidden;
}
.portal-image-preview img { max-width: 100%; max-height: 140px; object-fit: contain; }
.portal-image-preview span { color: #748278; font-size: .85rem; }
.portal-image-card label { display: block; font-size: .85rem; margin-bottom: 6px; }
.portal-image-card input { width: 100%; font-size: .82rem; margin-bottom: 10px; padding: 8px; }
.portal-image-card button { margin-top: 4px; }
.portal-muted { color: #6e7c72; font-size: .84rem; line-height: 1.9; }
.portal-print-preview { padding: 8px 0 24px; }
.portal-print-preview h2 { font-size: 1.1rem; }
.portal-paper {
  position: relative; isolation: isolate; background: white; border: 1px solid #dce4df;
  box-shadow: 0 12px 32px #173b2810; border-radius: 4px; max-width: 700px;
  margin: auto; padding: 40px; overflow: hidden; min-height: 310px;
}
.portal-paper > img { position: absolute; inset: 20%; width: 60%; height: 60%; object-fit: contain; z-index: 0; pointer-events: none; }
.portal-paper-content { position: relative; z-index: 1; text-align: center; overflow-wrap: anywhere; }
.portal-paper-content > img { display: block; max-width: 180px; max-height: 84px; margin: 0 auto 15px; object-fit: contain; }
.portal-paper-content p { font-size: .88rem; line-height: 1.9; white-space: pre-wrap; }
.portal-paper-rule { border-top: 2px solid #d8b65e; margin: 24px 0; }
.portal-settings-save {
  position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: #fff; border: 1px solid #ccdacf; border-radius: 12px;
  padding: 16px 22px; box-shadow: 0 8px 28px #123d2518; z-index: 2;
}
.portal-settings-save p { margin: 0; font-size: .88rem; color: #57685d; line-height: 1.8; }
.portal-settings-page [hidden] { display: none !important; }
.portal-settings-page :focus-visible { outline: 3px solid #bc9128; outline-offset: 3px; }
@media (max-width: 700px) {
  .portal-settings-main { padding: 22px 15px 40px; }
  .portal-settings-heading, .portal-hr-card { align-items: flex-start; flex-direction: column; }
  .portal-fields, .portal-image-grid { grid-template-columns: 1fr; }
  .portal-settings-card { padding: 20px 16px; }
  .portal-settings-save { position: static; flex-direction: column; align-items: stretch; }
  .portal-paper { padding: 24px 15px; }
  .portal-settings-toolbar { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-settings-page * { scroll-behavior: auto !important; transition: none !important; }
}
