:root {
  --iy-bg: #101010;
  --iy-panel: #1a1a1a;
  --iy-panel-soft: #222;
  --iy-text: #f0ede7;
  --iy-muted: #b5ad9f;
  --iy-gold: #d8b36a;
  --iy-gold-bright: #f1d28d;
  --iy-border: #3a3327;
}

html, body, #container, #main, #content, #content-main, #content-related,
#nav-sidebar, .main, .content, .colMS, .colSM, .colM {
  background: var(--iy-bg) !important;
  color: var(--iy-text);
}
.login { background: var(--iy-bg); color: var(--iy-text); }
.login #container { background: var(--iy-panel); border: 1px solid var(--iy-border); border-radius: 12px; box-shadow: 0 18px 60px #0008; }
.login #header { background: #090909; color: var(--iy-text); border-bottom: 1px solid var(--iy-border); justify-content: flex-start; }
.login #content { background: var(--iy-panel); color: var(--iy-text); }
.login #login-form .submit-row input[type="submit"] {
  display: block;
  width: 100%;
  min-height: 46px;
  background: #f0c46a !important;
  border: 1px solid #ffe0a0 !important;
  color: #17120a !important;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .12em;
  box-shadow: 0 5px 18px #d8b36a55;
}
.login #login-form .submit-row input[type="submit"]:hover,
.login #login-form .submit-row input[type="submit"]:focus {
  background: #ffdc91 !important;
  box-shadow: 0 0 0 3px #d8b36a44, 0 7px 22px #d8b36a66;
}
body, input, textarea, select, .button, input[type=submit] { font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
#header { background: #090909; color: var(--iy-text); border-bottom: 1px solid var(--iy-border); }
#branding h1, #branding h1 a:link, #branding h1 a:visited, #site-name a { color: var(--iy-gold-bright); }
#site-name { font-weight: 700; }
.yiyang-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; letter-spacing: .04em; }
.yiyang-brand small { color: var(--iy-muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.yiyang-brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--iy-gold); border-radius: 9px; color: var(--iy-gold-bright); font-size: 16px; }
#user-tools, #user-tools a { color: var(--iy-muted); }
#user-tools a[href$="/admin/password_change/"] {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--iy-gold);
  border-radius: 6px;
  color: var(--iy-gold-bright);
  font-weight: 700;
}
.iy-summary-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px !important;
  margin: 4px 0 14px;
  border: 1px solid #ffe0a0;
  border-radius: 8px;
  background: #f0c46a;
  color: #17120a !important;
  font-size: 15px;
  font-weight: 800 !important;
  box-shadow: 0 5px 18px #d8b36a44;
}
.iy-summary-link:hover { background: #ffdc91; color: #17120a !important; }
.dashboard #content-main .module td a:link,
.dashboard #content-main .module td a:visited {
  display: inline-block;
  padding: 7px 11px;
  border: 1px solid #725b30;
  border-radius: 6px;
  background: #302817;
  color: var(--iy-gold-bright) !important;
  font-weight: 700;
}
.dashboard #content-main .module td a:hover { background:#493a1e; border-color:var(--iy-gold); }
.iy-summary-page { max-width: 1200px; }
.iy-summary-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:8px 0 20px; }
.iy-summary-heading h1 { margin:0 0 6px; color:var(--iy-gold-bright); }
.iy-summary-heading p, .iy-summary-notes p { color:var(--iy-muted); }
.iy-summary-table-wrap { overflow-x:auto; border:1px solid var(--iy-border); border-radius:10px; }
.iy-summary-table { width:100%; border-collapse:collapse; background:var(--iy-panel); }
.iy-summary-table th, .iy-summary-table td { padding:14px 16px; border-bottom:1px solid var(--iy-border); text-align:left; white-space:nowrap; }
.iy-summary-table thead th { background:#252016; color:var(--iy-gold-bright); }
.iy-summary-table tbody tr:nth-child(even) { background:#202020; }
.iy-summary-table td { font-size:18px; font-weight:700; }
.iy-summary-notes { margin-top:20px; padding:8px 16px; border:1px solid var(--iy-border); border-radius:10px; background:var(--iy-panel); }
.iy-summary-notes h2 { color:var(--iy-gold-bright); }
.iy-order-counts { display:grid; grid-template-columns:repeat(4,minmax(130px,1fr)); gap:12px; margin-bottom:18px; }
.iy-order-counts div { display:flex; flex-direction:column; gap:8px; padding:16px; border:1px solid var(--iy-border); border-radius:10px; background:var(--iy-panel); }
.iy-order-counts span { color:var(--iy-muted); }
.iy-order-counts strong { color:var(--iy-gold-bright); font-size:26px; }
.iy-orders-table td { font-size:14px; font-weight:400; }
.iy-order-open { display:inline-block; padding:6px 10px; border:1px solid var(--iy-gold); border-radius:6px; background:#302817; color:var(--iy-gold-bright) !important; font-weight:700; }
@media (max-width: 767px) { .iy-order-counts { grid-template-columns:repeat(2,minmax(120px,1fr)); } }
#content-main .module caption,
#content-main .module h2 {
  font-size: 15px;
  padding: 12px 14px;
}
#content-main .module a:link,
#content-main .module a:visited {
  display: inline-block;
  color: var(--iy-gold-bright);
  font-weight: 700;
  padding: 5px 2px;
}
#user-tools a:hover, a:link, a:visited { color: var(--iy-gold); }
a:hover { color: var(--iy-gold-bright); }
div.breadcrumbs { background: #171512; color: var(--iy-muted); border-bottom: 1px solid var(--iy-border); }
div.breadcrumbs a { color: var(--iy-gold); }
#content, #content-main, #content-related { color: var(--iy-text); }
.module, .dashboard .module table, #changelist-filter, .selector, .inline-group { background: var(--iy-panel); border: 1px solid var(--iy-border); border-radius: 9px; overflow: hidden; }
.module, #nav-sidebar, #nav-sidebar .module, #nav-sidebar .module caption,
#nav-sidebar .module h2, #nav-sidebar .module h3, #nav-sidebar a,
.submit-row, .submit-row::before, .submit-row::after,
.form-row, .aligned .form-row, .paginator, #changelist .paginator {
  background-color: var(--iy-panel) !important;
  color: var(--iy-text) !important;
}
#nav-sidebar { border-right: 1px solid var(--iy-border) !important; }
#nav-sidebar a:link, #nav-sidebar a:visited { color: var(--iy-gold-bright) !important; }
#nav-sidebar a:hover, #nav-sidebar .current-model a { background: #302817 !important; color: #ffe3a5 !important; }
#nav-sidebar .current-app .section, #nav-sidebar .module caption,
#nav-sidebar .module h2, #nav-sidebar .module h3 { background: #252016 !important; color: var(--iy-gold-bright) !important; }
.module caption, .module h2, .module h3, #changelist-filter h2 { background: #252016; color: var(--iy-gold-bright); }
table thead th { background: #201d18; color: var(--iy-gold-bright); }
tr:nth-child(odd), .row1 { background: #191919; }
tr:nth-child(even), .row2 { background: #202020; }
td, th { border-color: var(--iy-border); }
fieldset, .form-row, .submit-row { border-color: var(--iy-border); }
.form-row, .aligned .form-row { background: transparent; }
label, .form-row label, .aligned label { color: var(--iy-text); }
input:not([type=checkbox]):not([type=radio]), textarea, select, .vTextField, .vLargeTextField { background: #111; color: var(--iy-text); border: 1px solid #554a36; border-radius: 6px; padding: 8px 10px; }
input:focus, textarea:focus, select:focus { border-color: var(--iy-gold); outline: 2px solid #d8b36a33; }
input[type=checkbox], input[type=radio] { accent-color: var(--iy-gold); }
.submit-row { border: 1px solid var(--iy-border) !important; border-radius: 8px; padding: 12px !important; }
.button, input[type=submit], input[type=button], .submit-row input, a.button, button { background: var(--iy-gold); border: 1px solid var(--iy-gold); color: #17120a !important; border-radius: 6px; font-weight: 700; padding: 8px 14px; }
.button:hover, input[type=submit]:hover, input[type=button]:hover, .submit-row input:hover, a.button:hover, button:hover { background: var(--iy-gold-bright); border-color: var(--iy-gold-bright); }
.deletelink, a.deletelink { color: #ff9d94 !important; }
.messagelist li { border-radius: 7px; }
.messagelist li.success { background: #17271b; color: #c6edcd; }
.messagelist li.warning { background: #2c2415; color: #f1d28d; }
.messagelist li.error { background: #301c1b; color: #ffc5bd; }
.help, p.help, form p.help, div.help { color: var(--iy-muted); }
#changelist .paginator, .paginator { color: var(--iy-muted); }
.object-tools a:link, .object-tools a:visited { background: var(--iy-gold); color: #17120a; border-radius: 6px; }
.iy-badge { display:inline-block; padding:5px 9px; border-radius:999px; font-size:12px; font-weight:800; white-space:nowrap; }
.iy-badge-insurance { color:#241906; background:#f4cd79; border:1px solid #ffe3a5; }
.iy-badge-deposit { color:#2b261c; background:#e1d3ad; border:1px solid #f0e3bf; }
/* Make the operations workspace read as a set of clear sections instead of one long form. */
body:not(.login) #nav-sidebar,
body:not(.login) #nav-sidebar .module,
body:not(.login) #nav-sidebar .module caption,
body:not(.login) #nav-sidebar .module h2,
body:not(.login) #nav-sidebar .module h3 {
  background:#171717 !important;
  color:var(--iy-text) !important;
}
body:not(.login) #nav-sidebar { border-right:1px solid var(--iy-border) !important; }
body:not(.login) #nav-sidebar .current-app .section,
body:not(.login) #nav-sidebar .module caption,
body:not(.login) #nav-sidebar .module h2,
body:not(.login) #nav-sidebar .module h3 {
  background:#252016 !important;
  color:var(--iy-gold-bright) !important;
}
.change-form #content-main { max-width:1500px; }
.change-form .module,
.change-form .inline-group {
  margin:0 0 22px;
  border:1px solid #4a4030;
  border-radius:12px;
  box-shadow:0 8px 24px #0002;
}
.change-form .module h2,
.change-form .inline-group h2 {
  padding:14px 18px !important;
  border-bottom:1px solid #51452f;
  background:linear-gradient(105deg,#2a2418,#1a1a1a) !important;
  color:var(--iy-gold-bright) !important;
  font-size:16px !important;
  letter-spacing:.02em;
}
.change-form .module fieldset,
.change-form .inline-group .inline-related {
  padding:8px 0;
}
.change-form .form-row,
.change-form .aligned .form-row {
  padding:12px 16px !important;
  border-bottom:1px solid #302b22;
}
.change-form .form-row:last-child { border-bottom:0; }
.change-form .aligned label,
.change-form .form-row label {
  color:#eee8dd !important;
  font-weight:650;
}
.change-form .form-row .help,
.change-form .form-row p.help { margin:6px 0 0; color:#bdb4a5 !important; }
.change-form input:not([type=checkbox]):not([type=radio]),
.change-form select,
.change-form textarea {
  max-width:100%;
  box-sizing:border-box;
}
.change-form textarea.vLargeTextField { min-height:145px; }
.change-form .inline-group { margin-top:28px; }
.change-form .inline-group .inline-related { background:#191919; }
.change-form .inline-group .inline-related h3 {
  margin:0;
  padding:12px 16px;
  background:#211d16 !important;
  color:var(--iy-gold-bright) !important;
}
.change-form .submit-row {
  position:sticky;
  bottom:8px;
  z-index:5;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:18px 0 12px;
  padding:12px 16px !important;
  background:#1b1a17 !important;
  box-shadow:0 8px 28px #0009;
}
.change-form .submit-row input { margin:0 !important; }
#content-main .module .addlink,
#content-main .module .changelink {
  padding:6px 10px;
  border-radius:6px;
  background:#2b2417;
  color:var(--iy-gold-bright) !important;
}
@media (max-width: 767px) {
  .change-form .form-row,
  .change-form .aligned .form-row { padding:10px 12px !important; }
  .change-form .submit-row { position:static; }
  .change-form .module h2,
  .change-form .inline-group h2 { padding:12px !important; }
}
/* Raise contrast on Django admin controls, including action menus and compact buttons. */
.submit-row input, .submit-row input[type=submit], .submit-row input[type=button], .submit-row a,
#changelist .actions button, #changelist .actions select, .object-tools a,
.button, a.button, button,
input[type=submit], input[type=button], .submit-row input {
  background-color:#f2c96f !important;
  border-color:#ffe1a1 !important;
  color:#17120a !important;
  font-weight:800 !important;
  text-shadow:none !important;
}
.submit-row input:hover, .submit-row a:hover, #changelist .actions button:hover,
.object-tools a:hover, .button:hover, a.button:hover, button:hover,
input[type=submit]:hover, input[type=button]:hover {
  background-color:#ffdf96 !important;
  border-color:#fff0ca !important;
  color:#100d08 !important;
}
.submit-row input:focus, .submit-row a:focus, #changelist .actions button:focus,
.object-tools a:focus, .button:focus, a.button:focus, button:focus {
  outline:3px solid #f2c96f88 !important;
  outline-offset:2px;
}
.submit-row input:disabled, #changelist .actions button:disabled, button:disabled {
  background-color:#8c754a !important;
  border-color:#b79b65 !important;
  color:#fff8e8 !important;
  opacity:1 !important;
}
@media (max-width: 767px) {
  #header { padding: 10px 14px; }
  #content { padding: 16px 12px; }
  .yiyang-brand small { display: none; }
  #user-tools { display: block; margin: 6px 0 0; }
  .submit-row { position: static; }
}
