/* LabCore skin on top of Bootstrap 3.3.7.
   Tokens mirror agkit.io-ui/src/app.css so the two products share a palette.
   Markup stays Bootstrap 3; this file only recolours and relays it out. */

:root {
  --radius: 0.5rem;
  --background: oklch(0.985 0.003 247.858);
  --foreground: oklch(0.129 0.042 264.695);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.129 0.042 264.695);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.129 0.042 264.695);
  --primary: oklch(0.208 0.042 265.755);
  --primary-foreground: oklch(0.984 0.003 247.858);
  --secondary: oklch(0.968 0.007 247.896);
  --secondary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.554 0.046 257.417);
  --accent: oklch(40.238% 0.13831 26.019);
  --accent-foreground: oklch(97.913% 0.00011 271.152);
  --destructive: oklch(0.577 0.245 27.325);
  --success: oklch(0.55 0.15 150);
  --warning: oklch(0.75 0.16 75);
  --info: oklch(0.6 0.12 240);
  --border: oklch(0.929 0.013 255.508);
  --input: oklch(0.929 0.013 255.508);
  --ring: oklch(0.704 0.04 256.788);
  --sidebar: oklch(0.984 0.003 247.858);
  --sidebar-foreground: oklch(0.129 0.042 264.695);
  --sidebar-primary: oklch(0.208 0.042 265.755);
  --sidebar-primary-foreground: oklch(0.984 0.003 247.858);
  --sidebar-accent: oklch(0.968 0.007 247.896);
  --sidebar-accent-foreground: oklch(0.208 0.042 265.755);
  --sidebar-border: oklch(0.929 0.013 255.508);
  --header: oklch(0.208 0.042 265.755);
  --header-foreground: oklch(0.984 0.003 247.858);
  --shadow: 0 1px 2px oklch(0 0 0 / 6%), 0 1px 3px oklch(0 0 0 / 8%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-width: 235px;
  --header-height: 60px;
  /* spacing scale; every margin and padding below picks from it */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  /* side gutter grows with the viewport, content stops widening at --content-max */
  --gutter: clamp(var(--space-2), 2.5vw, 48px);
  --content-max: 1680px;
  color-scheme: light;
}

[data-theme="dark"] {
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.984 0.003 247.858);
  --card: oklch(0.208 0.042 265.755);
  --card-foreground: oklch(0.984 0.003 247.858);
  --popover: oklch(0.208 0.042 265.755);
  --popover-foreground: oklch(0.984 0.003 247.858);
  --primary: oklch(0.929 0.013 255.508);
  --primary-foreground: oklch(0.208 0.042 265.755);
  --secondary: oklch(0.279 0.041 260.031);
  --secondary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --accent: oklch(0.65 0.14 26.019);
  --accent-foreground: oklch(0.984 0.003 247.858);
  --destructive: oklch(0.704 0.191 22.216);
  --success: oklch(0.7 0.15 150);
  --warning: oklch(0.8 0.16 75);
  --info: oklch(0.7 0.12 240);
  --border: oklch(1 0 0 / 12%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.551 0.027 264.364);
  --sidebar: oklch(0.208 0.042 265.755);
  --sidebar-foreground: oklch(0.984 0.003 247.858);
  --sidebar-primary: oklch(0.929 0.013 255.508);
  --sidebar-primary-foreground: oklch(0.208 0.042 265.755);
  --sidebar-accent: oklch(0.279 0.041 260.031);
  --sidebar-accent-foreground: oklch(0.984 0.003 247.858);
  --sidebar-border: oklch(1 0 0 / 10%);
  --header: oklch(0.17 0.04 265);
  --header-foreground: oklch(0.984 0.003 247.858);
  --shadow: 0 1px 2px oklch(0 0 0 / 40%);
  color-scheme: dark;
}

/* ---- base ---- */
html { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
}
a { color: var(--primary); }
a:hover, a:focus { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font); color: var(--foreground); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
hr { border-top-color: var(--border); }
code, pre, kbd, samp { font-family: var(--mono); }
pre { background: var(--muted); color: var(--foreground); border-color: var(--border); }
code { background: var(--muted); color: var(--accent); }
::selection { background: var(--primary); color: var(--primary-foreground); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---- shell: header, sidebar, content ---- */
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }
/* django-leaflet's raw textarea is hidden by attribute; .form-control would show it */
[hidden] { display: none !important; }
.wrapper { position: relative; width: 100%; min-height: 100vh; }

.main-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: var(--header); color: var(--header-foreground);
  box-shadow: var(--shadow);
}
.main-header .seipkon-logo {
  float: left; display: flex; align-items: center; justify-content: center;
  width: var(--sidebar-width); height: var(--header-height);
  background: var(--sidebar); border-right: 1px solid var(--sidebar-border);
}
.seipkon-logo a { display: inline-block; max-height: inherit; }
.seipkon-logo img { max-width: 90%; max-height: 44px; vertical-align: middle; }
.seipkon-logo p { margin: 0; color: var(--muted-foreground); font-size: 12px; }
.main-header .navbar.navbar-default {
  background: transparent; border: 0; border-radius: 0; margin: 0; min-height: var(--header-height);
}
.header-top-section { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-height); }
#sidebarCollapse {
  background: transparent; border: 0; color: var(--header-foreground);
  font-size: 18px; padding: 8px 12px; border-radius: var(--radius); margin: 0;
}
#sidebarCollapse:hover { background: oklch(1 0 0 / 10%); }
.nav-top { margin: 0; display: flex; align-items: center; }
.nav-top > li > a {
  color: var(--header-foreground); padding: 8px 12px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 6px;
}
.nav-top > li > a:hover, .nav-top > li > a:focus, .nav-top > li.open > a, .nav-top > li.open > a:hover, .nav-top > li.open > a:focus { background: oklch(1 0 0 / 12%); color: var(--header-foreground); }
.nav-top > li > a:hover p, .nav-top > li.open > a p { color: var(--header-foreground); }
.nav-top > li > a > span {
  display: inline-block; min-width: 18px; padding: 0 5px; font-size: 11px; line-height: 18px;
  text-align: center; border-radius: 999px; background: var(--accent); color: var(--accent-foreground);
}
.profile-avator { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.profile-avatar-txt { display: flex; align-items: center; gap: 6px; }
.profile-avatar-txt > p { margin: 0; color: var(--header-foreground); font-weight: 500; }

/* header dropdowns */
.message-box, .profile-box, .notification-box {
  right: 0; left: auto; margin: 6px 0 0; padding: 0; min-width: 240px;
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px oklch(0 0 0 / 14%);
}
.message-box { width: 320px; }
.message-header, .notification-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.message-header h4, .notification-header h4 { margin: 0; font-size: 14px; }
.message-body, .notification-body { max-height: 320px; overflow-y: auto; }
.message-body ul, .profile-box ul { list-style: none; margin: 0; padding: 0; }
.message-body li a, .profile-box li a { display: block; padding: 10px 14px; color: var(--popover-foreground); }
.message-body li + li a, .profile-box li + li a { border-top: 1px solid var(--border); }
.message-body li a:hover, .profile-box li a:hover { background: var(--muted); color: var(--popover-foreground); }
.profile-box li a i { width: 20px; margin-right: 6px; color: var(--muted-foreground); }
.single-notification, .single-message { overflow: hidden; }
.notification-img, .message-img {
  float: left; width: 36px; height: 36px; line-height: 36px; margin-right: 10px;
  text-align: center; border-radius: var(--radius); color: #fff;
}
.notification-txt h4, .message-txt h4 { margin: 0 0 2px; font-size: 13px; font-weight: 500; }
.notification-txt span, .message-txt p { color: var(--muted-foreground); font-size: 12px; margin: 0; }
.bg_yellow { background: var(--warning); }
.bg_green { background: var(--success); }
.bg_blue { background: var(--info); }
.bg_red { background: var(--destructive); }

/* sidebar */
#sidebar {
  position: fixed; top: 0; left: 0; z-index: 998;
  width: var(--sidebar-width); height: 100vh; overflow-y: auto;
  padding-top: var(--header-height); padding-bottom: 40px;
  background: var(--sidebar); color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
  transition: margin-left 0.2s ease;
}
#sidebar.active { margin-left: calc(-1 * var(--sidebar-width)); }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px; }
.profile-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.profile-info h3 { font-size: 14px; margin: 0; font-weight: 600; }
.profile-info p { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.menu-section h3 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground); margin: 12px 16px 4px;
}
#sidebar ul.components { padding: 0 8px; margin: 0; }
#sidebar ul li a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0; border-radius: var(--radius);
  color: var(--sidebar-foreground); font-weight: 500;
}
#sidebar ul li a i { width: 18px; text-align: center; color: var(--muted-foreground); }
#sidebar ul li a:hover, #sidebar ul li a.active { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
#sidebar ul li.active > a { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
#sidebar ul li.active > a i { color: inherit; }
#sidebar ul li a[data-toggle="collapse"]::after {
  content: "\f107"; font-family: "Font Awesome 5 Free"; font-weight: 900;
  margin-left: auto; font-size: 11px; color: var(--muted-foreground); transition: transform 0.15s;
}
#sidebar ul li a[data-toggle="collapse"][aria-expanded="true"]::after { transform: rotate(180deg); }
#sidebar ul ul { padding-left: 28px; }
#sidebar ul ul a { padding: 6px 10px; font-weight: 400; font-size: 13px; }

/* content */
#content {
  position: absolute; top: 0; right: 0;
  width: calc(100% - var(--sidebar-width)); min-height: 100vh;
  padding-top: var(--header-height);
  display: flex; flex-direction: column;
  transition: width 0.2s ease;
}
#content.active { width: 100%; }
.page-content { flex: 1; padding: 0 var(--gutter) var(--space-5); }
.page-content > .container-fluid, .loaf_div > * { max-width: var(--content-max); margin-inline: auto; }
.page-content > .container-fluid { padding: 0; }

/* page header: one line of heading and crumbs; daughters' older
   .breadcromb-area markup keeps its own rules below */
.loaf_div { background: var(--card); border-bottom: 1px solid var(--border); padding: 0 var(--gutter); }
.page-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--space-1) var(--space-4); padding: var(--space-3) 0; margin: 0 auto; border: 0;
}
.page-header h1 { font-size: 18px; font-weight: 600; margin: 0; }
.page-header h1 small { font-size: 13px; font-weight: 400; color: var(--muted-foreground); margin-left: var(--space-2); }
.page-header h1:empty, .crumbs:empty, .page-header:has(h1:empty):has(.crumbs:empty) { display: none; }
.crumbs { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted-foreground); }
.crumbs > li + li::before { content: "/"; padding: 0 var(--space-2); }
.crumbs a { color: var(--foreground); }
.loaf_div .breadcromb-area { border-bottom: 0; padding-inline: 0; }
.loaf_div > .row { margin-inline: auto; }
.loaf_div { position: sticky; top: var(--header-height); z-index: 500; }
.breadcromb-area { background: var(--card); padding: var(--space-3) 0; }
.breadcromb-area .row, .breadcromb-area .col-md-6, .breadcromb-area .col-sm-6 { display: flex; align-items: center; }
.breadcromb-area .row { justify-content: space-between; margin: 0; }
.seipkon-breadcromb-left h3, .breadcromb-area h3 { margin: 0; font-size: 18px; }
.seipkon-breadcromb-right { text-align: right; margin-left: auto; }
.seipkon-breadcromb-right ul { margin: 0; padding: 0; list-style: none; }
.seipkon-breadcromb-right li { display: inline-block; color: var(--muted-foreground); }
.seipkon-breadcromb-right ul > li + li::before { content: "/"; padding: 0 6px; color: var(--muted-foreground); }
.seipkon-breadcromb-right a { color: var(--foreground); }
.page-box, .widget_card_page, .card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--space-4) var(--space-5); margin-top: var(--space-4);
}
.page-box h3, .page-box .title { font-size: 16px; margin: 0 0 12px; }
.page-box h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 0; }
.card-text { font-size: 14px; }
/* stat tiles: neutral card, colour only on the icon chip, label above number */
.widget_card_page { text-align: left; padding: 14px 16px; }
.widget_card_page.grid_flex { display: flex; align-items: center; gap: 14px; }
.widget-icon {
  flex: 0 0 44px; width: 44px; height: 44px; line-height: 44px; margin: 0;
  border-radius: 10px; color: #fff; font-size: 18px; text-align: center;
}
.widget_bg_blue .widget-icon { background: var(--info); }
.widget_bg_purple .widget-icon { background: var(--primary); }
.widget_bg_dark_yellow .widget-icon { background: var(--warning); color: var(--foreground); }
.widget_bg_dark_red .widget-icon { background: var(--accent); }
[data-theme="dark"] .widget_bg_purple .widget-icon { background: var(--secondary); color: var(--foreground); }
.widget-page-text { min-width: 0; }
.widget-page-text h4 { font-size: 12px; font-weight: 500; margin: 0 0 2px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.04em; }
.widget-page-text h2, .widget-page-text h3 { font-size: 22px; font-weight: 600; margin: 0; color: var(--foreground); font-variant-numeric: tabular-nums; }
.widget-page-text p { color: var(--muted-foreground); margin: 0; }
.widget-page-text .fa-spinner { color: var(--muted-foreground); font-size: 20px; }
.grid_flex { display: grid; grid-template-columns: 30% 70%; }
.seipkon-footer-area {
  padding: 12px 16px; text-align: center; font-size: 12px;
  color: var(--muted-foreground); border-top: 1px solid var(--border); background: var(--card);
}
.seipkon-footer-area p { margin: 0; }
.messages { list-style: none; padding: 0; margin: 12px 0 0; }
.messages li {
  padding: 10px 14px; margin-bottom: 8px; border-radius: var(--radius);
  background: var(--muted); border-left: 4px solid var(--info);
}
.messages li.success { border-left-color: var(--success); }
.messages li.warning { border-left-color: var(--warning); }
.messages li.error { border-left-color: var(--destructive); }
.error-page-box { text-align: center; padding: 60px 20px; }
.error-page-box h2 { font-size: 96px; font-weight: 700; margin: 0; color: var(--muted-foreground); }
.error-page-box h4 { font-size: 22px; margin: 8px 0 16px; }
.error-page-box p { color: var(--muted-foreground); max-width: 48em; margin: 0 auto 10px; }
.error-page-box code { display: inline-block; margin-top: 8px; }

/* page loader: a thin bar under the header, gone on load.
   Tests wait on div.loader-section becoming invisible, so the markup stays. */
#loader-wrapper { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 999999; overflow: hidden; }
#loader-wrapper .loader-section { position: absolute; top: 0; height: 100%; width: 51%; background: var(--accent); }
#loader-wrapper .section-left { left: 0; }
#loader-wrapper .section-right { right: 0; }
#loader { display: none; }
.loaded #loader-wrapper { display: none; }

/* ---- bootstrap 3 recolour ---- */
.btn { border-radius: var(--radius); font-weight: 500; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.btn-default, .btn-bordered-default { background: var(--card); color: var(--foreground); border-color: var(--border); }
.btn-default:hover, .btn-default:focus, .btn-bordered-default:hover { background: var(--muted); color: var(--foreground); border-color: var(--border); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-info { background: var(--info); border-color: var(--info); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: var(--foreground); }
.btn-danger { background: var(--destructive); border-color: var(--destructive); }
.btn-link { color: var(--primary); }
.btn-bordered-info, .btn-bordered-primary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-bordered-info:hover, .btn-bordered-primary:hover { background: var(--primary); color: var(--primary-foreground); }

.form-control {
  height: 36px; border-radius: var(--radius); box-shadow: none;
  background: var(--card); color: var(--foreground); border: 1px solid var(--input);
}
.form-control:focus { border-color: var(--ring); box-shadow: 0 0 0 3px oklch(from var(--ring) l c h / 25%); }
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background: var(--muted); color: var(--muted-foreground); }
textarea.form-control { height: auto; }
label, label.control-label { font-weight: 500; color: var(--foreground); }
.help-block { color: var(--muted-foreground); }
.has-error .form-control { border-color: var(--destructive); }
.has-error .help-block, .has-error .control-label { color: var(--destructive); }
.input-group-addon { background: var(--muted); border-color: var(--input); color: var(--muted-foreground); border-radius: var(--radius); }
.required::after, label.required::after { content: " *"; color: var(--accent); }
.form-checkbox { margin-bottom: 10px; }
.lost-pass a { color: var(--muted-foreground); }
select.form-control { appearance: auto; }

.table { color: var(--foreground); }
.table > thead > tr > th {
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground);
}
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td { border-top: 1px solid var(--border); vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd), .stripe > tbody > tr:nth-of-type(odd) { background: var(--muted); }
.table-hover > tbody > tr:hover { background: var(--secondary); }
.table-bordered, .table-bordered > thead > tr > th, .table-bordered > tbody > tr > td { border-color: var(--border); }
.table-condensed > tbody > tr > td { padding: 4px 6px; }
/* row action icons: light and quiet until hovered */
.table td a > .fa, .table td > .fa { font-size: 12px; color: var(--muted-foreground); margin: 0 3px; vertical-align: -1px; }
.table td a:hover > .fa, .table td a:focus > .fa { color: var(--primary); }
.table td a.pull-right { margin-left: 2px; }
/* icon-only row actions: quiet until hovered, coloured only by intent */
.table .btn-xs {
  background: transparent; border-color: transparent; color: var(--muted-foreground);
  padding: 2px 6px; margin-left: 2px; box-shadow: none; font-size: 12px;
}
.table .btn-xs:hover, .table .btn-xs:focus { background: var(--muted); color: var(--primary); border-color: transparent; }
.table .btn-danger.btn-xs:hover, .table .btn-danger.btn-xs:focus { color: var(--destructive); }
.table .btn-xs[disabled] { color: var(--border); background: transparent; }
/* farm group row above its fields */
tr.farm_row td, td.farm_row { background: var(--muted); color: var(--foreground); font-weight: 600; }
/* section headings inside a page-box or panel read at one size */
.page-box .panel-heading, .panel .panel-heading { padding: 0 0 10px; }
.page-box .panel-heading h2, .page-box .panel-heading h3, .page-box .panel-heading h4,
.panel .panel-heading h4, .page-box > h4, .panel-body > h4 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.panel-default > .panel-heading, .panel-primary > .panel-heading { padding: 10px 15px; }

.panel { background: var(--card); border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-default > .panel-heading { background: var(--muted); color: var(--foreground); border-color: var(--border); }
.panel-primary > .panel-heading { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.panel-heading { border-radius: var(--radius) var(--radius) 0 0; }
.panel-footer { background: var(--muted); border-color: var(--border); }
.well { background: var(--muted); border-color: var(--border); border-radius: var(--radius); box-shadow: none; }
.list-group-item { background: var(--card); border-color: var(--border); color: var(--foreground); }
.list-group-item.active { background: var(--primary); border-color: var(--primary); }

.alert { border-radius: var(--radius); border-width: 0; border-left: 4px solid; }
.alert-success { background: oklch(from var(--success) l c h / 12%); color: var(--foreground); border-color: var(--success); }
.alert-info { background: oklch(from var(--info) l c h / 12%); color: var(--foreground); border-color: var(--info); }
.alert-warning { background: oklch(from var(--warning) l c h / 15%); color: var(--foreground); border-color: var(--warning); }
.alert-danger { background: oklch(from var(--destructive) l c h / 12%); color: var(--foreground); border-color: var(--destructive); }
.label { border-radius: 999px; font-weight: 500; padding: 0.2em 0.7em; }
.label-default { background: var(--muted-foreground); }
.label-primary { background: var(--primary); }
.label-success { background: var(--success); }
.label-info { background: var(--info); }
.label-warning { background: var(--warning); color: var(--foreground); }
.label-danger { background: var(--destructive); }
.badge { background: var(--primary); color: var(--primary-foreground); border-radius: 999px; }

.nav-tabs { border-bottom-color: var(--border); }
.nav-tabs > li > a { color: var(--muted-foreground); border-radius: var(--radius) var(--radius) 0 0; margin-right: 0; }
.nav-tabs > li > a:hover { background: var(--muted); border-color: transparent; }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
  background: var(--card); color: var(--foreground); border-color: var(--border) var(--border) var(--card);
}
.nav-pills > li.active > a, .nav-pills > li.active > a:hover { background: var(--primary); color: var(--primary-foreground); }
.nav-pills > li > a { border-radius: var(--radius); }
.nav:not(.nav-top) > li > a:hover, .nav:not(.nav-top) > li > a:focus { background: var(--muted); color: var(--foreground); }
.pagination > li > a, .pagination > li > span { color: var(--primary); background: var(--card); border-color: var(--border); }
.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > a:focus { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.breadcrumb { background: transparent; padding: 0; margin: 0; }

.dropdown-menu {
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px oklch(0 0 0 / 14%);
}
.dropdown-menu > li > a { color: var(--popover-foreground); padding: 6px 14px; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background: var(--muted); color: var(--popover-foreground); }
.dropdown-menu .divider { background: var(--border); }
.modal-content { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 16px 48px oklch(0 0 0 / 25%); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-header .close { color: var(--foreground); opacity: 0.5; text-shadow: none; }
.popover { background: var(--popover); color: var(--popover-foreground); border-color: var(--border); border-radius: var(--radius); }
.popover-title { background: var(--muted); border-color: var(--border); }
.tooltip-inner { background: var(--foreground); color: var(--background); border-radius: var(--radius); }
.progress { background: var(--muted); border-radius: 999px; box-shadow: none; }
.progress-bar { background: var(--primary); box-shadow: none; }
.close { text-shadow: none; color: var(--foreground); }
.text-muted { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--destructive); }
.text-success { color: var(--success); }
.bg-primary { background: var(--primary); color: var(--primary-foreground); }
.page-header { border-bottom-color: var(--border); }
blockquote { border-left-color: var(--border); color: var(--muted-foreground); }

/* DataTables (bootstrap flavour) */
.dataTables_wrapper .dataTables_filter input { margin-left: 6px; }
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_length label { color: var(--muted-foreground); }
table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::after { color: var(--muted-foreground); }
div.dt-buttons .btn { margin-right: 4px; }
table.dataTable tbody tr { background: transparent; }

/* bootstrap-select and daterangepicker inherit the card colours */
.bootstrap-select > .dropdown-toggle { background: var(--card); color: var(--foreground); border-color: var(--input); border-radius: var(--radius); }
.daterangepicker { background: var(--popover); color: var(--popover-foreground); border-color: var(--border); border-radius: var(--radius); }
.daterangepicker .calendar-table { background: var(--popover); border-color: var(--border); }
.daterangepicker td.off { background: transparent; color: var(--muted-foreground); }
.daterangepicker td.available:hover, .daterangepicker th.available:hover { background: var(--muted); }
.daterangepicker td.active, .daterangepicker td.active:hover { background: var(--primary); color: var(--primary-foreground); }
.daterangepicker .ranges li:hover { background: var(--muted); }
.daterangepicker .ranges li.active { background: var(--primary); }

/* Leaflet and select2 stay light; keep their popups readable on the dark shell */
.leaflet-container { border-radius: var(--radius); color: #333; }
.leaflet-popup-content-wrapper, .leaflet-bar a { color: #333; }
.select2-container--default .select2-selection--single { border-color: var(--input); border-radius: var(--radius); height: 36px; background: var(--card); color: var(--foreground); }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 34px; color: var(--foreground); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px; }
.select2-dropdown { background: var(--popover); color: var(--popover-foreground); border-color: var(--border); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--primary); }

/* zinnia articles */
.entry-title a { color: var(--foreground); }
.entry-info, .entry-footer { color: var(--muted-foreground); font-size: 13px; }
.mail-sidebar, .mailbox-left { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }

/* theme toggle in the header */
#theme-toggle .fa-sun { display: none; }
[data-theme="dark"] #theme-toggle .fa-sun { display: inline-block; }
[data-theme="dark"] #theme-toggle .fa-moon { display: none; }

/* field journal: the event palette scrolls beside the calendar instead of setting the page height */
#wrap #external-events { max-height: 640px; overflow-y: auto; }

/* ---- responsive ---- */
@media (max-width: 991px) {
  .main-header .seipkon-logo { width: 60px; }
  .seipkon-logo img { max-width: 44px; }
  #sidebar { margin-left: calc(-1 * var(--sidebar-width)); box-shadow: 0 0 24px oklch(0 0 0 / 25%); }
  #sidebar.active { margin-left: 0; }
  #content, #content.active { width: 100%; }
  .grid_flex { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .page-box, .card { padding: var(--space-3); }
  .breadcromb-area .row { flex-wrap: wrap; }
  .seipkon-breadcromb-right { text-align: left; margin-left: 0; }
  .nav-top > li > a { padding: 8px; }
  .profile-avatar-txt > p { display: none; }
  .message-box { width: 280px; }

  /* wide tables scroll inside their box instead of widening the page */
  .dataTables_wrapper, table.table, .table-responsive { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dataTables_wrapper table.table { display: table; overflow: visible; }
  .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate, .dt-buttons { float: none; text-align: left; margin: 4px 0; }
  .dataTables_wrapper .dataTables_filter input { width: 100%; margin-left: 0; }
  .dataTables_wrapper .dataTables_paginate .pagination { margin: 4px 0; }
  .table > tbody > tr > td, .table > thead > tr > th { white-space: nowrap; }

  /* field journal: event list above the calendar, not beside it */
  /* !important: fieldcalendar.css loads after this file */
  #wrap #external-events, #wrap #calendar { float: none !important; width: 100% !important; }
  #wrap #external-events { max-height: 240px; overflow-y: auto; margin-bottom: 12px; }
  .fc-toolbar { flex-wrap: wrap; gap: 4px; }
  .fc-toolbar .fc-left, .fc-toolbar .fc-center, .fc-toolbar .fc-right { float: none; display: block; flex: 1 1 100%; text-align: left; margin-bottom: 4px; }
  .fc-toolbar .fc-button { padding: 2px 6px; font-size: 12px; }
  .fc-toolbar .fc-center h2 { font-size: 16px; margin: 0; }
  .fc-toolbar .fc-center { order: -1; }

  /* forms and toolbars */
  .btn-toolbar { display: flex; flex-wrap: wrap; gap: 6px; float: none !important; }
  .btn-toolbar > .btn, .btn-toolbar > .btn-group { margin-left: 0; }
  .form-group .btn + .btn { margin-top: 6px; }
  .leaflet-container { max-height: 60vh; }
  .pull-right.btn, a.pull-right > .btn { float: none !important; }
}
@media print {
  .main-header, #sidebar, .loaf_div, .seipkon-footer-area, #loader-wrapper { display: none !important; }
  #content { width: 100%; padding-top: 0; position: static; }
  .page-box, .card { box-shadow: none; border: 0; }
}

/* nested tables inherit the card background instead of Bootstrap's white */
.table .table { background: transparent; }
