/* Misty-Land - Admin feature styles extracted from style.css */

/* ================= ADMIN DASHBOARD ================= */

/* ================= ADMIN PANEL CARD ================= */

.admin-panel-card {
  position: relative;
  width: min(96vw, 950px);
  max-width: 950px;
  margin: 78px auto 0;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 92, 0.6);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-elevated), var(--shadow-soft);
  padding: var(--space-xl) var(--space-xxl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  overflow: hidden;
}

.admin-panel-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--radius-large) - 8px);
  border: 1px solid rgba(224, 201, 138, 0.38);
  pointer-events: none;
}

/* One group: title + line + buttons */
.admin-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.admin-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.admin-section-title {
  font-family: var(--font-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: #111;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.admin-section-header--sub {
  margin-top: 8px;
}

.admin-section-line {
  flex: 1;
  height: 1px;
  background: var(--primary-gold);
  opacity: 0.35;
}

.admin-section-btns {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  align-items: flex-start;
}

/* Individual action buttons — fixed width so all align perfectly */
.admin-action-btn {
  height: 38px;
  width: 220px;
  padding: 0 20px;
  border-radius: 40px;
  border: 1px solid var(--primary-gold);
  background: transparent;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--text-brown);
  cursor: pointer;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: left;
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    transform var(--motion-fast),
    box-shadow var(--motion-fast);
}

.admin-action-btn:hover {
  background: var(--gold-light);
  border-color: #a07840;
  color: #3a2410;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(160,128,80,0.14);
}

.admin-action-btn:active {
  transform: scale(0.97);
  box-shadow: none;
}

/* Coming soon buttons — muted, not interactive */
.admin-action-btn--soon {
  opacity: 0.38;
  cursor: not-allowed;
  border-style: dashed;
}

.admin-action-btn--soon:hover {
  background: transparent;
  border-color: var(--primary-gold);
  color: var(--text-brown);
  transform: none;
  box-shadow: none;
}

#admin-page {
  text-align: center;
}

#admin-page .project-title {
  font-size: var(--font-size-xl);
  letter-spacing: 0.08em;
}

#admin-page .project-options-button {
  width: 14rem;
  height: 4rem;
  font-size: var(--font-size-sm);
}

@media (max-width: 640px) {
  .admin-panel-card {
    margin-top: 72px;
    padding: 18px 16px;
  }
}

/* ================= DRAFTING PAGE ================= */

.al-page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 80px 16px 28px;
  box-sizing: border-box;
}

.al-main-card {
  background: var(--bg-card);
  border: 1px solid #e0c98a;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-elevated);
  padding: 24px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 124px);
}

.al-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(224, 201, 138, 0.55);
}

.al-header-main {
  min-width: 0;
}

.al-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.al-header-btn {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #d4bb87;
  border-radius: 999px;
  background: linear-gradient(145deg, #ead5ac, #d6b881);
  color: #4a3218;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.6);
  font-family: var(--font-primary);
  font-size: 13px;
  cursor: pointer;
  transition: transform var(--motion-fast), box-shadow var(--motion-fast), filter var(--motion-fast);
}

.al-header-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 12px 25px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

.al-title {
  font-size: 19px;
  font-weight: 350;
  letter-spacing: 0.01em;
}

.al-subtitle {
  font-size: 13px;
  color: #8f7a5d;
}

.al-body {
  display: block;
  min-height: 0;
  flex: 1;
}

.al-form-col,
.al-history-col {
  min-width: 0;
}

.al-form-card,
.al-history-card {
  background: #fffdf9;
  border: 1px solid #e0c98a;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(75, 53, 28, 0.06);
  overflow: hidden;
}

.al-form-card {
  padding: 18px;
}

.al-drafting-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.al-form-card--standard {
  max-width: 1040px;
}

.al-form-card--template {
  max-width: 1100px;
}

.al-form-content {
  min-width: 0;
}

.al-form-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fbf6ee 0%, #f5ecdf 100%);
  border: 1px solid #ead7b7;
  border-radius: 12px;
}

.al-form-intro-kicker {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9b7b43;
}

.al-form-intro-title {
  font-family: var(--font-primary);
  font-size: 20px;
  color: #2b1b0e;
}

.al-form-intro-copy {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #735f45;
}

.al-form-card--standard .al-form-intro {
  max-width: 720px;
  margin-left: 0;
  margin-right: 0;
}

.al-template-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
  padding: 14px 16px;
  background: #fcf8f1;
  border: 1px solid #eadcc3;
  border-radius: 12px;
  position: sticky;
  top: 88px;
}

.al-template-bar-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.al-template-bar-title {
  font-family: var(--font-primary);
  font-size: 16px;
  color: #2f1f11;
}

.al-template-bar-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  color: #8a7356;
}

.al-template-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.al-template-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #d7be8f;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbf2de, #ecd9ae);
  color: #5a3d1f;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast), filter var(--motion-fast);
}

.al-template-chip:hover {
  background: linear-gradient(145deg, #fbeac5, #e5c27d);
  border-color: #c9a968;
  transform: translateY(-1px);
  filter: brightness(1.01);
}

.al-template-chip--active {
  background: linear-gradient(145deg, #e8c986, #d7af62);
  border-color: #b98d44;
  color: #3e2a12;
  box-shadow: 0 6px 16px rgba(169, 127, 52, 0.18), inset 0 1px 0 rgba(255,255,255,0.45);
}

.al-template-chip-name,
.al-template-chip-meta,
.al-template-empty {
  font-family: 'Source Sans 3', sans-serif;
}

.al-template-chip-name {
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.al-template-chip-meta {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(90, 61, 31, 0.1);
}

.al-template-chip--active .al-template-chip-meta {
  background: rgba(62, 42, 18, 0.1);
}

.al-template-empty {
  font-size: 12px;
  color: #8a7356;
  padding: 8px 0 2px;
}

.al-section {
  border-color: #e7d8be;
  border-radius: 12px;
  margin-bottom: 12px;
}

.al-section-head {
  background: #faf5ed;
  padding: 13px 16px;
}

.al-section-title {
  font-size: 15px;
}

.al-section-body {
  padding: 16px;
  gap: 12px;
}

.al-form-card--standard .al-section {
  max-width: 720px;
  margin-left: 0;
  margin-right: 0;
}

.al-form-row {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
}

.al-label,
.al-input,
.al-history-table,
.al-history-empty,
.al-result {
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
}

.al-input {
  min-height: 38px;
  border-color: #ddd2bf;
  background: #fffdfa;
}

.al-input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(224, 201, 138, 0.18);
}

.al-history-overlay {
  background: rgba(30, 20, 10, 0.38);
  backdrop-filter: blur(4px);
}

.al-history-modal {
  width: min(92vw, 760px);
  max-height: min(84vh, 820px);
  overflow: hidden;
  position: relative;
  margin: 6vh auto 0;
  background: #fffaf4;
  border: 1px solid #e0c98a;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.al-history-modal-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid #eadcc3;
}

.al-history-modal-title {
  font-family: var(--font-primary);
  font-size: 20px;
  color: #2f1f11;
}

.al-history-modal-sub {
  margin-top: 4px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  color: #8a7356;
}

.al-history-modal-body {
  padding: 14px 18px 18px;
  max-height: calc(min(84vh, 820px) - 86px);
  overflow: auto;
}

.al-history-list-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.al-history-row {
  display: block;
  padding: 14px 16px;
  border: 1px solid #e8d9bc;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf9 0%, #fbf4e8 100%);
  color: #4a3720;
  text-decoration: none;
  transition: transform var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast);
}

.al-history-row:hover {
  transform: translateY(-1px);
  border-color: #d6b36c;
  box-shadow: 0 8px 20px rgba(120, 92, 41, 0.08);
}

.al-history-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.al-history-row-title {
  font-family: var(--font-primary);
  font-size: 16px;
  color: #352313;
}

.al-history-row-date {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  color: #9a815f;
}

.al-history-row-meta,
.al-history-row-flat {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  color: #6a563c;
}

.al-history-row-meta {
  margin-top: 6px;
}

.al-history-row-flat {
  margin-top: 3px;
}

.al-generate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(224, 201, 138, 0.55);
}

.al-result {
  flex: 1;
  min-height: 20px;
}

.al-book-tabs {
  background: #f7efe0;
}

.al-book-tab {
  color: #876c45;
}

.al-book-tab--active {
  background: linear-gradient(145deg, #ead5ac, #d6b881);
  color: #4a3218;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 4px 12px rgba(120, 92, 41, 0.12);
}

.al-book-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.al-book-top {
  margin-bottom: 16px;
}

.al-book-subhead {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #7b674c;
  margin-top: 4px;
}

.al-book-layout--form-only {
  display: block;
  min-height: 0;
}

.al-book-left--full {
  padding-right: 0;
  border-right: none;
  max-height: none;
  overflow: visible;
  position: static;
}

.al-book-fields--form .al-acc-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.al-book-fields--form .al-section {
  margin-bottom: 0;
}

.al-book-fields--form .al-section-head {
  padding: 14px 16px;
}

.al-book-fields--form .al-section-title {
  font-size: 15px;
}

.al-book-fields--form .al-acc-body {
  background: #fffdfa;
}

.al-book-fields--form .al-form-row {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.al-book-fields--form .al-form-row:last-child {
  margin-bottom: 0;
}

.al-book-fields--form .al-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #6c5538;
}

.al-book-fields--form .al-input,
.al-book-fields--form .al-input-wrap,
.al-book-fields--form .al-pill-group {
  width: 100%;
}

.al-book-fields--form .al-pill-group {
  padding-top: 2px;
}

.al-doc-page {
  font-size: 9.5pt;
  line-height: 1.58;
  font-weight: 400;
}

.doc-page {
  font-weight: 400;
}

.doc-para,
.doc-table td,
.doc-table--header td {
  font-weight: 400;
}

.doc-h {
  font-weight: 700;
}

.doc-var--filled {
  font-weight: 400;
}

.al-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #d2b47c;
  border-radius: 999px;
  background: linear-gradient(145deg, #ead5ac, #d6b881);
  color: #4a3218;
  font-family: var(--font-primary);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: background var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast), filter var(--motion-fast);
}

.al-generate-btn:hover {
  background: linear-gradient(145deg, #ecd8b1, #d8bc88);
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 12px 25px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

.al-generate-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 980px) {
  .al-main-card {
    padding: 20px 18px 18px;
  }

  .al-drafting-layout {
    grid-template-columns: 1fr;
  }

  .al-template-bar {
    position: static;
  }

  .al-template-selector {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .al-template-chip {
    width: auto;
    border-radius: 999px;
  }
}

@media (max-width: 640px) {
  .al-page {
    padding: 74px 10px 18px;
  }

  .al-main-card {
    padding: 16px 14px;
    border-radius: 16px;
  }

  .al-header {
    flex-direction: column;
    align-items: stretch;
  }

  .al-header-btn {
    width: 100%;
    justify-content: center;
  }

  .al-form-card {
    padding: 14px;
  }

  .al-template-bar {
    padding: 12px;
  }

  .al-form-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .al-generate-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .al-generate-btn {
    justify-content: center;
    width: 100%;
  }
}
