:root {
  --bg: #121521;
  --bg-elev: #161a29;
  --text: #e5e9f0;
  --text-dim: #a4a9b6;
  --primary: #cd5de4;
  --accent: #eda971;
  --success: #55d48a;
  --warn: #ffb86b;
  --danger: #ff6b6b;

  --shadow-dark: rgba(0, 0, 0, 0.55);
  --shadow-light: rgba(255, 255, 255, 0.06);

  --gradient: conic-gradient(from var(--α), #ff0308, #ff5900, #ffff00, #00ff0d, #00e5ff, #1403ff, #c300ff, #ff0303) ; 
}
a {
  text-decoration: none;
  color: var(--text);
}

@property --α {
  /* must register --α to animate it */
  syntax: "<angle>";
  initial-value: 0deg;
  /* used only on pseudo, nowhere to be inherited, 
   * better perf if set false, see 
   * https://www.bram.us/2024/10/03/benchmarking-the-performance-of-css-property/ */
  inherits: false;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% 10%, #171b2a 0%, #121521 55%);
}

.neumorph {
  background: var(--bg-elev);
  border-radius: 16px;
  box-shadow:
    10px 12px 20px var(--shadow-dark),
    -8px -8px 18px var(--shadow-light);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b0e16; font-weight: 800;
  box-shadow: 0 6px 14px rgba(108,163,255,0.35);
}
.clock-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
.clock-label { color: var(--text-dim); font-size: 12px; }
#clock { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0.5px; }
.date { color: var(--text-dim); font-size: 12px; margin-left: 8px; opacity: .85; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.panel { padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.dimmed { color: var(--text-dim); font-weight: 600; font-size: 11px; letter-spacing: .2px; text-transform: uppercase; opacity: .5; }

.status-panel { grid-column: span 12; display: grid; gap: 12px; }
.status-row { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light); }
.status-dot.idle { background: #394155; }
.status-dot.running { background: var(--success); }
.status-dot.paused { background: var(--warn); }
.current-selection { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.label { color: var(--text-dim); font-size: 12px; }
.value { font-weight: 600; }
.muted { color: var(--text-dim); font-weight: 500; }

.timer-panel { grid-column: span 12; display: grid; gap: 12px; }
.timer-display { display: grid; place-items: center; padding: 8px; }
.elapsed { font-size: 40px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.controls { display: flex; gap: 14px; justify-content: center; }
.guard { text-align: center; color: var(--danger); min-height: 18px; margin: 0; }

.auftraege-panel { grid-column: span 12; }
.programme-panel { grid-column: span 12; }
.tags-panel { grid-column: span 12; }
.sessions-panel { grid-column: span 12; }

/* Gruppenlayout für Apps */
#programmeList > .dimmed { margin-top: 8px; margin-bottom: 6px; }
#programmeList > .btn-grid { margin-bottom: 12px; }

.adder { display: flex; gap: 12px; margin-bottom: 12px; }
.input {
  background: var(--bg);
  color: var(--text);
  border: 0;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
  outline: none;
}

.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.btn {
  appearance: none;
  background: linear-gradient(180deg, #181c2b, #121521);
  color: var(--text);
  border: 0;
  padding: 14px 16px;
  min-height: 44px;
  border-radius: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow:
    8px 10px 16px var(--shadow-dark),
    -6px -6px 14px var(--shadow-light);
  transition: transform .06s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(160deg, #1b2a4a, #13182a); }
.btn.active {
  outline: none;
  color: #ffa31a;
  text-shadow:
    0 0 8px rgba(255, 163, 26, 0.85),
    0 0 16px rgba(255, 163, 26, 0.65),
    0 0 28px rgba(255, 163, 26, 0.50),
    0 0 42px rgba(255, 163, 26, 0.35);
}
/* Keyboard-Fokus-Highlight für Navigation */
.btn:focus { outline: none; }
.btn:focus-visible {
  color: #ffa31a;
  text-shadow:
    0 0 6px rgba(255, 163, 26, 0.70),
    0 0 14px rgba(255, 163, 26, 0.55),
    0 0 22px rgba(255, 163, 26, 0.40);
}
/* Explizite Klasse für Keyboard-Navigation */
.btn.kb-focus {
  color: #ffa31a;
  text-shadow:
    0 0 6px rgba(255, 163, 26, 0.70),
    0 0 14px rgba(255, 163, 26, 0.55),
    0 0 22px rgba(255, 163, 26, 0.40);
}

/* Kleine Lösch-Buttons inline in Auftragskacheln */
.btn.delete {
  background: linear-gradient(180deg, #66334b, #1a1016);
  width: 30px;
  height: auto;
  aspect-ratio: 1/1;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
}
  
.btn.delete:hover { box-shadow: 8px 10px 16px var(--shadow-dark), -6px -6px 14px rgba(255, 107, 107, 0.08); }
.btn.delete:active { box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px rgba(255, 107, 107, 0.06); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  background: #141827;
  box-shadow: 6px 6px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
  cursor: pointer;
}
.chip.active { background: #1d2747; outline: 2px solid var(--accent); }

.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.session-item { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #121627; box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light); }
.session-item.summary { grid-template-columns: 1fr auto; }
.session-item .meta { color: var(--text-dim); font-size: 12px; }
.session-item .tags { color: var(--text-dim); font-size: 12px; }

.today { display: flex; align-items: baseline; gap: 8px; }

.empty-hint::after {
  content: attr(data-hint);
  color: var(--text-dim);
  display: block;
  padding: 6px 0 0 0;
  font-size: 13px;
}

.app-footer { text-align: center; color: var(--text-dim); padding: 16px 0 28px; }
/* Tabelle Umsatz */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; }
.table thead th { color: var(--text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.table tbody tr { background: #121627; }
.table tbody tr + tr { border-top: 8px solid transparent; }
.table tbody td { background: #121627; border-radius: 10px; box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light); }
.table input[type="number"], .table input[type="text"] { width: 100%; background: transparent; border: 0; color: var(--text); padding: 8px 10px; outline: none; font-weight: 600; }
.table input[type="text"]::placeholder { color: var(--text-dim); }
/* Nummern-Spinner (Buttons) entfernen */
.table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.table input[type="number"]::-webkit-outer-spin-button,
.table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.pagination .page-btn { min-width: 34px; min-height: 34px; padding: 8px 10px; border-radius: 10px; background: #151a2a; color: var(--text-dim); border: 0; cursor: pointer; box-shadow: 6px 6px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light); }
.pagination .page-btn:hover { color: var(--text); }
.pagination .page-btn.active { color: #ffa31a; text-shadow: 0 0 8px rgba(255,163,26,.6); }

/* Dashboard */
.dashboard-panel { grid-column: span 12; display: grid; gap: 12px; }
.dash-nav { display: flex; align-items: center; justify-content: center; gap: 30px; margin-bottom: 20px; }
.dash-date { font-weight: 700; letter-spacing: 0.4px; }
.dash-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dash-card { padding: 12px; border-radius: 12px; background: #121627; box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light); }
.dash-card h3 { margin: 0 0 8px; font-size: 14px; color: var(--text-dim); }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dash-list li { display: flex; align-items: center; justify-content: space-between; background: #0f1322; padding: 8px 10px; border-radius: 10px; }
.dash-list li.button-like { cursor: pointer; }
.dash-list li.button-like:hover { filter: brightness(1.05); }
.dash-list li.active span:first-child {
  color: #ffa31a;
  text-shadow:
    0 0 6px rgba(255, 163, 26, 0.70),
    0 0 14px rgba(255, 163, 26, 0.55),
    0 0 22px rgba(255, 163, 26, 0.40);
}

.dash-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.chart { width: 100%; height: auto; display: block; }
.legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Modal */
.modal { position: fixed; inset: 0; display: none; place-items: center; background: rgba(0, 0, 0, 0.45); }
.modal[aria-hidden="false"] { display: grid; }
.modal-content { width: min(560px, 92vw); padding: 12px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-body .row { display: grid; gap: 6px; margin: 8px 0; }
.modal-body .row-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-body .row label { color: var(--text-dim); font-size: 12px; }

/* Safari-freundliches Styling für Selects */
select.input {
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg);
  color: var(--text);
  border: 0;
  padding: 10px 36px 10px 12px; /* Platz für den Pfeil rechts */
  border-radius: 12px;
  min-height: 40px;
  box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a4a9b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}
select.input:hover { filter: brightness(1.02); }
select.input:focus { outline: none; box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light), 0 0 0 2px rgba(255, 163, 26, 0.35); }
.slider-wrap { display: grid; gap: 8px; margin-top: 8px; }
.double-slider { position: relative; height: 24px; display: grid; align-items: center; }
.double-slider .slider-scale { position: absolute; left: 0; right: 0; height: 6px; border-radius: 6px; background: linear-gradient(180deg, #181c2b, #121521); box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light); z-index: 1; }
.double-slider input[type="range"] { position: absolute; left: 0; right: 0; width: 100%; pointer-events: none; background: none; -webkit-appearance: none; appearance: none; height: 6px; z-index: 2; }
.double-slider input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.double-slider input[type="range"]::-moz-range-track { height: 6px; background: transparent; }
.double-slider input[type="range"]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: #1c2440; box-shadow: 4px 4px 8px var(--shadow-dark), -3px -3px 6px var(--shadow-light); }
.double-slider input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #1c2440; box-shadow: 4px 4px 8px var(--shadow-dark), -3px -3px 6px var(--shadow-light); border: none; }
.slider-labels { display: flex; align-items: center; justify-content: space-between; color: var(--text-dim); font-size: 12px; }

.left-panel {
  display: grid;
  place-items: center;
}

#leftPanelContent {
  background: var(--bg); 
  width: auto; height: 200px; aspect-ratio: 1/1; border-radius: 100%; padding: 2px; margin-bottom: 15px;
  box-shadow: 10px 12px 20px var(--shadow-dark), -8px -8px 18px var(--shadow-light);
  /* transform: rotate(18deg); */
  animation: rotate20s 20s linear infinite;
  animation-play-state: paused;
  will-change: transform;

}
#leftPanelContent.spinning { animation-play-state: running; }

@keyframes rotate20s {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#leftPanelContent::before {
  content: "";
  display: block;
  width: 5px;
  height: 30px;
  border-radius: 4px;
  background: var(--text);
  position: relative;
  top: 35px;
  left: 50%;
  transform: translate(-50%, -20px);
  z-index: 2;
}

#rangeApply {
  margin-top: 40px;
}



.umsatz-grid { grid-template-columns: repeat(12, 1fr); }
.umsatz-table-panel { grid-column: span 8; }
.avg-panel { grid-column: span 4; display: grid; gap: 12px; align-content: start; }
.avg-display { font-size: 48px; font-weight: 800; letter-spacing: .5px; }
.rev-panel { grid-column: span 12; }

@media (min-width: 900px) {
  .left-panel { grid-column: span 6; }
  .status-panel { grid-column: span 6; }
  .timer-panel { grid-column: span 6; }
  .auftraege-panel { grid-column: span 6; }
  .programme-panel { grid-column: span 6; }
  .tags-panel { grid-column: span 6; }
  .sessions-panel { grid-column: span 12; }
  .mobile-only { display: none; }
}

@media (max-width: 768px) {
  .container { grid-template-columns: 1fr; }
  .status-panel, .timer-panel, .auftraege-panel, .programme-panel, .tags-panel, .sessions-panel, .dashboard-panel, .rev-panel, .avg-panel, .umsatz-table-panel { grid-column: span 12; }
  .dash-content { grid-template-columns: 1fr; }
  .btn-grid { grid-template-columns: 1fr; }
  .umsatz-grid { grid-template-columns: repeat(1, 1fr); }
  .umsatz-table-panel { grid-column: span 12; }
  .avg-panel { grid-column: span 12; }
  .rev-panel { grid-column: span 12; }
  .brand .logo {
    width: 20px; height: 20px; border-radius: 3px; display: grid; place-items: center; aspect-ratio: 1/1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #0b0e16; font-weight: 800; font-size: 15px;
    box-shadow: 0 6px 14px rgba(108,163,255,0.35);
    padding-bottom: 5px;
    
  }
  .brand h1 { font-size: 12px; }
  .brand {display: none;}
  .btn {
    appearance: none;
    background: linear-gradient(180deg, #181c2b, #121521);
    color: var(--text);
    border: 0;
    padding: 14px 16px;
    min-height: 44px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow:
      8px 10px 16px var(--shadow-dark),
      -6px -6px 14px var(--shadow-light);
    transition: transform .06s ease, box-shadow .12s ease, background .12s;
  }
  /* Header untereinander */
  .app-header { flex-direction: column; align-items: stretch; gap: 8px; max-width: 60%; }
  .header-actions { flex-direction: column; width: 100%; justify-content: space-between; align-items: stretch; }
  .clock-wrap { width: 100%; justify-content: space-between; align-items: stretch; }
  .clock-label { font-size: 10px; }
  .date { font-size: 10px; }
  .panel { padding: 12px; }
  .panel h2 { font-size: 16px; }
  .panel-head { gap: 6px; }
  .panel-head h2 { margin-bottom: 6px; }
  .panel-head .adder { gap: 6px; }
  .panel-head .adder input { padding: 6px 8px; }
  .panel-head .adder button { padding: 6px 8px; }
  .panel-head .adder button.delete { width: 24px; height: 24px; }
  .panel-head .adder button.delete:hover { box-shadow: 6px 6px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light); }
  .panel-head .adder button.delete:active { box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light); }
  .desktop-only { display: none !important; }
  .mobile-only { margin: 16px 16px; width: 40%;}
  .left-panel {
    display: flex; justify-content: center; align-items: center;
  }
  #leftPanelContent {
    background: var(--bg); 
    width: calc(90%); height: auto; aspect-ratio: 1/1; border-radius: 100%; padding: 2px; 
    box-shadow: 10px 12px 20px var(--shadow-dark), -8px -8px 18px var(--shadow-light);
    /* transform: rotate(18deg); */
    animation: rotate20s 20s linear infinite;
    animation-play-state: paused;
    will-change: transform;
  
  }
  #leftPanelContent.spinning { animation-play-state: running; }
  
  @keyframes rotate20s {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  #leftPanelContent::before {
    content: "";
    display: block;
    width: 4.5px;
    height: 20px;
    border-radius: 4px;
    background: var(--text);
    position: relative;
    top: 30px;
    left: 50%;
    transform: translate(-50%, -20px);
    z-index: 2;
    box-shadow: 0px 0px 10px #fff, 0px 0px 20px #b6b6b6;
  }

  .mobile-header-row {
    display: flex; flex-direction: row;
  }
  .timer-panel {height: fit-content;}
  .elapsed {font-size: 28px; text-shadow: 0px 0px 5px #fff;}

.muted, #selectedAuftrag, #selectedProgram, #selectedTags {
  font-size: 12px;
}
#btnToggleEdit {display: none;}
}



