:root {
  --red: #d71920;
  --red-dark: #a90e14;
  --green: #006b3c;
  --green-dark: #004d2b;
  --gold: #ffd400;
  --ink: #17201c;
  --muted: #68736d;
  --line: #dfe5e1;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --surface-deep: #e9efeb;
  --danger: #b42318;
  --warning: #9a6700;
  --success: #067647;
  --info: #175cd3;
  --shadow: 0 12px 32px rgba(19, 46, 31, .09);
  --shadow-sm: 0 4px 14px rgba(19, 46, 31, .08);
  --radius: 18px;
  --sidebar: 272px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-soft); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface-soft); }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.required { color: var(--red); }
.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; }

/* Public access */
.public-page { background: linear-gradient(135deg, #f8faf9 0%, #edf3ef 100%); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, .9fr) minmax(520px, 1.2fr); }
.auth-visual { position: relative; overflow: hidden; background: linear-gradient(145deg, #aa1016 0%, var(--red) 42%, var(--green) 100%); color: white; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.10); }
.auth-visual::before { width: 420px; height: 420px; left: -180px; top: -140px; }
.auth-visual::after { width: 360px; height: 360px; right: -150px; bottom: -90px; }
.auth-logo { width: 124px; height: 124px; object-fit: contain; border-radius: 50%; background: white; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.22); position: relative; z-index: 1; }
.auth-visual-copy { position: relative; z-index: 1; max-width: 560px; }
.auth-visual-copy h1 { margin: 0 0 16px; font-size: clamp(2.2rem, 4vw, 4.1rem); line-height: .98; letter-spacing: -.04em; }
.auth-visual-copy p { margin: 0; max-width: 480px; font-size: 1.08rem; line-height: 1.65; opacity: .92; }
.auth-visual-footer { position: relative; z-index: 1; opacity: .82; font-size: .88rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 42px 28px; overflow-y: auto; }
.auth-card { width: min(100%, 620px); background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); padding: 38px; border: 1px solid rgba(0,107,60,.08); }
.auth-card.wide { width: min(100%, 920px); }
.auth-card-header { margin-bottom: 28px; }
.auth-card-header h2 { margin: 0 0 9px; font-size: 1.8rem; letter-spacing: -.03em; }
.auth-card-header p { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-back { display: inline-flex; margin-bottom: 20px; align-items: center; gap: 8px; font-weight: 700; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: .92rem; }
.credential-reveal { background: #f2f8f4; border: 1px dashed #8eb99f; border-radius: var(--radius); padding: 22px; margin: 22px 0; }
.credential-reveal code { display: block; font-size: 1.2rem; color: var(--green-dark); background: white; padding: 12px 14px; border-radius: 10px; margin-top: 5px; word-break: break-all; }

/* App shell */
.app-page { background: var(--surface-soft); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #10251a; color: white; display: flex; flex-direction: column; z-index: 30; box-shadow: 10px 0 30px rgba(12, 31, 21, .08); }
.brand { height: 96px; display: flex; align-items: center; gap: 14px; padding: 18px 22px; color: white; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand:hover { color: white; }
.brand img { width: 56px; height: 56px; object-fit: contain; border-radius: 50%; background: white; padding: 2px; }
.brand span { display: flex; flex-direction: column; }
.brand strong { font-size: 1.25rem; letter-spacing: .04em; }
.brand small { color: #a8cbb7; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 18px 12px; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 13px; color: #d5e4db; padding: 12px 14px; border-radius: 12px; margin-bottom: 5px; font-weight: 650; font-size: .94rem; transition: .18s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.08); }
.nav-link.is-active { color: white; background: linear-gradient(90deg, var(--red), #ef3340); box-shadow: 0 8px 22px rgba(215,25,32,.26); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; font-size: 1.15rem; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 16px; }
.user-chip { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar, .top-avatar { width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: #eaf5ee; color: var(--green-dark); font-weight: 850; }
.user-chip div { min-width: 0; display: flex; flex-direction: column; }
.user-chip strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; }
.user-chip small { color: #9db5a7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.logout-form { margin-top: 11px; }
.link-button { background: transparent; border: 0; color: #a9c2b3; padding: 0; font-size: .85rem; }
.link-button:hover { color: white; }
.app-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 76px; padding: 0 30px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.topbar-brand { display: none; align-items: center; gap: 9px; }
.topbar-brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 50%; }
.topbar-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.icon-button { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink); font-weight: 700; }
.icon-button:hover { background: var(--surface-soft); color: var(--green); }
.counter { position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: white; display: grid; place-items: center; font-size: .68rem; border: 2px solid white; }
.top-avatar { width: 42px; height: 42px; background: var(--green); color: white; }
.top-avatar:hover { color: white; background: var(--green-dark); }
.main-content { padding: 30px; max-width: 1600px; margin: 0 auto; }
.mobile-nav { display: none; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.page-header p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.section-title { margin: 28px 0 14px; font-size: 1.14rem; }

/* Buttons */
.btn { min-height: 43px; border: 0; border-radius: 11px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; line-height: 1.1; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: white; box-shadow: 0 7px 17px rgba(215,25,32,.18); }
.btn-primary:hover { color: white; background: var(--red-dark); }
.btn-secondary { background: var(--green); color: white; }
.btn-secondary:hover { color: white; background: var(--green-dark); }
.btn-soft { background: #eaf3ed; color: var(--green-dark); }
.btn-soft:hover { background: #dcebe2; color: var(--green-dark); }
.btn-outline { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn-outline:hover { color: var(--green); border-color: #a9c6b5; }
.btn-danger { background: #fee4e2; color: var(--danger); }
.btn-sm { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: .84rem; }
.btn-block { width: 100%; }
button[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Cards and statistics */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.card-header { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.08rem; }
.card-body { padding: 22px; }
.card-footer { padding: 15px 22px; border-top: 1px solid var(--line); background: #fbfcfb; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { min-height: 110px; display: flex; align-items: center; gap: 16px; background: white; border-radius: var(--radius); border: 1px solid var(--line); padding: 20px; color: var(--ink); box-shadow: var(--shadow-sm); }
.stat-card:hover { color: var(--ink); border-color: #b9cdc0; transform: translateY(-2px); }
.stat-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: #eaf5ee; color: var(--green); font-size: 1.35rem; flex: 0 0 auto; }
.stat-card strong { display: block; font-size: 1.75rem; line-height: 1; letter-spacing: -.04em; }
.stat-card span:not(.stat-icon) { display: block; color: var(--muted); margin-top: 7px; font-size: .88rem; }
.stat-card.tone-red .stat-icon { background: #fff0f0; color: var(--red); }
.stat-card.tone-gold .stat-icon { background: #fff8d8; color: #8a6a00; }
.stat-card.tone-blue .stat-icon { background: #eef4ff; color: var(--info); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: .87rem; font-weight: 750; color: #34423a; }
input, select, textarea { width: 100%; border: 1px solid #cad4ce; border-radius: 11px; background: white; color: var(--ink); padding: 11px 13px; outline: none; min-height: 44px; transition: border-color .14s, box-shadow .14s; }
textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,107,60,.10); }
input[type="file"] { padding: 8px; background: #fbfcfb; }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--green); }
.help { color: var(--muted); line-height: 1.4; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; }
.checkbox-row label { line-height: 1.45; font-size: .9rem; }
.form-actions { margin-top: 23px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-section { margin-top: 28px; padding-top: 23px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0 0 5px; }
.form-section > p { color: var(--muted); margin: 0 0 18px; }
.search-form { display: flex; gap: 9px; flex-wrap: wrap; }
.search-form input { flex: 1 1 240px; }
.search-form select { width: auto; min-width: 180px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.password-toggle { position: absolute; right: 8px; top: 7px; border: 0; background: transparent; width: 34px; height: 32px; color: var(--muted); }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .045em; color: #5c6861; background: #f8faf9; white-space: nowrap; }
td { font-size: .9rem; }
tbody tr:hover { background: #fbfdfb; }
tbody tr:last-child td { border-bottom: 0; }
.table-title { font-weight: 750; color: var(--ink); }
.table-subtitle { color: var(--muted); font-size: .79rem; margin-top: 3px; }
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Badges */
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.badge-success { background: #dcfae6; color: #067647; }
.badge-danger { background: #fee4e2; color: #b42318; }
.badge-warning { background: #fef0c7; color: #93370d; }
.badge-info { background: #dbeafe; color: #175cd3; }
.badge-muted { background: #edf0ee; color: #59655e; }
.badge-role { background: #eaf3ed; color: var(--green-dark); }
.badge-urgent { background: var(--red); color: white; }
.badge-important { background: #fff1c2; color: #7a5200; }

/* Flash, alerts, notices */
.flash { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; border-radius: 13px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.flash-success { background: #e7f8ed; border: 1px solid #a6dfb8; color: #075e36; }
.flash-error { background: #fff0ef; border: 1px solid #f4b1ad; color: #8d1711; }
.flash-info { background: #eff6ff; border: 1px solid #bfd7ff; color: #164c96; }
.flash button { margin-left: auto; border: 0; background: transparent; color: inherit; font-size: 1.25rem; }
.notice { padding: 15px 17px; border-radius: 13px; background: #f3f8f5; border-left: 4px solid var(--green); line-height: 1.5; }
.notice-warning { background: #fffae8; border-color: var(--gold); }
.notice-danger { background: #fff1f0; border-color: var(--red); }
.install-banner { display: flex; align-items: center; gap: 15px; background: #10251a; color: white; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.install-banner div { display: flex; flex-direction: column; flex: 1; }
.install-banner span { color: #b9cfc1; font-size: .84rem; margin-top: 3px; }
.install-close { border: 0; background: transparent; color: white; font-size: 1.3rem; }

/* Details and profile */
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-row span { color: var(--muted); font-size: .84rem; }
.detail-row strong { text-align: right; font-size: .9rem; }
.profile-hero { display: flex; gap: 22px; align-items: center; }
.profile-photo { width: 118px; height: 142px; object-fit: cover; border-radius: 16px; background: var(--surface-deep); border: 4px solid white; box-shadow: var(--shadow-sm); }
.profile-photo-placeholder { width: 118px; height: 142px; border-radius: 16px; background: #e7eee9; display: grid; place-items: center; font-size: 2rem; color: var(--green); }
.profile-info h2 { margin: 0 0 7px; }
.profile-info p { margin: 0 0 10px; color: var(--muted); }

/* Announcements */
.announcement-list { display: grid; gap: 13px; }
.announcement-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 15px; align-items: center; padding: 17px; background: white; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); }
.announcement-item:hover { color: var(--ink); border-color: #abc4b4; box-shadow: var(--shadow-sm); }
.announcement-item.is-unread { border-left: 5px solid var(--red); }
.announcement-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: #fff1f1; color: var(--red); font-size: 1.25rem; }
.announcement-copy h3 { margin: 0 0 5px; font-size: 1rem; }
.announcement-copy p { margin: 0; color: var(--muted); font-size: .83rem; }
.announcement-meta { text-align: right; min-width: 110px; }
.announcement-body { line-height: 1.7; font-size: 1rem; }

/* Documents */
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.document-card { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 17px; display: flex; flex-direction: column; min-height: 180px; }
.document-card h3 { margin: 0 0 8px; font-size: .98rem; }
.document-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.document-card .badge { align-self: flex-start; margin-bottom: 12px; }
.document-card .actions { margin-top: auto; padding-top: 16px; }
.document-observation { margin-top: 11px; background: #fff3f2; border-radius: 9px; padding: 9px; color: #8b241e; font-size: .79rem; }

/* Chat */
.conversation-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - 150px); overflow: hidden; }
.conversation-list { border-right: 1px solid var(--line); background: white; }
.conversation-list-header { padding: 17px; border-bottom: 1px solid var(--line); }
.conversation-link { display: flex; gap: 11px; padding: 14px 16px; color: var(--ink); border-bottom: 1px solid #edf0ee; }
.conversation-link:hover, .conversation-link.is-active { color: var(--ink); background: #f2f8f4; }
.conversation-link .avatar { flex: 0 0 auto; }
.conversation-link-copy { min-width: 0; flex: 1; }
.conversation-link-copy strong, .conversation-link-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-link-copy span { color: var(--muted); font-size: .79rem; margin-top: 4px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; background: #edf3ef; }
.chat-header { background: white; border-bottom: 1px solid var(--line); padding: 15px 19px; display: flex; align-items: center; gap: 12px; }
.chat-header h2 { margin: 0; font-size: 1rem; }
.chat-header p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 10px; min-height: 420px; max-height: calc(100vh - 294px); }
.message-row { display: flex; }
.message-row.is-own { justify-content: flex-end; }
.message-bubble { max-width: min(76%, 620px); padding: 11px 13px 8px; border-radius: 14px 14px 14px 3px; background: white; box-shadow: 0 3px 10px rgba(16,37,26,.06); }
.message-row.is-own .message-bubble { background: #dff3e6; border-radius: 14px 14px 3px 14px; }
.message-sender { display: block; color: var(--green); font-size: .72rem; font-weight: 800; margin-bottom: 4px; }
.message-text { line-height: 1.45; word-break: break-word; }
.message-meta { display: flex; justify-content: flex-end; gap: 6px; margin-top: 5px; font-size: .67rem; color: #75817a; }
.message-attachment { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 8px 9px; border-radius: 9px; background: rgba(255,255,255,.65); font-size: .78rem; }
.chat-form { background: white; border-top: 1px solid var(--line); padding: 13px 17px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: end; }
.chat-form textarea { min-height: 44px; max-height: 130px; }
.file-button { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); display: grid; place-items: center; background: white; }
.file-button input { display: none; }
.chat-empty { display: grid; place-items: center; height: 100%; padding: 40px; text-align: center; color: var(--muted); }

/* Credential */
.credential-card { width: min(100%, 780px); margin: 0 auto; border-radius: 26px; overflow: hidden; color: white; background: linear-gradient(145deg, #0b3f27, var(--green) 55%, #00512e); box-shadow: 0 24px 60px rgba(0,70,39,.25); position: relative; }
.credential-card::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.07); right: -120px; bottom: -160px; }
.credential-top { padding: 20px 24px; background: var(--red); display: flex; align-items: center; gap: 15px; }
.credential-top img { width: 68px; height: 68px; border-radius: 50%; background: white; padding: 2px; }
.credential-top h2 { margin: 0; font-size: 1.15rem; }
.credential-top p { margin: 5px 0 0; opacity: .88; font-size: .82rem; }
.credential-main { padding: 27px; display: grid; grid-template-columns: 150px 1fr 160px; gap: 24px; align-items: center; position: relative; z-index: 1; }
.credential-photo { width: 145px; height: 178px; object-fit: cover; border-radius: 14px; border: 4px solid rgba(255,255,255,.86); background: white; }
.credential-data h1 { margin: 0 0 7px; font-size: 1.55rem; line-height: 1.1; }
.credential-data .member-code { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); padding: 6px 10px; border-radius: 8px; margin-bottom: 14px; font-weight: 800; }
.credential-data dl { margin: 0; display: grid; grid-template-columns: 110px 1fr; gap: 7px 10px; font-size: .84rem; }
.credential-data dt { color: #bad9c7; }
.credential-data dd { margin: 0; font-weight: 700; }
.credential-qr { background: white; border-radius: 13px; padding: 8px; text-align: center; color: var(--ink); }
.credential-qr img { display: block; width: 144px; height: 144px; }
.credential-qr small { display: block; margin-top: 5px; font-size: .65rem; }

/* Empty and pagination */
.empty-state { padding: 50px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 13px; border-radius: 50%; display: grid; place-items: center; background: #eaf3ed; color: var(--green); font-size: 1.6rem; }
.empty-state h3 { color: var(--ink); margin: 0 0 8px; }
.empty-state p { margin: 0 auto 18px; max-width: 440px; line-height: 1.55; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 21px; }
.pagination a { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
.pagination a.is-current { background: var(--green); color: white; border-color: var(--green); }

/* Public verification */
.verify-shell { min-height: 100vh; display: grid; place-items: center; padding: 25px; }
.verify-card { width: min(100%, 520px); background: white; border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; text-align: center; }
.verify-header { background: linear-gradient(135deg, var(--red), #aa1118); padding: 25px; color: white; }
.verify-header img { width: 100px; height: 100px; background: white; padding: 4px; border-radius: 50%; }
.verify-body { padding: 28px; }
.verify-body h1 { margin: 0 0 8px; font-size: 1.55rem; }
.verify-check { width: 62px; height: 62px; margin: -58px auto 20px; border: 6px solid white; border-radius: 50%; display: grid; place-items: center; background: #12a05c; color: white; font-size: 1.7rem; position: relative; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credential-main { grid-template-columns: 130px 1fr; }
  .credential-photo { width: 125px; height: 155px; }
  .credential-qr { grid-column: 1 / -1; width: 165px; margin: 0 auto; }
}

@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .app-shell { margin-left: 0; padding-bottom: 72px; }
  .topbar { height: 64px; padding: 0 15px; }
  .topbar-brand { display: flex; }
  .main-content { padding: 20px 15px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(66px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 50; backdrop-filter: blur(12px); }
  .mobile-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); border-radius: 9px; }
  .mobile-nav-link span { font-size: 1.18rem; }
  .mobile-nav-link small { font-size: .68rem; }
  .mobile-nav-link.is-active { color: var(--red); background: #fff3f3; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 270px; padding: 26px; }
  .auth-logo { width: 84px; height: 84px; }
  .auth-visual-copy h1 { font-size: 2.4rem; }
  .auth-visual-copy p { display: none; }
  .auth-visual-footer { display: none; }
  .auth-main { padding: 24px 15px; align-items: flex-start; }
  .auth-card { padding: 25px 20px; }
  .conversation-layout { grid-template-columns: 1fr; min-height: auto; }
  .conversation-list.is-hidden-mobile { display: none; }
  .chat-pane { min-height: calc(100vh - 165px); }
  .chat-messages { max-height: calc(100vh - 285px); }
}

@media (max-width: 680px) {
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stats-grid, .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3, .document-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 92px; }
  .card-header, .card-body { padding: 17px; }
  .detail-list { grid-template-columns: 1fr; }
  .profile-hero { align-items: flex-start; }
  .profile-photo, .profile-photo-placeholder { width: 92px; height: 115px; }
  .announcement-item { grid-template-columns: 45px 1fr; }
  .announcement-icon { width: 43px; height: 43px; }
  .announcement-meta { grid-column: 2; text-align: left; }
  .credential-main { padding: 20px; grid-template-columns: 90px 1fr; gap: 15px; align-items: start; }
  .credential-photo { width: 88px; height: 112px; border-width: 3px; }
  .credential-data h1 { font-size: 1.15rem; }
  .credential-data dl { grid-template-columns: 1fr; gap: 2px; }
  .credential-data dd { margin-bottom: 6px; }
  .credential-qr { grid-column: 1 / -1; }
  .message-bubble { max-width: 88%; }
  .install-banner { align-items: flex-start; flex-wrap: wrap; }
  .install-banner .btn { margin-left: 0; }
  .search-form select { width: 100%; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, .page-header, .install-banner, .flash, .no-print { display: none !important; }
  .app-shell { margin: 0; }
  .main-content { padding: 0; }
  .credential-card { box-shadow: none; break-inside: avoid; }
  body { background: white; }
}


/* Registration wizard and public form sharing */
.registration-progress { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 10px; margin: 6px 0 24px; }
.registration-progress-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.registration-progress-item span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: white; font-weight: 900; }
.registration-progress-item.is-active, .registration-progress-item.is-complete { color: var(--green-dark); }
.registration-progress-item.is-active span { border-color: var(--green); color: white; background: var(--green); }
.registration-progress-item.is-complete span { border-color: var(--green); color: var(--green); background: #eef8f2; }
.registration-progress-line { height: 2px; background: var(--line); }
.registration-wizard.is-enhanced .registration-step { display: none; }
.registration-wizard.is-enhanced .registration-step.is-active { display: block; }
.form-section-first { margin-top: 0; padding-top: 0; border-top: 0; }
.registration-actions { justify-content: flex-end; }
.registration-success-mark { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 20px; background: #e7f6ed; color: var(--green); font-size: 2rem; font-weight: 900; }
.public-form-qr-wrap { text-align: center; }
.public-form-qr { width: min(100%, 330px); margin: 0 auto 14px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.public-form-qr img { display: block; width: 100%; height: auto; }
.instruction-list { margin: 0; padding-left: 22px; line-height: 1.7; }
.instruction-list li + li { margin-top: 7px; }

@media (max-width: 640px) {
  .registration-progress-item strong { display: none; }
  .registration-progress { grid-template-columns: auto 1fr auto 1fr auto; }
  .registration-actions { flex-direction: column-reverse; }
  .registration-actions .btn { width: 100%; }
}
