[hidden] {
  display: none !important;
}

:root {
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Mulish", system-ui, sans-serif;
  --ink: #1a1614;
  --muted: #6b635c;
  --accent: #c17a85;
  --accent-dark: #8f4a58;
  --accent-soft: #f5e8ec;
  --line: #e8e1d9;
  --bg: #faf7f4;
  --bg-card: #fffcfa;
  --radius: 14px;
  --shadow: 0 18px 44px rgba(26, 22, 20, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(245, 232, 236, 0.65), transparent 55%),
    var(--bg);
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.72rem 1.25rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--accent {
  background: linear-gradient(135deg, #c17a85, #8f4a58);
  color: #fff;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn--sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.card {
  background: var(--bg-card);
  border: 1px solid rgba(232, 225, 217, 0.95);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  padding: 2rem 1.75rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(232, 225, 217, 0.95);
  background: rgba(255, 252, 249, 0.95);
  box-shadow: var(--shadow);
}

.login-card__label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
}

.login-card__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
}

.login-form {
  display: grid;
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.field__input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.field__input:focus {
  outline: 2px solid rgba(193, 122, 133, 0.35);
  outline-offset: 1px;
}

.form-error {
  margin: 0;
  font-size: 0.85rem;
  color: #b42318;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(232, 225, 217, 0.95);
  background: rgba(255, 252, 249, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header__brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.admin-header__logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.admin-header__subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-header__user {
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-main {
  padding: 1.5rem 0 3rem;
}

.admin-section + .admin-section {
  margin-top: 2rem;
}

.admin-section__head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
}

.admin-section__head p {
  margin: 0;
  color: var(--muted);
}

.admin-layout {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.cert-form {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  align-items: end;
}

.cert-form .field:nth-child(-n+2) {
  grid-column: span 1;
}

.cert-form .field:nth-child(3) {
  grid-column: span 1;
}

.cert-form__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.15rem;
}

.cert-form .form-error {
  grid-column: 1 / -1;
}

.cert-tags-field {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
}

.cert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.35rem;
}

.cert-tags__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.cert-tags__item input {
  accent-color: var(--accent);
}

.cert-preview {
  padding: 1rem 1rem 1.15rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cert-preview__label {
  margin: 0 0 0.75rem;
  width: min(100%, 297mm);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cert-preview__frame {
  container-type: inline-size;
  container-name: cert-preview;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--line);
  background: #fff;
  width: min(100%, 297mm);
  aspect-ratio: 297 / 210;
  margin-inline: auto;
  box-shadow: 0 14px 36px rgba(26, 22, 20, 0.1);
}

.table-wrap {
  overflow-x: auto;
}

.cert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.cert-table th,
.cert-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(232, 225, 217, 0.85);
  text-align: left;
  vertical-align: top;
}

.cert-table th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cert-table__empty {
  text-align: center;
  color: var(--muted);
}

.btn--danger {
  background: rgba(180, 35, 24, 0.08);
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.22);
}

.cert-table__row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.cert-table__row:hover {
  background: rgba(245, 232, 236, 0.45);
}

.cert-table__row.is-selected {
  background: rgba(245, 232, 236, 0.75);
}

.cert-table__row.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.cert-table__actions {
  white-space: nowrap;
  cursor: default;
}

.cert-table__download {
  white-space: nowrap;
}

@media (max-width: 960px) {
  .cert-form {
    grid-template-columns: 1fr;
  }

  .cert-form__actions .btn {
    width: 100%;
  }
}
