body {
  font-family: "Inter", sans-serif;
}

*,
html,
body {
  font-size: 0.9rem;
}

.bg-primary {
  --bs-bg-opacity: 1;
  background-color: #263d6e !important;
}

.bg-secondary {
  background-color: #416ba8 !important;
}

.bg-grey {
  background-color: #f8f9fa !important;
}

.btn-primary {
  --bs-btn-bg: #263d6e !important;
  --bs-btn-border-color: #263d6e !important;
}

.btn-outline-primary {
  --bs-btn-color: #263d6e !important;
  --bs-btn-border-color: #263d6e !important;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: #436ca6 !important;
}

.nav-link {
  --bs-nav-link-color: #263d6e !important;
}

nav .nav-link {
  --bs-nav-link-color: #373c40 !important;
  font-size: 14px;
  line-height: 1;
  display: inline;
}

nav .nav-link:hover {
  color: #263d6e !important;
}

aside .nav-link {
  --bs-nav-link-color: #373c40 !important;
  font-size: 14px;
  line-height: 1;
  display: flex;
  gap: 5px;
  white-space: nowrap;
  align-items: center;
  text-decoration: none;
  transition: 0.4s ease;
  width: -webkit-fill-available;
}

/*.container-grid {*/
/*  display: grid;*/
/*  grid-template-columns: 150px 1fr;*/
/*}*/

.sidebar {
  z-index: 100;
  overflow: hidden;
  box-shadow:
    0 0.5em 1.5em #aeaeae4f,
    0 0.125em 0.5em #aeaeae3d;
  width: 150px;
  height: 100vh;
  position: sticky;
  top: 0;
}

.apl_thumb_image {
  transition: 1s ease;
}

.apl_thumb_image:hover {
  -webkit-filter: blur(1px);
  transition: 0.5s ease;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: rgb(255 255 255);
}

aside .nav-link:hover {
  color: white;
  background-color: #263d6e;
}

.sidebar-text {
  font-size: 14px !important;
}

.dropdown-toggle::after {
  margin: 0px 0px 0 auto;
}

.modal-body label {
  font-size: 0.85rem;
}

.highlight-row td {
  background-color: #ebebeb;
}

.changed-field {
  background-color: #f3f3f3 !important;
}

.zahl-zweistellig {
  width: 58px;
}

td.summe {
  text-align: right;
}

up-modal.formular-modal {
  .col-sm-2 {
    width: 34% !important;
  }

  .offset-sm-2 {
    margin-left: 34% !important;
  }

  .col-sm-10 {
    width: 66% !important;
  }
}

.tabelle-scrollable {
  max-height: 300px;
  overflow-y: auto;
}

.tabelle-klein {
  height: 300px;
}

.form-row textarea {
}

.kopftext textarea,
.fusstext textarea {
  /* height controlled by rows attribute */
}

.table-fixed {
/*  table-layout: fixed;*/
/*  width: 100%;*/
  min-width: 900px;
}

/* TODO: in scss/_utilities.scss umsetzen */
.w-2  { width: 2% !important; }
.w-5  { width: 5% !important; }
.w-8  { width: 8% !important; }
.w-10 { width: 10% !important; }
.w-15 { width: 15% !important; }
.w-20 { width: 20% !important; }

.w-30 { width: 30% !important; }
.w-35 { width: 35% !important; }
.w-40 { width: 40% !important; }
.w-45 { width: 45% !important; }

.w-55 { width: 55% !important; }
.w-60 { width: 60% !important; }
.w-65 { width: 65% !important; }
.w-70 { width: 70% !important; }

.w-80 { width: 80% !important; }
.w-85 { width: 85% !important; }
.w-90 { width: 90% !important; }
.w-95 { width: 95% !important; }

up-modal-box {
  border-radius: 1rem !important;
}

up-modal-dismiss {
  font-size: 2rem !important;
  line-height: 1 !important;
  color: #6c757d !important;
  top: 1.25rem !important;
  right: 1.5rem !important;
  text-decoration: none !important;
  font-weight: 300 !important;
}

up-modal-dismiss:hover {
  color: #212529 !important;
}

/* Kompakte Widget-Karte */
.widget-card {
    min-height: 95px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.widget-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15) !important;
}

/* Perfekt lesbare Titelbeschriftung */
.widget-label {
    color: rgba(255, 255, 255, 0.9); /* Fast 100% weiß, gestochen scharf */
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Rein dekoratives Icon (sieht nicht wie ein Button aus) */
.widget-icon-inline {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.35); /* Sanft transparent, tritt optisch zurück */
    flex-shrink: 0;
    margin-left: 0.5rem;
}

/* Die Custom-Gradients */
.widget-indigo  { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); }
.widget-ocean   { background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%); }
.widget-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.widget-amber   { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.widget-rose    { background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%); }
.widget-violet  { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.widget-slate   { background: linear-gradient(135deg, #64748b 0%, #334155 100%); }
.widget-teal    { background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%); }

/* Trend-Badge in Kennzahl-Widgets */
.widget-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
}

/* Helle Panel-Karten (Charts, Listen, Tools) */
.panel-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}
.panel-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
}
.panel-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    margin: 0;
}

/* Live-Uhr / Zeiterfassung */
.clock-time {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #1e293b;
}

/* Aufgabenliste */
.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 190px;
    overflow-y: auto;
}
.task-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.07);
    font-size: 0.875rem;
}
.task-list li:last-child { border-bottom: 0; }
.task-list li.done span.task-text {
    text-decoration: line-through;
    color: #94a3b8;
}

/* Timeline für Termine / Montagen */
.mini-timeline {
    list-style: none;
    margin: 0;
    padding-left: 0.75rem;
    border-left: 2px solid #e2e8f0;
}
.mini-timeline li {
    position: relative;
    padding: 0 0 0.9rem 0.85rem;
    font-size: 0.85rem;
}
.mini-timeline li:last-child { padding-bottom: 0; }
.mini-timeline li::before {
    content: "";
    position: absolute;
    left: -1.4rem;
    top: 0.35rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 0 0 3px #fff;
}
.mini-timeline li.is-warning::before { background: #f59e0b; }
.mini-timeline li.is-danger::before  { background: #f43f5e; }

/* Schnellaktionen */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.4rem;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 0.75rem;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.quick-action i { font-size: 1.35rem; }
.quick-action:hover {
    transform: translateY(-2px);
    background: #6366f1;
    color: #fff;
}

/* Münzwurf */
.muenzwurf-coin {
    display: inline-block;
}
.muenzwurf-coin.dreht-sich {
    animation: muenzwurf-drehung 0.6s ease-out;
}
@keyframes muenzwurf-drehung {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(1080deg); }
}

/* Notizzettel */
.note-area {
    border: 0;
    resize: none;
    width: 100%;
    min-height: 150px;
    background: #fffbeb;
    border-radius: 0.5rem;
    padding: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.5;
}
.note-area:focus { outline: 2px solid #fcd34d; }

/* Material- / Lagerbestand */
.stock-row {
    margin-bottom: 0.7rem;
}
.stock-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 0.5rem;
}
.stock-value {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.stock-row .progress {
    background-color: #f1f5f9;
    margin-top: 0.2rem;
}

/* ===================== Dark Mode ===================== */

/* Tabellen-Varianten (bleiben in Bootstrap sonst immer hell,
   unabhängig davon ob die Klasse auf <thead>, <tr> oder <th> gesetzt ist) */
[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #1e293b;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: #334155;
}
[data-bs-theme="dark"] .table-secondary {
    --bs-table-bg: #334155;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: #475569;
}

/* Allgemeine bg-light/text-bg-light Flächen (Header-Leisten, Badges, Suchergebnisse) */
[data-bs-theme="dark"] .bg-light {
    background-color: #1e293b !important;
}
[data-bs-theme="dark"] .text-bg-light {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Outline-Buttons in eigener Akzentfarbe (sonst dunkelblauer Text auf dunklem Grund) */
[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #7fa5e6 !important;
    --bs-btn-border-color: #7fa5e6 !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-hover-bg: #416ba8 !important;
    --bs-btn-hover-border-color: #416ba8 !important;
}

/* Nav-Links (Tabs, Pills, Kopf-/Seitennavigation) sind global auf dunkelblauen
   Text fest verdrahtet (#263d6e / #373c40) - im Dark Mode auf dunklem Grund
   unlesbar. Betrifft u.a. die Tabs in den Systemeinstellungen. */
[data-bs-theme="dark"] .nav-link {
    --bs-nav-link-color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link:focus {
    --bs-nav-link-hover-color: #93c5fd !important;
}
[data-bs-theme="dark"] nav .nav-link,
[data-bs-theme="dark"] aside .nav-link {
    --bs-nav-link-color: #cbd5e1 !important;
}
[data-bs-theme="dark"] nav .nav-link:hover {
    color: #93c5fd !important;
}
[data-bs-theme="dark"] aside .nav-link:hover {
    color: #fff !important;
    background-color: #416ba8 !important;
}
[data-bs-theme="dark"] .nav-pills .nav-link.active,
[data-bs-theme="dark"] .nav-pills .show > .nav-link {
    background-color: #416ba8 !important;
    color: #fff !important;
}
[data-bs-theme="dark"] .nav-tabs {
    --bs-nav-tabs-link-active-color: #f1f5f9;
    --bs-nav-tabs-link-active-bg: #1e293b;
    --bs-nav-tabs-link-active-border-color: #334155 #334155 #1e293b;
    border-bottom-color: #334155;
}
[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #334155 #334155 #334155;
}

/* Dashboard: Panel-/Widget-Karten */
[data-bs-theme="dark"] .panel-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .panel-title {
    color: #94a3b8;
}
[data-bs-theme="dark"] .clock-time {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .task-list li {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .task-list li.done span.task-text {
    color: #64748b;
}
[data-bs-theme="dark"] .mini-timeline {
    border-left-color: #334155;
}
[data-bs-theme="dark"] .mini-timeline li::before {
    box-shadow: 0 0 0 3px #1e293b;
}
[data-bs-theme="dark"] .quick-action {
    background: #0f172a;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .note-area {
    background: #3f3319;
    color: #f1f5f9;
}
[data-bs-theme="dark"] .note-area:focus {
    outline-color: #92702c;
}
[data-bs-theme="dark"] .stock-name {
    color: #cbd5e1;
}
[data-bs-theme="dark"] .stock-row .progress {
    background-color: #334155;
}
[data-bs-theme="dark"] .highlight-row td {
    background-color: #334155;
}
[data-bs-theme="dark"] .changed-field {
    background-color: #334155 !important;
}
[data-bs-theme="dark"] #global-search-results {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0;
}