/* MARC.center — authenticated member/admin shell (light default, full dark variant) */

:root[data-app-theme="light"] {
  --app-bg: #e8f1fb;
  --app-surface: #ffffff;
  --app-surface-2: #eef3f9;
  --app-text: #0a0f18;
  --app-muted: #3d4a5c;
  --app-border: rgba(6, 26, 51, 0.18);
  --app-nav-active: #f3e6d3;
  --app-accent: #9a5f28;
  --app-accent-mid: #b8742e;
  --app-navy: #061a33;
  --app-shadow: rgba(6, 26, 51, 0.12);
}

:root[data-app-theme="dark"] {
  --app-bg: #0d1117;
  --app-surface: #161b22;
  --app-surface-2: #21262d;
  --app-text: #e6edf3;
  --app-muted: #8b949e;
  --app-border: rgba(230, 237, 243, 0.14);
  --app-nav-active: #2d2a20;
  --app-accent: #d4a574;
  --app-accent-mid: #e8b88a;
  --app-navy: #8b949e;
  --app-shadow: rgba(0, 0, 0, 0.45);
}

.app-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--app-text);
  background: var(--app-bg);
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.app-shell__menu-toggle {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 1001;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--app-navy);
  background: var(--app-surface);
  color: var(--app-text);
  cursor: pointer;
}

.app-sidebar {
  flex: 0 0 240px;
  width: 240px;
  background: var(--app-surface-2);
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  z-index: 1000;
}

.app-sidebar__brand {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--app-border);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-sidebar__brand a {
  color: var(--app-accent);
  text-decoration: none;
}

.app-sidebar__brand a:hover,
.app-sidebar__brand a:focus-visible {
  color: var(--app-accent-mid);
  outline: none;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  flex: 1;
}

.app-sidebar__link {
  display: block;
  padding: 0.75rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--app-text);
  border-left: 3px solid transparent;
}

.app-sidebar__link:hover,
.app-sidebar__link:focus-visible {
  background: var(--app-surface);
  outline: none;
}

.app-sidebar__link.is-active {
  background: var(--app-nav-active);
  border-left-color: var(--app-accent-mid);
  color: var(--app-navy);
}

:root[data-app-theme="dark"] .app-sidebar__link.is-active {
  color: var(--app-text);
}

.app-sidebar__footer {
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-sidebar__select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-text);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0;
}

.app-sidebar__logout {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--app-accent);
  text-decoration: none;
}

.app-sidebar__logout:hover,
.app-sidebar__logout:focus-visible {
  color: var(--app-accent-mid);
  outline: none;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
}

.app-topbar {
  padding: 1.25rem 1.75rem;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 1px 0 var(--app-shadow);
}

.app-topbar__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-navy);
}

:root[data-app-theme="dark"] .app-topbar__title {
  color: var(--app-text);
}

.app-content {
  padding: 1.5rem 1.75rem 2.5rem;
  flex: 1;
}

.app-subnav,
.app-tier3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.75rem;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.app-tier3 {
  background: var(--app-surface-2);
  border-bottom-color: var(--app-border);
}

.app-tier3__muted {
  font-size: 0.8125rem;
  color: var(--app-muted);
  font-style: italic;
}

.app-subnav__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--app-text);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  cursor: pointer;
}

.app-subnav__btn:hover,
.app-subnav__btn:focus-visible {
  border-color: var(--app-accent-mid);
  outline: none;
}

.app-subnav__btn.is-active {
  background: var(--app-nav-active);
  border-color: var(--app-accent-mid);
  color: var(--app-navy);
}

:root[data-app-theme="dark"] .app-subnav__btn.is-active {
  color: var(--app-text);
}

.app-form {
  max-width: 36rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.app-form input[type="text"],
.app-form input[type="email"],
.app-form input[type="password"],
.app-form input[type="tel"],
.app-form select,
.app-form textarea {
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--app-text);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0;
}

.app-form textarea {
  min-height: 5rem;
  resize: vertical;
}

.app-form__readonly {
  padding: 0.55rem 0.65rem;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  font-size: 0.9375rem;
}

.app-form__hint {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--app-muted);
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: var(--app-navy);
  color: #fff;
}

:root[data-app-theme="dark"] .app-btn {
  background: #2d333b;
  color: var(--app-text);
  border: 1px solid var(--app-border);
}

.app-btn:hover,
.app-btn:focus-visible {
  opacity: 0.92;
  outline: 2px solid var(--app-accent-mid);
  outline-offset: 2px;
}

.app-flash {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
}

.app-flash--ok {
  border-left: 4px solid #2d6a4f;
}

.app-flash--err {
  border-left: 4px solid #9b2226;
}

.app-intro {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--app-text);
}

.app-dash-meta {
  margin: 0;
  max-width: 28rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  font-size: 0.9375rem;
}

.app-dash-meta dt {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--app-muted);
}

.app-dash-meta dd {
  margin: 0;
  font-weight: 600;
  color: var(--app-text);
}

.app-table-wrap {
  overflow-x: auto;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.app-table th,
.app-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--app-border);
}

.app-table th {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
  background: var(--app-surface-2);
}

.app-table a {
  color: var(--app-accent);
  font-weight: 700;
}

.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.app-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--app-muted);
}

.app-body--login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.app-login-wrap {
  width: 100%;
  max-width: 420px;
}

.app-login-back {
  margin: 0 0 1rem;
  font-size: 0.875rem;
}

.app-login-back a {
  color: var(--app-accent);
  font-weight: 700;
}

.app-login-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 8px 28px var(--app-shadow);
}

.app-login-card__title {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--app-navy);
}

:root[data-app-theme="dark"] .app-login-card__title {
  color: var(--app-text);
}

.app-login-lang {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
}

.app-shell__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 26, 51, 0.4);
  z-index: 999;
}

.app-shell__backdrop.is-open {
  display: block;
}

@media (max-width: 900px) {
  .app-shell__menu-toggle {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px var(--app-shadow);
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .app-main {
    width: 100%;
  }

  .app-topbar {
    padding-left: 5.5rem;
  }
}
