/* ==========================================================================
   Fonts
   ========================================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600.woff2') format('woff2');
}

/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */
:root {
  --bg: #0f1220;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.12);
  --text: #e8ecf1;
  --muted: #bac3cf;
  --accent: #7aa2ff;
  --accent-2: #6ce5e8;
  --danger: #ff6b6b;
  --success: #2dd4bf;
  --warning: #fbbf24;
  --shadow: 0 8px 32px rgba(0,0,0,0.35);
}

* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
  width: 100%; 
  overflow-x: hidden; 
}

body { 
  margin: 0; 
  letter-spacing: 1px; 
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; 
  background: radial-gradient(1200px 800px at 10% -10%, rgba(122,162,255,0.15), transparent), 
              radial-gradient(1000px 700px at 100% 0%, rgba(108,229,232,0.12), transparent), 
              linear-gradient(180deg, #0b0e1a, #0f1220); 
  color: var(--text); 
  line-height: 1.6; 
  background-attachment: fixed, fixed, fixed; 
}

/* ==========================================================================
   Layout & Grid System (Desktop First)
   ========================================================================== */
.container { 
  min-width: 1200px;
  max-width: 100%; 
  margin: 0 auto; 
  padding: 24px; 
}

.row { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 18px; 
  margin: 0; 
  width: 100%; 
}

.row-2-75-25 {
  grid-template-columns: 3fr 1fr;
  grid-template-areas: "chart depots";
}

/* ==========================================================================
   Components
   ========================================================================== */
.glass { 
  background: var(--card); 
  border: 1px solid rgba(255,255,255,0.14); 
  box-shadow: var(--shadow); 
  backdrop-filter: blur(14px) saturate(130%); 
  -webkit-backdrop-filter: blur(14px) saturate(130%); 
  border-radius: 12px; 
  width: 100%; 
}

.title { 
  font-size: 22px; 
  font-weight: 600; 
}

.button { 
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); 
  color: #0b0e1a; 
  border: none; 
  padding: 10px 16px; 
  border-radius: 10px; 
  font-weight: 600; 
  font-size: 16px; 
  line-height: 1.4; 
  box-shadow: 0 4px 12px rgba(122,162,255,0.28); 
  cursor: pointer; 
  transition: transform .1s ease, box-shadow .2s ease; 
  display: inline-block; 
  text-decoration: none; 
}

.button:disabled { 
  opacity: .6; 
  cursor: not-allowed; 
}

.button:hover { 
  transform: translateY(-1px); 
}

.button.yahoo { 
  background: linear-gradient(135deg, #af4dff, #9615ff); 
  color: #ffffff; 
  border: none; 
  padding: 10px 16px; 
  border-radius: 10px; 
  font-weight: 600; 
  font-size: 16px; 
  line-height: 1.4; 
  box-shadow: 0 4px 12px rgba(255, 114, 253, 0.28); 
  cursor: pointer; 
  transition: transform .1s ease, box-shadow .2s ease; 
  display: inline-block; 
  text-decoration: none; 
}

.button.secondary { 
  background: var(--card-strong); 
  color: var(--text); 
  box-shadow: none; 
}

.button.secondary.active { 
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); 
  color: #0b0e1a; 
  box-shadow: 0 4px 12px rgba(122,162,255,0.28); 
}

.button-danger {
  background: #ef4444 !important;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28) !important;
}

.button-danger:hover {
  transform: translateY(-1px) !important;
}

.button-full-width {
  width: 100%;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */
.header { 
  display: none; /* Desktop: Header ausgeblendet */
}

.footer-desktop { 
  display: block; 
  margin-top: 22px; 
  text-align: right; 
  padding: 18px 22px; 
  border-radius: 16px; 
}

.card { 
  padding: 18px; 
}

.card-chart { 
  grid-area: chart; 
}

.card-depots { 
  grid-area: depots; 
}

.card-title { 
  font-weight: bold; 
  margin-bottom: 10px; 
}

.card-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.input-area {
  margin-top: 25px;
}

.card-title-filter {
  display: flex; 
  justify-content: flex-end; 
  align-items: center; 
  gap: 12px; 
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.filter-group {
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap;
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.input, .select { 
  width: 100%; 
  background: rgba(255,255,255,0.06); 
  border: 1px solid rgba(255,255,255,0.18); 
  color: var(--text); 
  border-radius: 10px; 
  padding: 12px 14px; 
  font-size: 15px; 
  line-height: 1.45; 
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bac3cf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(122,162,255,0.2);
}

input[type="date"] { 
  font-size: 15px; 
}

/* Spinner-Pfeile bei Number-Inputs ausblenden */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator { 
  filter: invert(1) brightness(1.2); 
  opacity: 0.95; 
  cursor: pointer; 
}

input[type="color"] {
  opacity: 0; 
  width: 0; 
  height: 0; 
  position: absolute; 
  pointer-events: none;
}

/* Input mit Icon-Button */
.input-with-icon {
  position: relative;
  width: 100%;
}

.input-with-icon .input {
  padding-right: 45px; /* Platz für das Icon */
}

.input-icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s ease;
}

.input-icon-btn:hover {
  color: var(--accent);
}

.input-icon-btn .icon {
  width: 20px;
  height: 20px;
}

/* Input mit Button */
.input-with-button {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-with-button .input {
  flex: 1;
}

.input-with-button .button {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Calculator Button Wrapper - Button hat gleiche Größe wie Input-Felder */
.calculator-button-wrapper {
  display: flex;
  flex-direction: column;
}

.calculator-btn {
  width: 100%;
  height: 45px; /* Gleiche Höhe wie Input-Felder (padding 12px + 12px + line-height 1.45 * 15px) */
  padding: 12px 16px;
  margin-bottom: 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Calculator Results */
.calculator-results {
  margin-top: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.calculator-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
}

.calculator-result-row:last-child {
  border-bottom: none;
}

.calculator-result-label {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.calculator-result-value {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  font-family: 'Courier New', monospace;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.calculator-result-multiplied {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}

.calculator-apply-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #0b0e1a;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  box-shadow: 0 2px 8px rgba(122, 162, 255, 0.3);
  flex-shrink: 0;
}

.calculator-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(122, 162, 255, 0.4);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.calculator-apply-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(122, 162, 255, 0.3);
}

.calculator-apply-btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* Abstand zwischen Ergebnis-Box und Schließen-Button im Taschenrechner */
#modal-calculator .form-actions-right {
  margin-top: 24px;
}

label { 
  display: block; 
  font-size: 13px; 
  color: var(--muted); 
  margin-bottom: 6px; 
}

/* Character Counter Styles */
.char-counter {
  float: right;
  font-size: 11px;
  color: var(--muted);
  margin-top: -23px;
  margin-bottom: 5px;
}

/* Slide-Up Notification Styles */
.slide-notification {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 16px; /* +2px */
  font-weight: 500;
  z-index: 9999;
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 80vw;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.slide-notification.show {
  bottom: 30px;
}

.slide-notification.success {
  color: white;
  background: rgba(14, 84, 40, 0.6);
}

.slide-notification.error {
  color: white;
  background: rgba(239, 68, 68, 0.6);
}

.slide-notification-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Responsive Anpassungen */
@media (max-width: 1199px) {
  .slide-notification {
    left: 20px;
    right: 20px;
    transform: none;
    max-width: none;
  }
}

/* Checkbox Styles */
.checkbox-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold !important;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.2s ease;
}

.checkbox-label.selected {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
}

.checkbox-label:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--accent);
}


.checkbox-label .color-dot {
  margin-right: 8px;
  margin-left: 4px;
  vertical-align: middle !important;
  align-self: center !important;
  position: relative;
  top: 0;
}

.form-row { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 20px 30px;
  box-sizing: border-box;
}

.form-row-2 { 
  grid-template-columns: 1fr 1fr; 
}

.form-row-2-40-60 { 
  grid-template-columns: 40% calc(60% - 30px); 
}

.form-actions {
  display: flex; 
  margin-top: 30px;
}

.form-actions-spaced {
  display: flex; 
  justify-content: space-between; 
  margin-top: 40px; 
  gap: 10px;
}

.form-actions-right {
  display: flex; 
  gap: 10px;
  justify-content: flex-end;
}

.form-actions-left {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

/* ==========================================================================
   Table Components
   ========================================================================== */
.table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 14px; 
}

.table th, .table td { 
  padding: 12px 12px; 
  border-bottom: 1px solid rgba(59, 59, 59, 0.4);
}

.td-text-right {
  text-align: right;
}

.table th.td-text-right {
  text-align: right;
}

/* Letzte Tabellenzeile ohne unteren Rand */
.table tr:last-child td {
  border-bottom: 0 !important;
}

.table th { 
  text-align: left;
  color: var(--muted); 
  font-weight: 600; 
}

.table-wrap {
  overflow: auto; 
  margin-top: 30px;
  margin-bottom: 50px;
  padding-right: 30px;
  padding-left: 30px;
}

.table-wrap-values {
  overflow: auto; 
  margin-top: 45px;
  padding-right: 30px;
  padding-left: 30px;
}

.table-title {
  font-size: 24px;
  font-weight: 700;
}

.series-table {
  text-wrap: nowrap;
}

.series-table td, .series-table th {
  padding-right: 50px;
  width: 20%;
}

#stock-holdings-table th,
#stock-holdings-table td {
  width: auto;
  padding-right: 12px;
}

#stock-holdings-table th:last-child,
#stock-holdings-table td:last-child,
#stock-holdings-table th:nth-last-child(2),
#stock-holdings-table td:nth-last-child(2) {
  padding-right: 12px;
}

#stock-transactions-table th,
#stock-transactions-table td {
  width: auto;
  padding-right: 12px;
}

#stock-transactions-table th:last-child,
#stock-transactions-table td:last-child {
  padding-right: 12px;
}

/* Spalte "Auszahlung" ohne rechten Innenabstand */
#series-table th:nth-child(4),
#series-table td:nth-child(4),
#active-values-wrap .series-table th:nth-child(4),
#active-values-wrap .series-table td:nth-child(4) {
  padding-right: 0 !important;
}

/* Aktionen-Spalte in Wertetabelle */
.table-actions {
  text-align: right;
  padding-right: 0px !important;
}

/* In Tabellen: nur Icons, kein Button-Hintergrund */
.table-actions .icon-btn {
  background: transparent !important;
  border: 0;
  color: #d7d7d7;
  width: auto;
  height: auto;
  padding: 0 4px;
  box-shadow: none;
}

/* Hover/Focus: kein Hintergrund, nur dezenter Glow über dem SVG */
.table-actions .icon-btn:hover,
.table-actions .icon-btn:focus {
  background: transparent !important;
  box-shadow: none !important;
}

.table-actions .icon-btn .icon {
  width: 24px;
  height: 24px;
}

/* Papierkorb etwas größer */
.table-actions .btn-delete-value .icon {
  width: 30px;
  height: 30px;
  transform: translateY(4px);
  padding-right: 0px;
}

.table-actions .icon-btn:hover .icon,
.table-actions .icon-btn:focus .icon {
  box-shadow: none !important;
  background: transparent !important;
  filter: drop-shadow(0 0 6px rgba(122,162,255,0.35)) drop-shadow(0 0 2px rgba(122,162,255,0.7));
}

/* Falls nötig: Filter direkt auf den Pfad anwenden */
.table-actions .icon-btn:hover .icon path,
.table-actions .icon-btn:focus .icon path {
  filter: drop-shadow(0 0 6px rgba(122,162,255,0.35)) drop-shadow(0 0 2px rgba(122,162,255,0.7));
}

/* Verhindert Abschneiden des Schimmers am SVG-Rand */
.table-actions .icon {
  overflow: visible;
}

/* Inline-Edit Icons größer und leicht nach unten versetzt */
.table-actions .btn-save-edit .icon,
.table-actions .btn-cancel-edit .icon {
  width: 28px;
  height: 28px;
  transform: translateY(4px);
}

.table-actions .btn-save-edit .icon {
  transform: translateY(5px);
}

/* Gruppierte Tabellen-Styles */
.portfolio-header {
  background: rgba(122,162,255,0.1) !important;
  font-weight: 600;
  border-top: 2px solid rgba(122,162,255,0.3);
}

.portfolio-header td {
  border-bottom: 1px solid rgba(122,162,255,0.2) !important;
  padding: 12px 12px !important;
}

.portfolio-header .color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.depot-value-label {
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
  font-size: 14px;
}

.table-total {
  background: rgba(255,255,255,0.05) !important;
  font-weight: 600;
  border-top: 2px solid rgba(255,255,255,0.2);
}


#stock-holdings-table tr.table-total td,
#stock-transactions-table tr.table-total td {
  font-size: 16px;
}

.portfolio-spacer td {
  border: none !important;
  padding: 0 !important;
  height: 24px;
  background: transparent;
}


/* ==========================================================================
   List Components
   ========================================================================== */
.list { 
  display: grid; 
  gap: 12px;
}

.list-item { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 12px; 
  border-radius: 12px; 
  background: rgba(255,255,255,0.05); 
  border: 1px solid rgba(255,255,255,0.15); 
  cursor: pointer; 
  position: relative; 
}

.list-item:hover { 
  border-color: rgba(255,255,255,0.25); 
}

.list-item.active { 
  background: rgba(122,162,255,0.10); 
  border-color: rgba(122,162,255,0.45); 
}

/* Kein Hover-Effekt für das aktiv ausgewählte Depot */
.list-item.active:hover,
.list-item-sortable.active:hover {
  background: rgba(122,162,255,0.10);
  border-color: rgba(122,162,255,0.45);
}

.list-item-content {
  display: grid; 
  grid-template-columns: 20px auto; 
  align-items: start; 
  column-gap: 8px;
}

/* Portfolio-Liste Stile */
.list-item-sortable {
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.list-item-sortable:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
}

.list-item-fixed {
  cursor: pointer;
}







.list-item-actions {
  display: flex; 
  align-items: center; 
  gap: 8px;
}

#portfolio-list {
  margin-bottom: 60px;
}

.active-depot-name {
  color: var(--accent);
}

.color-dot { 
  width: 13px; 
  height: 13px; 
  border-radius: 999px; 
  display: inline-block; 
  border: 0px solid rgba(255,255,255,0.6); 
  grid-column: 1; 
  grid-row: 1 / span 2; 
}

.list-item-title {
  grid-column: 2;
  letter-spacing: 1px;
}

.list-item-description {
  grid-column: 2;
}

/* ==========================================================================
   Icon & Button Components
   ========================================================================== */
.icon-btn { 
  background: #ffffff; 
  border: 1px solid rgba(255,255,255,0.22); 
  color: #0b0e1a; 
  border-radius: 10px; 
  padding: 0; 
  cursor: pointer; 
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  width: 40px; 
  height: 40px; 
  box-shadow: 0 2px 10px rgba(0,0,0,0.25); 
  position: relative; 
  z-index: 10; 
  pointer-events: auto; 
}

.icon-btn:hover { 
  background: #f2f2f2; 
  box-shadow: 0 4px 16px rgba(0,0,0,0.28); 
}

.icon { 
  width: 19px; 
  height: 19px; 
}

.icon-btn .icon { 
  transform: translateY(1px); 
}

/* ==========================================================================
   Chip Components
   ========================================================================== */
.chip { 
  background: rgba(255,255,255,0.06); 
  color: var(--text); 
  border: 1px solid rgba(255,255,255,0.18); 
  padding: 6px 10px; 
  border-radius: 999px; 
  cursor: pointer; 
}

.chip.active { 
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); 
  color: #0b0e1a; 
  border: none; 
}

/* ==========================================================================
   Modal Components
   ========================================================================== */
.modal { 
  position: fixed; 
  inset: 0; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  padding: 20px; 
  z-index: 50; 
}

.modal[open], .modal:not([hidden]) { 
  display: flex; 
}

.modal-backdrop { 
  position: absolute; 
  inset: 0; 
  background: rgba(0,0,0,0.45); 
  backdrop-filter: blur(2px); 
}

.modal-card { 
  position: relative; 
  width: 100%; 
  max-width: 640px; 
  border-radius: 16px; 
}

.modal-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 14px 16px; 
  border-bottom: 1px solid rgba(255,255,255,0.12); 
}

.modal-form {
  padding: 18px;
}

.modal-card-large {
  max-width: 900px;
}

.modal-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow: hidden;
}

.modal-description {
  color: #bac3cf;
  font-size: 13px;
}

.modal-table-wrap {
  max-height: 45vh;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(12, 18, 34, 0.5);
}

.modal-table-wrap table {
  width: 100%;
}

.modal-table-wrap td {
  vertical-align: middle;
}

.modal-table-wrap input {
  width: 100%;
  box-sizing: border-box;
}

.modal-price-update-actions {
  padding: 0 18px 18px;
  gap: 12px;
  margin-top: 0;
  align-items: center;
}

.modal-loading {
  text-align: center;
  color: #bac3cf;
  font-size: 14px;
  padding: 18px 0;
}

.empty-state {
  text-align: center;
  color: #bac3cf;
  font-size: 14px;
  padding: 18px;
  border-radius: 12px;
  background: rgba(17, 26, 44, 0.6);
}

/* ==========================================================================
   Color Picker Components
   ========================================================================== */
.color-picker-container {
  margin-top: 8px; 
  display: flex; 
  align-items: center; 
  gap: 10px;
}

.color-picker-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  display: block;
  cursor: pointer;
}

.color-picker-preview {
  width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  background: #22c55e; 
  border: 3px solid rgba(255,255,255,0.6); 
  cursor: pointer; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.color-picker-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 50%;
  border: none;
  background: transparent;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* iOS-spezifische Anpassungen */
@supports (-webkit-touch-callout: none) {
  .color-picker-input {
    opacity: 0.01; /* Minimal sichtbar für iOS */
    z-index: 10;
  }
  
  .color-picker-preview {
    z-index: 5;
  }
}

.color-picker-label {
  color: #bac3cf; 
  font-size: 13px;
  cursor: pointer;
}

/* ==========================================================================
   Chart Components
   ========================================================================== */
.chart-container {
  position: relative; 
  height: 480px; 
  margin-bottom: 0px;
}


#performance-chart { 
  width: 100%; 
  height: 100%; 
  display: block; 
}

.performance-text {
  margin-left: 5px;
  font-size: 12px;
  background-color: #47474758;
  padding: 2.5px 4px;
  border-radius: 4px;
}

.performance-text-positive {
  color: #22c55e;
}

.performance-text-negative {
  color: #ef4444;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.hidden { 
  visibility: hidden; 
}

.display-none {
  display: none;
}

.display-block {
  display: block;
}

.display-flex {
  display: flex;
}

.muted { 
  color: var(--muted); 
  font-size: 12px; 
}

.alert { 
  margin-top: 10px; 
  font-size: 14px; 
  color: var(--danger); 
}

.success { 
  color: var(--success); 
}

.text-white {
  color: #ffffff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Auth Page Components
   ========================================================================== */
.center { 
  min-height: 100dvh; 
  display: grid; 
  place-items: center; 
  padding: 24px; 
}

.auth-card { 
  width: 100%; 
  max-width: 460px; 
  padding: 22px; 
}

.auth-head { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-bottom: 8px; 
}

.auth-head .brand { 
  font-size: 24px; 
  font-weight: 600; 
}

.auth-desc { 
  color: var(--muted); 
  font-size: 14px; 
  margin-bottom: 14px; 
}

.auth-actions { 
  display: flex; 
  gap: 10px; 
  justify-content: flex-end; 
  margin-top: 30px;
}

.footer { 
  color: var(--muted); 
  font-size: 12px; 
  text-align: center; 
  margin-top: 20px; 
}

/* ==========================================================================
   Mobile Responsive (max-width: 1199px)
   ========================================================================== */
@media (max-width: 1199px) {
  .container { 
    max-width: 100%; 
    width: 100vw; 
    padding: 12px; 
    min-width: auto;
  }

  .row-2-75-25 {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "depots"
      "chart";
  }

  .header { 
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    padding: 16px 22px; 
    flex-wrap: nowrap;
    gap: 12px;
    grid-area: header; 
  }

  .title { 
    flex-shrink: 0; 
  }

  .mobile-only { 
    display: flex; 
    justify-content: flex-end; 
  }

  .mobile-only .button { 
    font-size: 14px; 
    padding: 8px 12px; 
  }

  .footer-desktop { 
    display: none; 
  }

  #portfolio-list {
    margin-bottom: 35px;
  }

  .card-chart { 
    width: 100%; 
    max-width: 100vw; 
    overflow-x: hidden; 
  }

  .card-chart * { 
    box-sizing: border-box; 
  }

  .chart-container {
    height: 400px;
    margin-top: 40px;
    margin-bottom: 0px;
  }

  #performance-chart { 
    width: 100%; 
    max-width: 100%; 
    height: auto; 
  }

  .table th, .table td {  
    border-bottom: 1px solid rgba(96, 96, 96, 0.4);
  }

  .table-wrap {
    padding-right: 0px;
    padding-left: 0px;
  }

  .table-wrap-values {
    margin-top: 0px;
    padding-right: 0px;
    padding-left: 0px;
  }

  #series-table th:nth-child(4),
  #series-table td:nth-child(4),
  #active-values-wrap .series-table th:nth-child(4),
  #active-values-wrap .series-table td:nth-child(4) {
    padding-right: 50px !important;
  }

  .filter-btn { 
    padding: 8px 10px; 
    font-size: 15px; 
    border-radius: 8px; 
  }

  .card-title-filter {
    justify-content: center;
    margin-bottom: 25px;
  }

  .card-chart .card-title > div { 
    gap: 8px; 
  }

  .form-row-2 { 
    grid-template-columns: 1fr; 
  }

  .form-row-2-40-60 { 
    grid-template-columns: 1fr; 
  }

  .auth-actions {
    margin-top: 25px;
  }

  /* Modal Buttons für Mobile kleiner machen */
  .modal .button {
    padding: 8px 12px;
    font-size: 14px;
  }

  .form-actions-spaced {
    gap: 8px;
  }

  .form-actions-right {
    gap: 8px;
  }
}

/* ==========================================================================
   Desktop Specific (min-width: 1200px)
   ========================================================================== */
@media (min-width: 1200px) {
  .desktop-hide { 
    display: none; 
  }

  .mobile-only { 
    display: none; 
  }

  /* Letzte Spalte (Aktionen) in der Detailtabelle: feste Breite */
  #active-values-wrap .series-table th:last-child,
  #active-values-wrap .series-table td:last-child {
    width: 100px;
  }
}