:root {
  --primary-color: #1b5e20;
  --secondary-color: #388e3c;
  --accent-color: #4caf50;
  --background-color: #f5f7fa;
  --text-color: #1f2933;
  --border-color: #d9e2ec;
  --danger-color: #c62828;
  --muted-color: #627d98;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  background-color: #fff;
  border-radius: 12px;
  padding: 2.25rem 2rem;
  width: min(420px, 100%);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--primary-color);
}

.auth-card__subtitle {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-field label {
  font-weight: 600;
}

.auth-field input {
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
}

.auth-field input:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 1px;
}

.auth-error {
  margin: 0;
  color: var(--danger-color);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.auth-submit {
  align-self: flex-end;
  padding: 0.65rem 1.4rem;
}

.auth-submit:disabled {
  opacity: 0.75;
  cursor: progress;
}

header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 {
  font-size: 1.75rem;
  margin: 0;
}

.header-settings {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header button {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

header button:hover,
header button:focus {
  background-color: rgba(255, 255, 255, 0.3);
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.panel {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel__heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.panel__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.panel__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.panel__tab {
  appearance: none;
  border: none;
  background: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  color: var(--muted-color);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.panel__tab:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.panel__tab:not(:disabled):hover,
.panel__tab:not(:disabled):focus-visible {
  color: var(--text-color);
  background-color: rgba(98, 125, 152, 0.15);
  outline: none;
}

.panel__tab:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.panel__tab--active {
  background-color: rgba(27, 94, 32, 0.12);
  color: var(--primary-color);
  font-weight: 600;
}

.project-summary__section {
  display: grid;
  gap: 1rem;
}

.project-summary__section[hidden] {
  display: none;
}

.project-summary__note {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.project-summary__note:empty {
  display: none;
}

.panel__meta {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.panel__title {
  margin: 0;
  font-size: 1.25rem;
}

.panel__title-row .panel__title {
  flex: 1 1 auto;
}

.panel__title-number {
  margin-left: 0.5rem;
  font-weight: 600;
}

.panel__title-period {
  margin: 0;
  font-size: 1rem;
  color: var(--muted-color);
  text-align: right;
}

.panel__title-period:empty {
  display: none;
}

.panel__actions {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.5rem; /* Optional: space between buttons */
  justify-content: flex-start; /* Keeps items at the right edge */
}

.visually-hidden,
.trade-import__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.trade-import {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.trade-import__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.trade-import__dropzone {
  position: relative;
  flex: 1 1 260px;
  min-height: 3.5rem;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  color: var(--muted-color);
  background-color: #f9fbfc;
}

.trade-import__dropzone:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

.trade-import__dropzone--dragover {
  border-color: var(--accent-color);
  background-color: rgba(76, 175, 80, 0.1);
  color: var(--primary-color);
}

.trade-import__dropzone--disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.trade-import__dropzone-text {
  font-weight: 600;
  text-align: center;
}

.trade-import__description,
.trade-import__hint {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.trade-import__hint {
  font-style: italic;
}

.trade-import__status {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.trade-import__status[hidden] {
  display: none;
}

.trade-import__status--info {
  color: var(--muted-color);
}

.trade-import__status--success {
  color: var(--secondary-color);
}

.trade-import__status--error {
  color: var(--danger-color);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background-color: #f0f4f8;
  color: var(--secondary-color);
  font-weight: 600;
}

.status-badge--finalised {
  background-color: rgba(27, 94, 32, 0.12);
  color: var(--primary-color);
}

.status-badge--draft {
  background-color: rgba(255, 193, 7, 0.18);
  color: #8a6d1f;
}

.trade-summary__metric {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.claim-period-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
}

.claim-period-field span {
  display: block;
  font-weight: 600;
  color: var(--muted-color);
  font-size: 0.9rem;
}

.claim-period-field input[type='date'],
.claim-period-field input[type='month'] {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #fdfdfd;
  font: inherit;
  min-width: 12ch;
}

.claim-period-field input[type='date']:focus,
.claim-period-field input[type='month']:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.claim-period-field--inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-picker {
  position: relative;
  display: inline-flex;
  width: 100%;
}

.month-picker__native-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.month-picker__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #fdfdfd;
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.month-picker__trigger::after {
  content: '▾';
  font-size: 0.85rem;
  color: var(--muted-color);
}

.month-picker__trigger--placeholder {
  color: var(--muted-color);
}

.month-picker__trigger:hover,
.month-picker__trigger:focus-visible {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
  outline: none;
}

.month-picker__trigger:hover::after,
.month-picker__trigger:focus-visible::after {
  color: var(--accent-color);
}

.month-picker__dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 10;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  padding: 1rem;
  min-width: 260px;
  width: 100%;
}

.month-picker__dropdown[hidden] {
  display: none;
}

.month-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.month-picker__nav {
  border: 1px solid var(--border-color);
  background-color: #f0f4f8;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-color);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.month-picker__nav:hover,
.month-picker__nav:focus-visible {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  outline: none;
}

.month-picker__year {
  font-weight: 600;
}

.month-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.5rem;
}

.month-picker__month {
  border: 1px solid var(--border-color);
  background-color: #f7fafc;
  border-radius: 6px;
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

.month-picker__month:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background-color: #eceff1;
  border-color: var(--border-color);
  color: #6b7280;
}

.month-picker__month:hover,
.month-picker__month:focus-visible {
  border-color: var(--accent-color);
  background-color: rgba(76, 175, 80, 0.12);
  outline: none;
}

.month-picker__month.is-selected {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

button.primary {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button.primary:hover,
button.primary:focus {
  background-color: #2e7d32;
}

button.secondary {
  background-color: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 4px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

button.secondary:hover,
button.secondary:focus {
  background-color: var(--accent-color);
  color: #fff;
}

button.danger {
  background-color: var(--danger-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button.danger:hover,
button.danger:focus {
  background-color: #8e0000;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: var(--muted-color);
}

.form-grid label.autocomplete {
  position: relative;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  margin-top: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fdfdfd;
  transition: border-color 0.2s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.autocomplete__panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 20;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(15, 30, 50, 0.12);
  max-height: 16rem;
  overflow-y: auto;
}

.autocomplete__option {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(15, 30, 50, 0.08);
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
}

.autocomplete__option:last-child {
  border-bottom: none;
}

.autocomplete__option:hover,
.autocomplete__option:focus,
.autocomplete__option[aria-selected='true'] {
  background-color: #f0f4f8;
  outline: none;
}

.autocomplete__status,
.autocomplete__empty {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  color: var(--muted-color);
}

.autocomplete__status {
  border-bottom: 1px solid rgba(15, 30, 50, 0.08);
}

.autocomplete__hint {
  margin-top: 0.35rem;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted-color);
}

.project-details {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 10px 30px rgba(15, 30, 50, 0.08);
  min-height: 260px;
}

@media (min-width: 720px) {
  .project-details {
    flex-direction: row;
  }
}

.project-details__map {
  position: relative;
  flex: 1.25;
  min-height: 220px;
  overflow: hidden;
  background-color: #d8e3ef;
}

.project-details__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-details__map--has-image .project-details__image {
  opacity: 1;
}

.project-details__map::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(140px, 40%, 240px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 60%, #fff 100%);
  pointer-events: none;
}

.project-details__map--empty::after {
  display: none;
}

.project-details__map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted-color);
  font-weight: 600;
  background: linear-gradient(135deg, #ecf2f8 0%, #d8e3ef 100%);
}

.project-details__marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  background: #e53935;
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -88%) rotate(-45deg);
  box-shadow: 0 8px 18px rgba(229, 57, 53, 0.45);
  z-index: 2;
  pointer-events: none;
}

.project-details__marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.project-details__content {
  flex: 1;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 1.5rem;
  text-align: right;
  background: #fff;
}

@media (max-width: 719px) {
  .project-details__content {
    padding: 1.5rem 1.25rem 2rem;
  }
}

.project-details__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  color: #102542;
}

.project-details__meta {
  display: grid;
  gap: 0.75rem 1.5rem;
}

.project-details__item {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.project-details__item dt {
  font-weight: 600;
  color: var(--muted-color);
}

.project-details__item dd {
  margin: 0;
  color: #102542;
}

.project-details__progress {
  margin: 0;
}

.project-details__notes {
  margin: 0;
  max-width: 32rem;
  font-style: italic;
  color: #3f4c5c;
}

@media (max-width: 639px) {
  .project-details__notes {
    width: 100%;
  }
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: left;
}

th {
  background-color: #f0f4f8;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

tbody tr:nth-child(even) {
  background-color: #f9fbfd;
}

input.table-input,
select.table-input {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}
input.table-input-right,
select.table-input {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: right;
}

.table-text {
  display: block;
  color: #000;
  font-weight: 600;
}

.table-text--numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.numeric-input:not([readonly]):not(:disabled),
input[type='number']:not([readonly]):not(:disabled) {
  color: #0000ff;
}

.numeric-input[readonly],
.numeric-input:disabled,
input[type='number'][readonly],
input[type='number']:disabled {
  color: #000;
}

.numeric-input.numeric-input--negative,
input[type='number'].numeric-input--negative {
  color: #c62828;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.variation-claim-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.variation-claim-cell .table-input-right {
  flex: 0 1 9rem;
  min-width: 7rem;
  width: auto;
}

.variation-remove {
  white-space: nowrap;
  align-self: center;
}

.table__placeholder {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted-color);
  font-style: italic;
}

.summary-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.summary-footer__totals {
  max-width: 320px;
  width: 100%;
}

.summary-footer__placeholder {
  text-align: center;
  padding: 1rem;
  color: var(--muted-color);
  font-style: italic;
}

.summary-footer__totals div {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-weight: 600;
}

.summary-footer__label {
  color: var(--muted-color);
}

.summary-footer__value {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.summary-footer__indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--danger-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.summary-footer__indicator-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background-color: var(--danger-color);
  box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.15);
}

.fieldset-description {
  margin: 0 0 0.75rem;
  color: #455a64;
  font-size: 0.95rem;
}

.retention-tier-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.retention-tier-grid__row {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  padding: 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background-color: #f8fafc;
}

.retention-tier-grid__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  grid-column: 1 / -1;
  color: #2f4858;
}

.summary-footer__note {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.4rem;
}

.summary-footer__note input {
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #c5ccd6;
  font-size: 0.95rem;
}

.summary-footer__note label {
  font-size: 0.85rem;
  color: #455a64;
}

.summary-footer__info {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #455a64;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background-color: #e0f2f1;
  color: var(--secondary-color);
}

.project-selector {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.project-selector select {
  min-width: 220px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.history-list li {
  background-color: #f0f4f8;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-list__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.history-list__title {
  font-weight: 600;
}

.history-list__actions {
  display: flex;
  gap: 0.75rem;
}

.history-list button {
  border: none;
  background: transparent;
  color: var(--accent-color);
  cursor: pointer;
  font-weight: 600;
}

.history-list button.history-list__delete {
  color: var(--danger-color);
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .project-selector {
    flex-direction: column;
    align-items: flex-start;
  }
}
.table__header--right {
  text-align: right;
}
.table__footer--right {
  text-align: right;
  font-weight: bold;
}
.table__footer--left {
  font-weight: bold;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-profile {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  min-width: 140px;
}

.user-profile__name {
  font-weight: 600;
}

.user-profile__meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.account-settings__notifications {
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  background-color: #f9fbfd;
}

.account-settings__notifications legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.checkbox-field input[type='checkbox'] {
  width: 1.1rem;
  height: 1.1rem;
}

body.theme-light,
body.theme-dark {
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.theme-dark {
  --background-color: #0f172a;
  --text-color: #e2e8f0;
  --border-color: #27364a;
  --muted-color: #9ba8c6;
}

body.theme-dark header {
  background: linear-gradient(135deg, #0d4318, #1c5a2a);
}

body.theme-dark .panel {
  background-color: #1e293b;
  border-color: #27364a;
  color: var(--text-color);
  box-shadow: 0 18px 34px rgba(8, 16, 29, 0.4);
}

body.theme-dark main {
  background-color: var(--background-color);
}

body.theme-dark dialog {
  background-color: #1e293b;
  color: var(--text-color);
  border: 1px solid #27364a;
}

body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select {
  background-color: #0f172a;
  color: var(--text-color);
  border-color: #334155;
}

body.theme-dark .table-wrapper table {
  color: var(--text-color);
}

body.theme-dark .panel__tab {
  color: var(--muted-color);
}

body.theme-dark .panel__tab--active {
  color: var(--text-color);
  background-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark header button {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

body.theme-dark header button:hover,
body.theme-dark header button:focus {
  background-color: rgba(255, 255, 255, 0.22);
}

body.theme-dark .auth-card {
  background-color: #1e293b;
  color: var(--text-color);
}

body.theme-dark .auth-field input {
  background-color: #0f172a;
  color: var(--text-color);
  border-color: #334155;
}

body.theme-dark .account-settings__notifications {
  background-color: #162036;
  border-color: #27364a;
}

/* Admin user creation layout */
.admin-body {
  background-color: var(--background-color);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.admin-layout {
  width: min(520px, 100%);
}

.admin-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-card__title {
  margin: 0;
  font-size: 1.6rem;
  color: var(--primary-color);
}

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

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-form__group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-form__group--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.admin-form__label {
  font-weight: 600;
}

.admin-form__label--checkbox {
  margin: 0;
}

.admin-form__input {
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
}

.admin-form__input:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 1px;
}

.admin-form__checkbox {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary-color);
}

.admin-form__hint {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.9rem;
}

.admin-form__error {
  margin: 0;
  color: var(--danger-color);
  font-size: 0.9rem;
}

.admin-form__success {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background-color: rgba(76, 175, 80, 0.12);
  color: var(--secondary-color);
  border: 1px solid rgba(76, 175, 80, 0.35);
}

.admin-form__actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .admin-card {
    padding: 1.5rem;
  }

  .admin-form__group--checkbox {
    align-items: flex-start;
  }
}
