.overview { margin-top: 30px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.overview-heading h2 { margin: 0 0 6px; font: 27px Georgia, serif; }
.overview-heading p { margin: 0; color: #826f66; font-size: 12px; }
.overview-heading button { border: 1px solid #d7c6b9; background: #fff; color: #71342e; border-radius: 10px; padding: 11px 14px; font-weight: 700; cursor: pointer; }
.overview-heading button:disabled { opacity: .65; }
.overview .stats { margin-top: 20px; }
.overview-note { display: block; margin-top: 14px; color: #826f66; font-size: 11px; }
.new-user-form select { width: 100%; border: 1px solid #d8c7b9; border-radius: 11px; padding: 15px; background: #fff; }
.user-photo { overflow: hidden; flex: 0 0 auto; }
.user-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 18px; background: rgba(42,21,19,.72); }
.profile-modal form { position: relative; width: min(500px,100%); max-height: calc(100vh - 36px); overflow: auto; display: flex; flex-direction: column; padding: 28px; border-radius: 20px; background: #fffaf5; box-shadow: 0 30px 90px rgba(29,11,9,.3); }
.profile-modal h2 { margin: 0 0 4px; font: 30px Georgia,serif; }
.profile-modal form > p { margin: 0 0 16px; color: #806d65; font-size: 12px; }
.profile-modal form > label:not(.profile-photo-picker) { margin: 12px 0 7px; font-size: 12px; font-weight: 800; }
.profile-modal input,.profile-modal select { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #d9c3b5; border-radius: 10px; background: #fff; }
.profile-close { position: absolute; top: 15px; right: 15px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f2e7de; font-size: 23px; }
.profile-photo-picker { display: flex; align-items: center; gap: 13px; margin: 12px 0; cursor: pointer; color: #71342e; }
.profile-photo-picker input { display: none; }
.user-avatar.large { width: 72px; height: 72px; font-size: 24px; }
.profile-save,.profile-delete { min-height: 49px; margin-top: 15px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.profile-save { border: 0; background: #71342e; color: #fff; }
.profile-delete { border: 1px solid #edc7c2; background: #fff0ed; color: #a23b32; }
.header-photo { overflow: hidden; }
.header-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-loading { margin-top: 30px; color: #806d65; }
.my-profile { width: min(650px,100%); margin-top: 30px; padding: 28px; border: 1px solid #e1d6cc; border-radius: 18px; background: #fff; display: flex; flex-direction: column; }
.my-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid #eee4dc; }
.my-profile-head > div { display: flex; flex-direction: column; align-items: flex-end; }
.my-profile-head > div strong { color: #71342e; }
.my-profile-head small,.profile-photo-picker small { display: block; margin-top: 4px; color: #8b766d; font-size: 11px; }
.profile-main-photo { width: 84px !important; height: 84px !important; font-size: 28px; }
.my-profile > label { margin: 13px 0 7px; font-size: 12px; font-weight: 800; }
.my-profile > input { min-height: 50px; padding: 0 14px; border: 1px solid #d9c3b5; border-radius: 10px; background: #fff; }
.my-profile > button { min-height: 50px; margin-top: 18px; border: 0; border-radius: 10px; background: #71342e; color: #fff; font-weight: 800; }

@media (max-width: 640px) {
  .site-header { gap: 9px; padding: 0 11px; }
  .site-header .brand { gap: 7px; min-width: 0; }
  .site-header .brand img { width: 40px; height: 40px; }
  .site-header .brand span { padding-left: 7px; }
  .site-header .brand strong { font-size: 13px; }
  .site-header .brand small { font-size: 7px; letter-spacing: .1em; }
  .admin-link { display: flex; flex: 0 0 auto; gap: 6px; padding: 7px 8px; border-radius: 11px; font-size: 10px; font-weight: 700; }
  .admin-link span { display: inline; white-space: nowrap; }
  .admin-link b { width: 23px; height: 23px; font-size: 10px; }

  .hero { padding: 54px 18px 60px; min-height: auto; }
  .hero h1 { font-size: clamp(37px, 11vw, 46px); }
  .hero-copy { font-size: 15px; }
  .steps article { padding: 20px 8px; }
  footer { gap: 14px; padding: 28px 20px; }
  footer p { flex-basis: calc(100% - 96px); font-size: 13px; }

  .certificate-help { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px 14px; padding: 18px; text-align: left; }
  .certificate-help > span { width: 44px; height: 44px; align-self: start; }
  .certificate-help h3 { font-size: 18px; }
  .certificate-help p { font-size: 12px; overflow-wrap: normal; }
  .certificate-help p strong { display: inline; white-space: nowrap; color: inherit; background: transparent; padding: 0; border-radius: 0; }
  .certificate-help > a { grid-column: 1 / -1; width: 100%; padding: 14px; text-align: center; }

  .admin-page aside { position: sticky; top: 0; z-index: 40; display: block; padding: 10px 12px 8px; overflow: hidden; box-shadow: 0 5px 18px rgba(42,21,19,.2); }
  .admin-page .admin-brand { display: none; }
  .admin-page aside nav { display: flex; width: 100%; gap: 6px; margin: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .admin-page aside nav::-webkit-scrollbar { display: none; }
  .admin-page aside nav button { flex: 1 0 auto; min-height: 42px; padding: 10px 12px; font-size: 12px !important; text-align: center; white-space: nowrap; color: #dfc9c1; }
  .admin-main { padding: 18px 14px 34px; min-width: 0; }
  .admin-main > header { align-items: flex-start; gap: 12px; padding-bottom: 16px; }
  .admin-main h1 { font-size: 29px; }
  .admin-user { gap: 7px; }
  .admin-user span, .admin-user > div { display: none; }
  .admin-user > button { padding: 8px 11px; background: #fff; }
  .admin-toolbar { flex-direction: column; margin: 24px 0 16px; }
  .admin-toolbar button { width: 100%; }
  .overview-heading { align-items: flex-start; flex-direction: column; }
  .overview-heading button { width: 100%; }

  .admin-table { overflow: visible; background: transparent; border: 0; }
  .admin-table .table-head { display: none; }
  .admin-table .table-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px 10px; margin-bottom: 10px; padding: 15px; background: #fff; border: 1px solid #e2d8cf; border-radius: 14px; }
  .admin-table .table-row > span:nth-child(2),
  .admin-table .table-row > span:nth-child(3),
  .admin-table .table-row > span:nth-child(4) { display: block !important; grid-column: 1; padding-left: 46px; color: #806d65; }
  .admin-table .table-row > span:nth-child(3),
  .admin-table .table-row > span:nth-child(4) { font-size: 11px; }
  .admin-table .table-row > .dots-button { grid-column: 2; grid-row: 1 / 5; align-self: center; width: 40px; height: 42px; background: #f5ece5 !important; }

  .certificate-modal { padding: 0; place-items: stretch; }
  .certificate-dialog { width: 100%; height: 100dvh; max-height: none; border-radius: 0; display: flex; flex-direction: column; }
  .certificate-dialog > header { padding: 17px 15px; gap: 10px; }
  .certificate-dialog header h2 { font-size: 23px; }
  .modal-actions { flex-direction: column-reverse; align-items: flex-end; gap: 7px; }
  .modal-actions .delete-event { font-size: 11px; padding: 8px; }
  .cover-editor { padding: 15px; }
  .certificate-manager { flex: 1; max-height: none; }
  .certificate-list { padding: 12px; }
  .certificate-list article { padding: 11px; }
  .certificate-list article > div { min-width: calc(100% - 52px); }
  .pdf-preview { padding: 12px 12px 0; }
  .pdf-preview iframe { height: 48vh; }
  .event-create-dialog { width: 100%; max-height: 100dvh; border-radius: 0; padding: 22px 18px; }

  .users-layout { margin-top: 22px; }
  .new-user-form, .users-list { padding: 20px 16px; }
  .users-list article { align-items: flex-start; flex-wrap: wrap; }
  .users-list article > div { min-width: calc(100% - 55px); }
  .users-list article button { flex: 1; }
  .profile-modal { padding: 0; place-items: stretch; }
  .profile-modal form { width: 100%; max-height: 100dvh; min-height: 100dvh; border-radius: 0; padding: 24px 18px; }
  .my-profile { margin-top: 22px; padding: 20px 16px; }
  .my-profile-head { align-items: flex-start; flex-direction: column; }
  .my-profile-head > div { align-items: flex-start; }

  .upload-workspace { min-width: 0; }
  .upload-box, .upload-summary { min-width: 0; }
  .upload-results p { max-width: calc(100vw - 105px); }
}

@media (max-width: 370px) {
  .site-header .brand span { display: none; }
  .admin-link { font-size: 10px; }
}
