@font-face {
  font-family: "Noto Kufi Arabic";
  src: url("fonts/NotoKufiArabic-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #10263b;
  --navy-light: #183b53;
  --green: #0f936d;
  --green-dark: #087052;
  --green-light: #e7f7f1;
  --background: #f2f5f8;
  --surface: #fff;
  --text: #233044;
  --muted: #738094;
  --border: #dfe5ec;
  --danger: #b42318;
  --danger-light: #fff1f0;
  --warning: #a8600a;
  --warning-light: #fff5e6;
  --blue: #315d85;
  --shadow: 0 8px 28px rgba(20, 43, 64, .07);
  --shadow-hover: 0 14px 34px rgba(20, 43, 64, .11);
  --radius: 16px;
  --modal-width: 520px;
  --modal-wide-width: 780px;
  --modal-radius: 20px;
  --modal-overlay: rgba(8, 22, 36, .65);
  --modal-shadow: 0 28px 80px rgba(7, 24, 37, .35);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; overflow-x: hidden; background: var(--background); color: var(--text); font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; font-size: 14px; line-height: 1.7; }
button, input, select, textarea { font: inherit; }
a { color: var(--green-dark); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.app-shell > main { min-width: 0; }
.sidebar { position: sticky; top: 0; z-index: 40; display: flex; height: 100vh; flex-direction: column; overflow-y: auto; padding: 22px 13px 18px; background: linear-gradient(180deg, #1b6570 0%, #175565 50%, #143f52 100%); color: #fff; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 20px; border-bottom: 1px solid #ffffff18; color: #fff; text-decoration: none; }
.brand > span:first-child, .login-brand { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #19a982, #0c7d5d); color: #fff; font-size: 23px; font-weight: 900; }
.brand-mark { overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; padding: 4px; object-fit: contain; background: #fff; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #d0e2e5; font-size: 11px; }
.sidebar nav { display: grid; gap: 4px; margin-top: 17px; }
.sidebar nav a, .logout { display: flex; width: 100%; min-height: 45px; align-items: center; gap: 11px; padding: 9px 13px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #e1ecef; font-weight: 650; text-decoration: none; cursor: pointer; transition: .16s ease; }
.sidebar nav a:hover { transform: translateX(-2px); background: #ffffff13; color: #fff; }
.sidebar nav a.active { border-color: #8be1c64a; background: linear-gradient(90deg, #57d2ae32, #ffffff16); box-shadow: inset -3px 0 #79e0bf; color: #fff; }
.sidebar nav a.active .icon { color: #91efd1; }
.logout { margin-top: auto; color: #ffd0cd; }
.logout:hover { background: #d84b3f17; color: #fff; }
.logout-form { margin-top: auto; }
.logout-form .logout { margin-top: 0; }

.topbar { display: flex; height: 76px; align-items: center; justify-content: flex-end; padding: 0 30px; border-bottom: 1px solid var(--border); background: var(--surface); box-shadow: 0 3px 16px rgba(21, 43, 63, .035); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding-inline: 16px; border-inline: 1px solid var(--border); }
.topbar-user small, .topbar-user strong { display: block; }
.topbar-user small { color: var(--muted); font-size: 11px; }
.topbar-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #eff4f7; color: var(--navy-light); }
.tenant-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid #cceade; border-radius: 24px; background: var(--green-light); color: var(--green-dark); font-size: 12px; font-weight: 750; }
.tenant-pill .icon { width: 17px; height: 17px; }
.icon-button { position: relative; display: grid; width: 42px; height: 42px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 11px; background: #fff; color: var(--navy); cursor: pointer; }
.icon-button:hover { border-color: #b7c7d4; background: #f8fafb; }
.notification-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--danger); }
.mobile-menu-button { display: none; margin-left: auto; }
.sidebar-overlay { display: none; }

.content { width: 100%; max-width: 1500px; margin: auto; padding: 30px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-title-copy { display: flex; min-width: 0; align-items: center; gap: 13px; }
.page-heading-icon { display: grid; width: 49px; height: 49px; flex: 0 0 49px; place-items: center; border: 1px solid #cce9df; border-radius: 14px; background: linear-gradient(145deg, #f0fbf7, #ddf3eb); box-shadow: 0 6px 18px #0f936d12; color: var(--green-dark); }
.page-heading-icon .icon { width: 23px; height: 23px; }
.page-heading h1 { margin: 0; font-size: clamp(23px, 2.2vw, 29px); line-height: 1.35; }
.page-heading p, .panel-head p, .section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.actions, .welcome-actions, .table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.primary-btn, .secondary-btn, .danger-btn, .table-btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border: 0; border-radius: 10px; font-weight: 750; text-decoration: none; white-space: nowrap; cursor: pointer; transition: .15s ease; }
.primary-btn { background: linear-gradient(145deg, #149b75, #0d8060); box-shadow: 0 7px 16px #0f936d20; color: #fff; }
.primary-btn:hover { transform: translateY(-1px); background: linear-gradient(145deg, #0f8967, #096f53); box-shadow: 0 10px 22px #0f936d2e; color: #fff; }
.secondary-btn { border: 1px solid var(--border); background: #fff; color: var(--text); }
.secondary-btn:hover { transform: translateY(-1px); border-color: #9fb0c1; background: #f8fafb; }
.secondary-btn.strong { border-color: #98a7b6; background: #f4f6f8; color: var(--navy); }
.danger-btn { background: linear-gradient(145deg, #c95850, #a33b35); color: #fff; }
.primary-btn:disabled, .danger-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.table-btn { min-height: 31px; padding: 5px 9px; border-radius: 8px; color: #fff; font-size: 11px; }
.table-btn .icon { width: 14px; height: 14px; flex-basis: 14px; }
.table-btn.view { background: linear-gradient(145deg, #2b8292, #206a7d); }
.table-btn.edit { background: linear-gradient(145deg, #496d94, #304f75); }
.table-btn.danger { background: linear-gradient(145deg, #bf5a52, #973d38); }

.welcome-card { position: relative; display: grid; min-height: 172px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; overflow: hidden; margin-bottom: 24px; padding: 26px 29px; border: 1px solid #bfded5; border-radius: 20px; background: linear-gradient(125deg, #f5fcf9, #e5f5ef 55%, #d8ede8); box-shadow: 0 12px 30px rgba(24, 70, 58, .08); }
.welcome-card::before { position: absolute; top: -135px; left: -75px; width: 260px; height: 260px; border: 38px solid rgba(20, 155, 117, .07); border-radius: 50%; content: ""; }
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card h1 { margin: 0; color: var(--navy-light); font-size: clamp(23px, 2.6vw, 32px); }
.welcome-card p { max-width: 760px; margin: 6px 0 11px; color: #58706e; }
.eyebrow { color: #17675f; font-size: 12px; font-weight: 850; }
.date-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #c5e4da; border-radius: 18px; background: #ffffffaa; color: #3e6660; font-size: 11px; font-weight: 750; }
.date-pill .icon { width: 14px; height: 14px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 2px 12px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stats-grid article { position: relative; min-width: 0; padding: 19px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); transition: .16s ease; }
.stats-grid article:hover { transform: translateY(-2px); border-color: #c8d7e1; box-shadow: var(--shadow-hover); }
.stat-icon { position: absolute; top: 16px; left: 16px; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #edf8f4; color: var(--green); }
.stats-grid article > span:not(.stat-icon), .stats-grid small { display: block; color: var(--muted); }
.stats-grid strong { display: block; margin: 8px 0 3px; font-size: clamp(25px, 2.7vw, 32px); line-height: 1.4; overflow-wrap: anywhere; }
.stats-grid article.accent { border-color: var(--navy-light); background: var(--navy-light); color: #fff; }
.stats-grid article.accent > span, .stats-grid article.accent small { color: #c5d1dc; }
.stats-grid article.accent .stat-icon { background: #ffffff18; color: #78e4c0; }
.detail-stats .text-value, .detail-stats .date-value { font-size: 20px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 18px; }
.panel, .form-section { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #fbfcfd); }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head a { font-weight: 750; text-decoration: none; }
.visit-list, .alert-list { display: grid; }
.visit-list article { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px 20px; border-bottom: 1px solid #edf1f4; }
.visit-list article:last-child { border-bottom: 0; }
.visit-list time { color: var(--navy-light); font-weight: 800; }
.visit-list strong, .visit-list span { display: block; }
.visit-list div > span { color: var(--muted); font-size: 12px; }
.alert-list article { display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: start; gap: 12px; padding: 15px 20px; border-bottom: 1px solid #edf1f4; }
.alert-list article:last-child { border-bottom: 0; }
.alert-list p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.alert-mark { width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px #0f936d16; }
.alert-mark.warning { background: #c47b1c; box-shadow: 0 0 0 5px #c47b1c16; }
.alert-mark.danger { background: var(--danger); box-shadow: 0 0 0 5px #b4231816; }

.list-tools { display: flex; align-items: center; gap: 10px; padding: 17px 20px; border-bottom: 1px solid var(--border); background: #fbfcfd; }
.association-type-summary { margin-bottom: 18px; }
.summary-total { display: inline-flex; min-height: 32px; align-items: center; padding: 5px 11px; border-radius: 18px; background: var(--green-light); color: var(--green-dark); font-size: 11px; font-weight: 850; }
.association-type-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 11px; padding: 16px 18px 18px; }
.association-type-stat { display: grid; min-width: 0; min-height: 80px; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #dce5ea; border-radius: 12px; background: linear-gradient(145deg, #fff, #f8fafb); color: var(--text); text-decoration: none; transition: .16s ease; }
.association-type-stat:hover { transform: translateY(-2px); border-color: #9bcdbd; box-shadow: 0 8px 20px rgba(25, 72, 59, .08); }
.association-type-stat.active { border-color: var(--green); background: #edf9f4; box-shadow: 0 0 0 2px #0f936d16; }
.association-type-stat.total { border-right: 4px solid var(--navy-light); }
.association-type-stat.unclassified { border-right: 4px solid var(--warning); }
.type-stat-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #e7f3f6; color: #27647b; }
.association-type-stat:not(.total) .type-stat-icon { background: var(--green-light); color: var(--green-dark); }
.association-type-stat.unclassified .type-stat-icon { background: var(--warning-light); color: var(--warning); }
.association-type-stat > span:nth-child(2) { display: grid; min-width: 0; }
.association-type-stat strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.association-type-stat small { color: var(--muted); font-size: 9px; }
.association-type-stat b { min-width: 34px; color: var(--navy-light); font-size: 22px; text-align: center; }
.search-field { position: relative; flex: 1 1 340px; max-width: 520px; }
.search-field .icon { position: absolute; top: 50%; right: 13px; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); }
.search-field input { width: 100%; min-height: 44px; padding: 10px 42px 10px 13px; border: 1px solid #cbd5df; border-radius: 10px; background: #fff; outline: 0; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.data-table { width: 100%; min-width: 990px; border-collapse: collapse; white-space: nowrap; }
.data-table.license-table { min-width: 760px; }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid #edf1f4; text-align: right; vertical-align: middle; }
.data-table thead th { padding-block: 14px; border-bottom-color: #10263b; border-left: 1px solid rgba(255, 255, 255, .5); background: #183b53; color: #fff; font-size: 13px; }
.data-table thead th:last-child { border-left: 0; }
.data-table tbody tr:nth-child(even) { background: #fbfdfd; }
.data-table tbody tr:hover { background: #eef8f5; }
.record-name { display: block; max-width: 240px; overflow: hidden; color: var(--navy-light); font-weight: 800; text-overflow: ellipsis; text-decoration: none; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; background: #edf1f4; color: #56677a; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-badge.success { background: var(--green-light); color: var(--green-dark); }
.status-badge.warning { background: var(--warning-light); color: var(--warning); }
.status-badge.neutral { background: #eef2f6; color: #536275; }
.status-badge.active, .status-badge.completed, .status-badge.confirmed, .status-badge.compliant, .status-badge.resolved, .status-badge.closed { background: var(--green-light); color: var(--green-dark); }
.status-badge.needs_follow_up, .status-badge.high, .status-badge.in_progress, .status-badge.in_review { background: var(--warning-light); color: var(--warning); }
.status-badge.urgent, .status-badge.critical, .status-badge.suspended, .status-badge.cancelled, .status-badge.non_compliant, .status-badge.overdue { background: var(--danger-light); color: var(--danger); }
.status-badge.scheduled, .status-badge.normal { background: #eaf2fb; color: var(--blue); }
.status-badge.draft, .status-badge.low, .status-badge.archived, .status-badge.pending { background: #eef2f6; color: #536275; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 18px; border-top: 1px solid var(--border); background: #fbfcfd; }
.pagination-numbers { display: flex; align-items: center; gap: 6px; }
.pagination-link { display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid #d8e3e8; border-radius: 9px; background: #fff; color: #24536a; font-weight: 800; text-decoration: none; }
.pagination-link:hover { transform: translateY(-1px); border-color: #3c8f87; background: #eef8f6; }
.pagination-link.active { border-color: #17675f; background: #17675f; box-shadow: 0 4px 12px #17675f2e; color: #fff; }
.pagination-link.disabled { opacity: .42; cursor: not-allowed; }

.data-form { display: grid; gap: 18px; }
.form-section { overflow: hidden; }
.form-section-head { display: flex; align-items: center; gap: 12px; padding: 14px 19px; border-bottom: 1px solid #dce5ea; background: #f1f8f5; }
.form-section-head > span { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 11px; background: #e1f2ec; color: var(--green-dark); }
.form-section-head.blue { background: #f2f6fb; }
.form-section-head.blue > span { background: #e2ebf6; color: var(--blue); }
.form-section-head.violet { background: #f7f4fb; }
.form-section-head.violet > span { background: #ece5f5; color: #6c4c8c; }
.form-section-head h2 { margin: 0; font-size: 16px; }
.form-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; padding: 22px; }
.field { display: block; min-width: 0; }
.field > span { display: block; margin-bottom: 7px; color: #344054; font-size: 13px; font-weight: 750; }
.field > span b { color: var(--danger); }
.form-control { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd5df; border-radius: 10px; outline: 0; background: #fff; color: var(--text); transition: .15s ease; }
.form-control.compact { width: min(230px, 100%); }
.form-control:focus, .search-field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876618; }
.form-control:disabled { background: #f0f2f5; color: #667085; cursor: not-allowed; }
textarea.form-control { min-height: 100px; resize: vertical; }
.full-span { grid-column: 1 / -1; }
.visit-template-choice { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px; border: 1px solid #b9ddcf; border-radius: 12px; background: #eff9f5; }
.visit-template-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: #dcefe8; color: var(--green-dark); }
.visit-template-icon .icon { width: 21px; height: 21px; }
.visit-template-choice .field-help { color: #527164; }
.switch-field { display: flex; align-items: center; gap: 11px; min-height: 70px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfd; cursor: pointer; }
.switch-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch { position: relative; width: 34px; height: 20px; flex: 0 0 34px; border-radius: 20px; background: #cbd5dc; transition: .18s ease; }
.switch::after { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #1d344530; content: ""; transition: .18s ease; }
.switch-field input:checked + .switch { background: var(--green); }
.switch-field input:checked + .switch::after { transform: translateX(-14px); }
.switch-field input:focus-visible + .switch { outline: 3px solid #16876628; outline-offset: 2px; }
.switch-field strong, .switch-field small { display: block; }
.switch-field small { color: var(--muted); font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.field-error { display: block; margin-top: 6px; color: var(--danger); font-size: 12px; font-weight: 750; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.field-invalid .form-control, .field-invalid input, .field-invalid select, .field-invalid textarea { border-color: var(--danger); background: #fffafa; }
.validation-summary { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid #f2c4bf; border-right: 5px solid var(--danger); border-radius: 9px; background: var(--danger-light); color: #8f1d14; }
.flash { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 12px 15px; border: 1px solid #b9dfd1; border-right: 5px solid var(--green); border-radius: 10px; background: var(--green-light); color: var(--green-dark); }
.flash.error { border-color: #efc4c0; border-right-color: var(--danger); background: var(--danger-light); color: var(--danger); }
.flash.warning { border-color: #efd39d; border-right-color: #c47b1c; background: var(--warning-light); color: var(--warning); }
.compact-empty { padding: 28px 20px; color: var(--muted); text-align: center; }
.padded-form { display: grid; gap: 16px; padding: 22px; }
.form-grid.no-pad { padding: 0; }
.form-actions.inline-actions { padding: 18px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }

.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 8px 20px 20px; }
.detail-list div { padding: 14px 0; border-bottom: 1px solid #edf1f4; }
.detail-list div:nth-child(odd) { padding-left: 15px; }
.detail-list .full { grid-column: 1 / -1; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 4px 0 0; font-weight: 750; overflow-wrap: anywhere; }
.association-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 0; padding: 17px 18px 19px; }
.association-info-card { display: grid; min-width: 0; min-height: 78px; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid #e3e9ee; border-radius: 13px; background: linear-gradient(145deg, #fff, #fafcfd); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.association-info-card:hover { transform: translateY(-1px); border-color: #cfdbe3; box-shadow: 0 7px 18px rgba(16,38,59,.07); }
.association-info-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; }
.association-info-icon .icon { width: 19px; height: 19px; }
.association-info-card > div { min-width: 0; }
.association-info-card dt { color: var(--muted); font-size: 10px; font-weight: 750; }
.association-info-card dd { overflow: hidden; margin: 3px 0 0; font-size: 12px; font-weight: 850; text-overflow: ellipsis; overflow-wrap: anywhere; }
.association-info-card dd[dir="ltr"] { text-align: right; }
.association-map-card { grid-column: 1 / -1; min-height: 72px; }
.association-map-card > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.association-map-card dd { flex: 0 0 auto; }
.tone-green .association-info-icon { background: #e5f7f0; color: #087052; }
.tone-blue .association-info-icon { background: #e8f1f8; color: #315d85; }
.tone-amber .association-info-icon { background: #fff3df; color: #a8600a; }
.tone-purple .association-info-icon { background: #f1ebfa; color: #7353a4; }
.tone-teal .association-info-icon { background: #e5f7f6; color: #147d7a; }
.tone-rose .association-info-icon { background: #fcecef; color: #a5455d; }
.tone-navy .association-info-icon { background: #e8eef3; color: var(--navy-light); }
.tone-sky .association-info-icon { background: #e9f5fb; color: #24759c; }
.timeline { display: grid; padding: 12px 20px 20px; }
.timeline article { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 12px; padding: 11px 0; }
.timeline article > span { width: 11px; height: 11px; margin-top: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #bde8da; }
.timeline article > span.future { background: #c47b1c; box-shadow: 0 0 0 3px #f7dfbd; }
.timeline p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.spaced-panel { margin-top: 18px; }
.detail-list.one-column { grid-template-columns: 1fr; }
.detail-list.one-column div { padding-left: 0; }
.finding-list { display: grid; gap: 12px; padding: 18px; }
.finding-list > article { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfd; }
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.finding-head > div { display: flex; align-items: center; gap: 10px; }
.finding-head h3 { margin: 0; font-size: 15px; }
.finding-list article > p { margin: 9px 0; color: #506174; }
.action-strip { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--border); }
.action-strip > span { display: grid; flex: 1; }
.action-strip small, .muted { color: var(--muted); }
.action-strip a { font-weight: 800; text-decoration: none; }
.calendar-board { display: grid; gap: 14px; }
.calendar-day { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.calendar-day > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(100deg, #eff9f5, #f7fafc); }
.calendar-day header strong, .calendar-day header span { display: block; }
.calendar-day header span { color: var(--muted); font-size: 12px; }
.calendar-day header b { color: var(--green-dark); font-size: 12px; }
.calendar-day > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; padding: 14px; }
.calendar-event { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px; border: 1px solid #dce8e4; border-right: 4px solid var(--green); border-radius: 10px; background: #fbfefd; color: var(--text); text-decoration: none; }
.calendar-event.high { border-right-color: #c47b1c; background: #fffaf2; }
.calendar-event.urgent { border-right-color: var(--danger); background: #fff7f6; }
.calendar-event time { color: var(--navy-light); font-weight: 850; }
.calendar-event span strong, .calendar-event span small { display: block; }
.calendar-event small { color: var(--muted); }
.calendar-filter-panel { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px 20px; margin-bottom:16px; padding:16px; border:1px solid var(--border); border-radius:16px; background:#fff; box-shadow:var(--shadow); }
.calendar-quick-filters { display:grid; grid-template-columns:repeat(3,minmax(120px,1fr)); gap:9px; }
.calendar-quick-filters a { display:flex; min-height:62px; flex-direction:column; justify-content:center; padding:9px 14px; border:1px solid var(--border); border-radius:12px; color:var(--text); text-decoration:none; background:#f8fafc; transition:.2s ease; }
.calendar-quick-filters a:hover { border-color:#9fd5c4; transform:translateY(-1px); }.calendar-quick-filters a.active { color:#087052; border-color:#63bea2; background:#e7f7f1; box-shadow:0 0 0 3px rgba(15,147,109,.08); }
.calendar-quick-filters strong,.calendar-quick-filters small { display:block; }.calendar-quick-filters small { margin-top:2px; color:var(--muted); font-size:11px; }
.calendar-custom-range { display:flex; align-items:end; gap:8px; }.calendar-custom-range label span { display:block; margin-bottom:5px; color:var(--muted); font-size:11px; }.calendar-custom-range .form-control { min-width:145px; }
.calendar-range-summary { grid-column:1/-1; display:flex; align-items:center; gap:10px; padding-top:13px; border-top:1px solid var(--border); }.calendar-range-summary>span { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; color:#0f936d; background:#e7f7f1; }.calendar-range-summary .icon { width:19px; }.calendar-range-summary strong,.calendar-range-summary small { display:block; }.calendar-range-summary small { margin-top:2px; color:var(--muted); }
.calendar-inspector { display:flex!important; align-items:center; gap:5px; margin-top:7px; padding-top:7px; border-top:1px dashed #d8e4e0; color:#3d6470!important; font-weight:650; }.calendar-inspector .icon { width:15px; height:15px; color:#0f936d; }
@media(max-width:900px){.calendar-filter-panel{grid-template-columns:1fr}.calendar-custom-range{flex-wrap:wrap}.calendar-custom-range label{flex:1}.calendar-custom-range .form-control{width:100%;min-width:0}}
@media(max-width:600px){.calendar-quick-filters{grid-template-columns:1fr}.calendar-custom-range{align-items:stretch;flex-direction:column}.calendar-custom-range .secondary-btn{width:100%}}
.visit-cards-toolbar { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:16px; border:1px solid var(--border); border-radius:16px; background:#fff; box-shadow:var(--shadow); overflow:hidden; }.visit-cards-toolbar .list-tools{flex:1;border:0}.view-comparison-switch{display:flex;align-items:center;gap:5px;padding:10px 14px}.view-comparison-switch>span{margin-left:5px;color:var(--muted);font-size:11px}.view-comparison-switch a{display:flex;align-items:center;gap:5px;min-height:38px;padding:7px 11px;border:1px solid var(--border);border-radius:9px;color:var(--text);text-decoration:none;font-size:12px;font-weight:700}.view-comparison-switch a.active{color:#087052;border-color:#89cdb8;background:#e7f7f1}.view-comparison-switch .icon{width:16px}
.field-visit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.field-visit-card{position:relative;overflow:hidden;border:1px solid var(--border);border-top:4px solid var(--green);border-radius:17px;background:#fff;box-shadow:0 8px 24px rgba(16,38,59,.07);transition:.2s ease}.field-visit-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(16,38,59,.11)}.field-visit-card.high{border-top-color:#c47b1c}.field-visit-card.urgent{border-top-color:var(--danger)}.field-visit-card>header{display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:12px;padding:17px 18px;border-bottom:1px solid #edf1f4;background:linear-gradient(105deg,#fbfefd,#f6fafc)}.field-visit-date{display:grid;place-items:center;padding:6px;border-radius:13px;color:#087052;background:#e7f7f1}.field-visit-date strong{font-size:22px;line-height:1.1}.field-visit-date span{font-size:9px}.field-visit-title{min-width:0}.field-visit-title small{color:#0f936d;font-weight:700}.field-visit-title h2{overflow:hidden;margin:2px 0 4px;font-size:17px;text-overflow:ellipsis;white-space:nowrap}.field-visit-title p{display:flex;align-items:center;gap:4px;margin:0;color:var(--muted);font-size:11px}.field-visit-title .icon{width:14px}.field-visit-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px 18px}.field-visit-body>div{display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:9px;align-items:center;padding:9px;border-radius:11px;background:#f8fafc}.field-visit-body .card-data-icon{grid-row:1/3;display:grid;place-items:center;width:36px;height:36px;border-radius:10px}.card-data-icon.green{color:#087052;background:#e7f7f1}.card-data-icon.blue{color:#285f87;background:#eaf3fa}.card-data-icon.amber{color:#a76513;background:#fff2df}.card-data-icon.navy{color:#fff;background:#183b53}.card-data-icon .icon{width:17px}.field-visit-body small{color:var(--muted);font-size:10px}.field-visit-body strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.field-visit-purpose{margin:0 18px 15px;padding:10px 12px;border-right:3px solid #a8dccc;border-radius:8px;background:#f3faf7;color:#536577;font-size:11px;line-height:1.8}.field-visit-card>footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 18px;border-top:1px solid #edf1f4}.field-visit-card>footer>span{color:var(--muted);font-size:10px}.full-grid{grid-column:1/-1}
@media(max-width:1000px){.field-visit-grid{grid-template-columns:1fr}.visit-cards-toolbar{align-items:stretch;flex-direction:column}.view-comparison-switch{border-top:1px solid var(--border)}}
@media(max-width:600px){.field-visit-card>header{grid-template-columns:52px minmax(0,1fr)}.field-visit-card>header>.status-badge{grid-column:2;justify-self:start}.field-visit-body{grid-template-columns:1fr}.view-comparison-switch{flex-wrap:wrap}.view-comparison-switch>span{width:100%}}
.report-bars { display: grid; gap: 16px; padding: 20px; }
.report-bars article > div { display: flex; justify-content: space-between; margin-bottom: 7px; }
.report-bars progress { width: 100%; height: 10px; overflow: hidden; border: 0; border-radius: 99px; background: #e9eef2; }
.report-bars progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--green), #34b991); }
.report-bars progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--green), #34b991); }

/* Central modal design system. Keep page-specific modal CSS limited to body content. */
.modal[hidden], .waiting-screen[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: var(--modal-overlay); backdrop-filter: blur(5px); }
.modal-dialog { display: flex; width: min(var(--modal-width), 100%); max-height: calc(100dvh - 40px); flex-direction: column; overflow: hidden; border: 1px solid #ffffff80; border-radius: var(--modal-radius); background: var(--surface); box-shadow: var(--modal-shadow); animation: modal-enter .18s ease-out; }
.modal-dialog > form { display: grid; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.modal-head > div { display: flex; align-items: center; gap: 11px; }
.modal-heading { min-width: 0; }
.modal-heading > div { min-width: 0; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; }
.modal-icon.danger { background: var(--danger-light); color: var(--danger); }
.modal-body { display: grid; min-height: 0; gap: 16px; overflow-y: auto; padding: 20px; overscroll-behavior: contain; scrollbar-width: thin; }
.notice { padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 12px; font-weight: 700; }
.notice.warning { border-color: #efd39d; background: var(--warning-light); color: #80510d; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid var(--border); background: #f8fafb; }
.modal-actions > button, .modal-actions > a { min-width: 110px; }
.modal-context, .auto-schedule-summary, .question-form-intro { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid #b9ddcf; border-radius: 11px; background: #eff9f5; color: #436050; }
.modal-context > .icon, .auto-schedule-summary > .icon, .question-form-intro > .icon { width: 22px; height: 22px; flex: 0 0 22px; color: var(--green-dark); }
.modal-context > div, .auto-schedule-summary > div { display: grid; }
.modal-context p, .question-form-intro p { margin: 0; }
.modal-context span, .modal-context small, .auto-schedule-summary span { color: var(--muted); font-size: 11px; }
.modal-context.warning { border-color: #efd39d; background: var(--warning-light); color: #80510d; }
.modal-context.warning > .icon { color: var(--warning); }
.modal-context.danger { border-color: #efc3bf; background: var(--danger-light); color: var(--danger); }
.modal-context.danger > .icon { color: var(--danger); }
.modal-open, .menu-open { overflow: hidden; }
.waiting-screen { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(10, 30, 46, .62); backdrop-filter: blur(5px); }
.waiting-card { width: min(390px, 100%); padding: 28px; border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(7, 24, 37, .3); text-align: center; }
.spinner { display: block; width: 46px; height: 46px; margin: 0 auto 15px; border: 4px solid #c8e2da; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.waiting-card strong { display: block; color: var(--navy-light); font-size: 18px; }
.waiting-card p { margin: 5px 0 0; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: radial-gradient(circle at 18% 20%, #3f759038 0 13%, transparent 14%), linear-gradient(135deg, #122a3e, #2d6077); }
.login-card { position: relative; width: min(440px, 100%); overflow: hidden; padding: 31px 34px 34px; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px #08162455; }
.login-card::before { position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--green), var(--navy-light)); content: ""; }
.login-brand { margin: auto; }
.login-card h1 { margin: 17px 0 5px; text-align: center; font-size: 23px; }
.login-card > p { margin: 0 0 20px; color: var(--muted); text-align: center; }
.login-organization { display: grid; gap: 4px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #cce7dd; border-radius: 13px; background: linear-gradient(145deg, #f7fcfa, #eaf7f2); text-align: center; }
.login-organization small { color: var(--muted); font-size: 10px; }
.login-organization strong { color: var(--green-dark); font-size: 17px; }
.login-card form { display: grid; gap: 15px; }
.login-card input { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd5df; border-radius: 10px; outline: 0; }
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876618; }
.login-submit { width: 100%; margin-top: 3px; }
.empty-state { display: grid; min-height: 330px; place-items: center; align-content: center; padding: 35px; text-align: center; }
.empty-state > span { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 20px; background: var(--green-light); color: var(--green-dark); }
.empty-state > span .icon { width: 30px; height: 30px; }
.empty-state h2 { margin: 15px 0 2px; }
.empty-state p { max-width: 520px; margin: 0; color: var(--muted); }
.warning-btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #d88a20, #b7650b); color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.record-tabs { position: sticky; top: 76px; z-index: 8; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; padding: 8px; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.record-tab { display: flex; min-width: 0; min-height: 48px; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; background: #f6f8fa; color: #607080; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; transition: .16s ease; }
.record-tab .icon { width: 18px; height: 18px; }
.record-tab b { display: inline-grid; min-width: 25px; height: 25px; place-items: center; padding-inline: 6px; border-radius: 8px; background: #e5ebef; color: #526574; font-size: 11px; }
.record-tab:hover, .record-tab:focus-visible { border-color: #b9ddcf; background: #eef8f4; color: var(--green-dark); outline: 0; }
.record-tab.active { border-color: #0d8261; background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; box-shadow: 0 8px 18px rgba(15,147,109,.2); }
.record-tab.active b { background: rgba(255,255,255,.2); color: #fff; }
.tab-section { min-height: 280px; animation: tab-in .18s ease; }
.tab-section[hidden] { display: none; }
@keyframes tab-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.workflow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.workflow-steps span { padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.workflow-steps .done { border-color: #bce2d5; background: var(--green-light); color: var(--green-dark); }
.workflow-steps .current { border-color: #9eb7cc; background: #edf4f9; color: var(--navy); }
.assignment-list { display: grid; gap: 10px; padding: 18px; }
.assignment-card { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(260px, 1.5fr) auto; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfd; }
.assignment-card > div:first-child { display: grid; gap: 3px; }
.assignment-card small { color: var(--muted); }
.assignment-visits { display: flex; gap: 7px; flex-wrap: wrap; }
.assignment-visits a { display: grid; padding: 7px 10px; border: 1px solid #cde4dc; border-radius: 9px; background: #f4fbf8; color: var(--text); text-decoration: none; }
.assignment-visits a small { font-size: 10px; }
.checkbox-grid ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.workflow-actions { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 18px; }
.workflow-actions form { display: grid; min-width: min(100%, 310px); gap: 9px; }
.question-list { display: grid; gap: 9px; padding: 18px; }
.question-list article { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.question-list article > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--green-light); color: var(--green-dark); font-weight: 900; }
.question-list article > div { display: grid; }
.question-list small { color: var(--muted); }
.inspection-form { display: grid; gap: 18px; padding: 18px; }
.inspection-form fieldset { margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 13px; }
.inspection-form legend { margin-right: 16px; padding: 0 9px; color: var(--navy); font-weight: 900; }
.inspection-form .field > small { display: block; margin-bottom: 6px; color: var(--muted); }
.inspection-wizard { overflow: hidden; }
.wizard-progress { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.wizard-progress > div { flex: 1; height: 9px; overflow: hidden; border-radius: 20px; background: #dfeae6; }
.wizard-progress > div span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-dark), var(--green)); transition: width .25s ease; }
.wizard-progress strong { min-width: 46px; color: var(--green-dark); font-size: .84rem; }
.wizard-steps { display: flex; gap: 10px; overflow-x: auto; padding: 12px 20px 16px; scrollbar-width: thin; }
.wizard-steps a { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 145px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); background: #fff; text-decoration: none; }
.wizard-steps a span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #edf2f5; color: var(--navy); font-weight: 900; }
.wizard-steps a b { font-size: .8rem; }
.wizard-steps a.active { border-color: var(--green); background: var(--green-light); color: var(--green-dark); box-shadow: 0 0 0 3px rgba(15,147,109,.09); }
.wizard-steps a.active span, .wizard-steps a.complete span { color: #fff; background: var(--green); }
.inspection-form fieldset { background: #fbfcfd; }
.inspection-form .form-grid { align-items: stretch; }
.inspection-form .field:not(.full-span) { display: flex; height: 100%; flex-direction: column; }
.inspection-form .field:not(.full-span) > .form-control,
.inspection-form .field:not(.full-span) > .searchable-select { margin-top: auto; }
.inspection-form .form-grid > .field:last-child:nth-child(odd):not(.full-span) { grid-column: 1 / -1; }
.inspection-form .field.full-span { padding: 14px; border-radius: 12px; background: #fff; border: 1px solid #e9eef2; }
.yes-no-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.yes-no-options label { cursor: pointer; }
.yes-no-options input { position: absolute; opacity: 0; pointer-events: none; }
.yes-no-options span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--border); border-radius: 10px; font-weight: 800; background: #fff; transition: .18s ease; }
.yes-no-options input:checked + span { color: #fff; border-color: var(--green-dark); background: linear-gradient(135deg, var(--green-dark), var(--green)); box-shadow: 0 6px 15px rgba(15,147,109,.18); }
.inspection-upload { display: grid; gap: 10px; padding: 15px; border: 1px dashed #9fcdbf; border-radius: 12px; background: #f7fcfa; }
.inspection-upload > label { display: flex; align-items: center; gap: 9px; width: max-content; max-width: 100%; padding: 10px 15px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--green-dark), var(--green)); cursor: pointer; }
.inspection-upload > label span { font-size: .72rem; opacity: .85; }
.inspection-upload > input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.inspection-upload > small { color: var(--muted); line-height: 1.8; }
.saved-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-attachments a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 7px 10px; border-radius: 9px; color: var(--navy); background: #fff; border: 1px solid var(--border); text-decoration: none; overflow-wrap: anywhere; }
.wizard-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assessment-launch-card, .result-workflow-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; border: 1px solid #cfe4dc; border-radius: var(--radius); background: linear-gradient(135deg, #fff, #f3fbf8); box-shadow: var(--shadow); }
.assessment-launch-card > div:first-of-type, .result-workflow-card > div:first-child { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 0; }
.assessment-launch-card h2, .result-workflow-card h2 { margin: 2px 0 3px; color: var(--navy); font-size: 1.08rem; }
.assessment-launch-card p, .result-workflow-card p { margin: 0; color: var(--muted); }
.assessment-launch-card small, .result-workflow-card small { color: var(--green-dark); font-weight: 800; }
.assessment-launch-icon, .result-workflow-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--green-dark), var(--green)); box-shadow: 0 10px 24px rgba(15,147,109,.2); }
.assessment-meter { width: min(430px, 100%); height: 7px; margin-top: 12px; overflow: hidden; border-radius: 20px; background: #dbe9e4; }
.assessment-meter span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.result-workflow-card { border-color: #cbdbe7; background: linear-gradient(135deg, #fff, #f4f8fb); }
.result-workflow-icon { background: linear-gradient(135deg, var(--navy), var(--navy-light)); }
.result-approval-form { display: grid; gap: 7px; width: min(480px, 100%); }
.result-approval-form label { color: var(--navy); font-weight: 800; }
form:has(#id_status:disabled) button[type="submit"] { pointer-events: none; opacity: .48; filter: grayscale(.25); }
@media (max-width: 720px) {
  .wizard-steps a { min-width: 122px; }
  .wizard-steps a b { font-size: .72rem; }
  .yes-no-options { grid-template-columns: 1fr; }
  .inspection-upload > label { width: 100%; justify-content: center; }
  .assessment-launch-card, .result-workflow-card { align-items: stretch; flex-direction: column; }
  .assessment-launch-card > .primary-btn, .assessment-launch-card > .secondary-btn { width: 100%; }
}
.required { color: var(--danger); }
.title-status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-status-line h1 { margin: 0; }
.panel-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auto-schedule-btn { border-color: #a9d9c8; background: #f0faf6; color: var(--green-dark); }
.edit-schedule-btn { border-color: #b8cedd; background: #f3f8fb; color: var(--blue); }
.edit-schedule-btn:hover { border-color: var(--blue); background: #eaf3f8; }
.group-stats { margin-top: 16px; }
.group-instructions { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px 16px; border: 1px solid #cbdde9; border-radius: 12px; background: #f3f8fb; }
.group-instructions > .icon { width: 20px; height: 20px; flex: 0 0 20px; color: #376885; }
.group-instructions p { margin: 3px 0 0; color: var(--muted); }
.compact-workflow { margin-bottom: 0; }
.visit-association-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.visit-association-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(16,38,59,.05); }
.visit-association-card > header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px 15px; border-bottom: 1px solid #e8edf1; background: linear-gradient(120deg, #fbfdfd, #f4f8fa); }
.association-card-icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 11px; background: var(--green-light); color: var(--green-dark); }
.association-card-icon .icon { width: 19px; height: 19px; }
.visit-association-card h3 { overflow: hidden; margin: 0; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.visit-association-card header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.visit-target-badge { display: inline-grid; min-width: 48px; min-height: 31px; place-items: center; padding: 4px 9px; border-radius: 9px; background: #e7f1f6; color: var(--navy-light); font-weight: 900; }
.visit-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 15px; border-bottom: 1px solid #edf1f4; }
.visit-progress progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 99px; }
.visit-progress progress::-webkit-progress-value { border-radius: 99px; background: var(--green); }
.visit-progress progress::-moz-progress-bar { border-radius: 99px; background: var(--green); }
.visit-progress span { color: var(--muted); font-size: 10px; }
.scheduled-slots { display: grid; gap: 7px; min-height: 73px; padding: 12px 15px; }
.scheduled-slots a, .no-schedule { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #d6e7e1; border-radius: 9px; background: #f6fbf9; color: var(--text); text-decoration: none; }
.scheduled-slots .icon { width: 17px; height: 17px; flex: 0 0 17px; color: var(--green-dark); }
.scheduled-slots a span { display: grid; }
.scheduled-slots small, .no-schedule { color: var(--muted); font-size: 10px; }
.visit-association-card > footer { display: flex; justify-content: flex-end; padding: 0 15px 13px; }
.compact-group-empty { grid-column: 1 / -1; min-height: 290px; }
.workflow-submit-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.workflow-submit-panel > div:first-child { display: flex; align-items: center; gap: 12px; }
.workflow-submit-panel h2 { margin: 0; font-size: 17px; }
.workflow-submit-panel p { margin: 3px 0 0; color: var(--muted); }
.workflow-submit-icon { display: grid; width: 45px; height: 45px; flex: 0 0 45px; place-items: center; border-radius: 12px; background: var(--green-light); color: var(--green-dark); }
.modal-dialog.modal-wide { width: min(var(--modal-wide-width), 100%); }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.modal-wide .modal-body { max-height: none; }
.association-modal-search { position: relative; display: block; }
.association-modal-search .icon { position: absolute; z-index: 1; top: 13px; right: 13px; width: 18px; height: 18px; color: var(--muted); }
.association-modal-search input { padding-right: 42px; }
.association-picker { display: grid; gap: 8px; }
.association-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) 145px; align-items: center; gap: 14px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfd; }
.association-picker-row:has(input[type="checkbox"]:checked) { border-color: #b9ddcf; background: #f3faf7; }
.association-picker-row[hidden] { display: none; }
.association-picker-row > label { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.association-picker-row > label > span { display: grid; min-width: 0; }
.association-picker-row > label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.association-picker-row > label small { color: var(--muted); }
.association-picker-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--green); }
.association-visit-count { display: grid; grid-template-columns: 1fr 62px; align-items: center; gap: 8px; }
.association-visit-count span { color: var(--muted); font-size: 10px; }
.association-visit-count input { min-height: 38px; padding: 6px 8px; text-align: center; }
.modal-form-grid { padding: 0; }
.workdays-field > label { display: block; margin-bottom: 7px; font-weight: 800; }
.workdays-field ul { display: flex; gap: 7px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.workdays-field label { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; }
.workdays-field input { accent-color: var(--green); }
.approval-forms, .approval-forms form { display: grid; gap: 12px; }
.template-stats { margin-top: 4px; }
.template-sections { display: grid; gap: 14px; padding: 18px; }
.template-section-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.template-section-card > header { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--border); background: linear-gradient(110deg, #eff9f5, #f7fafc); }
.template-section-card > header > div { display: flex; align-items: center; gap: 10px; }
.section-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--green); color: #fff; font-weight: 900; }
.template-section-card h3 { margin: 0; font-size: 15px; }
.template-section-card header p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.template-question-list { display: grid; }
.template-question-list article { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 13px 15px; border-bottom: 1px solid #edf1f4; }
.template-question-list article:last-child { border-bottom: 0; }
.question-order { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #edf3f6; color: var(--navy-light); font-weight: 900; }
.question-copy { min-width: 0; }
.question-copy > strong { display: block; line-height: 1.7; }
.question-copy > p { margin: 3px 0; color: var(--muted); font-size: 11px; }
.question-option-preview { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.question-option-preview span, .question-option-preview b { padding: 3px 7px; border-radius: 7px; background: #f0f4f6; color: #607080; font-size: 9px; font-weight: 700; }
.question-meta { display: flex; align-items: flex-end; gap: 5px; flex-direction: column; }
.question-meta small { color: var(--muted); font-size: 9px; }
.question-type-badge { padding: 5px 8px; border: 1px solid #bfd8e7; border-radius: 8px; background: #eef6fa; color: #32617e; font-size: 10px; font-weight: 800; white-space: nowrap; }
.question-type-badge.multiple_choice, .question-type-badge.single_choice { border-color: #b8ddcf; background: #edf9f4; color: var(--green-dark); }
.required-badge { color: var(--danger) !important; }
.template-empty { min-height: 300px; }
.question-modal-body { gap: 14px; }
.question-form-intro p { color: #436050; font-size: 11px; }
.question-options-field.is-hidden { display: none; }
.dynamic-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dynamic-choice-grid label { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.dynamic-choice-grid input { width: 16px; height: 16px; accent-color: var(--green); }
.select-native-accessible { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
.searchable-select { position: relative; display: block; width: 100%; min-width: 0; }
.searchable-select.compact { width: min(230px, 100%); }
.searchable-select-trigger { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid #cbd5df; border-radius: 10px; outline: 0; background: #fff; color: var(--text); cursor: pointer; transition: .15s ease; }
.searchable-select-trigger:hover { border-color: #aebdca; }
.searchable-select-trigger:focus, .searchable-select-trigger.is-open { border-color: var(--green); box-shadow: 0 0 0 3px #16876618; }
.searchable-select-trigger.is-disabled { background: #f0f2f5; color: #667085; cursor: not-allowed; }
.searchable-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchable-select-value.is-placeholder { color: var(--muted); }
.searchable-select-arrow { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; color: #607080; transition: transform .15s ease; }
.searchable-select-arrow svg, .searchable-select-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.searchable-select-trigger.is-open .searchable-select-arrow { transform: rotate(180deg); }
.searchable-select-menu { position: fixed; z-index: 500; display: flex; max-height: 360px; flex-direction: column; overflow: hidden; padding: 7px; border: 1px solid #ccd8e0; border-radius: 12px; background: #fff; box-shadow: 0 18px 45px rgba(16,38,59,.2); }
.searchable-select-menu[hidden] { display: none; }
.searchable-select-search { position: relative; display: block; flex: 0 0 auto; padding-bottom: 7px; border-bottom: 1px solid #edf1f4; }
.searchable-select-search svg { position: absolute; z-index: 1; top: 10px; right: 11px; color: var(--green-dark); }
.searchable-select-search input { width: 100%; min-height: 39px; padding: 7px 38px 7px 10px; border: 1px solid #c7d6df; border-radius: 9px; outline: 0; background: #f8fbfa; color: var(--text); font-size: 12px; }
.searchable-select-search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876614; background: #fff; }
.searchable-select-options { display: grid; min-height: 0; overflow-y: auto; padding-top: 5px; overscroll-behavior: contain; scrollbar-width: thin; }
.searchable-select-option { width: 100%; min-height: 38px; padding: 7px 10px; border: 0; border-radius: 8px; background: #fff; color: var(--text); text-align: right; cursor: pointer; }
.searchable-select-option:hover, .searchable-select-option:focus { outline: 0; background: #eef8f5; color: var(--green-dark); }
.searchable-select-option.is-selected { position: relative; padding-left: 31px; background: var(--green-light); color: var(--green-dark); font-weight: 850; }
.searchable-select-option.is-selected::after { position: absolute; top: 50%; left: 11px; width: 8px; height: 4px; transform: translateY(-65%) rotate(-45deg); border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; content: ""; }
.searchable-select-option:disabled { color: #9aa5b1; cursor: not-allowed; }
.searchable-select-empty { padding: 18px 10px; color: var(--muted); font-size: 11px; text-align: center; }
.map-location-field { padding: 14px; border: 1px solid #cce3da; border-radius: 12px; background: linear-gradient(135deg, #f4fbf8, #f8fbfc); }
.map-field-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; color: var(--green-dark); font-weight: 900; }
.map-field-heading .icon { width: 17px; height: 17px; }
.map-location-field .field { margin: 0; }
.map-location-field input { text-align: left; }
.location-link { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #b8dacd; border-radius: 9px; background: #eff9f5; color: var(--green-dark); font-weight: 800; text-decoration: none; }
.location-link:hover { border-color: var(--green); background: var(--green-light); }
.location-link .icon { width: 16px; height: 16px; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 18px; align-items: start; }
.settings-validation, .settings-actions { grid-column: 1 / -1; }
.settings-main { display: grid; gap: 18px; min-width: 0; }
.settings-section { margin: 0; }
.settings-identity-grid { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 20px; padding: 20px; }
.settings-basic-fields { grid-template-columns: 1fr; padding: 0; }
.settings-basic-fields .full-span { grid-column: auto; }
.logo-upload-card { display: flex; align-items: center; flex-direction: column; gap: 10px; padding: 15px; border: 1px dashed #b6c8d5; border-radius: 14px; background: linear-gradient(145deg, #f9fbfc, #f0f7f5); text-align: center; }
.logo-preview { display: flex; width: 150px; height: 150px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; overflow: hidden; border: 1px solid #d8e5e0; border-radius: 18px; background: #fff; color: var(--muted); }
.logo-preview > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; background: var(--green-light); color: var(--green-dark); }
.logo-preview > span .icon { width: 25px; height: 25px; }
.logo-preview img { width: 100%; min-height: 0; flex: 1; object-fit: contain; padding: 12px; }
.logo-preview strong { max-width: 130px; overflow: hidden; padding-bottom: 7px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.logo-preview small { font-size: 9px; }
.logo-upload-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid #acd5c7; border-radius: 9px; background: #fff; color: var(--green-dark); font-weight: 800; cursor: pointer; }
.logo-upload-button:hover { background: var(--green-light); }
.logo-upload-button .icon { width: 16px; height: 16px; }
.logo-upload-card input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.logo-upload-card .field-help { text-align: center; }
.letterhead-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 20px; }
.letterhead-fields textarea { min-height: 135px; resize: vertical; line-height: 2; }
.settings-preview-panel { position: sticky; top: 94px; overflow: hidden; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.preview-label { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: var(--navy); font-weight: 900; }
.preview-label .icon { color: var(--green-dark); }
.letterhead-preview { display: grid; grid-template-columns: minmax(0, 1fr) 125px minmax(0, 1fr); align-items: start; gap: 11px; min-height: 180px; padding: 22px 15px 17px; border: 1px solid #d7e0e7; border-radius: 10px 10px 3px 3px; background: #fff; box-shadow: inset 0 -5px #f5f7f9; }
.letterhead-side { color: #425268; font-size: 9px; line-height: 2.15; white-space: pre-line; }
.letterhead-side.left { direction: ltr; text-align: left; }
.letterhead-logo { display: flex; min-width: 0; align-items: center; flex-direction: column; gap: 8px; color: var(--navy); text-align: center; }
.letterhead-logo > span { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #1aa27a, #0a7155); color: #fff; }
.letterhead-logo img { width: 68px; height: 68px; object-fit: contain; }
.letterhead-logo strong { max-width: 125px; font-size: 10px; line-height: 1.6; }
.letterhead-rule { height: 5px; margin: 0 3px; background: linear-gradient(90deg, var(--green), var(--navy-light)); }
.letterhead-rule span { display: block; width: 30%; height: 100%; margin: auto; background: #d6b45e; }
.letterhead-paper { display: grid; gap: 10px; min-height: 170px; padding: 30px 22px; border: 1px solid #e2e6ea; border-top: 0; background: #fff; }
.letterhead-paper span { display: block; height: 7px; border-radius: 5px; background: #edf0f3; }
.letterhead-paper span:nth-child(2) { width: 84%; }
.letterhead-paper span:nth-child(3) { width: 92%; }
.letterhead-paper span:nth-child(4) { width: 65%; }
.settings-preview-panel > p { margin: 12px 3px 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.settings-actions { position: sticky; bottom: 12px; z-index: 4; display: flex; justify-content: flex-start; gap: 9px; padding: 13px; border: 1px solid #dbe5e2; border-radius: 13px; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(16,38,59,.12); backdrop-filter: blur(8px); }
.settings-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-tab-panel { min-height: 360px; }
.settings-catalog-intro { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; padding: 17px 19px; border: 1px solid #c9e3da; border-radius: 15px; background: linear-gradient(135deg, #f5fbf9, #eef6f8); }
.settings-catalog-intro > span { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 13px; background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; box-shadow: 0 8px 18px rgba(15,147,109,.2); }
.settings-catalog-intro h2 { margin: 0; font-size: 18px; }
.settings-catalog-intro p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.settings-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.settings-type-card { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.settings-type-card.full { grid-column: 1 / -1; }
.settings-type-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid #e7ecef; background: linear-gradient(135deg, #fff, #f8fafb); }
.settings-type-card > header > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.settings-type-card h2 { margin: 0; font-size: 15px; }
.settings-type-card header p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.catalog-icon { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 11px; }
.catalog-icon.green { background: var(--green-light); color: var(--green-dark); }
.catalog-icon.blue { background: #e9f2f8; color: var(--blue); }
.catalog-icon.amber { background: var(--warning-light); color: var(--warning); }
.primary-btn.small { min-height: 36px; padding: 7px 11px; font-size: 11px; }
.settings-type-list { display: grid; padding: 7px 15px 13px; }
.settings-type-list.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.settings-type-list > div { display: flex; min-width: 0; min-height: 57px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid #edf1f4; }
.settings-type-list > div:last-child { border-bottom: 0; }
.settings-type-list > div > span { display: grid; min-width: 0; }
.settings-type-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.settings-type-list small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.settings-type-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.settings-type-actions form { margin: 0; }
.settings-type-actions .table-btn { min-height: 31px; padding-inline: 10px; }
[data-edit-field][hidden] { display: none; }
.status-toggle { min-width: 72px; min-height: 31px; padding: 5px 9px; border: 1px solid #d7dee5; border-radius: 9px; background: #f2f4f6; color: #667485; font: inherit; font-size: 9px; font-weight: 850; cursor: pointer; }
.status-toggle.active { border-color: #b8ddcf; background: var(--green-light); color: var(--green-dark); }
.status-toggle:hover { border-color: var(--green); }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .welcome-card { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-preview-panel { position: static; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; right: 0; width: min(285px, 86vw); transform: translateX(105%); box-shadow: -15px 0 40px #07111f55; transition: transform .2s ease; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 30; border: 0; background: #0b172966; }
  .app-shell.sidebar-open + .sidebar-overlay { display: block; }
  .mobile-menu-button { display: grid; }
  .topbar { justify-content: flex-start; padding: 0 18px; }
  .content { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .assignment-card { grid-template-columns: 1fr; }
  .checkbox-grid ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visit-association-grid { grid-template-columns: 1fr; }
  .association-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-type-grid { grid-template-columns: 1fr; }
  .settings-type-card.full { grid-column: auto; }
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .content { padding: 15px; }
  .modal { align-items: end; padding: 8px; }
  .modal-dialog { width: 100%; max-height: calc(100dvh - 16px); border-radius: 18px; }
  .modal-head { padding: 14px 15px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 15px; }
  .modal-actions { padding: 12px 15px; }
  .topbar { min-height: 68px; height: auto; padding-block: 10px; }
  .topbar-actions { width: 100%; }
  .topbar-user { margin-right: auto; padding-inline: 8px 0; border: 0; }
  .tenant-pill { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading > .primary-btn, .page-heading .actions > * { flex: 1; }
  .stats-grid { grid-template-columns: 1fr; }
  .welcome-card { min-height: 0; padding: 21px 18px; }
  .welcome-actions, .form-actions, .modal-actions { align-items: stretch; flex-direction: column; }
  .welcome-actions > *, .form-actions > *, .modal-actions > * { width: 100%; }
  .list-tools { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; max-width: none; flex: 0 0 auto; }
  .form-control.compact { width: 100%; max-width: none; }
  .visit-list article { grid-template-columns: 68px minmax(0, 1fr); }
  .visit-list .status-badge { grid-column: 2; justify-self: start; }
  .form-grid { padding: 17px; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list .full { grid-column: auto; }
  .association-overview-grid { grid-template-columns: 1fr; padding: 14px; }
  .association-map-card { grid-column: auto; }
  .association-map-card > div { align-items: flex-start; flex-direction: column; }
  .pagination { flex-wrap: wrap; }
  .table-btn span { display: none; }
  .login-card { padding: 28px 22px; }
  .workflow-steps { grid-template-columns: 1fr 1fr; }
  .checkbox-grid ul { grid-template-columns: 1fr; }
  .record-tabs { position: static; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .record-tab { min-width: 155px; flex: 0 0 155px; scroll-snap-align: start; }
  .workflow-submit-panel, .workflow-submit-panel > div:first-child { align-items: stretch; flex-direction: column; }
  .workflow-submit-panel .workflow-actions, .workflow-submit-panel .workflow-actions form { width: 100%; }
  .association-picker-row { grid-template-columns: 1fr; }
  .association-visit-count { max-width: 190px; margin-right: 28px; }
  .template-question-list article { grid-template-columns: 34px minmax(0, 1fr); }
  .question-meta { grid-column: 2; align-items: flex-start; flex-direction: row; }
  .dynamic-choice-grid { grid-template-columns: 1fr; }
  .settings-identity-grid, .letterhead-fields { grid-template-columns: 1fr; }
  .settings-tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .settings-tabs .record-tab { min-width: 0; width: auto; flex: initial; }
  .settings-catalog-intro { align-items: flex-start; padding: 14px; }
  .settings-type-card > header { align-items: flex-start; flex-direction: column; }
  .settings-type-card > header .primary-btn { width: 100%; }
  .settings-type-list.columns { grid-template-columns: 1fr; }
  .settings-type-actions .table-btn span { display: inline; }
  .letterhead-preview { grid-template-columns: 1fr; text-align: center; }
  .letterhead-side, .letterhead-side.left { direction: rtl; text-align: center; }
  .letterhead-logo { grid-row: 1; }
  .settings-actions { position: static; }
}

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

.checkbox-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:10px; }
.checkbox-card-grid label { display:flex; align-items:center; gap:9px; min-height:44px; padding:10px 12px; border:1px solid var(--border,#dfe5ec); border-radius:10px; background:#fff; cursor:pointer; }
.checkbox-card-grid input { width:17px; height:17px; accent-color:#0f936d; }
.satisfaction-card { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px; border:1px solid #cfe9df; border-radius:18px; background:linear-gradient(135deg,#fff,#f1fbf7); box-shadow:0 10px 25px rgba(16,38,59,.06); }
.satisfaction-card-copy { display:flex; align-items:center; gap:14px; min-width:0; }
.satisfaction-card h2 { margin:3px 0 5px; color:#10263b; }.satisfaction-card p{margin:0;color:#738094}.satisfaction-card small{color:#0f936d;font-weight:700}
.satisfaction-link-box,.satisfaction-create-form { display:flex; align-items:center; gap:8px; min-width:min(100%,520px); }.satisfaction-link-box input{min-width:260px}
.public-survey-body { margin:0; min-height:100vh; background:#f2f5f8; color:#233044; font-family:"Noto Kufi Arabic",sans-serif; }
.public-survey-shell { width:min(980px,calc(100% - 28px)); margin:0 auto; padding:34px 0 60px; }
.public-survey-head { display:flex; align-items:center; gap:18px; margin-bottom:22px; padding:25px; color:#fff; border-radius:22px; background:linear-gradient(135deg,#10263b,#0f936d); box-shadow:0 16px 34px rgba(16,38,59,.16); }
.public-survey-head h1{margin:4px 0;font-size:clamp(22px,4vw,32px)}.public-survey-head p,.public-survey-head small{margin:0;color:#d8f4eb}.public-survey-mark{display:grid;place-items:center;flex:0 0 58px;height:58px;border-radius:16px;background:rgba(255,255,255,.13)}.public-survey-mark svg{width:34px;fill:none;stroke:#fff;stroke-width:1.8}
.public-survey-section { margin-top:16px; padding:22px; border:1px solid #dfe5ec; border-radius:18px; background:#fff; box-shadow:0 8px 24px rgba(16,38,59,.05); }.public-survey-section>header{display:flex;align-items:center;gap:11px;margin-bottom:18px}.public-survey-section>header>span{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#e7f7f1;color:#087052;font-weight:800}.public-survey-section h2{margin:0;font-size:18px}.public-survey-section header p{margin:3px 0 0;color:#738094;font-size:12px}
.survey-rating{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:auto}.survey-rating label{cursor:pointer}.survey-rating input{position:absolute;opacity:0}.survey-rating span{display:grid;place-items:center;height:44px;border:1px solid #dfe5ec;border-radius:10px;background:#fff;font-weight:700}.survey-rating input:checked+span{color:#fff;border-color:#0f936d;background:#0f936d}
.public-survey-actions { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:18px; padding:18px 22px; border-radius:16px; background:#fff; border:1px solid #dfe5ec; }.public-survey-actions small{color:#738094}.public-survey-message{padding:36px;text-align:center;border-radius:20px;background:#fff;border:1px solid #dfe5ec}.public-survey-message.success{border-color:#bfe4d5;background:#f1fbf7}.public-survey-message h2{color:#087052}
@media(max-width:760px){.checkbox-card-grid{grid-template-columns:1fr}.satisfaction-card,.satisfaction-link-box,.satisfaction-create-form,.public-survey-actions{align-items:stretch;flex-direction:column}.satisfaction-link-box,.satisfaction-create-form{width:100%;min-width:0}.satisfaction-link-box input{min-width:0;width:100%}.public-survey-head{align-items:flex-start}.public-survey-section{padding:16px}}
