:root {
  --um-cyan: #00a8b5;
  --um-cyan-dark: #007e8b;
  --um-navy: #153b4b;
  --um-text: #303d43;
  --um-muted: #68787f;
  --um-background: #f3f6f7;
  --um-white: #ffffff;
  --um-border: #d5e0e4;
  --um-focus: rgba(0, 168, 181, 0.22);
  --um-shadow: 0 18px 50px rgba(21, 59, 75, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--um-text);
  background:
    linear-gradient(180deg, #eef6f7 0, var(--um-background) 340px);
  font-family:
    "Montserrat",
    "Segoe UI",
    Arial,
    Helvetica,
    sans-serif;
  line-height: 1.5;
}

.um-header {
  background: var(--um-white);
  border-bottom: 1px solid var(--um-border);
}

.um-header__inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.um-logo {
  display: inline-flex;
  align-items: center;
}

.um-logo img {
  display: block;
  width: auto;
  max-width: 230px;
  height: 56px;
  object-fit: contain;
}

.um-main {
  width: min(850px, calc(100% - 32px));
  margin: 48px auto 72px;
}

.um-panel {
  overflow: hidden;
  background: var(--um-white);
  border: 1px solid var(--um-border);
  border-radius: 3px;
  box-shadow: var(--um-shadow);
}

.um-panel__header {
  padding: 34px 42px 30px;
  color: var(--um-white);
  background:
    linear-gradient(
      120deg,
      rgba(21, 59, 75, 0.98),
      rgba(0, 126, 139, 0.94)
    );
}

.um-kicker {
  margin: 0 0 7px;
  color: #bceef0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.um-panel h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.um-notice {
  margin: 36px 42px 4px;
  padding: 23px 25px;
  color: #40535b;
  background: #edf8f8;
  border-left: 5px solid var(--um-cyan);
}

.um-notice p {
  margin: 0;
}

.um-notice p + p {
  margin-top: 12px;
}

.um-notice strong {
  color: var(--um-navy);
}

.um-error {
  margin: 0 0 22px;
  padding: 16px 18px;
  color: #7a271a;
  background: #fef3f2;
  border-left: 5px solid #d92d20;
  border-radius: 2px;
  font-size: 0.92rem;
}

.um-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 145px;
  min-height: 48px;
  padding: 12px 27px;
  color: var(--um-white);
  background: var(--um-cyan-dark);
  border: 2px solid var(--um-cyan-dark);
  border-radius: 2px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.um-button:hover {
  background: var(--um-navy);
  border-color: var(--um-navy);
  transform: translateY(-1px);
}

.um-form {
  padding: 32px 42px 42px;
}

.um-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 24px;
}

.um-field {
  display: grid;
  gap: 7px;
}

.um-field--full {
  grid-column: 1 / -1;
}

.um-field label {
  color: var(--um-navy);
  font-size: 0.91rem;
  font-weight: 700;
}

.um-field label span,
.um-form__footer span {
  color: #b42318;
}

.um-field input,
.um-field select,
.um-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  color: var(--um-text);
  background: var(--um-white);
  border: 1px solid #aebdc3;
  border-radius: 2px;
  font: inherit;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.um-field textarea {
  resize: vertical;
}

.um-field input:hover,
.um-field select:hover,
.um-field textarea:hover {
  border-color: var(--um-cyan-dark);
}

.um-field input:focus,
.um-field select:focus,
.um-field textarea:focus {
  border-color: var(--um-cyan);
  outline: none;
  box-shadow: 0 0 0 4px var(--um-focus);
}

.um-field textarea::placeholder {
  color: var(--um-muted);
}

.um-captcha {
  margin-top: 28px;
  min-height: 78px;
  display: flex;
  align-items: center;
}

.um-form__footer {
  margin-top: 24px;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--um-border);
}

.um-form__footer p {
  margin: 0;
  color: var(--um-muted);
  font-size: 0.84rem;
}

.um-form__footer button {
  min-width: 145px;
  min-height: 48px;
  padding: 12px 27px;
  color: var(--um-white);
  background: var(--um-cyan-dark);
  border: 2px solid var(--um-cyan-dark);
  border-radius: 2px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.um-form__footer button:hover {
  background: var(--um-navy);
  border-color: var(--um-navy);
  transform: translateY(-1px);
}

.um-form__footer button:focus-visible {
  outline: 3px solid var(--um-cyan);
  outline-offset: 4px;
}

.um-form__footer button:disabled,
.um-form__footer button:disabled:hover {
  background: #aebdc3;
  border-color: #aebdc3;
  cursor: not-allowed;
  transform: none;
}

.um-footer {
  padding: 29px 20px;
  color: #d6e4e8;
  background: var(--um-navy);
}

.um-footer__inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.um-footer p {
  margin: 0;
  font-size: 0.82rem;
}

@media (max-width: 680px) {
  .um-header__inner {
    width: min(100% - 28px, 1120px);
    min-height: 78px;
  }

  .um-logo img {
    max-width: 190px;
    height: 48px;
  }

  .um-main {
    margin-top: 28px;
  }

  .um-panel__header,
  .um-form {
    padding-left: 24px;
    padding-right: 24px;
  }

  .um-notice {
    margin-right: 24px;
    margin-left: 24px;
  }

  .um-grid {
    grid-template-columns: 1fr;
  }

  .um-field--full {
    grid-column: auto;
  }

  .um-form__footer,
  .um-footer__inner {
    align-items: stretch;
    flex-direction: column;
  }

  .um-form__footer button {
    width: 100%;
  }

  .g-recaptcha {
    transform: scale(0.9);
    transform-origin: left top;
  }
}

@media (max-width: 380px) {
  .g-recaptcha {
    transform: scale(0.82);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}


/* ============================================================
   Backoffice (admin panel) - prefix .adm-
   Reuses the :root tokens defined above.
   ============================================================ */

.adm-body {
  min-height: 100vh;
  margin: 0;
  color: var(--um-text);
  background: var(--um-background);
  font-family: "Montserrat", "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

/* --- Login --- */
.adm-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.adm-card {
  width: min(400px, 100%);
  background: var(--um-white);
  border: 1px solid var(--um-border);
  border-radius: 8px;
  box-shadow: var(--um-shadow);
  overflow: hidden;
}

.adm-card__header {
  padding: 26px 32px;
  color: var(--um-white);
  background: linear-gradient(135deg, var(--um-navy), var(--um-cyan-dark));
}

.adm-card__header img {
  display: block;
  height: 52px;
  width: auto;
  filter: brightness(0) invert(1);
}

.adm-card__kicker {
  margin: 14px 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bceef0;
}

.adm-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.adm-card__body {
  padding: 26px 32px 30px;
}

.adm-field {
  margin-bottom: 16px;
}

.adm-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--um-navy);
}

.adm-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--um-text);
  background: var(--um-white);
  border: 1px solid #aebdc3;
  border-radius: 4px;
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.adm-input:focus {
  outline: none;
  border-color: var(--um-cyan);
  box-shadow: 0 0 0 4px var(--um-focus);
}

.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  color: var(--um-white);
  background: var(--um-cyan-dark);
  border: 1px solid var(--um-cyan-dark);
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.adm-btn:hover {
  background: var(--um-navy);
  border-color: var(--um-navy);
}

.adm-btn--block {
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adm-btn--ghost {
  color: var(--um-cyan-dark);
  background: transparent;
}

.adm-btn--ghost:hover {
  color: var(--um-white);
  background: var(--um-cyan-dark);
}

.adm-btn--muted {
  color: var(--um-text);
  background: var(--um-white);
  border-color: #aebdc3;
}

.adm-btn--muted:hover {
  color: var(--um-text);
  background: #eef4f5;
  border-color: #aebdc3;
}

.adm-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  color: #7a271a;
  background: #fef3f2;
  border-left: 4px solid #d92d20;
  border-radius: 3px;
  font-size: 0.9rem;
}

/* --- Topbar --- */
.adm-topbar {
  background: var(--um-white);
  border-bottom: 1px solid var(--um-border);
}

.adm-topbar__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.adm-brand img {
  height: 36px;
  width: auto;
}

.adm-brand span {
  font-weight: 700;
  color: var(--um-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-logout {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--um-cyan-dark);
  text-decoration: none;
  white-space: nowrap;
}

.adm-logout:hover {
  color: var(--um-navy);
}

/* --- Container + toolbar --- */
.adm-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.adm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.adm-search {
  display: flex;
  gap: 8px;
  flex: 1 1 320px;
}

.adm-search .adm-input {
  max-width: 340px;
}

.adm-toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.adm-count {
  font-size: 0.88rem;
  color: var(--um-muted);
  white-space: nowrap;
}

/* --- Table --- */
.adm-table-wrap {
  background: var(--um-white);
  border: 1px solid var(--um-border);
  border-radius: 8px;
  overflow: hidden;
}

.adm-scroll {
  overflow-x: auto;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.adm-table thead th {
  padding: 12px;
  text-align: left;
  white-space: nowrap;
  font-weight: 700;
  color: var(--um-navy);
  background: #edf8f8;
  border-bottom: 1px solid var(--um-border);
}

.adm-table tbody td {
  padding: 9px 12px;
  vertical-align: top;
  border-bottom: 1px solid #eef2f4;
}

.adm-table tbody tr:last-child td {
  border-bottom: none;
}

.adm-table tbody tr:hover {
  background: #f7fafb;
}

.adm-nowrap {
  white-space: nowrap;
}

.adm-muted {
  color: var(--um-muted);
}

.adm-strong {
  font-weight: 600;
}

.adm-truncate {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.adm-badge--ok {
  color: #067647;
  background: #d1fae5;
}

.adm-badge--err {
  color: #b42318;
  background: #fee2e2;
}

.adm-empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--um-muted);
}

/* --- Pagination --- */
.adm-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 0.875rem;
}

.adm-page-link {
  padding: 8px 12px;
  border: 1px solid #aebdc3;
  border-radius: 4px;
  color: var(--um-text);
  text-decoration: none;
}

.adm-page-link:hover {
  background: var(--um-white);
}

.adm-page-info {
  padding: 8px 12px;
  color: var(--um-muted);
}

@media (max-width: 640px) {
  .adm-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .adm-search {
    flex: 1 1 auto;
  }

  .adm-search .adm-input {
    max-width: none;
  }

  .adm-toolbar__right {
    justify-content: space-between;
  }
}


/* --- Backoffice additions: filters, resend, flash --- */

.adm-search {
  flex-wrap: wrap;
}

.adm-input--month {
  max-width: 180px;
}

.adm-btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 0.8rem;
  border-radius: 3px;
}

.adm-actions {
  margin: 0;
}

.adm-flash {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.adm-flash--ok {
  color: #067647;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
}

.adm-flash--err {
  color: #b42318;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.adm-badge--warn {
  color: #92400e;
  background: #fef3c7;
}

.adm-badge--muted {
  color: #68787f;
  background: #eef2f4;
}


/* --- Backoffice: row actions + detail view --- */

.adm-rowactions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.adm-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--um-cyan-dark);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.adm-back:hover {
  color: var(--um-navy);
}

.adm-detail {
  max-width: 820px;
  background: var(--um-white);
  border: 1px solid var(--um-border);
  border-radius: 8px;
  padding: 24px;
}

.adm-detail__head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid #eef2f4;
}

.adm-detail__title {
  margin: 0;
  color: var(--um-navy);
  font-size: 1.4rem;
}

.adm-detail__date {
  margin: 4px 0 0;
  color: var(--um-muted);
  font-size: 0.9rem;
}

.adm-detail__status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.adm-detail__status > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-detail__label {
  color: var(--um-muted);
}

.adm-dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
  margin: 0;
}

.adm-dl > div {
  min-width: 0;
}

.adm-dl__full {
  grid-column: 1 / -1;
}

.adm-dl dt {
  margin-bottom: 3px;
  color: var(--um-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.adm-dl dd {
  margin: 0;
  color: var(--um-text);
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.adm-detail__errors {
  margin-top: 18px;
  padding: 12px 14px;
  background: #fef3f2;
  border-left: 4px solid #d92d20;
  border-radius: 3px;
  color: #7a271a;
  font-size: 0.85rem;
}

.adm-detail__errors p {
  margin: 0 0 6px;
}

.adm-detail__errors p:last-child {
  margin: 0;
}

.adm-detail__meta {
  margin-top: 18px;
  color: var(--um-muted);
  font-size: 0.8rem;
}

.adm-detail__actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #eef2f4;
}

@media (max-width: 640px) {
  .adm-dl {
    grid-template-columns: 1fr;
  }
}
