/* E.D.I.T.H. — tokens de tema (claro / oscuro) */

:root {
  color-scheme: light;
  --edith-bg: #eef1f6;
  --edith-bg-subtle: #f4f6fa;
  --edith-surface: #ffffff;
  --edith-surface-muted: #f8fafc;
  --edith-surface-gradient: linear-gradient(165deg, #ffffff 0%, #f4f7fb 100%);
  --edith-text: #1a2332;
  --edith-text-muted: #5c6570;
  --edith-border: #e5e8ec;
  --edith-border-strong: #d8dee8;
  --edith-primary: #00568e;
  --edith-primary-soft: #e8f4fc;
  --edith-menu-hover: #f4f8fc;
  --edith-menu-active-bg: linear-gradient(135deg, #e8f4fc 0%, #d8ecfa 100%);
  --edith-menu-active-text: #004a7a;
  --edith-shadow: rgba(0, 44, 74, 0.06);
  --edith-header-bg: linear-gradient(165deg, #062a4a 0%, #0a3a5c 42%, #0c2744 100%);
  --edith-quote-bg: linear-gradient(135deg, rgba(0, 86, 142, 0.08) 0%, rgba(0, 137, 123, 0.06) 100%);
  --edith-section-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --edith-bg: #0c1017;
  --edith-bg-subtle: #121820;
  --edith-surface: #161d28;
  --edith-surface-muted: #1a2230;
  --edith-surface-gradient: linear-gradient(165deg, #1a2230 0%, #141b26 100%);
  --edith-text: #e8edf4;
  --edith-text-muted: #9aa8b8;
  --edith-border: #2a3544;
  --edith-border-strong: #364556;
  --edith-primary: #7ec8ff;
  --edith-primary-soft: rgba(126, 200, 255, 0.12);
  --edith-menu-hover: rgba(126, 200, 255, 0.08);
  --edith-menu-active-bg: linear-gradient(135deg, rgba(0, 86, 142, 0.35) 0%, rgba(0, 137, 123, 0.2) 100%);
  --edith-menu-active-text: #b8dcff;
  --edith-shadow: rgba(0, 0, 0, 0.35);
  --edith-header-bg: linear-gradient(165deg, #041525 0%, #062a4a 50%, #051018 100%);
  --edith-quote-bg: linear-gradient(135deg, rgba(0, 86, 142, 0.22) 0%, rgba(0, 137, 123, 0.12) 100%);
  --edith-section-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

body.app-body {
  background: var(--edith-bg);
  color: var(--edith-text);
}

.header {
  background: var(--edith-header-bg);
}

.sidebar {
  background: var(--edith-surface);
  border-right-color: var(--edith-border);
}

.sidebar-nav--main {
  margin-bottom: 1.35rem;
  padding-bottom: 0.25rem;
}

.sidebar-nav--admin {
  margin-top: 0.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--edith-border);
}

.nav-group-title {
  margin-top: 0;
  margin-bottom: 0.55rem;
  color: var(--edith-primary);
}

.menu-item {
  color: var(--edith-text);
}

.menu-item:hover {
  background: var(--edith-menu-hover);
  color: var(--edith-primary);
}

.menu-item.active {
  background: var(--edith-menu-active-bg);
  color: var(--edith-menu-active-text);
  border-color: transparent;
  box-shadow: none;
}

.main-content {
  background: transparent;
}

.section {
  background: var(--edith-surface);
  color: var(--edith-text);
  box-shadow: var(--edith-section-shadow);
}

.section-header h2,
.subsection-title {
  color: var(--edith-primary);
}

.muted {
  color: var(--edith-text-muted);
}

.m3-surface {
  background: var(--edith-surface-gradient);
  border-color: var(--edith-border);
  box-shadow: 0 2px 12px var(--edith-shadow);
  color: var(--edith-text);
}

.edith-quote-card {
  background: var(--edith-quote-bg);
  border-left-color: var(--edith-primary);
}

.edith-quote-text {
  color: var(--edith-text);
}

.field-input,
.field-select {
  background: var(--edith-surface-muted);
  color: var(--edith-text);
  border-color: var(--edith-border);
}

.badge {
  background: var(--edith-primary-soft);
  color: var(--edith-primary);
}

.badge-muted {
  background: var(--edith-surface-muted);
  color: var(--edith-text-muted);
  border: 1px solid var(--edith-border);
}

.alert-warn {
  background: rgba(239, 108, 0, 0.12);
  border-color: rgba(239, 108, 0, 0.35);
  color: var(--edith-text);
}

html[data-theme='dark'] .alert-warn {
  background: rgba(239, 108, 0, 0.18);
}

.table {
  color: var(--edith-text);
}

.table th {
  color: var(--edith-text-muted);
  border-bottom-color: var(--edith-border);
}

.table td {
  border-bottom-color: var(--edith-border);
}

.nomad-dialog.m3-surface {
  color: var(--edith-text);
  background: var(--edith-surface, #fff);
}

html[data-theme='dark'] .nomad-dialog.m3-surface {
  background: var(--edith-surface, #162033);
  color: var(--edith-text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .nomad-dialog h3,
html[data-theme='dark'] .nomad-dialog .field-label {
  color: #8fc0f0;
}

html[data-theme='dark'] .nomad-dialog .field-input {
  background: var(--edith-surface-muted, #1c2a3d);
  color: var(--edith-text);
  border-color: var(--edith-border, #2a3a4f);
}

html[data-theme='dark'] .nomad-dialog .btn-secondary,
html[data-theme='dark'] .nomad-dialog .btn-ghost {
  background: transparent;
  color: #e8eef5;
  border-color: rgba(232, 238, 245, 0.45);
}

html[data-theme='dark'] .nomad-dialog .btn-secondary:hover,
html[data-theme='dark'] .nomad-dialog .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: #8fc0f0;
}

html[data-theme='dark'] .nomad-dialog .btn-primary {
  background: #2f8fe8;
  border-color: #2f8fe8;
  color: #fff;
}

html[data-theme='dark'] .nomad-dialog .btn-primary:hover {
  background: #1e6bb8;
  border-color: #1e6bb8;
}

html[data-theme='dark'] .btn-secondary {
  background: var(--edith-surface-muted);
  color: var(--edith-text);
  border-color: var(--edith-border-strong);
}

html[data-theme='dark'] .login-screen,
html[data-theme='dark'] .login-split-panel {
  background: #0f1724;
  color: var(--edith-text);
}

html[data-theme='dark'] .login-panel-card {
  background: var(--edith-surface, #162033);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme='dark'] .login-panel-heading,
html[data-theme='dark'] .login-field-label {
  color: #e8eef5;
}

html[data-theme='dark'] .login-forgot-link {
  color: #8fc0f0;
}

html[data-theme='dark'] .login-field-input,
html[data-theme='dark'] .login-password-row {
  background: var(--edith-surface-muted, #1c2a3d);
  color: var(--edith-text);
  border-color: var(--edith-border, #2a3a4f);
}

html[data-theme='dark'] .login-submit {
  background: #2f8fe8;
}

html[data-theme='dark'] .login-submit:hover {
  background: #1e6bb8;
}

html[data-theme='dark'] .edith-kpi--pending strong {
  color: #ffb74d;
}

html[data-theme='dark'] .edith-kpi--done strong {
  color: #4db6ac;
}

html[data-theme='dark'] .edith-kpi--progress strong {
  color: #4dd0e1;
}

html[data-theme='dark'] .edith-activities li {
  border-bottom-color: var(--edith-border);
}

html[data-theme='dark'] .edith-issue-key {
  color: var(--edith-primary);
}

#btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  min-width: 0;
}

#btn-theme-toggle .edith-theme-icon {
  display: block;
}

@media (max-width: 900px) {
  .sidebar {
    border-bottom-color: var(--edith-border);
  }
}
