:root {
  --navy: #071c33;
  --navy-soft: #0e3153;
  --blue: #145080;
  --gold: #d4a23c;
  --gold-light: #f3d48a;
  --ivory: #f7f0e2;
  --paper: #fffaf0;
  --ink: #10233a;
  --muted: #647283;
  --line: #dcc9a8;
  --shadow: rgba(7, 28, 51, 0.12);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 5%, rgba(212, 162, 60, 0.12), transparent 26rem),
    linear-gradient(180deg, #fbf5e9 0%, var(--ivory) 100%);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
.hidden {
  display: none !important;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(212, 162, 60, 0.22), transparent 18rem),
    linear-gradient(145deg, var(--navy), var(--blue));
}
.login-card {
  width: min(420px, 90vw);
  background: var(--paper);
  padding: 40px;
  text-align: center;
  border-radius: 20px;
  border: 1px solid rgba(243, 212, 138, 0.7);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}
.login-card img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}
.login-card span,
.heading span,
.label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 800;
}
.login-card h1,
.heading h1,
h2 {
  font-family: Georgia, serif;
  color: var(--navy);
}
.login-card label{display:flex;flex-direction:column;text-align:left;gap:6px;margin:12px 0;font-size:12px;font-weight:700;color:var(--navy)}.login-card input{border:1px solid var(--line);border-radius:9px;padding:12px;font:inherit}
.login-card button,
.attendance button,
.quick button,
.admin button,
.card a {
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: white;
  padding: 11px 15px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(7, 28, 51, 0.16);
}
.login-card .reset-password {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  background: transparent;
  color: var(--navy);
  text-decoration: underline;
}
.login-card .register-link {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  background: #efe1c3;
  color: var(--navy);
  border: 1px solid rgba(212, 162, 60, 0.55);
  box-shadow: none;
}
.login-card #loginMessage {
  display: block;
  margin-top: 10px;
  line-height: 1.4;
}
.shell aside {
  position: fixed;
  width: 240px;
  inset: 0 auto 0 0;
  background:
    radial-gradient(circle at 20% 9%, rgba(212, 162, 60, 0.16), transparent 11rem),
    linear-gradient(180deg, #06192e 0%, var(--navy-soft) 100%);
  color: white;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--gold);
}
.brand div {
  display: flex;
  flex-direction: column;
}
.brand small {
  font-size: 9px;
  color: #bac5ce;
}
.shell aside nav {
  display: grid;
  gap: 8px;
  margin-top: 48px;
}
.shell aside nav button {
  border: 0;
  background: transparent;
  color: #b5c0ca;
  text-align: left;
  padding: 13px;
  border-radius: 9px;
}
.shell aside nav button.active {
  background: linear-gradient(90deg, rgba(212, 162, 60, 0.28), rgba(212, 162, 60, 0.09));
  color: var(--gold-light);
  box-shadow: inset 3px 0 0 var(--gold);
}
.shell aside footer {
  margin-top: auto;
  color: #aebbc6;
  font-size: 12px;
}
.shell > main {
  margin-left: 240px;
}
.shell main > header {
  height: 80px;
  background: rgba(255, 250, 240, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5vw;
}
.shell header div {
  display: flex;
  flex-direction: column;
}
.shell header span {
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.12em;
}
.user {
  align-items: end;
}
.user button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.shell main > section {
  padding: 38px 5vw 100px;
  max-width: 1400px;
  margin: auto;
}
.heading h1 {
  font-size: clamp(30px, 4vw, 42px);
  margin: 7px 0;
}
.heading p {
  color: var(--muted);
  margin: 0 0 28px;
}
.grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 24px;
  box-shadow: 0 10px 30px var(--shadow);
}
.request-documents {
  margin: 18px 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 240, 226, 0.72);
}
.request-documents h3 {
  margin: 0 0 7px;
  color: var(--navy);
  font-family: Georgia, serif;
}
.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.document-actions a {
  display: inline-block;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: white;
  padding: 11px 15px;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(7, 28, 51, 0.16);
}
.document-actions a:last-child {
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--navy);
  box-shadow: none;
}
.communication-grid {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(360px, 1.2fr);
  gap: 18px;
}
.communication-notices,
.communication-forum {
  grid-column: 1 / -1;
}
.communication-grid label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
.communication-grid input,
.communication-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 11px;
  color: var(--ink);
}
.message-item,
.forum-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.message-item:last-child,
.forum-item:last-child {
  border-bottom: 0;
}
.message-item.unread {
  margin: 0 -10px;
  padding: 14px 10px;
  border-left: 4px solid var(--gold);
  background: rgba(212, 162, 60, .09);
}
.message-item div,
.forum-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.message-item small,
.forum-item small {
  color: var(--muted);
}
.message-item p,
.forum-item p {
  white-space: pre-wrap;
  line-height: 1.5;
}
@media (max-width: 760px) {
  .communication-grid { grid-template-columns: 1fr; }
  .communication-notices, .communication-forum { grid-column: auto; }
  .message-item div, .forum-item div { flex-direction: column; gap: 3px; }
  .bottom button { min-width: 0; padding-inline: 4px; }
  .bottom small { font-size: 8px; }
}

/* Versión 18: tema oscuro inspirado en la aplicación de referencia. */
:root {
  --navy: #0b0f15;
  --navy-soft: #151c25;
  --blue: #223247;
  --gold: #d5aa54;
  --gold-light: #f0d48c;
  --ivory: #0d1219;
  --paper: #121922;
  --ink: #f3f0e8;
  --muted: #b9b6ad;
  --line: #3d4652;
  --shadow: rgba(0, 0, 0, 0.32);
}
body {
  background:
    radial-gradient(circle at 86% 3%, rgba(213, 170, 84, 0.08), transparent 28rem),
    linear-gradient(180deg, #0b0f15 0%, #101720 100%);
  color: var(--ink);
}
.shell aside {
  background:
    radial-gradient(circle at 18% 8%, rgba(213, 170, 84, 0.13), transparent 12rem),
    linear-gradient(180deg, #080c12 0%, #101823 100%);
  border-right: 1px solid rgba(213, 170, 84, 0.25);
}
.shell main > header,
.bottom {
  background: rgba(12, 17, 24, 0.97);
  border-color: var(--line);
}
.shell main > header strong,
.user small,
.heading h1,
.card h2,
h1, h2, h3,
.event h2,
.meeting b,
.privacy h2 {
  color: var(--ink);
}
.heading p,
.card p,
.card small,
.form-help,
.event p,
.event time,
.login-card p {
  color: var(--muted);
}
.card,
.event,
.login-card,
.request-documents,
.treasury-summary,
.member-card,
.role-card {
  background: linear-gradient(145deg, #141c26, #10161e);
  border-color: var(--line);
  box-shadow: 0 12px 34px var(--shadow);
}
.notice,
.message-item,
.forum-item {
  border-color: var(--line);
}
.notice b,
.message-item b,
.forum-item b,
.attendance b,
.treasury-table b {
  color: var(--gold-light);
}
.login {
  background:
    radial-gradient(circle at 50% 18%, rgba(213, 170, 84, 0.16), transparent 19rem),
    linear-gradient(145deg, #080c12, #172334);
}
input,
select,
textarea,
.login-card input,
.communication-grid input,
.communication-grid textarea {
  background: #0d131b;
  color: var(--ink);
  border-color: #536070;
}
input::placeholder,
textarea::placeholder {
  color: #8f969e;
}
label,
.login-card label,
.communication-grid label {
  color: var(--gold-light);
}
.login-card button,
.attendance button,
.quick button,
.admin button,
.card a,
.document-actions a,
.communication-grid button {
  background: linear-gradient(135deg, #b9842d, var(--gold));
  color: #0a0e14;
  font-weight: 750;
  box-shadow: 0 6px 18px rgba(213, 170, 84, 0.16);
}
.light,
.login-card .reset-password,
.document-actions a:last-child {
  background: transparent !important;
  color: var(--gold-light) !important;
  border: 1px solid var(--gold) !important;
}
.login-card .register-link {
  background: rgba(213, 170, 84, 0.13) !important;
  color: var(--gold-light) !important;
  border-color: var(--gold) !important;
}
.quick button,
.authority-buttons button {
  border: 1px solid rgba(213, 170, 84, 0.36);
}
.admin > header {
  background: linear-gradient(110deg, #080c12, #172334);
  border-bottom: 1px solid rgba(213, 170, 84, 0.3);
}
.admin-nav {
  background: #101720;
  border-color: var(--line);
}
.admin-nav a {
  color: var(--gold-light);
}
.admin-status {
  color: var(--muted);
}
.message-item.unread {
  background: rgba(213, 170, 84, 0.1);
}
.bottom button.active,
.shell aside nav button.active {
  color: var(--gold-light);
}
#toast {
  background: #111923;
  color: var(--ink);
}
.wide {
  grid-column: 1;
}
.quote {
  background:
    radial-gradient(circle at 90% 10%, rgba(212, 162, 60, 0.25), transparent 14rem),
    linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: white;
  font:
    italic 18px/1.6 Georgia,
    serif;
  text-align: center;
}
.attendance {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 17px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.attendance b {
  margin-right: auto;
}
.attendance .light {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 20px;
}
.quick button {
  background: linear-gradient(145deg, #fffaf0, #efe1c3);
  color: var(--navy);
  min-height: 70px;
  border: 1px solid rgba(212, 162, 60, 0.38);
}
.authority-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.authority-buttons button {
  min-height: 105px;
  padding: 16px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background:
    radial-gradient(circle at 95% 5%, rgba(212, 162, 60, 0.2), transparent 8rem),
    linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: white;
  text-align: left;
  cursor: pointer;
}
.authority-buttons b,
.authority-buttons small {
  display: block;
}
.authority-buttons b {
  margin-bottom: 8px;
  color: #f5dcae;
}
.authority-buttons small {
  line-height: 1.4;
}
.office-grid .card,
.treasury-card {
  min-height: 190px;
}
.treasury-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}
.treasury-form,
.treasury-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.treasury-form {
  gap: 14px;
}
.treasury-form input,
.treasury-form select,
.treasury-form textarea {
  width: 100%;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.treasury-form .row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.treasury-form label,
.treasury-list-card {
  min-width: 0;
}
.treasury-actions {
  display: flex;
  gap: 10px;
}
.treasury-actions button,
.treasury-list-card > button,
.record-actions button {
  border: 0;
  border-radius: 8px;
  padding: 10px 13px;
  background: var(--navy);
  color: white;
  cursor: pointer;
}
.treasury-actions .light {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.treasury-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 14px;
  margin: 12px 0;
  background: var(--ivory);
  border-radius: 10px;
}
.treasury-summary small,
.treasury-table small {
  color: var(--muted);
}
.treasury-table article {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.treasury-table article > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.record-actions {
  flex-direction: row !important;
}
.record-actions .danger {
  background: #8b2f2f;
}
.notice {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.notice p {
  color: var(--muted);
}
.list {
  display: grid;
  gap: 12px;
}
.event {
  display: grid;
  grid-template-columns: 140px 1fr;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.event time {
  color: var(--gold);
  font-weight: 700;
}
.event h2 {
  margin: 6px 0;
}
.event p {
  color: var(--muted);
}
.docs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.docs .card > span {
  color: var(--gold);
  font-size: 11px;
}
.privacy {
  background: linear-gradient(145deg, #f4f6ef, #e6eee5);
}
.seal {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  float: right;
}
.social-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.social-links .social {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: white;
  font-weight: 700;
  text-decoration: none;
}
.social-links .whatsapp {
  background: #128c7e;
}
.social-links .instagram {
  background: #c13584;
}
.social-links .facebook {
  background: #1877f2;
}
.social-links .general,
.social-links .documento {
  background: var(--navy);
}
.bottom {
  display: none;
}
#toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  background: var(--navy);
  color: white;
  padding: 13px 18px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s;
}
#toast.show {
  opacity: 1;
  transform: none;
}
.admin > header {
  background: linear-gradient(110deg, var(--navy), var(--navy-soft));
  color: white;
  padding: 18px 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin > header a {
  color: #f5dcae;
}
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: #f3e8d4;
  border-bottom: 1px solid var(--line);
}
.admin-nav a {
  color: var(--navy);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}
.admin-nav a:hover {
  background: var(--paper);
  color: var(--blue);
}

a,
button {
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.card a:hover,
.login-card button:hover,
.attendance button:hover,
.quick button:hover,
.authority-buttons button:hover,
.admin button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(212, 162, 60, 0.48);
  outline-offset: 2px;
}
.admin-status {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 20px;
  color: var(--muted);
}
.form-help {
  color: var(--muted);
  font-size: 14px;
}
.admin > main {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 20px;
}
.admin form,
.admin label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.admin form {
  gap: 14px;
}
.admin input,
.admin select,
.admin textarea {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#items article,
#links article,
#roles article {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
#items p,
#links p,
#roles p {
  font-size: 12px;
  color: var(--muted);
}
.member-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.member-summary small {
  color: var(--muted);
}
.member-admin-card {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.member-admin-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.member-admin-title small,
.member-result {
  color: var(--muted);
}
.member-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}
.member-admin-card > button {
  align-self: flex-start;
}
.member-result {
  display: block;
  margin-top: 8px;
}
@media (max-width: 850px) {
  .shell aside {
    display: none;
  }
  .shell > main {
    margin-left: 0;
  }
  .shell main > header {
    height: 68px;
  }
  .shell main > section {
    padding: 24px 16px 95px;
  }
  .grid,
  .docs,
  .admin > main {
    grid-template-columns: 1fr;
  }
  .member-fields {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .social-links {
    grid-template-columns: 1fr;
  }
  .authority-buttons {
    grid-template-columns: 1fr;
  }
  .treasury-layout {
    grid-template-columns: 1fr;
  }
  .treasury-table article {
    grid-template-columns: 1fr;
  }
  .admin-nav {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .bottom {
    display: flex;
    position: fixed;
    z-index: 5;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 250, 240, 0.98);
    box-shadow: 0 -8px 24px rgba(7, 28, 51, 0.08);
    border-top: 1px solid var(--line);
    height: 70px;
    justify-content: space-around;
  }
  .bottom button {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .bottom button.active {
    color: var(--navy);
  }
  .event {
    grid-template-columns: 1fr;
  }
  .attendance {
    flex-wrap: wrap;
  }
  .attendance b {
    width: 100%;
  }
  .user small {
    display: none;
  }
}
@media (max-width: 1150px) {
  .treasury-layout {
    grid-template-columns: 1fr;
  }
}

/* Ajustes finales del tema oscuro (deben permanecer al final). */
.agenda-document-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.agenda-document-links .agenda-document {
  display: inline-block; padding: 12px 16px; border: 1px solid var(--gold);
  border-radius: 9px; background: #18222e; color: var(--gold-light);
  text-decoration: none; font-weight: 700; max-width: 100%; overflow-wrap: anywhere;
}
.agenda-document:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
.agenda-document-help { font-size: 12px; line-height: 1.5; color: var(--muted); }
.agenda-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.event > div { min-width: 0; }
.event h2 { overflow-wrap: anywhere; }
#activityDocuments { min-width: 0; }
#saveContentButton:disabled { opacity: .65; cursor: wait; }
.quick button {
  background: linear-gradient(145deg, #17212d, #111820);
  color: var(--gold-light);
}
.treasury-form input,
.treasury-form select,
.treasury-form textarea,
.admin input,
.admin select,
.admin textarea {
  background: #0d131b;
  color: var(--ink);
  border-color: #536070;
}
.treasury-actions button,
.treasury-list-card > button,
.record-actions button,
.admin button {
  background: linear-gradient(135deg, #b9842d, var(--gold));
  color: #0a0e14;
}
.privacy {
  background: linear-gradient(145deg, #141c26, #10161e);
}
.admin-nav {
  background: #101720;
}
.admin-nav a {
  color: var(--gold-light);
}
.admin-nav a:hover {
  background: #18222e;
  color: var(--ink);
}
.bottom {
  background: rgba(12, 17, 24, 0.98);
}
.bottom button.active {
  color: var(--gold-light);
}
/* V21: profile editor remains usable in narrow mobile layouts. */
.profile-tools { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.profile-tools button, .profile-tools a, #removeProfilePhoto, #editMemberProfile { padding: 12px 16px; border: 1px solid var(--gold); border-radius: 9px; background: #17212d; color: var(--gold-light); cursor: pointer; text-decoration: none; }
.profile-tools button:disabled { opacity: .6; cursor: wait; }
.profile-form { width: 100%; box-sizing: border-box; margin: 20px 0; }
.profile-form label { display: block; margin: 14px 0; }
.profile-form input, #directorySearch, #profileMember { width: 100%; min-width: 0; box-sizing: border-box; padding: 12px; border-radius: 10px; }
.profile-form .profile-check { display: flex; align-items: center; gap: 12px; }
.profile-form .profile-check input { width: 22px; height: 22px; flex: 0 0 22px; }
.profile-form fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 12px; }
.profile-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.profile-photo { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; }
#directoryCards .card p { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 600px) { .profile-dates { grid-template-columns: minmax(0, 1fr); } }

/* Manual language selector. No automatic browser-language detection. */
.language-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 56px; padding: 8px 20px; background: #0c1118; border-bottom: 1px solid #536070; box-sizing: border-box; }
.language-bar select { max-width: 190px; padding: 8px 12px; border-radius: 8px; direction: ltr; }
.language-bar label { display: flex; gap: 6px; align-items: center; }
.language-bar details p { position: absolute; inset-inline-end: 12px; top: 42px; max-width: 320px; padding: 18px; border: 1px solid var(--gold); background: #101720; color: var(--ink); font-size: 14px; }
.language-bar summary { cursor: pointer; color: var(--gold-light); }
.shell aside { top: 56px; }
html[dir="rtl"] .shell aside { left: auto; right: 0; }
html[dir="rtl"] .shell > main { margin-left: 0; margin-right: 240px; }
html[dir="rtl"] .shell aside nav button, html[dir="rtl"] .login-card label { text-align: right; }
html[dir="rtl"] .admin { text-align: right; }
input[type="email"], input[type="url"], input[type="password"], input[type="time"], input[type="date"] { direction: ltr; unicode-bidi: plaintext; }

.compact { margin-top: .55rem; padding: .55rem .8rem; width: auto; }
.calendar { margin: 1.25rem 0; overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.calendar-toolbar h2 { margin: 0; text-align: center; }
.calendar-toolbar button { min-width: 3rem; padding: .55rem .8rem; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.calendar-week b { color: var(--gold, #d6a53a); font-size: .85rem; padding: .35rem; text-align: center; }
.calendar-day { border: 1px solid #354252; border-radius: .45rem; min-height: 5.2rem; padding: .4rem; }
.calendar-day.empty { border-color: transparent; }
.calendar-day.has-event { border-color: var(--gold, #d6a53a); background: rgba(214, 165, 58, .08); }
.calendar-day b { display: block; margin-bottom: .25rem; }
.calendar-day small { display: block; font-size: .72rem; line-height: 1.25; margin-top: .25rem; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .calendar-week b { font-size: .68rem; }
  .calendar-day { min-height: 3.8rem; padding: .25rem; }
  .calendar-day small { font-size: .62rem; }
}
.payment-options { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; }
.payment-options button:disabled { cursor: not-allowed; opacity: .65; }
.attendance-admin { margin: .7rem 0; }
.attendance-admin summary { color: var(--gold, #d6a53a); cursor: pointer; }
.registration-main-button { grid-column: 1 / -1; font-size: 1.2rem; min-height: 4rem; font-weight: 700; }
.registration-help { border-color: var(--gold, #d6a53a); font-size: 1.08rem; line-height: 1.6; }
.registration-list .event { font-size: 1.08rem; }
.registration-list input { font-size: 1.1rem; min-height: 3.3rem; }
.registration-list .attendance button { font-size: 1.05rem; min-height: 3.3rem; }
@media (max-width: 900px) { html[dir="rtl"] .shell > main { margin-right: 0; } .language-bar { justify-content: center; } }
