/*
 * Pretty Stocked — dark/gold admin theme
 * Overrides Django admin CSS custom properties (Django 4.2+)
 */

:root,
html[data-theme="light"],
html[data-theme="dark"] {
  --primary: #c9a84c;
  --secondary: #b8963c;
  --accent: #e5c876;
  --primary-fg: #000;

  --body-fg: #d0d0d0;
  --body-bg: #0d0d0d;
  --body-quiet-color: #888;
  --body-loud-color: #fff;

  --header-color: #e0e0e0;
  --header-branding-color: #c9a84c;
  --header-bg: #111111;
  --header-link-color: #c9a84c;

  --breadcrumbs-fg: #aaa;
  --breadcrumbs-link-fg: #c9a84c;
  --breadcrumbs-bg: #161616;

  --link-fg: #c9a84c;
  --link-hover-color: #e5c876;
  --link-selected-fg: #c9a84c;

  --hair-line-color: #2a2a2a;
  --border-color: #2a2a2a;

  --error-fg: #ff6b6b;

  --message-success-bg: #0c1f0c;
  --message-warning-bg: #1a1200;
  --message-error-bg: #1a0808;

  --darkened-bg: #141414;
  --selected-bg: #1c1c1c;
  --selected-row: rgba(201,168,76,.07);

  --button-fg: #000;
  --button-bg: #c9a84c;
  --button-hover-bg: #e5c876;
  --default-button-bg: #b8963c;
  --default-button-hover-bg: #c9a84c;
  --close-button-bg: #2a2a2a;
  --close-button-hover-bg: #3a3a3a;
  --delete-button-bg: #7a1515;
  --delete-button-hover-bg: #a41515;

  --object-tools-fg: #c9a84c;
  --object-tools-bg: #1a1a1a;
  --object-tools-hover-bg: #242424;
}

/* ── Layout ── */
body { background: var(--body-bg); }

/* ── Header ── */
#header {
  background: #111;
  border-bottom: 1px solid rgba(201,168,76,0.28);
  box-shadow: 0 2px 12px rgba(0,0,0,.6);
}
#header a:link, #header a:visited { color: #c9a84c; }
#header a:hover { color: #e5c876; }

#site-name a { color: #c9a84c; text-decoration: none; }

/* ── Nav / breadcrumbs ── */
div.breadcrumbs {
  background: #141414;
  border-bottom: 1px solid #1e1e1e;
  color: #888;
}
div.breadcrumbs a { color: #c9a84c; }

/* ── Main content area ── */
#content-main { background: transparent; }
#content { background: var(--body-bg); }
.colM #content { background: var(--body-bg); }
.dashboard #content { background: var(--body-bg); }

/* ── Module headers ── */
.module h2, .module caption, .inline-group h2 {
  background: #181818;
  color: #c9a84c;
  border-bottom: 1px solid #2a2a2a;
}

/* ── Tables ── */
#changelist table { border-color: #222; }
#changelist table thead th {
  background: #161616;
  color: #c9a84c;
  border-bottom: 2px solid #2a2a2a;
}
#changelist table thead th a { color: #c9a84c; }
#changelist table thead th.sorted a { color: #e5c876; }
#changelist table tbody tr { background: #0f0f0f; }
#changelist table tbody tr:nth-child(even) { background: #121212; }
#changelist table tbody tr:hover { background: #1a1a1a; }
#changelist table tbody td { border-bottom: 1px solid #1e1e1e; color: #ccc; }
#changelist table tfoot { background: #141414; }

/* row selection highlight */
#changelist table tbody tr.selected { background: rgba(201,168,76,.09); }

/* ── Filters (sidebar) ── */
#changelist-filter { background: #121212; border-left: 1px solid #1e1e1e; }
#changelist-filter h2 { color: #c9a84c; background: #161616; border-bottom: 1px solid #222; }
#changelist-filter h3 { color: #999; border-bottom: 1px solid #1e1e1e; }
#changelist-filter ul li a { color: #aaa; }
#changelist-filter ul li a:hover { color: #c9a84c; }
#changelist-filter ul li.selected a { color: #c9a84c; font-weight: 700; }

/* ── Search bar ── */
#toolbar { background: #141414; border-bottom: 1px solid #1e1e1e; }
#searchbar { background: #1a1a1a; border: 1px solid #2a2a2a; color: #d0d0d0; border-radius: 6px; }
#searchbar:focus { border-color: #c9a84c; outline: none; }

/* ── Forms & Inputs ── */
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="number"], input[type="tel"], select, textarea {
  background: #181818 !important;
  color: #d0d0d0 !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 5px;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="number"]:focus, select:focus, textarea:focus {
  border-color: #c9a84c !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(201,168,76,.2) !important;
}

.form-row { border-bottom: 1px solid #1e1e1e; }
.form-row label { color: #999; }
.help { color: #666; }

/* ── Fieldsets ── */
fieldset { background: #0f0f0f; border: 1px solid #1e1e1e; border-radius: 6px; }
fieldset.collapsed { border-color: #1e1e1e; }
fieldset h2 { background: #161616; color: #c9a84c; border-bottom: 1px solid #1e1e1e; }
fieldset.collapse h2 { background: #161616; }

/* ── Action buttons / object tools ── */
ul.object-tools a {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #c9a84c;
}
ul.object-tools a:hover { background: #222; border-color: #c9a84c; }

.object-tools a.addlink { color: #c9a84c; }
.object-tools a.changelink { color: #c9a84c; }

/* ── Submit row ── */
.submit-row {
  background: #141414;
  border-top: 1px solid #1e1e1e;
  padding: 0.75rem 1rem;
}
.submit-row input[type="submit"],
.submit-row button[type="submit"] {
  background: #c9a84c;
  border: none;
  color: #000;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.45rem 1.25rem;
  cursor: pointer;
}
.submit-row input[type="submit"]:hover { background: #e5c876; }
.submit-row .deletelink { color: #ff6b6b !important; }
.submit-row .closelink { color: #888; }

/* ── Inline tables ── */
.inline-related { background: #0f0f0f; border: 1px solid #1e1e1e; }
.inline-related h3 { background: #161616; color: #c9a84c; border-bottom: 1px solid #1e1e1e; }
.tabular td { border-color: #1e1e1e; color: #ccc; }
.tabular thead th { background: #161616; color: #c9a84c; border-color: #222; }

/* ── Pagination ── */
.paginator { background: #141414; border-top: 1px solid #1e1e1e; color: #888; }
.paginator a { color: #c9a84c; }
.paginator a.showall { color: #c9a84c; }
.paginator .this-page { color: #e5c876; font-weight: 700; }

/* ── Dashboard app index ── */
#content-related { background: #111; border-left: 1px solid #1e1e1e; }
#content-related .module h2 { background: #161616; }
#content-related .module h3 { background: #141414; color: #c9a84c; border-bottom: 1px solid #1e1e1e; }
#content-related .module table td a { color: #c9a84c; }

/* ── Login page ── */
body.login { background: #0d0d0d; }
body.login #header { display: block; }
body.login #container { background: transparent; }
#login-form { background: #111; border: 1px solid #222; border-radius: 10px; padding: 1.5rem; }

/* ── Messages ── */
ul.messagelist li.success { background: #0c1f0c; border-left: 4px solid #28a745; color: #8bc98b; }
ul.messagelist li.warning { background: #1a1200; border-left: 4px solid #fd7e14; color: #d4a657; }
ul.messagelist li.error   { background: #1a0808; border-left: 4px solid #dc3545; color: #e88; }

/* ── Calendar / date picker ── */
.calendarbox { background: #1a1a1a; border: 1px solid #2a2a2a; }
.calendar caption { background: #161616; color: #c9a84c; }
.calendar td a { color: #ccc; }
.calendar td a:hover { background: rgba(201,168,76,.15); color: #c9a84c; }
.calendar td.selected a { background: #c9a84c; color: #000; }

/* ── Select2 / chosen ── */
.help-block { color: #666; }

/* ── Action checkboxes ── */
#action-toggle { accent-color: #c9a84c; }
input[type="checkbox"] { accent-color: #c9a84c; }

/* ── Related object links ── */
.related-widget-wrapper-link img { filter: brightness(0) invert(0.7); }

/* ── Topmenu (if used) ── */
#user-tools a { color: #c9a84c; }
#user-tools a:hover { color: #e5c876; }
#user-tools { color: #888; }
