/* ---------- Wirtschaftskalender: Kachel ---------- */

.cal-tile {
  padding: 6px 10px 10px 16px;
}

.cal-list {
  display: grid;
}

.cal-row {
  display: grid;
  grid-template-columns: 74px 10px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 34px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.cal-row:last-child {
  border-bottom: none;
}

.cal-row.is-soon .cal-title,
.cal-row.is-soon .cal-cd {
  color: var(--text-primary);
  font-weight: 600;
}

.cal-when {
  color: var(--text-secondary);
  text-align: left;
}

.cal-cur {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.cal-cd {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cal-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.cal-dot.is-high {
  background: var(--danger);
}

.cal-dot.is-medium {
  background: var(--warning);
}

.cal-dot.is-low {
  background: var(--border-strong);
}

.cal-dot.is-holiday {
  background: transparent;
  border: 1px solid var(--text-muted);
}

/* ---------- Wirtschaftskalender: Reiter ---------- */

.cal-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cal-chip {
  padding: 2px 8px;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.cal-chip:hover {
  color: var(--text-primary);
}

.cal-chip[aria-pressed="true"] {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.cal-body {
  padding: 0 20px 20px;
}

.cal-table td {
  height: 38px;
}

.cal-table th:first-child,
.cal-table td:first-child {
  width: 70px;
}

.cal-table .cal-dot-cell {
  width: 22px;
  padding: 0 4px;
}

.cal-table .cal-title {
  max-width: 0;
  width: 100%;
  color: var(--text-primary);
}

.cal-table .cal-day td {
  height: 34px;
  padding-top: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.cal-table tr.is-past td {
  opacity: 0.45;
}

.cal-table tr.is-next td {
  box-shadow: inset 0 1px 0 var(--text-primary);
}

/* ---------- MT5-Konto ---------- */

/* P&L-Kalender */
.pc {
  margin-top: 8px;
}

.pc-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 10px;
}

.pc-nav {
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 1;
}

.pc-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.pc-title {
  min-width: 132px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.pc-total {
  margin-left: 6px;
  font-size: 18px;
  font-weight: 600;
}

.pc-facts {
  font-size: 12px;
}

.pc-today,
.pc-clear {
  margin-left: auto;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pc-today:hover,
.pc-clear:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.pc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, 0.55fr)) minmax(0, 0.75fr);
  gap: 4px;
}

.pc-wd {
  padding: 0 8px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pc-day,
.pc-week {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 74px;
  text-align: center;
  padding: 6px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pc-week {
  background: transparent;
  border-style: dashed;
}

.pc-date {
  position: absolute;
  top: 5px;
  left: 8px;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text-muted);
}

.pc-day.has-trades .pc-date {
  color: rgba(255, 255, 255, 0.7);
}

.pc-day.is-today .pc-date {
  color: var(--text-primary);
  font-weight: 700;
}

.pc-day.is-today {
  border-color: var(--text-secondary);
}

.pc-day.is-out,
.pc-day.is-before {
  opacity: 0.35;
}

.pc-day.is-weekend:not(.has-trades) {
  background: transparent;
}

.pc-day.has-trades {
  cursor: pointer;
}

.pc-day.is-win {
  background: color-mix(in srgb, var(--success) var(--pc-a, 20%), var(--bg-surface));
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
}

.pc-day.is-loss {
  background: color-mix(in srgb, var(--danger) var(--pc-a, 20%), var(--bg-surface));
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.pc-day.has-trades:hover,
.pc-day.has-trades:focus-visible {
  outline: 1px solid var(--text-secondary);
  outline-offset: 1px;
}

.pc-day[aria-pressed="true"] {
  outline: 2px solid var(--text-primary);
  outline-offset: 1px;
}

/* Auf dem farbigen Grund in Weiß, sonst geht Grün auf Grün unter */
.pc-day.has-trades .pc-pnl {
  color: var(--text-primary);
}

.pc-pnl {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.pc-day .pc-pnl,
.pc-week .pc-pnl {
  text-align: center;
}

.pc-n {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-day.is-weekend .pc-n {
  display: none;
}

.pc-clear {
  margin-left: 4px;
}

.ac-since {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.ac-since[hidden] {
  display: none;
}

.ac-since input {
  height: 26px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color-scheme: dark;
}

.ac-body {
  padding: 16px 20px 20px;
}

#ac-meta.is-warn {
  color: var(--warning);
}

.ac-section {
  margin-top: 18px;
}

.ac-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.ac-section-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.ac-section-head .mk-dim {
  font-size: 12px;
}

.ac-table td {
  height: 38px;
  font-size: 13px;
}

.ac-table th:first-child,
.ac-table td:first-child {
  width: 1%;
  padding-right: 24px;
  white-space: nowrap;
}

.ac-date {
  font-family: var(--font-num);
}

.ac-sym {
  font-weight: 600;
}

.ac-none {
  margin: 8px 0 0;
  font-size: 13px;
}

.ac-empty {
  max-width: 620px;
  margin: 40px auto;
}

.ac-empty h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.ac-empty p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}

.ac-steps {
  margin: 0 0 20px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}
