* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  color: var(--text-900);
  background: var(--sand-50);
  line-height: 1.55;
}
body.drawer-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 2.2vw, 2.15rem); line-height: 1.3; }
h2 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); }
h3 { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--text-500); }
.subtle { color: var(--text-500); line-height: 1.75; }
.eyebrow { color: var(--primary-700); font-size: .78rem; font-weight: 800; letter-spacing: .02em; margin-bottom: var(--space-1); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }

/* Buttons and fields */
.btn, .primary-btn, .secondary-btn, .danger-btn, .icon-btn {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 16px;
  font-weight: 700;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.primary-btn { color: #fff; background: var(--primary-800); }
.primary-btn:hover { background: var(--primary-900); transform: translateY(-1px); }
.secondary-btn { color: var(--primary-900); background: #fff; border-color: var(--border-strong); }
.secondary-btn:hover { background: var(--primary-50); border-color: #a9c5b6; }
.danger-btn { color: var(--danger); background: var(--danger-soft); border-color: #f3c9c5; }
.danger-btn:hover { background: #ffe4e1; }
.icon-btn { width: 46px; padding: 0; color: var(--text-700); background: transparent; border-color: var(--border); }
.btn:active, .primary-btn:active, .secondary-btn:active, .danger-btn:active, .icon-btn:active { transform: translateY(1px); }
button:disabled, .btn[aria-disabled='true'] { cursor: not-allowed; opacity: .55; transform: none; }
:focus-visible { outline: 3px solid rgba(28,114,90,.25); outline-offset: 2px; }
input, select, textarea {
  display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px;
  color: var(--text-900); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input[type='date'] { box-sizing: border-box; width: 100%; inline-size: 100%; max-width: 100%; min-width: 0; min-inline-size: 0; font-size: 16px; }
input[type='date']::-webkit-date-and-time-value { width: 100%; inline-size: 100%; min-width: 0; min-inline-size: 0; margin: 0; text-align: right; }
input[type='date']::-webkit-datetime-edit { min-width: 0; min-inline-size: 0; padding: 0; }
input[type='date']::-webkit-calendar-picker-indicator { flex: 0 0 auto; margin: 0; padding: 2px; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #9eb8aa; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-700); box-shadow: 0 0 0 3px rgba(28,114,90,.12); outline: 0; }
input:disabled, select:disabled { background: #f1f3f1; color: var(--text-500); cursor: not-allowed; }
textarea { min-height: 150px; resize: vertical; }
.field-group { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.field-group label, .field-label { font-size: .9rem; font-weight: 700; }
.required::after { content: ' *'; color: var(--danger); }
.optional-label { color: var(--text-500); font-size: .86em; font-weight: 500; }
.field-error { min-height: 18px; color: var(--danger); font-size: .78rem; }
.field-error:empty { display: none; }
.field-hint { margin-top: 6px; color: var(--text-500); font-size: .82rem; }
.field-group.has-error > input,
.field-group.has-error > select,
.field-group.has-error .date-input-wrap,
.field-group.has-error .password-input-wrap > input,
.field-group.has-error .searchable-combobox > input { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 0 0 3px rgba(180,35,24,.08); }
.searchable-combobox { position: relative; width: 100%; max-width: 100%; min-width: 0; }
.searchable-combobox input { padding-left: 42px; }
.combobox-toggle { position: absolute; left: 1px; top: 1px; width: 42px; height: 46px; padding: 0; color: var(--primary-800); background: transparent; border: 0; border-radius: var(--radius-sm); font-size: 1.25rem; }
.combobox-toggle:disabled { cursor: not-allowed; }
.combobox-list { position: absolute; z-index: 700; top: calc(100% + 6px); right: 0; left: 0; max-height: min(260px, calc(100vh - 140px)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 6px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.searchable-combobox.open-upward .combobox-list { top: auto; bottom: calc(100% + 6px); }
.combobox-option { width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 8px 10px; color: var(--text-900); text-align: right; background: transparent; border: 0; border-radius: 8px; }
.combobox-option:hover, .combobox-option.is-active { background: var(--primary-50); color: var(--primary-900); }
.combobox-option[aria-selected='true'] { background: var(--primary-100); font-weight: 700; }
.combobox-option small { color: var(--text-500); font-size: .72rem; }
.combobox-empty { padding: 18px 10px; color: var(--text-500); text-align: center; }
.searchable-combobox.is-disabled .combobox-toggle { color: var(--text-500); }
.helper-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); color: var(--text-500); font-size: .8rem; }
.password-wrap { position: relative; }
.password-wrap input { padding-left: 54px; }
.password-wrap .icon-btn { position: absolute; left: 4px; top: 1px; border: 0; }
.checkbox-row { display: flex; align-items: center; gap: 10px; color: var(--text-700); font-size: .9rem; cursor: pointer; }
.checkbox-row input { width: 20px; min-height: 20px; accent-color: var(--primary-800); }

/* Login */
.auth-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 20%, #dfeee6 0, transparent 34%), linear-gradient(135deg, #f9faf7, #edf4ef); }
.auth-pending > * { visibility: hidden; }
.auth-pending::after { content: 'جاري التحقق من جلسة الدخول...'; position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; visibility: visible; color: var(--primary-900); font-weight: 700; background: var(--surface); }
.auth-page::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(rgba(13,69,56,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(13,69,56,.08) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 75%); }
.auth-shell { width: 100%; display: grid; place-items: center; position: relative; }
.auth-card { width: min(460px, 100%); padding: clamp(24px, 4vw, 36px); background: rgba(255,255,255,.96); border: 1px solid rgba(200,214,206,.9); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.brand-block { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 24px; }
.brand-mark { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--primary-800); border-radius: 16px; box-shadow: 0 9px 20px rgba(20,91,73,.2); }
.brand-mark svg { width: 28px; height: 28px; }
.auth-card h1 { font-size: clamp(1.35rem, 5vw, 1.7rem); margin-bottom: 7px; }
.stack { display: flex; flex-direction: column; gap: 15px; }
.auth-card .primary-btn { width: 100%; margin-top: 2px; }
.form-note { padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--border); color: var(--text-500); font-size: .82rem; text-align: center; }

/* Application shell */
.app-shell { min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 500; color: #fff; background: rgba(9,47,39,.97); backdrop-filter: blur(10px); box-shadow: 0 4px 18px rgba(9,47,39,.15); }
.header-inner { width: min(var(--container), calc(100% - 40px)); min-height: 72px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.app-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; white-space: nowrap; }
.app-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary-950); background: #fff; }
.desktop-nav { display: flex; align-self: stretch; }
.desktop-nav a { display: flex; align-items: center; gap: 7px; padding: 0 15px; color: #d8e9e1; font-size: .9rem; border-bottom: 3px solid transparent; }
.desktop-nav a:hover, .desktop-nav a.active { color: #fff; background: rgba(255,255,255,.06); border-bottom-color: #7bc4a7; }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-meta { text-align: right; line-height: 1.35; }
.user-meta strong, .user-meta span { display: block; }
.user-meta span { color: #b8d0c5; font-size: .75rem; }
.header-logout { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); }
.menu-btn { display: none; color: #fff; border-color: rgba(255,255,255,.25); }
.page-container { width: min(var(--container), calc(100% - 40px)); margin: 0 auto; padding: 30px 0 42px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.page-heading .subtle { max-width: 720px; margin-top: 5px; }
.page-actions, .inline-actions, .action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.panel { padding: clamp(18px, 2.5vw, 26px); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-title { display: flex; align-items: center; gap: 11px; }
.section-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary-800); background: var(--primary-50); border-radius: 11px; }
.section-icon .icon { width: 19px; height: 19px; }
.section-divider { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }

/* Drawer */
.drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 800; background: rgba(4,20,16,.55); }
.drawer { position: fixed; z-index: 900; top: 0; right: 0; bottom: 0; width: min(310px, 86vw); padding: 18px; color: #fff; background: var(--primary-950); transform: translateX(105%); transition: transform 220ms ease; }
.drawer-backdrop.open { display: block; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
.drawer-nav { display: grid; gap: 7px; padding-top: 18px; }
.drawer-nav a, .drawer-nav button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 13px; border: 0; border-radius: 10px; color: #d9e8e1; background: transparent; font: inherit; text-align: right; cursor: pointer; }
.drawer-nav a:hover, .drawer-nav a.active, .drawer-nav button:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Dashboard and lists */
.hero-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 23px 25px; color: #fff; background: linear-gradient(120deg, var(--primary-900), var(--primary-700)); border-radius: var(--radius-md); overflow: hidden; position: relative; }
.hero-strip::after { content: ''; position: absolute; width: 190px; height: 190px; left: -45px; bottom: -110px; border: 32px solid rgba(255,255,255,.08); border-radius: 50%; }
.hero-strip .subtle { color: #d6e9e0; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 18px; min-width: 0; }
.stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--text-500); font-size: .82rem; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--primary-800); background: var(--primary-50); border-radius: 10px; }
.stat-value { margin-top: 12px; color: var(--primary-900); font-size: 1.8rem; font-weight: 800; line-height: 1; }
.filter-bar { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.dashboard-filter { grid-template-columns: minmax(240px,2fr) repeat(2,minmax(150px,1fr)); }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; right: 13px; top: 14px; color: var(--text-500); }
.search-wrap input { padding-right: 42px; }
.table-wrap { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.data-table th { padding: 13px 12px; color: var(--text-700); background: #f5f8f6; text-align: right; white-space: nowrap; }
.data-table td { padding: 14px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfdfc; }
.table-actions { display: flex; gap: 6px; }
.table-actions .btn { min-height: 36px; padding: 6px 10px; font-size: .8rem; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-cell { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.deleted-label, .table-rejection-note { display: block; color: var(--text-500); font-size: .72rem; line-height: 1.45; overflow-wrap: anywhere; }
.table-rejection-note { max-width: 220px; color: var(--danger); }
.status-completed { color: var(--success); background: var(--success-soft); }
.status-draft { color: var(--warning); background: var(--warning-soft); }
.status-submitted { color: #1d4ed8; background: #dbeafe; }
.status-approved { color: var(--success); background: var(--success-soft); }
.status-rejected { color: var(--danger); background: #fee2e2; }
.mobile-records { display: none; }
.record-card { padding: 16px; }
.record-card + .record-card { margin-top: 10px; }
.record-card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.record-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; font-size: .83rem; }
.record-meta span { display: block; color: var(--text-500); font-size: .74rem; }
.empty-state { padding: 44px 20px; text-align: center; color: var(--text-500); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.empty-state .section-icon { margin: 0 auto 12px; }
.text-button { padding: 0; border: 0; color: var(--primary-700); background: transparent; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Forms and upload */
.form-card { min-width: 0; min-inline-size: 0; padding: clamp(18px, 3vw, 28px); }
.form-card > section { width: 100%; inline-size: 100%; max-width: 100%; min-width: 0; min-inline-size: 0; }
.form-grid { width: 100%; inline-size: 100%; max-width: 100%; min-width: 0; min-inline-size: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.form-grid > * { width: 100%; inline-size: 100%; max-width: 100%; min-width: 0; min-inline-size: 0; }
.date-field { width: 100%; inline-size: 100%; max-width: 100%; min-width: 0; min-inline-size: 0; }
.date-input-wrap { box-sizing: border-box; width: 100%; inline-size: 100%; max-width: 100%; min-width: 0; min-inline-size: 0; display: grid; grid-template-columns: minmax(0,1fr); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color var(--transition), box-shadow var(--transition), background var(--transition); }
.date-input-wrap:hover { border-color: #9eb8aa; }
.date-input-wrap:focus-within { border-color: var(--primary-700); box-shadow: 0 0 0 3px rgba(28,114,90,.12); }
.date-input-wrap > input[type='date'] { -webkit-appearance: none; appearance: none; width: 100%; inline-size: 100%; max-width: 100%; min-width: 0; min-inline-size: 0; margin: 0; border: 0; border-radius: inherit; box-shadow: none; background: transparent; }
.date-input-wrap > input[type='date']:focus { border: 0; box-shadow: none; }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }
.location-actions { display: flex; align-items: end; }
.map-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-700); font-weight: 700; font-size: .84rem; }
.upload-zone { padding: 22px; text-align: center; background: #fbfdfc; border: 1px dashed #a9c5b6; border-radius: var(--radius-sm); }
.upload-zone .section-icon { margin: 0 auto 10px; }
.photos-section { border: 2px solid transparent; border-radius: var(--radius-sm); outline: none; transition: border-color 160ms ease, background 160ms ease; }
.photos-section.has-error { padding: 10px; border-color: var(--danger); background: #fff8f7; }
.photos-section.has-error .upload-zone { border-color: var(--danger); }
.upload-toolbar { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 15px 0 8px; }
.image-preview-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.preview-item { min-width: 0; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.preview-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.preview-info { min-width: 0; padding: 9px 2px 5px; }
.preview-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-weight: 700; }
.preview-size { color: var(--text-500); font-size: .72rem; }
.preview-actions { display: flex; gap: 5px; margin-top: 8px; }
.preview-actions button { min-height: 34px; flex: 1; padding: 5px; font-size: .73rem; }
.upload-state { margin-top: 5px; font-size: .78rem; font-weight: 700; }
.image-count-summary { display: grid; gap: 4px; font-weight: 700; text-align: start; }
.upload-pending { color: var(--warning); }
.upload-uploading { color: #1d4ed8; }
.upload-uploaded { color: var(--success); }
.upload-failed { color: var(--danger); }
.review-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.review-actions { padding-top: 22px; margin-top: 24px; border-top: 1px solid var(--border); }
.review-actions .primary-btn { min-width: 180px; }

/* Details */
.details-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; }
.details-gallery { display: grid; gap: 12px; margin-top: 16px; }
.details-gallery figure { margin: 0; }
.details-gallery img { width: 100%; border-radius: var(--radius-sm); }
.details-gallery figcaption { margin-top: 5px; color: var(--text-500); font-size: .82rem; overflow-wrap: anywhere; }
.photo-card { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.photo-frame { min-height: 180px; display: grid; place-items: center; background: #f5f8f6; border-radius: 8px; overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; min-height: 180px; object-fit: cover; }
.photo-load-state { margin-top: 7px; color: var(--text-500); font-size: .8rem; }
.rejection-note { padding: 12px 14px; color: #8a1c1c; background: #fff1f1; border: 1px solid #fecaca; border-radius: var(--radius-sm); }
.save-state { margin-bottom: 14px; color: var(--text-500); font-size: .85rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; }
.detail-item { padding: 15px 0; border-bottom: 1px solid var(--border); }
.detail-item:nth-child(odd) { padding-left: 16px; }
.detail-item span { display: block; color: var(--text-500); font-size: .78rem; margin-bottom: 4px; }
.description-box { padding: 16px; color: var(--text-700); background: #f8faf8; border-radius: var(--radius-sm); }
.photo-placeholder { min-height: 220px; display: grid; place-items: center; color: var(--text-500); background: #f5f8f6; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.timeline { display: grid; gap: 16px; }
.timeline-item { position: relative; padding-right: 25px; }
.timeline-item::before { content: ''; position: absolute; right: 2px; top: 6px; width: 9px; height: 9px; background: var(--primary-700); border-radius: 50%; }
.timeline-item::after { content: ''; position: absolute; right: 6px; top: 18px; bottom: -17px; width: 1px; background: var(--border-strong); }
.timeline-item:last-child::after { display: none; }

/* Toast and modal */
#toast-root { position: fixed; left: 18px; bottom: 18px; z-index: 1200; display: grid; gap: 9px; }
.toast { width: min(370px, calc(100vw - 36px)); display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; color: #fff; background: var(--text-900); border-radius: 11px; box-shadow: var(--shadow-md); animation: toast-in 180ms ease-out; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 18px; background: rgba(4,20,16,.62); }
.modal { width: min(580px,100%); max-height: min(760px,90vh); overflow-y: auto; padding: 24px; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.modal h3 { font-size: 1.25rem; margin-bottom: 8px; }
.modal-body { color: var(--text-700); }
.modal-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 22px; }
.input-modal { width: min(460px,100%); }
.input-modal form { margin-top: 18px; }
.validation-summary-toast { position: fixed; z-index: 1500; top: 86px; left: 50%; width: min(520px, calc(100% - 28px)); max-height: min(420px, calc(100vh - 110px)); overflow-y: auto; transform: translateX(-50%); padding: 16px 18px; color: #7a271a; background: #fff8f7; border: 1px solid #f2b8b1; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.validation-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.validation-summary-head h3 { font-size: 1rem; }
.validation-summary-toast ul { margin: 10px 0 0; padding-right: 22px; }
.validation-summary-close { width: 32px; height: 32px; padding: 0; color: var(--danger); background: transparent; border: 0; border-radius: 8px; font-size: 1.4rem; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Signatures and permanent deletion */
.signature-panel { display: grid; gap: 14px; }
.signature-panel > h3 { margin: 0; }
.signature-canvas { display: block; width: 100%; height: 240px; background: #fff; border: 1px solid var(--border); border-radius: 16px; cursor: crosshair; box-shadow: inset 0 1px 4px rgba(15,61,50,.06); touch-action: none; }
.signature-canvas:focus-visible { outline: 3px solid rgba(13,133,100,.24); outline-offset: 3px; }
.signature-canvas.is-disabled { pointer-events: none; opacity: .7; }
.signature-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.signature-save-option { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.signature-save-option input { width: 20px; height: 20px; accent-color: var(--primary); }
.signature-state { margin: 0; }
.signature-review-preview { display: block; width: 100%; height: 180px; object-fit: contain; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.signature-readonly-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.signature-readonly-card { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.signature-readonly-card img { width: 100%; height: 150px; object-fit: contain; background: #fff; }
.signature-readonly-card figcaption { margin-top: 8px; font-weight: 700; text-align: center; }
.permanent-delete-summary { display: grid; gap: 8px; padding: 12px; margin: 14px 0; border-radius: 12px; background: #fff5f5; }
.permanent-delete-warning { color: #9f1d1d; font-weight: 700; line-height: 1.8; }
.users-filter { grid-template-columns: minmax(240px,1fr) minmax(150px,.35fr) minmax(150px,.35fr); }
.user-form-modal { max-height: min(92vh,760px); overflow: auto; }
.user-form-modal .field-group label { display: block; margin-bottom: 7px; font-weight: 700; }
.password-input-wrap { position: relative; min-width: 0; }
.password-input-wrap > input { width: 100%; padding-left: 48px; }
.password-visibility-toggle { position: absolute; right: auto; left: 4px; top: 50%; width: 40px; min-width: 40px; height: 40px; padding: 0; transform: translateY(-50%); border: 0; background: transparent; color: var(--primary-800); font-size: .78rem; font-weight: 700; }
.password-visibility-toggle:hover { background: var(--primary-50); }
.user-form-summary { padding: 10px 12px; border: 1px solid var(--danger); border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .86rem; font-weight: 700; }
