.woc-brand {
  min-width: 0;
}

.woc-brand__logo {
  display: block;
  object-fit: contain;
  height: auto;
  border-radius: 12px;
}

.woc-brand__title {
  color: #0f172a;
  font-weight: 800;
  line-height: 1.4;
}

.woc-brand--sidebar {
  flex: 1;
}

.woc-brand--sidebar .woc-brand__logo {
  width: 156px;
  max-width: 100%;
}

.woc-brand--sidebar .woc-brand__title {
  margin-top: 10px;
  max-width: 210px;
  font-size: 12px;
}

.woc-brand--login {
  text-align: center;
}

.woc-brand--login .woc-brand__logo {
  width: 255px;
  max-width: 90%;
  margin: 0 auto 20px;
}

.woc-brand--login .woc-brand__title {
  font-size: clamp(20px, 4vw, 25px);
  text-wrap: balance;
}

.woc-selection {
  position: sticky;
  top: 88px;
  z-index: 15;
  border: 1px solid #a7d8c2;
  border-radius: 16px;
  background: #f0fdf6;
  color: #12382b;
  padding: 14px 16px;
  box-shadow: 0 4px 14px #0f172a0a;
}

.woc-selection__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.woc-selection__heading h2 {
  font-weight: 800;
}

.woc-selection__count {
  font-weight: 600;
}

.woc-selection__metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.woc-selection__metric dt {
  font-size: 11px;
  line-height: 1.5;
}

.woc-selection__metric dd {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.woc-selection__metric--total dd {
  font-size: 17px;
}

.woc-selection__metric--saida dd {
  color: #be123c;
}

.woc-selection__note {
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.5;
  color: #466557;
}

.woc-selection-actions {
  flex-wrap: wrap;
}

.dark .woc-brand__title {
  color: #f1f5f9;
}

.dark .woc-selection {
  background: #102c24;
  border-color: #28634e;
  color: #d5f6e6;
}

.dark .woc-selection__metric--saida dd {
  color: #fda4af;
}

.dark .woc-selection__note {
  color: #acd1bf;
}

@media (max-width: 767px) {
  .woc-selection {
    position: fixed;
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 12px;
  }

  main:has(.woc-selection) {
    padding-bottom: 150px;
  }

  .woc-selection__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  .woc-selection__metric--entrada,
  .woc-selection__metric--saida,
  .woc-selection__metric--transferencia,
  .woc-selection__note {
    display: none;
  }
}

@media print {
  .woc-selection {
    display: none !important;
  }
}

/* Opt-in and screen-only: existing themes and printed reports keep their styles. */
@media screen {
  :root[data-theme="woc_emerald"] {
    color-scheme: dark;
    --woc-canvas: #081f1c;
    --woc-surface: #102e29;
    --woc-elevated: #173c34;
    --woc-hover: #20493f;
    --woc-border: #356354;
    --woc-control-border: #659486;
    --woc-text: #f0faf4;
    --woc-secondary: #b2cec1;
    --woc-muted: #a4bfb2;
    --woc-accent: #66d6a2;
    --woc-on-accent: #08281e;
    --woc-danger: #ffafb9;
    --woc-danger-bg: #48262e;
    --woc-warning: #f9d38a;
    --woc-warning-bg: #423823;
    --woc-info: #a4dcff;
    --woc-info-bg: #17384a;
    --woc-focus: #76e4b1;
  }

  [data-theme="woc_emerald"] body,
  [data-theme="woc_emerald"] #root > .min-h-screen {
    background: var(--woc-canvas);
    color: var(--woc-text);
  }

  [data-theme="woc_emerald"] body {
    background-image: radial-gradient(ellipse at 85% 0%, #17463770, transparent 55%);
    background-attachment: fixed;
  }

  [data-theme="woc_emerald"] ::selection {
    background: var(--woc-accent);
    color: var(--woc-on-accent);
  }

  [data-theme="woc_emerald"] :is(
    .bg-white, [class~="bg-white/90"], .bg-slate-950,
    [class*="dark:bg-slate-950"], [class*="dark:bg-slate-900"]
  ) {
    background-color: var(--woc-surface);
  }

  [data-theme="woc_emerald"] :is(
    .bg-slate-50, .bg-slate-100, .bg-slate-200,
    [class~="bg-slate-50/70"], [class~="bg-slate-50/80"],
    [class~="bg-slate-100/80"], [class*="dark:bg-slate-800"]
  ) {
    background-color: var(--woc-elevated);
  }

  [data-theme="woc_emerald"] :is(
    .text-slate-50, .text-slate-100, .text-slate-200,
    .text-slate-700, .text-slate-800, .text-slate-900, .text-slate-950
  ) {
    color: var(--woc-text);
  }

  [data-theme="woc_emerald"] :is(.text-slate-300, .text-slate-600) {
    color: var(--woc-secondary);
  }

  [data-theme="woc_emerald"] :is(.text-slate-400, .text-slate-500) {
    color: var(--woc-muted);
  }

  [data-theme="woc_emerald"] :is([class*="border-slate-"], [class*="border-white"]) {
    border-color: var(--woc-border);
  }

  [data-theme="woc_emerald"] [class*="divide-slate-"] > :not(:last-child) {
    border-color: var(--woc-border);
  }

  [data-theme="woc_emerald"] :is(
    [class*="text-emerald-"], [class*="text-green-"], .woc-brand__title
  ) {
    color: var(--woc-accent);
  }

  [data-theme="woc_emerald"] :is([class*="bg-emerald-50"], [class*="bg-emerald-100"]) {
    background-color: #153e30;
    color: var(--woc-accent);
  }

  [data-theme="woc_emerald"] [class*="border-emerald-"] {
    border-color: #408568;
  }

  [data-theme="woc_emerald"] :is([class*="text-rose-"], [class*="text-red-"]) {
    color: var(--woc-danger);
  }

  [data-theme="woc_emerald"] :is(
    [class*="bg-rose-50"], [class*="bg-rose-100"],
    [class*="bg-red-50"], [class*="dark:bg-rose-950"]
  ) {
    background-color: var(--woc-danger-bg);
    color: var(--woc-danger);
  }

  [data-theme="woc_emerald"] :is([class*="border-rose-"], [class*="border-red-"]) {
    border-color: #965b69;
  }

  [data-theme="woc_emerald"] :is([class*="text-amber-"], [class*="text-orange-"]) {
    color: var(--woc-warning);
  }

  [data-theme="woc_emerald"] :is(
    [class*="bg-amber-50"], [class*="bg-amber-100"], [class*="dark:bg-amber-950"]
  ) {
    background-color: var(--woc-warning-bg);
    color: var(--woc-warning);
  }

  [data-theme="woc_emerald"] [class*="border-amber-"] {
    border-color: #947e4f;
  }

  [data-theme="woc_emerald"] :is([class*="text-sky-"], [class*="text-blue-"], [class*="text-indigo-"]) {
    color: var(--woc-info);
  }

  [data-theme="woc_emerald"] :is(
    [class*="bg-sky-50"], [class*="bg-sky-100"], [class*="bg-blue-50"],
    [class*="bg-indigo-50"], [class*="dark:bg-sky-950"]
  ) {
    background-color: var(--woc-info-bg);
    color: var(--woc-info);
  }

  [data-theme="woc_emerald"] :is([class*="border-sky-"], [class*="border-blue-"]) {
    border-color: #537e91;
  }

  [data-theme="woc_emerald"] header {
    background: #0b2722f5;
    border-color: var(--woc-border);
    box-shadow: 0 8px 24px #00000018;
  }

  [data-theme="woc_emerald"] :is(aside, .h-full:has(> nav)) {
    background: #0a2621;
    border-color: var(--woc-border);
  }

  [data-theme="woc_emerald"] .woc-brand--sidebar {
    padding-block: 6px;
  }

  [data-theme="woc_emerald"] .woc-brand__logo {
    box-shadow: 0 0 0 1px #66d6a224;
  }

  [data-theme="woc_emerald"] .woc-brand__title {
    color: var(--woc-text);
  }

  [data-theme="woc_emerald"] :is(.rounded-2xl, .rounded-3xl).border {
    box-shadow: 0 8px 24px #00000018;
  }

  [data-theme="woc_emerald"] nav button {
    min-height: 40px;
  }

  [data-theme="woc_emerald"] nav button.bg-emerald-50 {
    background: #1b4939;
    color: #9aefc6;
    box-shadow: inset 3px 0 0 var(--woc-accent);
  }

  [data-theme="woc_emerald"] :is(button, input, select, textarea) {
    accent-color: var(--woc-accent);
  }

  [data-theme="woc_emerald"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) {
    background-color: #0b241f;
    color: var(--woc-text);
    border-color: var(--woc-control-border);
  }

  [data-theme="woc_emerald"] :is(input, textarea)::placeholder {
    color: var(--woc-muted);
    opacity: 1;
  }

  [data-theme="woc_emerald"] select option {
    background: #0b241f;
    color: var(--woc-text);
  }

  [data-theme="woc_emerald"] :is(button, input, select, textarea, a):focus-visible {
    outline: 2px solid var(--woc-focus);
    outline-offset: 3px;
  }

  [data-theme="woc_emerald"] button:not(:disabled):hover {
    filter: brightness(1.09);
  }

  [data-theme="woc_emerald"] button:disabled {
    cursor: not-allowed;
  }

  /* Solid actions keep dark ink on mint, including nested labels and icons. */
  [data-theme="woc_emerald"] :is(button, a).bg-emerald-600 {
    background: linear-gradient(135deg, #76e4b1, #66d6a2);
    background-color: var(--woc-accent);
    color: var(--woc-on-accent);
    border-color: #76e4b1;
    box-shadow: 0 4px 12px #00000024;
  }

  [data-theme="woc_emerald"] :is(button, a).bg-emerald-600 * {
    color: var(--woc-on-accent);
  }

  [data-theme="woc_emerald"] button.bg-rose-600 {
    background: #aa2947;
    color: #ffffff;
    border-color: #e0768e;
  }

  [data-theme="woc_emerald"] button.bg-rose-600 * {
    color: #ffffff;
  }

  [data-theme="woc_emerald"] #btn-toggle-theme {
    color: var(--woc-accent);
    border-color: #659486;
    background: var(--woc-elevated);
  }

  [data-theme="woc_emerald"] #btn-toggle-theme svg {
    color: var(--woc-accent);
  }

  [data-theme="woc_emerald"] [data-theme-option="woc_emerald"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 8px;
    background: #0b3226;
    box-shadow: 0 0 0 2px #d1f9e6;
  }

  [data-theme="woc_emerald"] thead tr {
    background: #173c34;
    color: var(--woc-secondary);
  }

  [data-theme="woc_emerald"] tbody tr {
    background-color: var(--woc-surface);
  }

  [data-theme="woc_emerald"] tbody tr:hover {
    background-color: var(--woc-hover);
  }

  [data-theme="woc_emerald"] :is(tr, div)[class*="bg-emerald-50/70"] {
    background-color: #1b4939;
  }

  [data-theme="woc_emerald"] .woc-selection {
    background: #153e30;
    color: var(--woc-text);
    border-color: #659486;
    box-shadow: 0 12px 32px #00000040;
  }

  [data-theme="woc_emerald"] .woc-selection__metric--total dd {
    color: #9aefc6;
  }

  [data-theme="woc_emerald"] .woc-selection__metric--saida dd {
    color: var(--woc-danger);
  }

  [data-theme="woc_emerald"] .woc-selection__note {
    color: var(--woc-secondary);
  }

  [data-theme="woc_emerald"] .recharts-text {
    fill: var(--woc-secondary);
  }

  [data-theme="woc_emerald"] .recharts-cartesian-grid line {
    stroke: var(--woc-border);
  }

  [data-theme="woc_emerald"] .recharts-default-tooltip {
    background-color: var(--woc-elevated) !important;
    border-color: var(--woc-control-border) !important;
    color: var(--woc-text);
  }

  [data-theme="woc_emerald"] .recharts-tooltip-label {
    color: var(--woc-text);
  }

  /* Recharts supplies inline series colors; keep its labels readable and the markers colored. */
  [data-theme="woc_emerald"] :is(.recharts-legend-item-text, .recharts-tooltip-item) {
    color: var(--woc-text) !important;
  }

  [data-theme="woc_emerald"] [class*="bg-blue-500/15"] {
    background-color: #66d6a215;
  }

  [data-theme="woc_emerald"] ::-webkit-scrollbar-thumb {
    background: #659486;
  }

  [data-theme="woc_emerald"] ::-webkit-scrollbar-thumb:hover {
    background: #8cbdab;
  }

  @media (prefers-reduced-motion: reduce) {
    [data-theme="woc_emerald"] * {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
}
