/* ERPNext dark & gold theme — injected by Caddy (see /opt/caddy/Caddyfile).
   Builds on Frappe v16's own [data-theme="dark"] tokens. */

[data-theme="dark"] {
  --gold: #d4af37;
  --gold-light: #e9c968;
  --gold-dark: #a8862a;
  --gold-alpha: rgba(212, 175, 55, 0.14);
  --gold-alpha-strong: rgba(212, 175, 55, 0.28);

  /* warm near-black neutrals (dark scale is inverted: 950 = darkest) */
  --gray-50: #f6efdf;
  --gray-100: #e6dcc6;
  --gray-200: #cbbe9f;
  --gray-300: #a99c80;
  --gray-400: #837861;
  --gray-450: #5d5545;
  --gray-500: #423b30;
  --gray-600: #332d24;
  --gray-700: #27221b;
  --gray-800: #1e1a14;
  --gray-900: #16130e;
  --gray-950: #0e0c09;

  --heading-color: var(--gold-light);
  --brand-color: var(--gold);
  --primary: var(--gold);
  --primary-color: var(--gold);
  --btn-primary: var(--gold);
  --invert-neutral: var(--gold-light);
  --progress-bar-bg: var(--gold);
  --checkbox-gradient: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  --checkbox-color: #14110a;
  --focus-default: 0 0 0 2px var(--gold-alpha-strong);
  --date-active-bg: var(--gold);
  --date-active-text: #14110a;
  --sidebar-select-color: var(--gold-alpha);

  scrollbar-color: var(--gold-dark) transparent;
}

[data-theme="dark"] ::selection {
  color: #14110a;
  background: var(--gold);
}

/* primary buttons */
[data-theme="dark"] .btn.btn-primary,
[data-theme="dark"] .es-button[data-variant="solid"] {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #14110a;
  --icon-stroke: #14110a;
  --icon-fill-bg: var(--gold);
  font-weight: 600;
}
[data-theme="dark"] .btn.btn-primary:hover,
[data-theme="dark"] .es-button[data-variant="solid"]:hover {
  background: var(--gold-light);
  color: #14110a;
}
[data-theme="dark"] .btn.btn-primary:active,
[data-theme="dark"] .es-button[data-variant="solid"]:active {
  background: var(--gold-dark) !important;
  color: #14110a !important;
}

/* links & accents */
[data-theme="dark"] a:not(.btn):not(.es-button):not(.item-anchor):not(.dropdown-item):hover {
  color: var(--gold-light);
}
[data-theme="dark"] .page-title .title-text,
[data-theme="dark"] .ellipsis.title-text {
  color: var(--gold-light);
}

/* navbar: thin gold rule */
[data-theme="dark"] .navbar,
[data-theme="dark"] .page-head {
  border-bottom: 1px solid var(--gold-alpha-strong);
}

/* sidebar: active row in gold */
[data-theme="dark"] .active-sidebar {
  background: var(--gold-alpha);
  box-shadow: inset 3px 0 0 var(--gold);
}
[dir="rtl"][data-theme="dark"] .active-sidebar,
[dir="rtl"] [data-theme="dark"] .active-sidebar {
  box-shadow: inset -3px 0 0 var(--gold);
}
[data-theme="dark"] .active-sidebar .item-anchor,
[data-theme="dark"] .active-sidebar .sidebar-item-label {
  color: var(--gold-light) !important;
  --icon-stroke: var(--gold-light);
}

/* inputs: gold focus */
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  box-shadow: 0 0 0 1px var(--gold) !important;
}
[data-theme="dark"] input[type="checkbox"]:checked {
  background-color: var(--gold);
}

/* cards & widgets: subtle gold edge */
[data-theme="dark"] .frappe-card,
[data-theme="dark"] .widget,
[data-theme="dark"] .page-card {
  border: 1px solid var(--gold-alpha);
}
[data-theme="dark"] .widget:hover {
  border-color: var(--gold-alpha-strong);
}

/* tabs */
[data-theme="dark"] .form-tabs .nav-link.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold) !important;
}

/* login page */
[data-theme="dark"] body[data-path="login"] {
  background:
    radial-gradient(ellipse at top, rgba(212, 175, 55, 0.10), transparent 60%),
    var(--gray-950);
}
[data-theme="dark"] body[data-path="login"] .page-card {
  background: var(--gray-900);
  border-color: var(--gold-alpha-strong);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--gold-alpha);
}
[data-theme="dark"] body[data-path="login"] .page-card-head h4,
[data-theme="dark"] body[data-path="login"] .page-card-head-text > :first-child {
  color: var(--gold-light);
}
