@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --alh-bg: #f4ede3;
  --alh-bg-soft: #fbf7f1;
  --alh-surface: rgba(255, 255, 255, 0.92);
  --alh-surface-strong: #ffffff;
  --alh-ink: #2f241a;
  --alh-muted: #7c6b5a;
  --alh-line: #e6ddd1;
  --alh-brown: #8a5c37;
  --alh-brown-deep: #6f4525;
  --alh-sand: #eadbca;
  --alh-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  --alh-shadow-strong: 0 14px 32px rgba(16, 24, 40, 0.10);
  --alh-radius-card: 20px;
  --alh-radius-control: 12px;
}

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

body.alhambra-ui,
body.alhambra-ui-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  color: var(--alh-ink);
  background: linear-gradient(180deg, #f7f2ea 0%, #f1e8dc 100%);
}

body.alhambra-ui::before,
body.alhambra-ui-page::before {
  display: none;
}

.alh-shell {
  max-width: 1420px;
  margin: 0 auto;
  padding: 28px;
}

.alh-page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 24px 12px;
  backdrop-filter: blur(14px);
  background: rgba(247, 242, 234, 0.86);
  border-bottom: 1px solid var(--alh-line);
}

.alh-page-header-compact {
  padding: 14px 20px 10px;
}

.alh-page-header-compact .alh-title {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1;
}

.alh-page-header-compact .alh-eyebrow {
  margin-top: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.alh-title {
  margin: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--alh-brown-deep);
}

.alh-eyebrow {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--alh-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alh-card,
.alh-panel {
  border: 1px solid var(--alh-line);
  border-radius: var(--alh-radius-card);
  background: var(--alh-surface-strong);
  box-shadow: var(--alh-shadow);
}

.alh-card:hover,
.alh-panel:hover {
  box-shadow: var(--alh-shadow);
}

.alh-btn,
.btn {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.86rem;
}

.alh-btn-primary,
.btn-primary,
.btn-success,
.btn-dark {
  border: none;
  color: #fff;
  background: var(--alh-brown);
  box-shadow: none;
}

.alh-btn-primary:hover,
.btn-primary:hover,
.btn-success:hover,
.btn-dark:hover {
  color: #fff;
  background: var(--alh-brown-deep);
}

.alh-btn-secondary,
.btn-outline-secondary,
.btn-outline-dark,
.btn-secondary {
  border-color: var(--alh-line);
  color: var(--alh-brown-deep);
  background: #fff;
}

.alh-btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-outline-dark:hover,
.btn-secondary:hover {
  background: #f8fafc;
  color: var(--alh-brown-deep);
  border-color: #d0d5dd;
}

.form-control,
.form-select,
.form-control-color,
input.form-control,
select.form-select,
textarea.form-control {
  min-height: 48px;
  border-radius: var(--alh-radius-control);
  border: 1px solid #d7cab9;
  background: #fff;
  color: var(--alh-ink);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.form-control-color:focus,
input.form-control:focus,
select.form-select:focus,
textarea.form-control:focus {
  border-color: rgba(138, 92, 55, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(138, 92, 55, 0.10);
}

.alh-taxid-field {
  position: relative;
}

.alh-taxid-field .form-control.alh-taxid-invalid,
.alh-taxid-field input.form-control.alh-taxid-invalid {
  border-color: rgba(180, 35, 24, 0.75);
  box-shadow: 0 0 0 0.18rem rgba(180, 35, 24, 0.10);
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23b42318'/%3E%3Cpath d='M12 6v7' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='17.5' r='1.4' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
}

.alh-taxid-hint {
  display: none;
  margin-top: 6px;
  color: #b42318;
  font-size: 0.78rem;
  line-height: 1.4;
  font-family: inherit;
}

.alh-taxid-hint.is-visible {
  display: block;
}

.form-label,
.modal-body label {
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--alh-brown-deep);
}

.modal-content {
  border: 1px solid var(--alh-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.14);
}

.modal-header,
.modal-footer {
  border-color: rgba(94, 69, 45, 0.10);
  padding: 22px 24px;
}

.modal-title {
  font-weight: 700;
  color: var(--alh-brown-deep);
}

.modal-body {
  padding: 8px 24px 22px;
}

.table,
table {
  color: var(--alh-ink);
}

th {
  background: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  color: #667085;
}

.alh-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: none;
}

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

.alh-status-line {
  min-height: 24px;
  margin-top: 8px;
  color: var(--alh-muted);
  font-family: inherit;
  font-size: 0.88rem;
}

.alh-status-line.error {
  color: #ab3a2f;
}

.alh-suggestion-list {
  display: grid;
  gap: 8px;
}

.alh-suggestion-list:empty {
  display: none;
}

.alh-suggestion-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(111, 75, 47, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--alh-ink);
  padding: 12px 14px;
  font-weight: 600;
  line-height: 1.25;
}

.alh-suggestion-item:hover,
.alh-suggestion-item:focus {
  border-color: rgba(111, 75, 47, 0.4);
  background: #f8efe5;
}

[class*="inline-panel"] form > .d-flex.gap-2.flex-wrap,
[class*="inline-panel"] > .d-flex.gap-2.flex-wrap,
[class*="inline-panel"] .address-editor > .d-flex.gap-2.flex-wrap {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(138, 92, 55, 0.12);
}

[class*="inline-panel"] form > .d-flex.gap-2.flex-wrap .btn,
[class*="inline-panel"] > .d-flex.gap-2.flex-wrap .btn,
[class*="inline-panel"] .address-editor > .d-flex.gap-2.flex-wrap .btn {
  margin-top: 0;
}

.alh-inline-feedback {
  margin-top: 8px;
  min-height: 22px;
}

.module-user-menu {
  position: relative;
  margin-left: auto;
  z-index: 60;
}

.module-switcher-shell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.module-version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 75, 47, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--alh-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(61, 41, 24, 0.06);
  cursor: pointer;
}

button.module-version-badge:hover,
button.module-version-badge:focus {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(111, 75, 47, 0.22);
  color: var(--alh-brown-deep);
}

.module-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: auto;
  border: 1px solid rgba(111, 75, 47, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  padding: 6px 12px 6px 6px;
  color: var(--alh-brown-deep);
  box-shadow: 0 10px 26px rgba(61, 41, 24, 0.08);
}

.module-user-pill:hover,
.module-user-pill:focus {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(111, 75, 47, 0.22);
  color: var(--alh-brown-deep);
}

.module-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--alh-brown), var(--alh-brown-deep));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.module-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-user-pill-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.module-user-pill-label {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.05;
}

.module-user-pill-meta {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  color: var(--alh-muted);
  font-size: 0.68rem;
  line-height: 1;
}

.module-user-pill-caret {
  color: var(--alh-brown);
  font-size: 0.7rem;
  line-height: 1;
}

.module-user-flyout {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  min-width: 240px;
  max-height: min(calc(100vh - 88px), 680px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 10px;
  border: 1px solid rgba(111, 75, 47, 0.14);
  border-radius: 20px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 22px 44px rgba(61, 41, 24, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.module-user-menu.is-open .module-user-flyout {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.module-user-flyout-header {
  padding: 4px 6px 10px;
}

.module-user-flyout-title {
  color: var(--alh-brown-deep);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.1;
}

.module-user-flyout-subtitle {
  margin-top: 3px;
  color: var(--alh-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.module-user-flyout-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--alh-ink);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 700;
}

.module-user-flyout-item:hover,
.module-user-flyout-item:focus {
  background: #f4eadf;
}

.module-user-flyout-item.is-active {
  background: rgba(111, 75, 47, 0.1);
  color: var(--alh-brown-deep);
}

.module-user-flyout-mark {
  color: var(--alh-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.module-user-flyout-divider {
  height: 1px;
  margin: 8px 4px;
  background: rgba(111, 75, 47, 0.12);
}

.module-user-flyout-item-logout {
  color: #9e3f35;
}

.alh-feedback-open {
  overflow: hidden;
}

.alh-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.alh-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 36, 26, 0.38);
  backdrop-filter: blur(6px);
}

.alh-feedback-dialog {
  position: relative;
  width: min(100% - 32px, 640px);
  max-height: calc(100vh - 40px);
  border: 1px solid var(--alh-line);
  border-radius: 22px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 24px 56px rgba(61, 41, 24, 0.18);
  padding: 22px 22px 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.alh-feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.alh-feedback-header strong {
  color: var(--alh-brown-deep);
  font-size: 1.05rem;
}

.alh-feedback-subtitle {
  margin-top: 5px;
  color: var(--alh-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.alh-feedback-close {
  border: 1px solid rgba(111, 75, 47, 0.14);
  background: #fff;
  color: var(--alh-brown-deep);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
}

.alh-feedback-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
  color: var(--alh-muted);
  font-size: 0.76rem;
}

.alh-feedback-form {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.alh-feedback-form .row {
  --bs-gutter-x: 1rem;
  margin-left: 0;
  margin-right: 0;
}

.alh-feedback-upload-block {
  border: 1px solid rgba(138, 92, 55, 0.12);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.alh-feedback-paste-zone {
  border: 1px dashed var(--alh-line);
  border-radius: 12px;
  background: #fff;
  color: var(--alh-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 12px 14px;
  cursor: text;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.alh-feedback-paste-zone:focus,
.alh-feedback-paste-zone.is-active {
  outline: none;
  border-color: rgba(138, 92, 55, 0.45);
  background: #fcf4e9;
  color: var(--alh-brown-deep);
}

.alh-feedback-files {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.alh-feedback-file-empty {
  color: var(--alh-muted);
  font-size: 0.8rem;
  width: 100%;
}

.alh-feedback-file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(138, 92, 55, 0.12);
  border-radius: 12px;
  background: #fffaf4;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: var(--alh-brown-deep);
  min-width: 0;
}

.alh-feedback-file-chip span,
.alh-feedback-file-card-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.alh-feedback-file-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 152px;
  width: 152px;
  border: 1px solid rgba(138, 92, 55, 0.12);
  border-radius: 14px;
  background: #fffaf4;
  overflow: hidden;
  min-width: 0;
}

.alh-feedback-file-card img {
  width: 100%;
  height: 104px;
  display: block;
  object-fit: contain;
  background: #fff;
}

.alh-feedback-file-card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  font-size: 0.72rem;
  color: var(--alh-brown-deep);
  min-width: 0;
}

.alh-feedback-file-card-meta button,
.alh-feedback-file-chip button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(138, 92, 55, 0.14);
  border-radius: 999px;
  background: #fff;
  color: var(--alh-brown-deep);
  line-height: 1;
}

@media (max-width: 991px) {
  .alh-shell {
    padding: 20px 18px 30px;
  }

  .alh-page-header {
    padding: 22px 18px 16px;
  }

  .alh-page-header-compact {
    padding: 10px 14px 8px;
  }

  .alh-feedback-dialog {
    width: min(100% - 20px, 640px);
    padding: 18px;
  }
}

@media (max-width: 576px) {
  .alh-title {
    font-size: 2rem;
  }

  .alh-eyebrow {
    letter-spacing: 0.1em;
    line-height: 1.45;
  }

  .alh-page-header-compact .alh-toolbar {
    align-items: flex-start;
    gap: 6px;
  }

  .module-user-menu {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .alh-page-header-compact .alh-title {
    font-size: 1.3rem;
  }

  .alh-page-header-compact .alh-eyebrow {
    margin-top: 2px;
    font-size: 0.64rem;
    line-height: 1.2;
    letter-spacing: 0.05em;
  }

  .module-user-pill {
    max-width: min(100%, 280px);
  }

  .module-user-pill-label,
  .module-user-pill-meta {
    max-width: 150px;
  }

  .module-user-flyout {
    left: auto;
    right: 0;
    min-width: min(92vw, 260px);
  }

  .btn,
  .alh-btn {
    width: 100%;
  }
}
