/* VedAnshu Properties brand for Django Admin (loaded by templates/admin/base_site.html).
   Same palette and type as the website: deep maroon, antique gold, warm cream; Cormorant Garamond / Georgia for
   headings, DM Sans / Arial for text. Only Django's own colour variables and a few layout details are changed, so
   every admin page and the property media manager pick the brand up automatically. */

:root, html[data-theme="light"] {
  --brand-maroon: #410a10;
  --brand-wine: #6b1424;
  --brand-gold: #b08a4a;
  --brand-gold-deep: #84622c;
  --brand-cream: #faf4e8;
  --brand-line: #e6d6b8;
  --brand-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --primary: #6b1424;
  --secondary: #410a10;
  --accent: #e6c98d;
  --primary-fg: #fffaf0;
  --caption-fg: #fffaf0; /* text on the maroon caption bars */

  --body-fg: #2c1a1d;
  --body-bg: #fffdf8;
  --body-quiet-color: #76655f;
  --body-medium-color: #4d3a3c;
  --body-loud-color: #1f0c0f;

  --header-color: #6b5a52;
  --header-branding-color: #410a10;
  --header-bg: #ffffff;
  --header-link-color: #6b1424;

  --breadcrumbs-fg: #e9d7b2;
  --breadcrumbs-link-fg: #ffffff;
  --breadcrumbs-bg: #410a10;

  --link-fg: #7a1a2b;
  --link-hover-color: #410a10;
  --link-selected-fg: #84622c;

  --hairline-color: #efe4cf;
  --border-color: #ddc9a6;

  --error-fg: #b3261e;
  --message-success-bg: #eef3e3;
  --message-warning-bg: #fbf0d6;
  --message-error-bg: #fbe6e3;

  --darkened-bg: #faf4e8;
  --selected-bg: #f3e5c8;
  --selected-row: #fbf3df;

  --button-fg: #fffaf0;
  --button-bg: #6b1424;
  --button-hover-bg: #410a10;
  --default-button-bg: #410a10;
  --default-button-hover-bg: #2a0509;
  --close-button-bg: #8a7a72;
  --close-button-hover-bg: #5f514b;
  --delete-button-bg: #b3261e;
  --delete-button-hover-bg: #8c1d17;

  --object-tools-fg: #fffaf0;
  --object-tools-bg: #84622c;
  --object-tools-hover-bg: #410a10;

  --font-family-primary: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, 'Noto Sans Devanagari', sans-serif;
  color-scheme: light;
}

/* Dark mode: Django's theme switch (auto follows the device). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #c9a46a;
    --secondary: #2a0a0f;
    --accent: #e6c98d;
    --primary-fg: #1b0c0e;
    --caption-fg: #f3dfb4;
    --body-fg: #f1e6d6;
    --body-bg: #1b1112;
    --body-quiet-color: #b8a698;
    --body-medium-color: #dccbb8;
    --body-loud-color: #fff6e8;
    --header-color: #d9c4a3;
    --header-branding-color: #f3dfb4;
    --header-bg: #2a0a0f;
    --header-link-color: #f3dfb4;
    --breadcrumbs-fg: #c9b08a;
    --breadcrumbs-link-fg: #f3dfb4;
    --breadcrumbs-bg: #3a0d14;
    --link-fg: #e6c98d;
    --link-hover-color: #fff1d4;
    --link-selected-fg: #f3dfb4;
    --hairline-color: #3a2a2b;
    --border-color: #5a4440;
    --error-fg: #ff9b8f;
    --message-success-bg: #24301c;
    --message-warning-bg: #3a2f14;
    --message-error-bg: #3d1b18;
    --darkened-bg: #241718;
    --selected-bg: #3a2a1c;
    --selected-row: #2e2117;
    --button-fg: #1b0c0e;
    --button-bg: #c9a46a;
    --button-hover-bg: #e6c98d;
    --default-button-bg: #e6c98d;
    --default-button-hover-bg: #f3dfb4;
    --object-tools-fg: #1b0c0e;
    --object-tools-bg: #c9a46a;
    --object-tools-hover-bg: #f3dfb4;
    color-scheme: dark;
  }
}
html[data-theme="dark"] {
  --primary: #c9a46a;
  --secondary: #2a0a0f;
  --accent: #e6c98d;
  --primary-fg: #1b0c0e;
  --caption-fg: #f3dfb4;
  --body-fg: #f1e6d6;
  --body-bg: #1b1112;
  --body-quiet-color: #b8a698;
  --body-medium-color: #dccbb8;
  --body-loud-color: #fff6e8;
  --header-color: #d9c4a3;
  --header-branding-color: #f3dfb4;
  --header-bg: #2a0a0f;
  --header-link-color: #f3dfb4;
  --breadcrumbs-fg: #c9b08a;
  --breadcrumbs-link-fg: #f3dfb4;
  --breadcrumbs-bg: #3a0d14;
  --link-fg: #e6c98d;
  --link-hover-color: #fff1d4;
  --link-selected-fg: #f3dfb4;
  --hairline-color: #3a2a2b;
  --border-color: #5a4440;
  --error-fg: #ff9b8f;
  --message-success-bg: #24301c;
  --message-warning-bg: #3a2f14;
  --message-error-bg: #3d1b18;
  --darkened-bg: #241718;
  --selected-bg: #3a2a1c;
  --selected-row: #2e2117;
  --button-fg: #1b0c0e;
  --button-bg: #c9a46a;
  --button-hover-bg: #e6c98d;
  --default-button-bg: #e6c98d;
  --default-button-hover-bg: #f3dfb4;
  --object-tools-fg: #1b0c0e;
  --object-tools-bg: #c9a46a;
  --object-tools-hover-bg: #f3dfb4;
  color-scheme: dark;
}

/* Header: white bar with the logo, like the website's inner pages; a thin gold rule underneath. */
#header { padding: 14px 40px; border-bottom: 3px solid var(--brand-gold); box-shadow: 0 6px 24px #410a1012; }
#site-name { margin: 0; }
#site-name a.brand-link { display: inline-flex; align-items: center; gap: 18px; text-decoration: none; }
.brand-logo { display: block; height: 58px; width: auto; }
.brand-logo-dark { display: none; border-radius: 6px; }
.brand-label { padding-left: 18px; border-left: 1px solid var(--brand-line); font-family: var(--brand-serif);
  font-size: 22px; font-weight: 500; letter-spacing: .01em; color: var(--header-branding-color); white-space: nowrap; }
#user-tools { font-size: 12px; letter-spacing: .06em; color: var(--header-color); }
#user-tools a, #logout-form button { color: var(--header-link-color); border-bottom-color: #b08a4a66; }
#user-tools a:hover, #logout-form button:hover { color: var(--brand-gold-deep); }
html[data-theme="dark"] .brand-logo-light { display: none; }
html[data-theme="dark"] .brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .brand-logo-light { display: none; }
  html:not([data-theme="light"]) .brand-logo-dark { display: block; }
  :root:not([data-theme="light"]) .brand-label { border-left-color: #5a4440; }
}

/* Breadcrumbs: the maroon band. */
div.breadcrumbs { padding: 12px 40px; font-size: 13px; letter-spacing: .02em; }
div.breadcrumbs a { text-decoration: underline; text-decoration-color: #e6c98d80; text-underline-offset: 3px; }

/* Typography: serif headings like the website. */
#content h1 { font-family: var(--brand-serif); font-size: 34px; font-weight: 500; color: var(--secondary); letter-spacing: -.01em; margin: 6px 0 22px; }
html[data-theme="dark"] #content h1 { color: var(--body-loud-color); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) #content h1 { color: var(--body-loud-color); } }
#content h2.subhead, #content > h2 { font-family: var(--brand-serif); font-weight: 500; }

/* Modules and fieldsets: cream cards with maroon caption bars. */
.module { border-radius: 12px; overflow: hidden; border: 1px solid var(--hairline-color); background: var(--body-bg); }
.module h2, .module caption, .inline-group h2 { background: var(--secondary); color: var(--caption-fg); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; font-size: 12px; padding: 10px 16px; }
.module h2 a, .module caption a, .module caption a.section:link, .module caption a.section:visited,
.inline-group h2 a { color: var(--caption-fg); }
.module caption a.section:hover { color: var(--accent); }
#nav-sidebar .current-app .section:link, #nav-sidebar .current-app .section:visited { color: var(--accent); }
/* Fieldset titles inside a form: quiet cream band with maroon text. */
fieldset.module h2.fieldset-heading, fieldset.module > h2 { background: var(--darkened-bg); color: var(--secondary);
  border-bottom: 1px solid var(--hairline-color); }
html[data-theme="dark"] fieldset.module h2.fieldset-heading, html[data-theme="dark"] fieldset.module > h2 { color: var(--accent); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) fieldset.module h2.fieldset-heading, html:not([data-theme="light"]) fieldset.module > h2 { color: var(--accent); }
}
fieldset.module { margin-bottom: 22px; box-shadow: 0 10px 30px #410a100a; }
.module.collapse > details > summary, fieldset.collapse summary { cursor: pointer; }
.aligned label { color: var(--body-medium-color); }

/* Inputs */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=tel],
input[type=search], input[type=date], input[type=month], textarea, select, .vTextField, .vURLField, .vIntegerField {
  border: 1px solid var(--border-color); border-radius: 8px; padding: 7px 10px; background: var(--body-bg); }
select { padding: 4px 8px; height: auto; min-height: 34px; line-height: 1.4; }
input:focus, textarea:focus, select:focus { border-color: var(--brand-gold); outline: 2px solid #b08a4a40; outline-offset: 1px; }

/* Buttons */
.button, input[type=submit], input[type=button], .submit-row input, a.button { border-radius: 999px; padding: 10px 20px;
  font-weight: 600; letter-spacing: .02em; transition: background .2s, transform .2s; }
.button.default, input[type=submit].default, .submit-row input.default { box-shadow: 0 8px 20px #410a1026; }
.submit-row { background: var(--darkened-bg); border: 1px solid var(--hairline-color); border-radius: 12px; padding: 14px 16px; }
.submit-row a.deletelink { border-radius: 999px; padding: 10px 18px; }
.object-tools a:link, .object-tools a:visited { border-radius: 999px; letter-spacing: .06em; }

/* Change lists */
#changelist .results { border-radius: 12px; border: 1px solid var(--hairline-color); }
#result_list thead th { background: var(--darkened-bg); color: var(--body-medium-color); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
#result_list tbody tr:hover { background: var(--selected-row); }
#changelist-search, #changelist .actions { border-radius: 10px; }
#changelist-filter { border-radius: 12px; overflow: hidden; border: 1px solid var(--hairline-color); }
#changelist-filter h2 { background: var(--secondary); color: var(--caption-fg); }
#changelist-filter li.selected a { color: var(--link-selected-fg); font-weight: 600; }
.paginator { border-radius: 0 0 12px 12px; }

/* Side menu */
#nav-sidebar .current-model { background: var(--selected-row); }
#nav-sidebar .module caption, #nav-sidebar .module th { font-size: 12.5px; }

/* Messages */
ul.messagelist li { border-radius: 10px; margin-bottom: 8px; }

/* Login page */
body.login { background: radial-gradient(ellipse at 85% 0, #e9d3a6 0, transparent 55%), var(--brand-cream); }
html[data-theme="dark"] body.login { background: var(--body-bg); }
.login #container { border-radius: 16px; border: 1px solid var(--brand-line); box-shadow: 0 30px 70px #410a1022; overflow: hidden; width: min(440px, calc(100% - 32px)); }
.login #header { padding: 26px 30px 20px; justify-content: center; border-bottom-width: 2px; }
.login #site-name a.brand-link { flex-direction: column; gap: 10px; }
.login .brand-logo { height: 76px; }
.login .brand-label { border: 0; padding: 0; font-size: 18px; color: var(--body-quiet-color); }
.login #content { padding: 24px 30px 30px; }
.login .submit-row { background: none; border: 0; padding: 12px 0 0; }
.login .submit-row input { width: 100%; padding: 13px; }

/* Owner search results (templates/admin/owner_search.html). The dashboard itself is styled by admin_shell.css. */
.owner-search { max-width: 900px; }
.owner-search-form label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--body-loud-color); }
.owner-search-form div { display: flex; gap: 10px; flex-wrap: wrap; }
.owner-search-form input { flex: 1 1 280px; max-width: none; min-height: 44px; border-radius: 999px; padding: 0 18px; font-size: 15px; }
.owner-search-hint { color: var(--body-quiet-color); margin: 18px 0; }
.owner-search-results { margin-top: 22px; }
.owner-search-results h2 span { font-weight: 400; opacity: .8; }
.owner-search-results ul { list-style: none; margin: 0; padding: 0; }
.owner-search-results li { list-style: none; display: grid; gap: 2px; padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--hairline-color); }
.owner-search-results li:last-child { border-bottom: 0; }
.owner-search-results li a { font-weight: 600; }
.owner-search-results li span { color: var(--body-quiet-color); font-size: 13px; overflow-wrap: anywhere; }

/* Tablet and phone sizes for the brand elements (layout fixes are in admin_responsive.css). */
@media (max-width: 1024px) {
  #header { padding: 12px 24px; }
  div.breadcrumbs { padding: 10px 24px; }
  .brand-logo { height: 48px; }
}
@media (max-width: 767px) {
  #header { padding: 12px 16px; gap: 8px; }
  #site-name a.brand-link { gap: 12px; }
  .brand-logo { height: 40px; }
  .brand-label { font-size: 17px; padding-left: 12px; }
  #content h1 { font-size: 27px; }
}
@media (max-width: 420px) {
  .brand-label { display: none; }
}
