@font-face {
  font-family: IRANSans;
  src: url('./fonts/IRANSansWeb.woff2') format('woff2');
  font-display: swap;
}
:root {
  --access-green: #176b60;
  --access-dark: #123e39;
  --access-line: #dce7e5;
  --access-muted: #58716d;
  --access-surface: #f3f7f6;
}
.management-page {
  margin: 0;
  background: var(--access-surface);
  color: #183d37;
  font:
    1rem/1.9 IRANSans,
    system-ui,
    sans-serif;
}
.management-page *,
.access-root * {
  box-sizing: border-box;
}
.management-page [hidden],
.access-root [hidden] {
  display: none !important;
}
.management-main button,
.management-main input,
.management-main select,
.management-main textarea,
.access-root button,
.access-root input,
.access-root select,
.access-root textarea {
  font: inherit;
}
.management-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px max(24px, calc((100vw - 1400px) / 2));
  background: white;
  border-bottom: 1px solid var(--access-line);
}
.management-header > a:last-child {
  margin-inline-start: auto;
}
.management-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.55rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--access-green);
}
.management-header img {
  object-fit: contain;
}
.management-main {
  max-width: 1450px;
  margin: auto;
  padding: 32px 28px 64px;
}
.management-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.management-heading h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.6;
  margin: 4px 0;
}
.management-heading p {
  margin: 0;
  color: var(--access-muted);
}
.eyebrow {
  font-size: 0.875rem;
  color: var(--access-green) !important;
  font-weight: bold;
}
.management-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.management-layout aside {
  position: sticky;
  top: 20px;
  border: 1px solid var(--access-line);
  border-radius: 20px;
  background: white;
  padding: 12px;
}
.management-layout nav {
  display: grid;
  gap: 5px;
}
.management-layout nav a {
  padding: 10px 14px;
  text-decoration: none;
  border-radius: 12px;
  color: #365650;
}
.management-layout nav a[aria-current='page'] {
  background: #e5f3ed;
  color: var(--access-green);
  font-weight: bold;
}
.sidebar-note {
  font-size: 0.875rem;
  color: var(--access-muted);
  padding: 12px;
  border-top: 1px solid var(--access-line);
}
#management-panel {
  background: white;
  border: 1px solid var(--access-line);
  border-radius: 20px;
  padding: 26px;
  min-width: 0;
  min-height: 500px;
}
.access-root {
  color: #183d37;
  font-size: 1rem;
  line-height: 1.9;
}
.access-card {
  padding: 22px;
  border: 1px solid var(--access-line);
  border-radius: 16px;
  background: white;
  margin: 16px 0;
}
.access-card h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
}
.access-card h3 {
  font-size: 1rem;
  margin: 12px 0 6px;
}
.muted {
  color: var(--access-muted);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.metric-card {
  background: #f3f8f6;
  padding: 20px;
  border: 1px solid #dfece7;
  border-radius: 16px;
  text-decoration: none;
  color: #25483f;
  display: grid;
  gap: 10px;
}
.metric-card strong {
  font-size: 2rem;
  color: var(--access-green);
}
.metric-card span {
  font-size: 0.9rem;
}
.management-main a,
.access-root a {
  color: var(--access-green);
}
.quick-link {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid #e8efeb;
  text-decoration: none;
}
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.portal-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--access-line);
  border-radius: 16px;
  text-decoration: none;
  background: #fff;
}
.portal-card strong {
  font-size: 1.05rem;
}
.portal-card small {
  color: var(--access-muted);
  font-size: 0.875rem;
}
.portal-card.admin-portal {
  background: var(--access-dark);
  color: white;
}
.portal-card.admin-portal small {
  color: #c4e7de;
}
.access-form {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}
.form-fields {
  display: grid;
  gap: 14px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 0.95rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #bed3cb;
  border-radius: 10px;
  background: white;
  color: #183d37;
  min-width: 0;
}
.field textarea {
  resize: vertical;
}
.field select {
  appearance: none;
  padding-inline-end: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23176b60' fill='none' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.management-main button,
.access-root button,
.secondary-link {
  padding: 10px 16px;
  border: 1px solid #b8d2c8;
  border-radius: 10px;
  background: white;
  color: var(--access-green);
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  width: fit-content;
}
.management-main button.primary,
.access-root button.primary {
  background: var(--access-green);
  color: white;
  border-color: var(--access-green);
}
.management-main button:disabled,
.access-root button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.management-page :focus-visible,
.access-root :focus-visible {
  outline: 3px solid #f0b65a;
  outline-offset: 3px;
}
.notice {
  padding: 12px 14px;
  background: #eff7f3;
  border-radius: 10px;
  color: #32594d;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.notice:empty {
  display: none;
}
.notice.error {
  background: #fff0ee;
  color: #8a2c25;
}
.actions,
.search-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.search-form .field {
  flex: 1;
  min-width: 180px;
}
.list-card {
  padding: 18px;
  border: 1px solid var(--access-line);
  border-radius: 14px;
  margin: 12px 0;
}
.list-card h3 {
  margin: 0 0 8px;
}
.badge {
  display: inline-block;
  font-size: 0.875rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8f2ed;
  color: #255c45;
}
.state-suspended,
.state-rejected,
.state-revoked {
  background: #fdebe7;
  color: #8a332b;
}
.state-pending,
.state-submitted,
.state-changes_requested {
  background: #fff3d4;
  color: #785b18;
}
.table-scroll {
  overflow: auto;
  margin: 18px 0;
}
.management-page table,
.access-root table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  text-align: right;
}
.management-page th,
.management-page td,
.access-root th,
.access-root td {
  padding: 12px;
  border-bottom: 1px solid #e1ebe6;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.management-page th,
.access-root th {
  background: #f1f6f3;
  font-weight: bold;
  white-space: nowrap;
}
.permission-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.permission-options label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.permission-options input {
  width: 20px;
  height: 20px;
  accent-color: var(--access-green);
}
.message {
  padding: 15px;
  background: #f5f7f6;
  border-radius: 12px;
  margin: 10px 0;
}
.message.staff {
  background: #e9f4ee;
}
.message p {
  white-space: pre-wrap;
}
.review-photos {
  display: flex;
  gap: 10px;
  overflow: auto;
}
.review-photos img {
  height: 160px;
  max-width: 240px;
  object-fit: cover;
  border-radius: 10px;
}
.account-section-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 8px 0 18px;
}
.account-section-tabs a {
  white-space: nowrap;
  padding: 8px 14px;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--access-line);
}
.account-section-tabs a[aria-current='page'] {
  background: var(--access-green);
  color: white;
}
.access-panel {
  scroll-margin-top: 20px;
}
.access-panel h2 {
  font-size: 1.3rem;
}
.access-panel p {
  white-space: pre-line;
}
@media (min-width: 900px) {
  .access-form .form-fields.two-columns {
    grid-template-columns: 1fr 1fr;
  }
  .access-form .form-fields .wide {
    grid-column: 1/-1;
  }
}
@media (max-width: 800px) {
  .management-layout {
    grid-template-columns: 1fr;
  }
  .management-layout aside {
    position: static;
    padding: 8px;
  }
  .management-layout nav {
    display: flex;
    overflow: auto;
    gap: 6px;
  }
  .management-layout nav a {
    white-space: nowrap;
  }
  .sidebar-note {
    display: none;
  }
  .management-main {
    padding: 20px 14px 40px;
  }
  .management-header {
    padding: 12px 16px;
    gap: 12px;
    font-size: 0.875rem;
  }
  .management-header > span {
    display: none;
  }
  #management-panel {
    padding: 18px;
    min-height: 350px;
  }
  .management-heading {
    align-items: start;
  }
  .management-heading .secondary-link {
    display: none;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-card {
    padding: 14px;
  }
  .metric-card strong {
    font-size: 1.6rem;
  }
  .access-card {
    padding: 16px;
  }
  .management-page th,
  .management-page td,
  .access-root th,
  .access-root td {
    padding: 10px;
    min-width: 100px;
  }
}

.access-root input[type='checkbox'] {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0 0 0 8px;
  padding: 0;
  accent-color: var(--access-green);
}

/* Multiple simultaneous roles remain readable on mobile account and management pages. */
.user-role-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.effective-role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .75rem; margin-block: 1rem; }
.effective-role-grid .list-card { margin: 0; min-width: 0; }
.role-choice-list { min-width: 0; border: 1px solid #d5e5df; border-radius: 12px; padding: 1rem; display: grid; gap: .75rem; }
.role-choice-list legend { padding-inline: .5rem; }
.role-choice { display: flex; align-items: flex-start; gap: .5rem; padding: .5rem; cursor: pointer; }
.role-choice input { flex: 0 0 20px; }
.role-choice span { display: grid; gap: .25rem; }
.role-choice small { font-size: .875rem; color: #53665e; }
.role-choice-edit{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}
.role-choice-edit .role-choice{min-height:44px;border:1px solid #e3ebe5;border-radius:9px}
.role-choice-edit .role-choice:has(input:checked){background:#e8f4ec;border-color:#95b9a6}
.role-choice-edit .role-choice:has(input:disabled){cursor:default;color:#53665e;background:#f7f9f7}
.role-choice-base{grid-column:1/-1;background:#eaf4ee;color:#294c3c;border:1px solid #cfe2d5;border-radius:9px;cursor:default}
.role-choice-base input:disabled{opacity:1;accent-color:#176b60}
.invite-role-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:7px;margin-block-start:8px}
.invite-role-group>summary{min-height:44px;align-content:center;font-weight:700;cursor:pointer}
.management-role-catalog{margin-block:20px}
