/* ═══════════════════════════════════════════════════════════════════════════
   cimBox 2 – NiceAdmin-aligned styles
   Based on NiceAdmin Bootstrap 5 theme, adapted for cimBox
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --cimdata-red: #DC003C;
  --cimdata-red-light: #ff1a56;
  --cimdata-red-dark: #b0002f;
  --sidebar-bg: #fff;
  --sidebar-width: 260px;
  --header-height: 60px;
  --body-bg: #f6f9ff;
  --card-border: #ebeef4;
}

/* ── Reset / global ─────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--body-bg);
  color: #444;
  font-size: 0.9rem;
  overflow-x: hidden;
}

a { color: #4154f1; text-decoration: none; }
a:hover { color: #EF004F; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  z-index: 997;
  transition: all 0.3s;
  padding: 0 20px;
  background: #fff;
  box-shadow: 0 2px 20px rgba(1,41,112,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header .logo {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #012970;
  line-height: 1;
}
.header .logo img { max-height: 36px; margin-right: 8px; }
.header .logo span {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--cimdata-red);
}

.header .toggle-sidebar-btn {
  font-size: 28px;
  padding-left: 10px;
  cursor: pointer;
  color: #012970;
}

.header-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0; padding: 0;
}
.header-nav > li { margin-left: 12px; }

.header-nav .nav-profile {
  color: #012970;
  cursor: pointer;
}
.header-nav .nav-profile .dropdown-header {
  text-align: center;
}
.header-nav .nav-profile .dropdown-header h6 {
  font-size: 1rem;
  margin-bottom: 0;
  font-weight: 600;
  color: #444;
}
.header-nav .nav-profile .dropdown-header span {
  font-size: 0.8rem;
  color: #aaa;
}
.header-nav .nav-profile img {
  max-height: 36px;
  border-radius: 50%;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 996;
  transition: all 0.3s;
  padding: 20px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  background: var(--sidebar-bg);
  box-shadow: 0 0 20px rgba(1,41,112,.08);
  border-right: 1px solid var(--card-border);
}

.sidebar-nav {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav li {
  padding: 0;
  margin: 0;
}

.sidebar-nav .nav-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #899bbd;
  font-weight: 700;
  margin: 10px 0 5px 15px;
  letter-spacing: 0.06em;
}

.sidebar-nav .nav-item {
  margin-bottom: 2px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #DC003C;
  padding: 10px 15px;
  transition: 0.3s;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-link i {
  font-size: 1rem;
  margin-right: 10px;
  color: #DC003C;
}
.sidebar-nav .nav-link:hover {
  color: #DC003C;
  background: #f6f9ff;
}
.sidebar-nav .nav-link.active {
  color: var(--cimdata-red);
  background: #f6f9ff;
  border-left-color: var(--cimdata-red);
}
.sidebar-nav .nav-link.active i {
  color: var(--cimdata-red);
}

.sidebar-nav .nav-link.collapsed::after {
  content: '\F282'; /* bi-chevron-down */
  font-family: 'bootstrap-icons';
  margin-left: auto;
  transition: transform 0.3s;
  font-size: 0.75rem;
}
.sidebar-nav .nav-link:not(.collapsed)::after {
  content: '\F282';
  font-family: 'bootstrap-icons';
  margin-left: auto;
  transform: rotate(180deg);
  font-size: 0.75rem;
}
.sidebar-nav .nav-link:not([data-bs-toggle])::after {
  content: none;
}

.sidebar-nav .nav-content {
  padding: 5px 0 5px 25px;
  list-style: none;
}
.sidebar-nav .nav-content a {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #012970;
  padding: 6px 15px;
  transition: 0.3s;
}
.sidebar-nav .nav-content a:hover,
.sidebar-nav .nav-content a.active {
  color: #DC003C;
}
.sidebar-nav .nav-content a i {
  font-size: 0.75rem;
  margin-right: 8px;
}

/* ── Main content ───────────────────────────────────────────────────────── */
#main {
  margin-top: var(--header-height);
  margin-left: var(--sidebar-width);
  padding: 20px 30px;
  transition: all 0.3s;
  min-height: calc(100vh - var(--header-height));
}

/* ── Toggle sidebar (collapsed) ─────────────────────────────────────────── */
body.toggle-sidebar .sidebar {
  left: calc(var(--sidebar-width) * -1);
}
body.toggle-sidebar #main {
  margin-left: 0;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.pagetitle {
  margin-bottom: 10px;
}
.pagetitle h1 {
  font-size: 24px;
  margin-bottom: 0;
  font-weight: 600;
  color: #012970;
}
.breadcrumb {
  font-size: 0.85rem;
  color: #899bbd;
}
.breadcrumb a { color: #899bbd; }
.breadcrumb a:hover { color: #DC003C; }
.breadcrumb .active { color: #444; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  border: 0;
  box-shadow: 0 0 30px rgba(1,41,112,.08);
  border-radius: 5px;
  margin-bottom: 30px;
}
.card-title {
  padding: 20px 0 15px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #012970;
}
.card-body { padding: 20px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  padding: 20px 0;
  font-size: 0.85rem;
  color: #899bbd;
  border-top: 1px solid var(--card-border);
}
.footer .credits a { color: #DC003C; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table > tbody > tr:hover {
  background-color: rgba(65,84,241,.04);
}
.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #012970;
}

/* ── Status badges ──────────────────────────────────────────────────────── */
.badge-status-aktiv {
  background-color: #198754;
  color: #fff;
}
.badge-status-neu {
  background-color: #ffc107;
  color: #000;
}
.badge-status-deaktiviert {
  background-color: #dc3545;
  color: #fff;
}

/* ── Export medium badges ───────────────────────────────────────────────── */
.badge-export {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2em 0.5em;
  margin-right: 3px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-cimdata {
  background: var(--cimdata-red);
  color: #fff;
  border-color: var(--cimdata-red);
}
.btn-cimdata:hover {
  background: var(--cimdata-red-dark);
  border-color: var(--cimdata-red-dark);
  color: #fff;
}

.btn-xs {
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

/* ── Form tabs ──────────────────────────────────────────────────────────── */
.nav-tabs .nav-link {
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  color: #012970;
}
.nav-tabs .nav-link.active {
  color: #DC003C;
  border-color: #dee2e6 #dee2e6 #fff;
}

/* ── DataTables integration ─────────────────────────────────────────────── */
.datatable-wrapper .datatable-top,
.datatable-wrapper .datatable-bottom {
  padding: 10px 0;
  margin-left: 10px;
  margin-right: 10px;
}
.datatable-wrapper .datatable-search input {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.375rem 0.75rem;
  font-size: 0.9rem;
}
.datatable-wrapper .datatable-selector {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.375rem 0.75rem;
}

/* ── Login page ─────────────────────────────────────────────────────────── */
.login-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--body-bg);
}
.login-card {
  max-width: 440px;
  width: 100%;
}
.login-card .logo {
  text-align: center;
  margin-bottom: 20px;
}
.login-card .logo span {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cimdata-red);
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  font-size: 0.875rem;
  border-radius: 4px;
}

/* ── Sortable (drag-and-drop) ───────────────────────────────────────────── */
.sortable-ghost {
  opacity: 0.4;
  background: #e8ecf7;
}
.sortable-chosen {
  cursor: grabbing;
}
.sortable-handle {
  cursor: grab;
  color: #899bbd;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  .sidebar { left: calc(var(--sidebar-width) * -1); }
  #main { margin-left: 0; }
  body.toggle-sidebar .sidebar { left: 0; }
  body.toggle-sidebar #main { margin-left: var(--sidebar-width); }
}

/* ── Rich-text / prose ──────────────────────────────────────────────────── */
.prose p { margin-bottom: 0.5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose strong { font-weight: 600; }

/* ── Filters row ────────────────────────────────────────────────────────── */
.filter-bar .form-select,
.filter-bar .form-control {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
}
