/* ─────────────────────────────────────────────────
   Admin custom styles — overrides Administrate defaults
   Matches the public site design system
───────────────────────────────────────────────── */

:root {
  --bg:        #F7F3EE;
  --surface:   #FFFFFF;
  --surface-2: #EDE7DC;
  --ink:       #1A1714;
  --ink-soft:  #4A4540;
  --muted:     #8C847C;
  --border:    #E4DDD4;

  --terra:       #C05A28;
  --terra-light: #F5E0D4;
  --ocean:       #2870A5;
  --sage:        #4B7855;
  --sage-light:  #D5EAD8;
  --coral:       #CC5840;
  --coral-light: #FAE0D8;
  --navy:        #1A2E44;
  --navy-mid:    #243d5e;
  --navy-light:  #CFDAE8;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif !important;
  background: var(--bg) !important;
  color: var(--ink) !important;
  -webkit-font-smoothing: antialiased;
}

/* ── APP CONTAINER ── */
.app-container {
  display: block !important;
  padding: 0 !important;
  max-width: 100% !important;
  min-height: 100vh;
  background: var(--bg);
}

/* ── SIDEBAR NAVIGATION — fixed, independent of flex ── */
.navigation {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  overflow-y: auto;
  background: var(--navy) !important;
  display: flex !important;
  flex-direction: column;
  padding: 1.5rem 0 1rem !important;
  z-index: 100;
  /* override all Administrate flex properties */
  flex: none !important;
}

.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #F7F3EE;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.nav-spacer { flex: 1; }

.nav-back, .nav-signout {
  font-size: 0.78rem !important;
  color: rgba(247,243,238,0.4) !important;
  border-left-color: transparent !important;
  background: none !important;
}
.nav-back:hover, .nav-signout:hover {
  color: rgba(247,243,238,0.7) !important;
  background: none !important;
}


.navigation__link {
  display: block;
  padding: 0.55rem 1.25rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(247,243,238,0.72) !important;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  margin: 0.05rem 0;
}

.navigation__link:hover {
  color: #F7F3EE !important;
  background: rgba(255,255,255,0.08);
}

.navigation__link--active {
  color: #F7F3EE !important;
  border-left-color: var(--terra) !important;
  background: rgba(192,90,40,0.18);
}


/* ── MAIN CONTENT AREA ── */
.main-content {
  margin-left: 220px !important;
  min-width: 0 !important;
  background: var(--bg) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding-bottom: 2rem !important;
  /* override Administrate flex child properties */
  flex: none !important;
}

/* ── PAGE HEADER ── */
.main-content__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 1rem;
}

.main-content__page-title {
  font-family: 'Fraunces', serif !important;
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: var(--navy) !important;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ── SEARCH BAR ── */
.search-form {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
}

.search-form input[type="search"] {
  font-family: 'Nunito', sans-serif;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.45rem 0.9rem;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.875rem;
}
.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(192,90,40,0.1);
}

/* ── BODY SECTION ── */
.main-content__body {
  padding: 1.75rem 2rem;
  background: var(--surface);
  margin: 1.5rem 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(26,23,20,0.05);
}

.main-content__body--flush {
  padding: 0;
  overflow: hidden;
}

/* ── TABLES ── */
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}

thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cell-label {
  font-family: 'Nunito', sans-serif !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
  padding: 0.75rem 1.1rem !important;
  text-align: left;
  white-space: nowrap;
}

.cell-value {
  padding: 0.85rem 1.1rem !important;
  color: var(--ink-soft) !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 0.875rem !important;
  vertical-align: middle;
}

tbody tr:last-child .cell-value {
  border-bottom: none !important;
}

tbody tr:hover .cell-value {
  background: var(--bg);
}

/* Table row links */
tbody tr[data-url] { cursor: pointer; }

/* ── FLASHES ── */
.flash {
  padding: 0.75rem 1.1rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}
.flash-notice, .flash-alert { padding: 0.75rem 2rem; font-family: 'Nunito', sans-serif; font-size: 0.875rem; font-weight: 600; }
.flash-notice { background: var(--sage-light); color: var(--sage); }
.flash-alert  { background: var(--coral-light); color: var(--coral); }
.flash-error  { background: var(--coral-light); color: var(--coral); font-size: 0.82rem; }

/* ── BUTTONS ── */
.button {
  font-family: 'Nunito', sans-serif !important;
  font-weight: 700 !important;
  font-size: 0.845rem !important;
  padding: 0.5rem 1.1rem !important;
  border-radius: 7px !important;
  border: none !important;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  background: var(--terra) !important;
  color: white !important;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.button:hover { opacity: 0.88; transform: translateY(-1px); color: white !important; }
.button:active { transform: translateY(0); }

.button--alt {
  background: var(--surface-2) !important;
  color: var(--ink-soft) !important;
}
.button--alt:hover { opacity: 0.8; color: var(--ink-soft) !important; }

.button--danger {
  background: var(--coral) !important;
  color: white !important;
}

/* ── FORM FIELDS ── */
.form {
  max-width: 640px;
}

.field-unit {
  margin-bottom: 1.1rem;
}

.field-unit__label, label {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
textarea,
select {
  font-family: 'Nunito', sans-serif !important;
  font-size: 0.9rem !important;
  color: var(--ink) !important;
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 7px !important;
  padding: 0.55rem 0.8rem !important;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: var(--terra) !important;
  box-shadow: 0 0 0 3px rgba(192,90,40,0.1) !important;
}

textarea { min-height: 90px; resize: vertical; }

select { appearance: auto; }

input[type="checkbox"] { accent-color: var(--terra); width: 1rem; height: 1rem; }

.form-actions {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

/* ── ERRORS ── */
#error_explanation {
  background: var(--coral-light);
  border: 1px solid #f5bdb5;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--coral);
}
#error_explanation h2 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.5rem; }
#error_explanation li { margin-left: 1.25rem; margin-bottom: 0.25rem; }

/* ── PAGINATION ── */
.pagination {
  padding: 1rem 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.pagination a {
  color: var(--terra);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}
.pagination a:hover { background: var(--terra-light); }
.pagination .current {
  font-weight: 700;
  color: var(--ink);
  padding: 0.2rem 0.5rem;
}

/* ── ATTRIBUTE DATA (show pages) ── */
.attribute-label {
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
  font-family: 'Nunito', sans-serif !important;
  padding: 0.5rem 0 0.15rem;
}

.attribute-data {
  font-size: 0.9rem !important;
  color: var(--ink-soft) !important;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  font-family: 'Nunito', sans-serif !important;
}

/* Fieldset (grouped attributes) */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.75rem;
  padding: 0;
}

/* ── MISC ── */
a { text-decoration: none; }

.main-content__body dl { display: block; }

/* Collection item actions */
.collection-actions, .resource-actions {
  display: flex;
  gap: 0.4rem;
}
