:root,
html[data-theme="dark"] {
  --wccc-bg-dark: #111827;
  --wccc-bg-dark-2: #0b1220;
  --wccc-accent: #facc15;
  --wccc-accent-hover: #fde047;
  --wccc-panel: #ffffff;
  --wccc-border: #e5e7eb;
  --wccc-muted: #6b7280;
  --body-bg: #f3f4f6;
  --body-fg: #111827;
  --border-color: #e5e7eb;
  --hairline-color: #e5e7eb;
  --darkened-bg: #f9fafb;
  --selected-bg: #fef9c3;
  --selected-row: #fff7ed;
  --link-fg: #0369a1;
  --link-hover-color: #0c4a6e;
}

#header {
  background: linear-gradient(120deg, var(--wccc-bg-dark), var(--wccc-bg-dark-2));
  color: #f3f4f6;
  border-bottom: 1px solid #1f2937;
}

#branding h1,
#branding h1 a:link,
#branding h1 a:visited {
  color: var(--wccc-accent);
  font-weight: 800;
  letter-spacing: 0.01em;
}

#user-tools,
#user-tools a {
  color: #d1d5db;
}

#user-tools a:hover,
#user-tools a:focus {
  color: var(--wccc-accent-hover);
}

.wccc-public-link {
  margin-left: 16px;
  color: #e5e7eb;
  font-weight: 600;
  text-decoration: none;
}

.wccc-public-link:hover,
.wccc-public-link:focus {
  color: var(--wccc-accent-hover);
}

/* Force all admin content into the same light style as dashboard cards. */
body,
#content,
#container,
#main,
#content-main,
#changelist,
.module,
fieldset,
.change-form #content-main,
.change-list #content-main,
.dashboard #content-main,
html[data-theme="dark"] body,
html[data-theme="dark"] #content,
html[data-theme="dark"] #container,
html[data-theme="dark"] #main,
html[data-theme="dark"] #content-main,
html[data-theme="dark"] #changelist,
html[data-theme="dark"] .module,
html[data-theme="dark"] fieldset {
  background: #f3f4f6;
  color: #111827;
}

#changelist-form,
.results,
.paginator,
#changelist-filter,
.object-tools,
.submit-row,
form .aligned,
.inline-group {
  background: #ffffff;
  border-color: var(--wccc-border);
}

/* Strong overrides for changelist/search/filter controls that can remain dark. */
#changelist .actions,
#changelist .actions select,
#changelist .actions input,
#changelist .paginator,
#changelist #toolbar,
#changelist .xfull,
#changelist .xfull input,
#changelist .xfull select,
#changelist .xfull textarea,
html[data-theme="dark"] #changelist .actions,
html[data-theme="dark"] #changelist .actions select,
html[data-theme="dark"] #changelist .actions input,
html[data-theme="dark"] #changelist .paginator,
html[data-theme="dark"] #changelist #toolbar,
html[data-theme="dark"] #changelist .xfull,
html[data-theme="dark"] #changelist .xfull input,
html[data-theme="dark"] #changelist .xfull select,
html[data-theme="dark"] #changelist .xfull textarea {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: var(--wccc-border) !important;
}

#changelist-search input[type="text"],
#changelist-search input[type="search"],
#changelist-search select,
#searchbar {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #d1d5db !important;
}

#changelist-filter,
#changelist-filter h2,
#changelist-filter h3,
#changelist-filter ul,
#changelist-filter li,
#changelist-filter details,
#changelist-filter summary,
html[data-theme="dark"] #changelist-filter,
html[data-theme="dark"] #changelist-filter h2,
html[data-theme="dark"] #changelist-filter h3,
html[data-theme="dark"] #changelist-filter ul,
html[data-theme="dark"] #changelist-filter li,
html[data-theme="dark"] #changelist-filter details,
html[data-theme="dark"] #changelist-filter summary {
  background: #ffffff !important;
  color: #374151 !important;
  border-color: var(--wccc-border) !important;
}

/* Light sidebar */
#nav-sidebar,
html[data-theme="dark"] #nav-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--wccc-border);
}

#nav-filter,
#nav-sidebar input[type="search"],
#nav-sidebar input[type="text"] {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

#nav-sidebar .module,
#nav-sidebar .app-auth,
#nav-sidebar .app-inventory,
#nav-sidebar .app-sales,
#nav-sidebar .app-reporting,
#nav-sidebar .app-integrations,
#nav-sidebar .app-accounts {
  background: transparent;
}

#nav-sidebar caption,
#nav-sidebar .section,
#nav-sidebar th {
  background: #f9fafb;
  color: #374151;
  border-bottom: 1px solid var(--wccc-border);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  font-size: 0.62rem !important;
  line-height: 1.2;
}

#nav-sidebar td,
#nav-sidebar th,
#nav-sidebar .model,
#nav-sidebar .model a,
#nav-sidebar .model-current a,
#nav-sidebar a:link,
#nav-sidebar a:visited {
  background: #ffffff;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.72rem !important;
  line-height: 1.2;
}

#nav-sidebar .addlink,
#nav-sidebar .viewlink,
#nav-sidebar .changelink,
#nav-sidebar .deletelink {
  font-size: 0.68rem !important;
}

#nav-sidebar a:hover,
#nav-sidebar a:focus {
  color: #111827;
}

#nav-sidebar .current-app .section,
#nav-sidebar .current-model {
  background: #fef9c3;
  border-left: 3px solid #f59e0b;
}

#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited,
#nav-sidebar .current-model,
#nav-sidebar .current-model a:link,
#nav-sidebar .current-model a:visited,
#nav-sidebar .current-model a:hover,
#nav-sidebar .current-model a:focus {
  background: transparent;
  color: #92400e;
  font-weight: 700;
}

#toggle-nav-sidebar,
.toggle-nav-sidebar,
html[data-theme="dark"] #toggle-nav-sidebar,
html[data-theme="dark"] .toggle-nav-sidebar {
  background: #f9fafb;
  color: #6b7280;
  border-right: 1px solid var(--wccc-border);
}

/* Light content controls */
div.breadcrumbs,
html[data-theme="dark"] div.breadcrumbs {
  background: #f3f4f6;
  color: #374151;
}

div.breadcrumbs a,
html[data-theme="dark"] div.breadcrumbs a {
  color: #111827;
}

.module h2,
.module caption,
.inline-group h2,
html[data-theme="dark"] .module h2,
html[data-theme="dark"] .module caption,
html[data-theme="dark"] .inline-group h2 {
  background: #f9fafb;
  color: #111827;
  border-bottom: 1px solid var(--wccc-border);
}

.button,
input[type=submit],
input[type=button],
.submit-row input,
a.button {
  background: #111827;
  border: 1px solid #111827;
  color: #ffffff;
}

.button:hover,
input[type=submit]:hover,
input[type=button]:hover,
.submit-row input:hover,
a.button:hover {
  background: #1f2937;
}

.button.default,
input[type=submit].default,
.submit-row input.default {
  background: #d97706;
  border-color: #d97706;
}

.button.default:hover,
input[type=submit].default:hover,
.submit-row input.default:hover {
  background: #b45309;
}

/* Changelist tables and filters */
#changelist table,
#changelist table thead th,
#changelist table tbody tr,
#changelist table tbody td,
#changelist-filter,
#changelist-filter h2,
#changelist-filter h3,
#changelist-filter li,
html[data-theme="dark"] #changelist table,
html[data-theme="dark"] #changelist table thead th,
html[data-theme="dark"] #changelist table tbody tr,
html[data-theme="dark"] #changelist table tbody td,
html[data-theme="dark"] #changelist-filter,
html[data-theme="dark"] #changelist-filter h2,
html[data-theme="dark"] #changelist-filter h3,
html[data-theme="dark"] #changelist-filter li {
  background: #ffffff;
  color: #111827;
  border-color: var(--wccc-border);
}

#changelist table thead th {
  background: #f9fafb;
  color: #374151;
}

#changelist table tbody tr:nth-child(even) {
  background: #fafafa;
}

#changelist table tbody tr:hover,
html[data-theme="dark"] #changelist table tbody tr:hover {
  background: #fff7ed;
}

#changelist-filter a,
#changelist table a,
html[data-theme="dark"] #changelist-filter a,
html[data-theme="dark"] #changelist table a {
  color: #0369a1;
}

#changelist-filter a:hover,
#changelist table a:hover {
  color: #0c4a6e;
}

/* Dashboard custom cards */
.wccc-admin-shell {
  max-width: 1200px;
}

.wccc-admin-hero {
  background: #ffffff;
  border: 1px solid var(--wccc-border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wccc-admin-hero h1 {
  margin: 0;
  font-size: 1.3rem;
  color: #111827;
}

.wccc-admin-hero p {
  margin: 6px 0 0;
  color: var(--wccc-muted);
}

.wccc-section-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.wccc-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 6px 12px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
}

.wccc-pill:hover,
.wccc-pill:focus {
  background: #111827;
  color: #ffffff;
}

.wccc-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.wccc-section-card {
  border: 1px solid var(--wccc-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wccc-section-card-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--wccc-border);
  background: #f9fafb;
}

.wccc-section-card-header h2 {
  margin: 0;
  font-size: 1rem;
}

.wccc-section-card-header a {
  color: #111827;
  text-decoration: none;
}

.wccc-section-card-header a:hover {
  color: #d97706;
}

.wccc-model-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wccc-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
}

.wccc-model-row:last-child {
  border-bottom: 0;
}

.wccc-model-link,
.wccc-model-name {
  color: #1f2937;
  font-weight: 600;
  text-decoration: none;
}

.wccc-model-link:hover,
.wccc-model-link:focus {
  color: #d97706;
}

.wccc-model-actions {
  display: inline-flex;
  gap: 6px;
}

.wccc-chip {
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  padding: 3px 10px;
  color: #374151;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
}

.wccc-chip:hover,
.wccc-chip:focus {
  border-color: #111827;
  color: #111827;
}

.wccc-muted {
  color: var(--wccc-muted);
  font-size: 0.9rem;
}

.wccc-admin-image-preview-wrap {
  background: #ffffff;
  border: 1px solid var(--wccc-border);
  border-radius: 12px;
  padding: 14px;
  margin: 16px 0;
}

.wccc-admin-image-preview-wrap h2 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 1rem;
}

.wccc-admin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.wccc-admin-image-card {
  background: #f9fafb;
  border: 1px solid var(--wccc-border);
  border-radius: 10px;
  padding: 10px;
}

.wccc-admin-image-card h3 {
  margin: 0 0 8px;
  color: #374151;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wccc-admin-image-card img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.wccc-admin-image-card p {
  margin: 0;
  color: #6b7280;
  font-size: 0.85rem;
}
