:root {
  --pewag-navy: #003863;
  --pewag-navy-dark: #002746;
  --pewag-red: #d60029;
  --pewag-red-dark: #b80023;
  --pewag-bg: #f3f6f8;
  --pewag-surface: #ffffff;
  --pewag-text: #243746;
  --pewag-muted: #6b7b88;
  --pewag-border: #dce3e8;
  --pewag-shadow: 0 8px 24px rgba(0, 56, 99, 0.08);
  --pewag-shadow-hover: 0 12px 30px rgba(0, 56, 99, 0.13);
  --pewag-radius: 12px;
}

html {
  background: var(--pewag-bg);
}

body {
  background: var(--pewag-bg);
  color: var(--pewag-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--pewag-navy);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--pewag-red);
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(214, 0, 41, 0.28) !important;
  outline-offset: 2px;
}

/* Application shell */
.navbar.navbar-default {
  min-height: 64px;
  border: 0;
  box-shadow: 0 2px 14px rgba(0, 39, 70, 0.16);
  z-index: 1100;
}

.navbar-header,
.fix-sidebar .top-left-part {
  min-height: 64px;
  background: linear-gradient(120deg, var(--pewag-navy-dark), var(--pewag-navy));
}

.top-left-part {
  width: 250px;
  height: 64px;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
}

.top-left-part .logo {
  height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-left-part .logo img {
  width: 88px;
  max-height: 38px;
  object-fit: contain;
}

.brand-text {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  opacity: 0.88;
  letter-spacing: 0.02em;
}

.navbar-top-links > li > a {
  min-height: 64px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  color: #fff;
}

.navbar-top-links > li > a:hover,
.navbar-top-links > li > a:focus,
.navbar-top-links > .open > a {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.navbar-top-links .profile-pic img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background: #fff;
}

.navbar-top-links .profile-pic b {
  margin-left: 9px;
  font-weight: 600;
  line-height: 1.15;
}

.navbar-top-links .profile-pic small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 400;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-menu {
  border: 1px solid var(--pewag-border);
  border-radius: 10px;
  box-shadow: var(--pewag-shadow);
  padding: 7px;
}

.dropdown-menu > li > a {
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--pewag-text);
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background: #f2f5f7;
  color: var(--pewag-red);
}

.sidebar {
  width: 250px;
  top: 64px;
  border: 0;
  box-shadow: 3px 0 18px rgba(0, 56, 99, 0.06);
}

.sidebar .sidebar-nav {
  padding: 10px 10px 24px;
}

.sidebar #side-menu {
  padding-top: 0;
}

.sidebar #side-menu .user-pro {
  margin: 4px 2px 12px;
  padding: 12px;
  border-radius: 10px;
  background: #f4f7f9;
}

.sidebar #side-menu .user-pro > a {
  min-height: auto;
  padding: 0;
  background: transparent !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar #side-menu .user-pro img {
  max-width: 94px;
  margin: 0 auto;
}

#side-menu > li {
  margin-bottom: 3px;
}

#side-menu > li > a {
  min-height: 46px;
  padding: 9px 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #405565;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#side-menu > li > a p {
  margin: 0;
  line-height: 1.25;
}

#side-menu > li > a:hover,
#side-menu > li > a:focus {
  background: #d60029;
  color: #fff;
  transform: translateX(2px);
}

#side-menu > li > a.active,
#side-menu > li > a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(105deg, var(--pewag-red), var(--pewag-red-dark));
  box-shadow: 0 6px 15px rgba(214, 0, 41, 0.2);
  border-left: 0;
}

#side-menu > li i.pewag-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin: 0;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

#page-wrapper {
  min-height: calc(100vh - 64px);
  margin-left: 250px;
  padding-top: 64px;
  background: var(--pewag-bg);
}

#page-wrapper > .container-fluid {
  padding: 22px 24px 36px;
}

/* Page title and breadcrumbs */
.bg-title {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--pewag-surface);
  border: 1px solid var(--pewag-border);
  border-radius: var(--pewag-radius);
  box-shadow: 0 4px 14px rgba(0, 56, 99, 0.045);
}

.bg-title .page-title {
  margin: 0;
  color: var(--pewag-navy);
  font-size: 20px;
  font-weight: 700;
  text-transform: none;
}

.bg-title .breadcrumb {
  margin: 0;
  padding: 0;
  min-height: 34px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  background: transparent;
}

.bg-title .breadcrumb > li + li::before {
  color: #9aa7b1;
}

.bg-title .breadcrumb .btn {
  min-height: 34px;
  padding: 6px 11px;
}

/* Cards */
.white-box,
.panel,
.card {
  border: 1px solid var(--pewag-border) !important;
  border-radius: var(--pewag-radius) !important;
  background: var(--pewag-surface);
  box-shadow: var(--pewag-shadow);
}

.white-box {
  padding: 18px !important;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.white-box:hover {
  box-shadow: var(--pewag-shadow-hover);
}

.white-box .box-title {
  margin: 0 0 15px !important;
  padding-bottom: 11px;
  border-bottom: 1px solid #edf1f3;
  color: var(--pewag-navy);
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
}

.white-box .box-title p {
  margin: 0;
}

.panel-heading {
  border-radius: var(--pewag-radius) var(--pewag-radius) 0 0;
  font-weight: 700;
}

/* Forms */
.form-control,
select.form-control,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  min-height: 42px;
  border: 1px solid #cfd8de !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--pewag-text);
  box-shadow: none !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus,
.select2-container--focus .select2-selection {
  border-color: var(--pewag-navy) !important;
  box-shadow: 0 0 0 3px rgba(0, 56, 99, 0.1) !important;
}

textarea.form-control {
  min-height: 100px;
}

.form-group label,
.control-label {
  margin-bottom: 6px;
  color: #334c5d;
  font-weight: 600;
}

.form-group.is-required > label::after,
label.is-required::after {
  content: " *";
  color: var(--pewag-red);
}

.help-block,
.form-text,
.text-muted {
  color: var(--pewag-muted) !important;
}

.input-group-addon,
.input-group-text {
  border-color: #cfd8de;
  background: #f4f7f9;
}

/* Buttons */
.btn {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary,
.btn-info,
.btn-custom {
  border-color: var(--pewag-navy) !important;
  background: var(--pewag-navy) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-info:hover,
.btn-custom:hover,
.btn-primary:focus,
.btn-info:focus,
.btn-custom:focus {
  border-color: var(--pewag-navy-dark) !important;
  background: var(--pewag-navy-dark) !important;
  box-shadow: 0 5px 12px rgba(0, 56, 99, 0.2) !important;
}

.btn-danger {
  border-color: var(--pewag-red) !important;
  background: var(--pewag-red) !important;
}

.btn-default {
  border-color: #cfd8de;
  background: #fff;
  color: #3f5362;
}

.btn-default:hover,
.btn-default:focus {
  border-color: #aebcc5;
  background: #f5f7f8;
  color: var(--pewag-navy);
}

.btn-sm {
  min-height: 32px;
  border-radius: 7px;
}

/* Tables */
.table-responsive {
  border: 0;
  border-radius: 9px;
}

.table {
  margin-bottom: 0;
  color: var(--pewag-text);
}

.table > thead > tr > th {
  padding: 11px 9px !important;
  border-bottom: 1px solid #cad5dc !important;
  background: #eef3f6;
  color: #324b5c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.table > tbody > tr > td {
  padding: 10px 9px !important;
  border-top: 1px solid #e8edf0;
  vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background: #fafcfd !important;
}

.table-hover > tbody > tr:hover > * {
  background: #f2f6f8 !important;
}

.table .label,
.label-table {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.pagination > li > a,
.pagination > li > span {
  margin: 0 2px;
  border-radius: 7px !important;
  color: var(--pewag-navy);
}

.pagination > .active > a,
.pagination > .active > span {
  border-color: var(--pewag-navy);
  background: var(--pewag-navy);
}

/* Tabs, alerts and modals */
.nav-tabs {
  border-bottom-color: var(--pewag-border);
}

.nav-tabs > li > a {
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
  color: var(--pewag-navy);
  border-color: var(--pewag-border) var(--pewag-border) #fff;
}

.alert {
  border: 0;
  border-radius: 9px;
}

.modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 39, 70, 0.24);
}

.modal-header {
  border-bottom: 1px solid var(--pewag-border);
  background: #f8fafb;
}

.modal-footer {
  border-top: 1px solid var(--pewag-border);
  background: #f8fafb;
}

/* Login and registration */
.login-register {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  background:
    radial-gradient(circle at 15% 15%, rgba(214, 0, 41, 0.13), transparent 32%),
    linear-gradient(140deg, var(--pewag-navy-dark), var(--pewag-navy));
}

.login-box {
  width: min(430px, 100%);
  margin: auto;
}

.login-box .white-box {
  padding: 30px !important;
  border: 0 !important;
  box-shadow: 0 22px 55px rgba(0, 24, 44, 0.32);
}

.login-box .db img {
  display: block;
  max-width: 150px;
  max-height: 64px !important;
  margin: 0 auto 24px;
}

.login-box .form-control {
  min-height: 48px;
  font-size: 15px;
}

.login-box .btn {
  min-height: 46px;
}

.password-field-wrap {
  position: relative;
}

.password-field-wrap .form-control {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--pewag-muted);
}

.password-toggle:hover {
  background: #eef2f4;
  color: var(--pewag-navy);
}

/* Footer and utility */
.footer {
  position: static;
  padding: 20px 24px;
  border-top: 1px solid var(--pewag-border);
  background: transparent;
  color: var(--pewag-muted);
}

.preloader {
  background-color: rgba(0, 39, 70, 0.94);
  background-size: min(150px, 35vw);
}

.pewag-ui-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--pewag-navy);
  border-radius: 8px;
  background: #edf4f8;
  color: #355165;
}

@media (max-width: 1169px) {
  .top-left-part,
  .sidebar {
    width: 220px;
  }

  #page-wrapper {
    margin-left: 220px;
  }

  .brand-text {
    display: none;
  }
}

@media (max-width: 767px) {
  .navbar.navbar-default,
  .navbar-header {
    min-height: 58px;
  }

  .top-left-part {
    width: 112px;
    height: 58px;
  }

  .top-left-part .logo {
    height: 58px;
    padding: 0 12px;
  }

  .top-left-part .logo img {
    width: 78px;
  }

  .navbar-top-links > li > a {
    min-height: 58px;
    padding: 11px 9px;
  }

  .sidebar {
    top: 58px;
    width: 240px;
  }

  #page-wrapper {
    margin-left: 0;
    padding-top: 58px;
  }

  #page-wrapper > .container-fluid {
    padding: 12px 10px 24px;
  }

  .bg-title {
    padding: 13px;
  }

  .bg-title .page-title {
    font-size: 18px;
  }

  .bg-title .breadcrumb {
    margin-top: 10px;
    justify-content: flex-start;
  }

  .white-box {
    padding: 14px !important;
  }

  .white-box300,
  .white-box400,
  .white-box240,
  .white-box200 {
    min-height: 0;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .login-register {
    align-items: flex-start;
    padding-top: 18px;
  }

  .login-box .white-box {
    padding: 22px 18px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ==============================================================
   PEWAG application shell layout fix — 2026-07-26
   Keeps the header fixed, removes the duplicated 60/64px offset and
   prevents the centered brand text from overlapping the logo.
   ============================================================== */

.navbar.navbar-default.navbar-static-top {
  position: fixed !important;
  inset: 0 0 auto 0;
  width: 100%;
  height: 64px;
  min-height: 64px;
  margin: 0 !important;
  z-index: 1000;
}

.navbar.navbar-default .navbar-header {
  position: relative;
  width: 100%;
  height: 64px;
  min-height: 64px;
}

.navbar.navbar-default .navbar-top-links {
  position: relative;
  z-index: 3;
}

.navbar.navbar-default .top-left-part.app-brand {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  min-width: 225px;
  height: 64px;
  margin: 0;
  transform: translateX(-50%);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  z-index: 2;
}

.navbar.navbar-default .top-left-part.app-brand .logo {
  width: 100%;
  height: 64px;
  min-height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: visible;
  line-height: normal;
  text-transform: none;
}

.navbar.navbar-default .top-left-part.app-brand .brand-logo-mark {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.navbar.navbar-default .top-left-part.app-brand .brand-logo-mark img {
  display: block;
  width: 108px;
  max-width: 108px;
  height: auto;
  max-height: 34px;
  object-fit: contain;
}

.navbar.navbar-default .top-left-part.app-brand .brand-text {
  flex: 0 0 auto;
  margin: 0;
  padding: 1px 0 1px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.92;
}

.navbar.navbar-default .top-left-part.app-brand .brand-text span {
  display: block;
}

.sidebar {
  position: fixed !important;
  top: 64px !important;
  bottom: 0;
  left: 0;
  width: 250px;
  height: auto !important;
  min-height: 0 !important;
  padding-top: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  z-index: 1050;
}

.sidebar .sidebar-nav.navbar-collapse,
.sidebar .slimScrollDiv,
.sidebar .slimscrollsidebar {
  top: 0 !important;
  padding-top: 0 !important;
}

#page-wrapper {
  position: relative;
  min-height: 100vh;
  margin: 0 0 0 250px;
  padding: 64px 0 0 !important;
  background: var(--pewag-bg);
}

.fix-header #page-wrapper {
  margin-top: 0 !important;
}

#page-wrapper > .container-fluid {
  padding: 14px 18px 30px;
}

.bg-title {
  margin-bottom: 16px;
  padding: 13px 16px;
}

.sidebar .sidebar-nav {
  padding-top: 8px;
}

.sidebar #side-menu .user-pro {
  margin-top: 0;
  margin-bottom: 8px;
}

@media (max-width: 1360px) {
  .navbar.navbar-default .top-left-part.app-brand {
    min-width: 190px;
  }

  .navbar.navbar-default .top-left-part.app-brand .logo {
    padding-right: 14px;
    padding-left: 14px;
    gap: 9px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-logo-mark img {
    width: 94px;
    max-width: 94px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-text {
    padding-left: 9px;
    font-size: 10px;
  }
}

@media (max-width: 1169px) and (min-width: 768px) {
  .sidebar {
    width: 220px;
  }

  body:not(.content-wrapper) #page-wrapper {
    margin-left: 220px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-text {
    display: flex;
  }
}

@media (max-width: 900px) and (min-width: 768px) {
  .navbar.navbar-default .top-left-part.app-brand {
    min-width: 116px;
    border-left: 0;
    border-right: 0;
  }

  .navbar.navbar-default .top-left-part.app-brand .logo {
    padding: 0 10px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-logo-mark img {
    width: 92px;
    max-width: 92px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-text {
    display: none;
  }
}

@media (max-width: 767px) {
  .navbar.navbar-default.navbar-static-top,
  .navbar.navbar-default .navbar-header {
    height: 58px;
    min-height: 58px;
  }

  .navbar.navbar-default .top-left-part.app-brand {
    position: relative;
    top: auto;
    left: auto;
    float: left;
    min-width: 104px;
    width: 104px;
    height: 58px;
    transform: none;
    border: 0;
  }

  .navbar.navbar-default .top-left-part.app-brand .logo {
    height: 58px;
    min-height: 58px;
    padding: 0 10px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-logo-mark img {
    width: 82px;
    max-width: 82px;
    max-height: 29px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-text {
    display: none;
  }

  .sidebar {
    top: 58px !important;
    width: 240px;
  }

  #page-wrapper,
  body:not(.content-wrapper) #page-wrapper {
    margin-left: 0;
    padding-top: 58px !important;
  }

  #page-wrapper > .container-fluid {
    padding: 10px 9px 22px;
  }
}

/* ==============================================================
   PEWAG UI refinement — compact, intuitive spacing (2026-07-26)
   ============================================================== */

:root {
  --pewag-space-1: 4px;
  --pewag-space-2: 8px;
  --pewag-space-3: 12px;
  --pewag-space-4: 16px;
  --pewag-space-5: 20px;
  --pewag-control-height: 40px;
}

/* Compact application canvas and predictable gutters */
#page-wrapper > .container-fluid.app-container {
  width: 100%;
  padding: 12px 14px 24px;
}

.app-container > .row:not(.bg-title) {
  margin-right: -7px;
  margin-left: -7px;
}

.app-container > .row:not(.bg-title) > [class*="col-"] {
  padding-right: 7px;
  padding-left: 7px;
}

/* Page heading: one compact line on desktop, two clean lines on mobile */
.bg-title {
  min-height: 58px;
  margin: 0 0 14px !important;
  padding: 10px 14px !important;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.bg-title > [class*="col-"] {
  padding-right: 6px;
  padding-left: 6px;
}

.bg-title .page-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.bg-title .page-title {
  margin: 0 !important;
  font-size: 19px;
  line-height: 1.25;
}

.bg-title .page-title > i {
  margin-right: 7px;
  color: var(--pewag-red);
  font-size: 18px;
}

.bg-title .page-subtitle {
  margin-top: 3px;
  color: var(--pewag-muted);
  font-size: 12px;
  line-height: 1.35;
}

.bg-title .page-breadcrumb-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.bg-title .breadcrumb {
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.bg-title .breadcrumb > li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.bg-title .breadcrumb > li > a {
  min-height: 32px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--pewag-border);
  border-radius: 7px;
  background: #fff;
  color: #526776;
  font-weight: 600;
}

.bg-title .breadcrumb > li > a:hover,
.bg-title .breadcrumb > li > a:focus {
  border-color: #bdc9d0;
  background: #f6f8f9;
  color: var(--pewag-navy);
}

.bg-title .breadcrumb > li.active {
  max-width: 260px;
  overflow: hidden;
  color: var(--pewag-navy);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cards: remove unused vertical space and excessive padding */
.white-box,
.panel,
.card {
  margin-bottom: 14px;
}

.white-box {
  padding: 14px !important;
}

.white-box:hover {
  transform: none;
}

.white-box .box-title {
  margin: 0 0 12px !important;
  padding: 0 0 9px;
  font-size: 15px;
  line-height: 1.3;
}

.white-box .box-title:empty,
.white-box .box-title.is-empty-title {
  display: none !important;
}

.white-box > .row {
  margin-right: -7px;
  margin-left: -7px;
}

.white-box > .row > [class*="col-"] {
  padding-right: 7px;
  padding-left: 7px;
}

.white-box200,
.white-box240,
.white-box300,
.white-box400 {
  min-height: 0;
}

/* Dashboard cards stay aligned without a fixed 450px empty area */
.dashboard-grid,
.dashboard-analytics {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.dashboard-grid > .dashboard-column,
.dashboard-analytics > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

.dashboard-card,
.chart-card,
.stat-card {
  width: 100%;
}

.dashboard-card {
  min-height: 0 !important;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.dashboard-card > .table-responsive {
  flex: 1 1 auto;
}

.dashboard-chart-column,
.dashboard-stats-column {
  padding-right: 7px !important;
  padding-left: 7px !important;
}

.dashboard-stats-column > .row {
  width: calc(100% + 14px);
  margin-right: -7px;
  margin-left: -7px;
}

.dashboard-stats-column > .row > [class*="col-"] {
  padding-right: 7px;
  padding-left: 7px;
}

.stat-card h1 {
  margin: 6px 0 2px;
  font-size: 28px;
  line-height: 1.1;
}

/* Forms and controls */
.form-group {
  margin-bottom: 12px;
}

.form-control,
select.form-control,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  min-height: var(--pewag-control-height);
}

.form-group label,
.control-label {
  margin-bottom: 5px;
  font-size: 13px;
  line-height: 1.3;
}

.input-group-btn + .input-group-btn {
  padding-left: 6px;
}

.input-group-btn .btn {
  min-height: var(--pewag-control-height);
}

/* Filter/search cards: responsive without forced 1480px empty canvas */
.pewag-filter-card {
  padding: 12px 14px !important;
}

.pewag-filter-card .pewag-filter-layout,
.pewag-filter-card .row.table-responsive {
  margin-right: -6px;
  margin-left: -6px;
  overflow: visible;
}

.pewag-filter-form {
  margin: 0 !important;
}

.pewag-filter-form::before,
.pewag-filter-form::after,
.pewag-filter-form .pewag-filter-row::before,
.pewag-filter-form .pewag-filter-row::after {
  display: none;
  content: none;
}

.pewag-filter-form.pewag-direct-filter,
.pewag-filter-form .pewag-filter-row,
.pewag-filter-layout > .minWidth1480 {
  width: 100%;
  min-width: 0 !important;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
}

.pewag-filter-form.pewag-direct-filter > [class*="col-"],
.pewag-filter-form .pewag-filter-row > [class*="col-"],
.pewag-filter-layout > .minWidth1480 > [class*="col-"] {
  width: auto;
  min-width: 170px;
  margin-bottom: 10px;
  padding-right: 6px;
  padding-left: 6px;
  float: none;
  flex: 1 1 190px;
}

.pewag-filter-form.pewag-direct-filter > .col-md-1,
.pewag-filter-form .pewag-filter-row > .col-md-1,
.pewag-filter-layout > .minWidth1480 > .col-md-1 {
  min-width: 92px;
  flex: 0 1 110px;
}

.pewag-filter-form.pewag-direct-filter > .col-md-2,
.pewag-filter-form .pewag-filter-row > .col-md-2,
.pewag-filter-layout > .minWidth1480 > .col-md-2 {
  flex-basis: 180px;
}

.pewag-filter-form.pewag-direct-filter > .col-md-3,
.pewag-filter-form .pewag-filter-row > .col-md-3,
.pewag-filter-layout > .minWidth1480 > .col-md-3 {
  flex-basis: 230px;
}

.pewag-filter-form.pewag-direct-filter > .col-md-4,
.pewag-filter-form .pewag-filter-row > .col-md-4,
.pewag-filter-layout > .minWidth1480 > .col-md-4 {
  flex-basis: 310px;
}

.pewag-filter-form h3.box-title {
  min-height: 18px;
  margin: 0 0 5px !important;
  padding: 0;
  border: 0;
  color: #334c5d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.pewag-filter-form [class*="col-"] > .col-md-12,
.pewag-filter-form [class*="col-"] > .input-group.col-md-12 {
  width: 100%;
  padding-right: 0;
  padding-left: 0;
}

.pewag-filter-form [class*="col-"] > .col-md-6,
.pewag-filter-form [class*="col-"] > .col-md-7,
.pewag-filter-form [class*="col-"] > .col-md-5 {
  padding-right: 4px;
  padding-left: 4px;
}

.pewag-filter-form [class*="col-"] > .col-md-6:first-of-type,
.pewag-filter-form [class*="col-"] > .col-md-7:first-of-type {
  padding-left: 0;
}

.pewag-filter-form [class*="col-"] > .col-md-6:last-of-type,
.pewag-filter-form [class*="col-"] > .col-md-5:last-of-type {
  padding-right: 0;
}

.pewag-filter-form .btn,
.pewag-filter-card .btn {
  white-space: nowrap;
}

/* Do not force ordinary forms to 1480px. Wide tables may still scroll. */
.minWidth1480:not(table) {
  min-width: 0 !important;
}

table.minWidth1480,
.table.minWidth1480 {
  min-width: 1080px;
}

/* Tables */
.table-responsive {
  margin: 0;
  border: 0;
}

.table > thead > tr > th {
  padding: 9px 8px !important;
  line-height: 1.3;
  white-space: nowrap;
}

.table > tbody > tr > td {
  padding: 8px !important;
  line-height: 1.35;
}

.table .btn-sm,
.table .btn-xs {
  min-height: 30px;
  padding: 4px 8px;
}

.pewag-has-table {
  padding-bottom: 10px !important;
}

.pewag-has-table > .table-responsive:last-child,
.pewag-has-table > .row:last-child,
.pewag-has-table > form:last-child {
  margin-bottom: 0;
}

.table-responsive.pewag-scrollable-table {
  position: relative;
  scrollbar-width: thin;
}

/* Buttons and action groups */
.btn {
  min-height: 36px;
  padding: 7px 12px;
}

.btn-sm {
  min-height: 30px;
  padding: 4px 9px;
}

.btn-xs {
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 6px;
}

.pewag-icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pewag-action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pewag-action-group .input-group-btn {
  width: auto;
  padding: 0;
}

/* Sidebar: denser navigation without losing click area */
.sidebar .sidebar-nav {
  padding: 7px 8px 18px;
}

.sidebar #side-menu .user-pro {
  margin: 0 1px 7px;
  padding: 9px 10px;
}

.sidebar #side-menu .user-pro img {
  max-width: 86px;
  max-height: 40px;
}

#side-menu > li {
  margin-bottom: 2px;
}

#side-menu > li > a {
  min-height: 43px;
  padding: 7px 10px;
  gap: 9px;
  border-radius: 8px;
  font-size: 13px;
}

#side-menu > li i.pewag-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  padding-bottom: 0 !important;
}

#side-menu > li > a p,
#side-menu > li > a .menu-label {
  margin: 0;
}

/* Settings navigation */
.settings-menu {
  padding-right: 7px;
  padding-left: 7px;
}

.settings-menu .white-box {
  padding: 7px !important;
}

.settings-menu .table-responsive {
  overflow: visible;
}

.settings-menu .list-group {
  margin: 0 !important;
}

.settings-menu .list-group-item {
  margin: 0 0 2px;
  padding: 9px 9px !important;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-left: 3px solid transparent !important;
  border-radius: 7px;
  line-height: 1.25;
}

.settings-menu .list-group-item:hover,
.settings-menu .list-group-item:focus {
  padding-left: 9px !important;
  background: #f1f5f7;
}

.settings-menu .list-group-item.active {
  border-left-color: var(--pewag-red) !important;
  background: #f9e9ed !important;
  color: var(--pewag-red) !important;
}

.settings-menu .list-group-item i {
  width: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center;
}

/* Modals */
.modal-dialog.modal-xl {
  width: min(1180px, calc(100% - 28px));
  max-width: 1180px;
  margin: 24px auto;
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 14px 16px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
}

.modal-footer .btn + .btn {
  margin-left: 6px;
}

/* Footer */
.footer {
  padding: 12px 16px 16px;
  font-size: 12px;
}

/* Small-screen behaviour */
@media (max-width: 1199px) {
  .dashboard-grid > .dashboard-column {
    width: 100%;
  }

  .navbar-top-links .profile-pic small {
    max-width: 180px;
  }
}

@media (max-width: 991px) {
  .settings-menu {
    width: 100%;
  }

  .settings-menu .list-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .settings-menu .list-group-item {
    margin: 0;
  }

  .pewag-filter-form.pewag-direct-filter > [class*="col-"],
  .pewag-filter-form .pewag-filter-row > [class*="col-"],
  .pewag-filter-layout > .minWidth1480 > [class*="col-"] {
    min-width: 210px;
    flex: 1 1 calc(50% - 12px);
  }

  .pewag-filter-form.pewag-direct-filter > .col-md-1,
  .pewag-filter-form .pewag-filter-row > .col-md-1,
  .pewag-filter-layout > .minWidth1480 > .col-md-1 {
    min-width: 100%;
    flex-basis: 100%;
  }
}

@media (max-width: 767px) {
  #page-wrapper > .container-fluid.app-container {
    padding: 8px 8px 18px;
  }

  .bg-title {
    min-height: 0;
    margin-bottom: 9px !important;
    padding: 10px 11px !important;
  }

  .bg-title .page-heading,
  .bg-title .page-breadcrumb-wrap {
    width: 100%;
  }

  .bg-title .page-breadcrumb-wrap {
    margin-top: 8px;
    justify-content: flex-start;
  }

  .bg-title .breadcrumb {
    width: 100%;
    justify-content: flex-start;
  }

  .bg-title .breadcrumb > li.active {
    max-width: calc(100vw - 155px);
  }

  .white-box {
    margin-bottom: 9px;
    padding: 11px !important;
    border-radius: 10px !important;
  }

  .white-box .box-title {
    margin-bottom: 9px !important;
    padding-bottom: 7px;
    font-size: 14px;
  }

  .pewag-filter-card {
    padding: 10px !important;
  }

  .pewag-filter-form.pewag-direct-filter > [class*="col-"],
  .pewag-filter-form .pewag-filter-row > [class*="col-"],
  .pewag-filter-layout > .minWidth1480 > [class*="col-"] {
    width: 100%;
    min-width: 100%;
    margin-bottom: 8px;
    flex-basis: 100%;
  }

  .pewag-filter-form h3.box-title {
    min-height: 0;
  }

  .settings-menu .list-group {
    grid-template-columns: 1fr;
  }

  .table > thead > tr > th,
  .table > tbody > tr > td {
    padding: 7px !important;
  }

  .modal-dialog.modal-xl,
  .modal-dialog {
    width: calc(100% - 16px);
    margin: 8px auto;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 11px;
  }

  .navbar-top-links .profile-pic b {
    display: none !important;
  }
}

/* Final form width safeguard for legacy nested Bootstrap markup. */
.pewag-filter-form {
  width: 100%;
}

.pewag-filter-layout > .minWidth1480 > .pewag-filter-form {
  flex: 1 1 100%;
}

.pewag-action-group {
  width: 100%;
  display: flex;
}

.pewag-action-group > .form-control,
.pewag-action-group > input.form-control,
.pewag-action-group > select.form-control {
  min-width: 0;
  flex: 1 1 auto;
}

.pewag-filter-form.pewag-direct-filter > div:not([class*="col-"]) {
  margin-right: 6px;
  margin-bottom: 10px;
  margin-left: auto;
  align-self: flex-end;
}

/* Legacy form grids: remove the second 15px gutter around every input. */
.white-box form > .row {
  margin-right: -7px;
  margin-left: -7px;
}

.white-box form .form-group[class*="col-"] {
  padding-right: 7px;
  padding-left: 7px;
}

.white-box .form-group > label.col-md-12,
.white-box .form-group > label.col-sm-12,
.white-box .form-group > label.col-xs-12,
.white-box .form-group > div.col-md-12,
.white-box .form-group > div.col-sm-12,
.white-box .form-group > div.col-xs-12 {
  padding-right: 0;
  padding-left: 0;
}

.white-box > p:empty,
.white-box .text-muted:empty {
  display: none;
}

.white-box hr {
  margin: 14px 0;
  border-color: #e5ebee;
}

.white-box > .table-responsive.m-t-10,
.white-box .table-responsive > .box-title:first-child {
  margin-top: 0 !important;
}

.btn i.p-b-10,
.list-group-item i.p-b-10 {
  padding-bottom: 0 !important;
}

.panel-body .nav > li > a {
  margin: 0 3px 4px !important;
  padding: 8px 11px !important;
}

/* User cards: balanced two-column layout and compact status/actions. */
.user-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.user-grid > .user-grid-column {
  display: flex;
}

.user-card {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.user-card > .row {
  height: 100%;
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
}

.user-card .imgzaposleni {
  min-height: 116px;
  margin-top: 0 !important;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.user-card .imgzaposleni img {
  width: 100%;
  max-width: 112px;
  max-height: 116px;
  border-radius: 9px;
  object-fit: cover;
}

.user-card address {
  margin: 0 0 10px;
  color: #526776;
  font-size: 12px;
  line-height: 1.55;
}

.user-card address strong {
  color: #304958;
}

.user-card .btn-block.col-xs-2 {
  width: auto;
  margin: 0 4px 4px 0;
  display: inline-flex;
  float: none !important;
}

.user-card .fa-pull-botton,
.user-card .fa-pull-right {
  margin-top: 0;
}

@media (max-width: 767px) {
  .user-grid > .user-grid-column {
    width: 100%;
  }

  .user-card .imgzaposleni {
    min-height: 90px;
  }

  .user-card .imgzaposleni img {
    max-width: 86px;
    max-height: 90px;
  }
}

.table.pewag-wide-table {
  min-width: 900px;
}

.table.pewag-very-wide-table {
  min-width: 1120px;
}

/* PEWAG UI refinement phase 2: compact workflows and action placement. */
.white-box::after,
.panel-body::after,
.card-body::after {
  display: table;
  clear: both;
  content: "";
}

/* Keep Select2 selection inside form columns. Do not apply this globally:
   Select2 appends the open dropdown container to <body>; forcing that element
   to width:100% makes the page/grid jump horizontally. */
.form-group > .select2-container,
.form-group [class*="col-"] > .select2-container,
.pewag-user-form .select2-container {
  width: 100% !important;
  max-width: 100%;
}

/* The floating dropdown uses Select2's calculated inline width/position. */
body > .select2-container.select2-container--open {
  max-width: none;
}

.box-title.pewag-title-actions {
  min-height: 36px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.box-title.pewag-title-actions .btn {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  float: none !important;
}

.box-title.pewag-title-actions .btn:first-of-type {
  margin-left: auto !important;
}

.white-box > .fa-pull-right.btn,
.white-box > .pull-right.btn,
.white-box > a.fa-pull-right.btn,
.white-box > a.pull-right.btn {
  margin: 0 0 8px 6px;
}

.white-box > .fa-pull-left.btn,
.white-box > .pull-left.btn,
.white-box > a.fa-pull-left.btn,
.white-box > a.pull-left.btn {
  margin: 0 6px 8px 0;
}

/* Wizard forms: less empty canvas, clearer progress and natural mobile flow. */
.pewag-wizard .wizard-steps {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex !important;
  overflow: hidden;
  border: 1px solid var(--pewag-border);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  list-style: none;
}

.pewag-wizard .wizard-steps > li {
  min-width: 0;
  padding: 8px 12px;
  display: flex !important;
  align-items: center;
  flex: 1 1 0;
}

.pewag-wizard .wizard-steps > li h4 {
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 1.3;
}

.pewag-wizard .wizard-steps > li span {
  width: 32px;
  min-width: 32px;
  height: 32px;
  margin-right: 7px;
  padding-top: 6px;
}

.pewag-wizard .wizard-content {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--pewag-border);
  border-radius: 0 0 9px 9px;
  background: #fff;
}

.pewag-wizard .wizard-pane > h3:first-child {
  margin: 0 0 13px;
  font-size: 16px;
  line-height: 1.35;
}

.pewag-wizard .panel-footer {
  padding: 10px 12px;
}

.compact-form {
  margin-right: -7px;
  margin-left: -7px;
}

.compact-form > [class*="col-"] {
  padding-right: 7px;
  padding-left: 7px;
}

.assign-summary-table {
  border-radius: 8px;
}

#assigntable {
  border: 1px solid var(--pewag-border) !important;
  background: #fff;
}

#assigntable td {
  padding: 10px !important;
  border-color: var(--pewag-border) !important;
}

#assigntable h3,
#assigntable h4 {
  margin: 3px 0;
}

#assigntable img {
  max-width: 125px;
  height: auto;
  margin: 0 auto;
}

/* SAP order summary: responsive toolbar instead of stretched empty areas. */
.sap-orders-content .sap-summary-card {
  margin-bottom: 10px;
}

.sap-orders-content .sap-summary-body {
  padding: 11px 12px;
}

.sap-summary-layout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sap-summary-meta {
  min-width: 170px;
  flex: 0 1 230px;
}

.sap-summary-progress {
  min-width: 220px;
  flex: 1 1 340px;
}

.sap-summary-actions {
  margin-left: auto;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 5px;
}

.sap-summary-actions > .btn {
  margin: 0 !important;
  border-radius: 6px !important;
}

.sap-auto-certificate-box {
  padding: 0 12px 11px;
}

.sap-order-detail-cell {
  padding: 8px !important;
}

.sap-order-detail-cell > .table {
  margin-bottom: 0;
  background: #fff;
}

/* Keep preview windows inside the available application viewport. */
#frameDoc,
#framePreview {
  width: 100% !important;
  max-width: 100%;
  height: calc(100vh - 122px) !important;
  min-height: 520px;
  border: 0;
  background: #fff;
}

/* Empty information blocks should not reserve visible space. */
.alert:empty,
.help-block:empty,
.panel-heading:empty,
.card-header:empty {
  display: none !important;
}

@media (max-width: 767px) {
  .box-title.pewag-title-actions {
    align-items: stretch;
  }

  .box-title.pewag-title-actions .btn:first-of-type {
    width: 100%;
    margin-left: 0 !important;
  }

  .pewag-wizard .wizard-steps > li {
    padding: 7px 8px;
  }

  .pewag-wizard .wizard-steps > li h4 {
    font-size: 11px;
  }

  .pewag-wizard .wizard-steps > li span {
    width: 28px;
    min-width: 28px;
    height: 28px;
    margin-right: 5px;
    padding-top: 5px;
  }

  .pewag-wizard .wizard-content {
    padding: 10px;
  }

  .sap-summary-meta,
  .sap-summary-progress,
  .sap-summary-actions {
    width: 100%;
    min-width: 100%;
    margin-left: 0;
    flex-basis: 100%;
  }

  .sap-summary-actions .btn {
    flex: 1 1 auto;
  }

  #frameDoc,
  #framePreview {
    height: calc(100vh - 92px) !important;
    min-height: 420px;
  }
}

/* PEWAG UX phase 3: filter panels, sticky actions, saved views and bulk tables. */
.pewag-filter-card {
  position: relative;
}

.pewag-filter-toolbar {
  min-height: 44px;
  margin: -2px 0 12px;
  padding: 7px 0 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  border-bottom: 1px solid var(--pewag-border);
}

.pewag-filter-toolbar .btn {
  min-height: 34px;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.pewag-filter-toggle {
  color: var(--pewag-navy) !important;
  font-weight: 700;
}

.pewag-filter-count {
  min-width: 20px;
  height: 20px;
  padding: 1px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--pewag-red);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.pewag-filter-count:empty {
  display: none;
}

.pewag-saved-view-controls {
  min-width: 360px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pewag-saved-view-select {
  min-width: 170px;
  max-width: 250px;
  height: 34px !important;
  flex: 1 1 200px;
}

.pewag-filter-form {
  max-height: 1800px;
  overflow: visible;
  opacity: 1;
  transition: max-height .2s ease, opacity .18s ease, margin .2s ease;
}

.pewag-filter-form.is-collapsed {
  max-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.pewag-filter-toolbar.is-collapsed {
  margin-bottom: 0;
  padding-bottom: 7px;
  border-bottom-color: transparent;
}

.pewag-form-action-bar {
  position: sticky;
  z-index: 35;
  bottom: 0;
  min-height: 58px;
  margin: 18px -14px -14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid var(--pewag-border);
  border-radius: 0 0 10px 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -8px 20px rgba(0, 56, 99, .08);
  backdrop-filter: blur(6px);
}

.pewag-form-action-bar .btn {
  min-width: 112px;
  min-height: 38px;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pewag-form-action-bar .pewag-auto-cancel {
  margin-right: auto !important;
}

#modalForm .pewag-form-action-bar {
  margin-right: -15px;
  margin-bottom: -15px;
  margin-left: -15px;
}

.pewag-validation-summary {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-left: 4px solid #c62828;
  border-radius: 7px;
}

.pewag-validation-summary ul {
  margin: 6px 0 0 20px;
  padding: 0;
}

.pewag-validation-summary li {
  margin: 2px 0;
}

.pewag-status {
  min-height: 26px;
  padding: 5px 9px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-transform: none;
  white-space: nowrap;
}

.pewag-status i {
  margin: 0 !important;
  font-size: 12px;
}

.pewag-status-pending {
  border-color: #f1c75b !important;
  background: #fff3cd !important;
  color: #5f4800 !important;
}

.pewag-status-approved,
.pewag-status-active {
  border-color: #84d8bd !important;
  background: #d9f6ec !important;
  color: #087356 !important;
}

.pewag-status-suspended,
.pewag-status-inactive {
  border-color: #ffb3a7 !important;
  background: #ffe3de !important;
  color: #a43322 !important;
}

.pewag-status-assigned {
  border-color: #a9c9ea !important;
  background: #e5f1fc !important;
  color: #165b91 !important;
}

.pewag-status-error {
  border-color: #ef9ca5 !important;
  background: #fde1e5 !important;
  color: #a4162a !important;
}

.pewag-bulk-toolbar {
  min-height: 44px;
  margin: 0 0 9px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--pewag-border);
  border-radius: 9px;
  background: #f8fafb;
}

.pewag-bulk-toolbar.has-selection {
  border-color: rgba(0, 56, 99, .32);
  background: #f2f7fa;
  box-shadow: 0 4px 12px rgba(0, 56, 99, .06);
}

.pewag-selection-summary {
  min-width: 105px;
  margin-right: auto;
  color: var(--pewag-muted);
}

.pewag-selection-summary strong {
  min-width: 27px;
  height: 27px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--pewag-navy);
  color: #fff;
}

.pewag-bulk-toolbar .btn {
  min-height: 32px;
  margin: 0 !important;
}

.pewag-select-column {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  padding-right: 7px !important;
  padding-left: 7px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.pewag-select-column input {
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
}

.pewag-column-menu {
  position: relative;
}

.pewag-column-menu > summary {
  list-style: none;
  cursor: pointer;
}

.pewag-column-menu > summary::-webkit-details-marker {
  display: none;
}

.pewag-column-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  width: 265px;
  max-height: 340px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--pewag-border);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--pewag-shadow);
}

.pewag-column-option {
  min-height: 34px;
  margin: 0;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  color: var(--pewag-text);
  font-weight: 500;
  cursor: pointer;
}

.pewag-column-option:hover {
  background: #f2f5f7;
}

.pewag-column-option input {
  margin: 0;
}

.pewag-column-hidden {
  display: none !important;
}

.pewag-sortable-header {
  position: relative;
  padding-right: 24px !important;
  cursor: pointer;
  user-select: none;
}

.pewag-sortable-header::after {
  position: absolute;
  top: 50%;
  right: 8px;
  color: #9aabb7;
  font-family: FontAwesome;
  font-size: 11px;
  content: "\f0dc";
  transform: translateY(-50%);
}

.pewag-sortable-header.pewag-sort-asc::after {
  color: var(--pewag-navy);
  content: "\f0de";
}

.pewag-sortable-header.pewag-sort-desc::after {
  color: var(--pewag-navy);
  content: "\f0dd";
}

/* Settings grouped by user task rather than one long technical menu. */
.settings-layout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.settings-sidebar {
  flex: 0 0 255px;
  width: 255px;
}

.settings-content {
  min-width: 0;
  flex: 1 1 auto;
}

.settings-nav-card {
  padding: 10px !important;
}

.settings-group {
  margin: 0 0 7px;
  overflow: hidden;
  border: 1px solid var(--pewag-border);
  border-radius: 9px;
  background: #fff;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group > summary {
  min-height: 43px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  list-style: none;
  color: var(--pewag-navy);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.settings-group > summary::-webkit-details-marker {
  display: none;
}

.settings-group > summary::after {
  margin-left: auto;
  color: #7d909f;
  font-family: FontAwesome;
  content: "\f107";
  transition: transform .18s ease;
}

.settings-group[open] > summary::after {
  transform: rotate(180deg);
}

.settings-group > summary:hover,
.settings-group > summary:focus {
  background: #f4f7f9;
}

.settings-group-icon {
  width: 25px;
  text-align: center;
  color: var(--pewag-red);
}

.settings-group-count {
  min-width: 22px;
  height: 22px;
  margin-left: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf2f5;
  color: #536978;
  font-size: 11px;
}

.settings-group-links {
  padding: 0 6px 7px;
}

.settings-group-links .list-group-item {
  min-height: 39px;
  margin: 2px 0;
  padding: 8px 9px !important;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0 !important;
  border-left: 3px solid transparent !important;
  border-radius: 7px !important;
  background: transparent;
}

.settings-group-links .list-group-item:hover {
  padding-left: 12px !important;
  background: #f4f7f9;
}

.settings-group-links .list-group-item.active {
  border-left-color: var(--pewag-red) !important;
  background: #f8e9ec !important;
  color: var(--pewag-red) !important;
  font-weight: 700;
}

.settings-group-links .list-group-item i {
  width: 21px;
  margin: 0;
  text-align: center;
}

@media (max-width: 991px) {
  .settings-layout {
    display: block;
  }

  .settings-sidebar {
    width: 100%;
    margin-bottom: 12px;
  }

  .settings-nav-card {
    padding: 8px !important;
  }

  .settings-group {
    display: inline-block;
    width: calc(50% - 5px);
    margin-right: 6px;
    vertical-align: top;
  }
}

@media (max-width: 767px) {
  .pewag-filter-toolbar {
    align-items: stretch;
  }

  .pewag-filter-toggle,
  .pewag-reset-filters {
    flex: 1 1 calc(50% - 4px);
  }

  .pewag-saved-view-controls {
    width: 100%;
    min-width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .pewag-saved-view-select {
    max-width: none;
    flex: 1 1 100%;
  }

  .pewag-saved-view-controls .btn {
    flex: 1 1 auto;
  }

  .pewag-button-text {
    display: inline;
  }

  .pewag-form-action-bar {
    margin-right: -10px;
    margin-bottom: -10px;
    margin-left: -10px;
    padding: 9px 10px;
  }

  .pewag-form-action-bar .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 5px);
  }

  .pewag-form-action-bar .pewag-auto-cancel {
    margin-right: 0 !important;
  }

  .pewag-bulk-toolbar {
    align-items: stretch;
  }

  .pewag-selection-summary {
    width: 100%;
    margin-right: 0;
  }

  .pewag-bulk-toolbar > .btn,
  .pewag-column-menu {
    flex: 1 1 calc(50% - 5px);
  }

  .pewag-column-menu > summary {
    width: 100%;
    text-align: center;
  }

  .pewag-column-panel {
    position: fixed;
    z-index: 1300;
    top: 84px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 110px);
  }

  .settings-group {
    width: 100%;
    margin-right: 0;
  }
}

/* Final UX consistency fixes for grouped settings and compact actions. */
.settings-content > .row {
  margin-right: -7px;
  margin-left: -7px;
}

.settings-content > .row > [class*="col-"] {
  padding-right: 7px;
  padding-left: 7px;
}

.settings-content .white-box:first-child {
  margin-top: 0;
}

.settings-group > summary:focus-visible,
.pewag-column-menu > summary:focus-visible,
.pewag-sortable-header:focus-visible {
  outline: 3px solid rgba(0, 56, 99, .2);
  outline-offset: 2px;
}

.pewag-bulk-toolbar button:disabled,
.pewag-filter-toolbar button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@supports not ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) {
  .pewag-form-action-bar {
    background: #fff;
  }
}

/* ==============================================================
   PEWAG mobile sidebar + neutral login fields — 2026-07-26
   ============================================================== */

.pewag-mobile-sidebar-head,
.pewag-sidebar-backdrop {
  display: none;
}

/* Login controls must stay neutral. PEWAG red is reserved for errors/actions. */
.pewag-login-form .form-group {
  overflow: visible;
}

.pewag-login-form .col-xs-12,
.pewag-login-form .col-sm-12,
.pewag-login-form .col-md-6 {
  padding-right: 0;
  padding-left: 0;
}

.login-box .pewag-login-form input.form-control:not([type="hidden"]),
.login-box .pewag-login-form input.form-control:not([type="hidden"]):hover,
.login-box .pewag-login-form input.form-control:not([type="hidden"]):focus,
.login-box .pewag-login-form input.form-control:not([type="hidden"]).focus {
  min-height: 48px;
  padding: 11px 14px !important;
  border: 1px solid #cbd5dc !important;
  border-radius: 9px !important;
  background: #fff !important;
  background-color: #fff !important;
  background-image: none !important;
  color: var(--pewag-text) !important;
  -webkit-text-fill-color: var(--pewag-text);
  caret-color: var(--pewag-navy);
}

.login-box .pewag-login-form input.form-control:not([type="hidden"]):focus {
  border-color: var(--pewag-navy) !important;
  box-shadow: 0 0 0 3px rgba(0, 56, 99, 0.12) !important;
  outline: 0;
}

.login-box .pewag-login-form input.form-control::placeholder {
  color: #7b8994;
  opacity: 1;
}

.login-box .pewag-login-form input.form-control:-webkit-autofill,
.login-box .pewag-login-form input.form-control:-webkit-autofill:hover,
.login-box .pewag-login-form input.form-control:-webkit-autofill:focus {
  border: 1px solid #cbd5dc !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: var(--pewag-text) !important;
  transition: background-color 9999s ease-out 0s;
}

.login-box .pewag-login-form .has-error input.form-control,
.login-box .pewag-login-form input.form-control[aria-invalid="true"] {
  border-color: var(--pewag-red) !important;
  box-shadow: 0 0 0 3px rgba(214, 0, 41, 0.10) !important;
}

.login-box .pewag-login-form #recaptchaResponse[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  body.pewag-sidebar-open {
    overflow: hidden !important;
  }

  .navbar.navbar-default .navbar-header {
    display: flex;
    align-items: center;
  }

  .navbar-header .pewag-mobile-menu-toggle {
    position: absolute;
    top: 7px;
    left: 8px;
    z-index: 8;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    float: none;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 21px;
  }

  .navbar-header .pewag-mobile-menu-toggle:hover,
  .navbar-header .pewag-mobile-menu-toggle:focus,
  .navbar-header .pewag-mobile-menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
  }

  .navbar.navbar-default .top-left-part.app-brand {
    position: absolute !important;
    top: 0;
    left: 50% !important;
    width: 92px;
    min-width: 92px;
    height: 58px;
    margin: 0;
    float: none;
    transform: translateX(-50%) !important;
  }

  .navbar.navbar-default .top-left-part.app-brand .logo {
    width: 92px;
    padding: 0 6px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-logo-mark img {
    width: 78px;
    max-width: 78px;
  }

  .navbar.navbar-default .navbar-top-links.navbar-right {
    position: absolute;
    top: 0;
    right: 3px;
    z-index: 7;
    margin: 0;
  }

  .navbar.navbar-default .navbar-top-links.navbar-right > li > a {
    min-width: 48px;
    padding-right: 6px;
    padding-left: 6px;
    justify-content: center;
  }

  .navbar.navbar-default .navbar-top-links.navbar-right .profile-pic img {
    width: 32px;
    height: 32px;
  }

  .sidebar,
  body.content-wrapper .sidebar,
  body:not(.content-wrapper) .sidebar {
    position: fixed !important;
    top: 58px !important;
    right: auto;
    bottom: 0;
    left: 0;
    z-index: 1300;
    width: 86vw !important;
    max-width: 300px;
    height: calc(100vh - 58px) !important;
    height: calc(100dvh - 58px) !important;
    min-height: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow: hidden !important;
    visibility: hidden;
    background: #fff;
    box-shadow: 12px 0 34px rgba(0, 39, 70, 0.22);
    transform: translate3d(-105%, 0, 0);
    transition: transform 0.24s ease, visibility 0s linear 0.24s;
    will-change: transform;
  }

  body.pewag-sidebar-open .sidebar {
    visibility: visible;
    transform: translate3d(0, 0, 0);
    transition: transform 0.24s ease, visibility 0s linear 0s;
  }

  .pewag-mobile-sidebar-head {
    height: 52px;
    padding: 0 10px 0 16px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--pewag-border);
    background: #f8fafb;
  }

  .pewag-mobile-sidebar-title {
    color: var(--pewag-navy);
    font-size: 15px;
    font-weight: 700;
  }

  .pewag-mobile-sidebar-close {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #536a79;
    font-size: 18px;
  }

  .pewag-mobile-sidebar-close:hover,
  .pewag-mobile-sidebar-close:focus {
    background: #e9eef1;
    color: var(--pewag-red);
  }

  .sidebar .slimScrollDiv {
    width: 100% !important;
    height: calc(100vh - 110px) !important;
    height: calc(100dvh - 110px) !important;
    max-height: none !important;
    display: block !important;
    overflow: visible !important;
  }

  .sidebar .sidebar-nav.navbar-collapse,
  .sidebar .sidebar-nav.navbar-collapse.collapse,
  .sidebar .slimscrollsidebar {
    width: 100% !important;
    height: calc(100vh - 110px) !important;
    height: calc(100dvh - 110px) !important;
    max-height: none !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .sidebar-nav.navbar-collapse {
    padding: 8px 9px calc(20px + env(safe-area-inset-bottom));
    border: 0;
  }

  .sidebar .slimScrollBar,
  .sidebar .slimScrollRail {
    display: none !important;
  }

  .sidebar #side-menu .user-pro {
    margin: 0 1px 8px;
  }

  #side-menu > li > a {
    min-height: 48px;
    padding: 9px 11px;
    gap: 10px;
    font-size: 14px;
  }

  #side-menu > li i.pewag-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .pewag-sidebar-backdrop {
    position: fixed;
    top: 58px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1250;
    width: 100%;
    height: auto;
    padding: 0;
    display: block;
    border: 0;
    background: rgba(0, 26, 47, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
  }

  body.pewag-sidebar-open .pewag-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
  }

  .login-box .white-box {
    padding: 20px 16px !important;
  }

  .pewag-login-form .form-group {
    margin-bottom: 14px;
  }

  .pewag-login-form .checkbox,
  .pewag-login-form #ponistiLozinku {
    float: none !important;
  }

  .pewag-login-form #ponistiLozinku {
    display: inline-block;
    margin-top: 8px;
  }
}

@media (max-width: 359px) {
  .navbar.navbar-default .top-left-part.app-brand {
    width: 76px;
    min-width: 76px;
  }

  .navbar.navbar-default .top-left-part.app-brand .logo {
    width: 76px;
  }

  .navbar.navbar-default .top-left-part.app-brand .brand-logo-mark img {
    width: 68px;
    max-width: 68px;
  }
}

/* Dashboard workspace */
.pewag-dashboard {
  --dashboard-navy: #003863;
  --dashboard-blue: #0083b7;
  --dashboard-red: #d60029;
  --dashboard-green: #23885d;
  --dashboard-amber: #d88100;
  --dashboard-text: #24313d;
  --dashboard-muted: #6d7985;
  --dashboard-border: #e4e9ee;
  --dashboard-surface: #f5f7f9;
  color: var(--dashboard-text);
}

.pewag-dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 20px;
}

.pewag-dashboard-eyebrow,
.pewag-dashboard-section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--dashboard-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pewag-dashboard-header h1 {
  margin: 0;
  color: var(--dashboard-navy);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 750;
  line-height: 1.1;
}

.pewag-dashboard-header p,
.pewag-dashboard-panel-head p {
  margin: 7px 0 0;
  color: var(--dashboard-muted);
  font-size: 13px;
}

.pewag-dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.pewag-dashboard-updated {
  color: var(--dashboard-muted);
  font-size: 12px;
  white-space: nowrap;
}

.pewag-dashboard-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border-color: var(--dashboard-border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--dashboard-navy) !important;
  font-weight: 700;
}

.pewag-dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.pewag-kpi {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 104px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--dashboard-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 42, 73, 0.06);
  color: var(--dashboard-text);
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pewag-kpi:hover,
.pewag-kpi:focus {
  transform: translateY(-2px);
  border-color: #c9d6df;
  box-shadow: 0 10px 26px rgba(0, 42, 73, 0.11);
  outline: none;
}

.pewag-kpi::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  content: '';
  background: var(--dashboard-blue);
}

.pewag-kpi-waiting::before { background: var(--dashboard-amber); }
.pewag-kpi-approved::before { background: var(--dashboard-green); }
.pewag-kpi-assigned::before { background: var(--dashboard-blue); }
.pewag-kpi-suspended::before { background: var(--dashboard-red); }

.pewag-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  margin-right: 14px;
  border-radius: 12px;
  background: #edf6fa;
  color: var(--dashboard-blue);
  font-size: 20px;
}

.pewag-kpi-waiting .pewag-kpi-icon { background: #fff5e5; color: var(--dashboard-amber); }
.pewag-kpi-approved .pewag-kpi-icon { background: #eaf6f1; color: var(--dashboard-green); }
.pewag-kpi-suspended .pewag-kpi-icon { background: #fdecef; color: var(--dashboard-red); }

.pewag-kpi-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.pewag-kpi-content strong {
  color: var(--dashboard-navy);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.pewag-kpi-content small {
  margin-top: 8px;
  overflow: hidden;
  color: var(--dashboard-muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pewag-kpi-arrow {
  margin-left: auto;
  color: #afbac3;
  font-size: 18px;
}

.pewag-dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.pewag-dashboard-panel {
  margin: 0 !important;
  border: 1px solid var(--dashboard-border);
  border-radius: 12px !important;
  box-shadow: 0 5px 20px rgba(0, 42, 73, 0.05);
}

.pewag-dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.pewag-dashboard-panel-head.compact {
  margin-bottom: 12px;
}

.pewag-dashboard-panel-head h2 {
  margin: 0;
  color: var(--dashboard-navy);
  font-size: 18px;
  font-weight: 750;
}

.pewag-dashboard-side {
  display: grid;
  gap: 18px;
}

.pewag-dashboard-tabs {
  display: flex;
  gap: 5px;
  margin: 0 -4px 12px;
  padding: 4px;
  overflow-x: auto;
  border-radius: 9px;
  background: var(--dashboard-surface);
}

.pewag-dashboard-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dashboard-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pewag-dashboard-tab span {
  min-width: 21px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e2e8ed;
  color: #53616d;
  font-size: 10px;
  text-align: center;
}

.pewag-dashboard-tab.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 42, 73, 0.09);
  color: var(--dashboard-navy);
}

.pewag-dashboard-tab.active span {
  background: var(--dashboard-navy);
  color: #fff;
}

.pewag-dashboard-table-panel[hidden] { display: none; }

.pewag-dashboard-table {
  margin: 0;
  font-size: 12px;
}

.pewag-dashboard-table thead th {
  padding: 10px 9px !important;
  border-bottom: 1px solid var(--dashboard-border) !important;
  color: #77838e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pewag-dashboard-table tbody td {
  padding: 12px 9px !important;
  border-top: 1px solid #edf0f3 !important;
  color: #40505d;
  vertical-align: middle !important;
}

.pewag-dashboard-table td strong,
.pewag-dashboard-table td small {
  display: block;
}

.pewag-dashboard-table td small {
  margin-top: 3px;
  color: var(--dashboard-muted);
}

.pewag-certificate-number {
  color: var(--dashboard-navy) !important;
  font-weight: 800;
  text-decoration: none !important;
}

.pewag-certificate-number:hover { color: var(--dashboard-red) !important; }

.pewag-dashboard-date {
  color: var(--dashboard-muted);
  font-size: 11px;
  white-space: nowrap;
}

.pewag-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.pewag-status-badge.waiting { background: #fff3dd; color: #9a5d00; }
.pewag-status-badge.approved { background: #e8f5ef; color: #177049; }
.pewag-status-badge.suspended { background: #fde9ed; color: #b50023; }


.pewag-dashboard-row-actions {
  white-space: nowrap;
  text-align: right;
}

.pewag-dashboard-activate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  margin-right: 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--dashboard-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.pewag-dashboard-activate:hover,
.pewag-dashboard-activate:focus {
  color: #fff;
  filter: brightness(.94);
  outline: none;
}

.pewag-row-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef4f7;
  color: var(--dashboard-navy) !important;
  text-decoration: none !important;
}

.pewag-dashboard-empty {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #96a3ad;
  text-align: center;
}

.pewag-dashboard-empty i { margin-bottom: 8px; color: var(--dashboard-green); font-size: 32px; }

.pewag-attention-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--dashboard-border);
  border-radius: 9px;
  background: #fff;
  color: var(--dashboard-text);
  text-align: left;
}

.pewag-attention-item strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #fff3dd;
  color: #9a5d00;
  font-size: 16px;
}

.pewag-attention-item.suspended strong { background: #fde9ed; color: #b50023; }
.pewag-attention-item span { color: var(--dashboard-muted); font-size: 11px; font-weight: 650; line-height: 1.35; }
.pewag-attention-item > i { color: #a2afb9; }

.pewag-attention-clear {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 9px;
  background: #eaf6f1;
  color: #177049;
  font-size: 12px;
  font-weight: 700;
}

.pewag-attention-clear i { font-size: 20px; }

.pewag-quick-actions { display: grid; gap: 8px; }

.pewag-quick-action {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--dashboard-border);
  border-radius: 9px;
  background: #fff;
  color: var(--dashboard-navy) !important;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  text-decoration: none !important;
}

.pewag-quick-action > i:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eef5f8;
  color: var(--dashboard-blue);
}

.pewag-quick-action > i:last-child { color: #a4b0b9; }
.pewag-quick-action:hover { border-color: #bdccd6; background: #f9fbfc; }
.pewag-quick-action.primary { border-color: var(--dashboard-navy); background: var(--dashboard-navy); color: #fff !important; }
.pewag-quick-action.primary > i:first-child { background: rgba(255, 255, 255, 0.14); color: #fff; }
.pewag-quick-action.primary > i:last-child { color: rgba(255, 255, 255, 0.72); }

.pewag-dashboard-analytics { margin-top: 18px !important; }

.pewag-chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 700;
}

.pewag-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pewag-chart-legend i { width: 18px; height: 3px; border-radius: 2px; background: var(--dashboard-red); }
.pewag-chart-legend .issued i { background: var(--dashboard-navy); }

.pewag-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(230px, 0.75fr);
  gap: 24px;
  align-items: center;
}

.pewag-line-chart {
  min-width: 0;
  height: 250px;
  padding: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfcfd, #fff);
}

.pewag-line-chart svg { width: 100%; height: 100%; overflow: visible; }
.pewag-line-chart .grid-line { stroke: #e8edf1; stroke-width: 1; }
.pewag-line-chart .chart-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pewag-line-chart .chart-line.created { stroke: var(--dashboard-red); }
.pewag-line-chart .chart-line.issued { stroke: var(--dashboard-navy); }
.pewag-line-chart text { fill: #82909b; font-size: 10px; }

.pewag-channel-chart {
  padding: 18px;
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  background: var(--dashboard-surface);
}

.pewag-channel-chart h3 { margin: 0 0 18px; color: var(--dashboard-navy); font-size: 14px; }
.pewag-channel-row + .pewag-channel-row { margin-top: 17px; }
.pewag-channel-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--dashboard-muted); font-size: 11px; }
.pewag-channel-row strong { color: var(--dashboard-navy); }
.pewag-channel-track { height: 7px; overflow: hidden; border-radius: 4px; background: #dfe6eb; }
.pewag-channel-track i { display: block; min-width: 3px; height: 100%; border-radius: 4px; background: var(--dashboard-blue); }
.pewag-channel-track .channel-qr { background: var(--dashboard-red); }
.pewag-channel-track .channel-email { background: var(--dashboard-navy); }

@media (max-width: 1199px) {
  .pewag-dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pewag-dashboard-main-grid { grid-template-columns: 1fr; }
  .pewag-dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .pewag-dashboard-header { align-items: stretch; flex-direction: column; gap: 13px; }
  .pewag-dashboard-header-actions { justify-content: space-between; }
  .pewag-dashboard-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pewag-kpi { min-height: 90px; padding: 13px; }
  .pewag-kpi-icon { width: 40px; height: 40px; flex-basis: 40px; margin-right: 10px; font-size: 17px; }
  .pewag-kpi-content strong { font-size: 23px; }
  .pewag-kpi-content small { font-size: 10px; white-space: normal; }
  .pewag-kpi-arrow { display: none; }
  .pewag-dashboard-panel { padding: 16px !important; }
  .pewag-dashboard-side { grid-template-columns: 1fr; }
  .pewag-analytics-grid { grid-template-columns: 1fr; }
  .pewag-line-chart { height: 220px; overflow-x: auto; }
  .pewag-line-chart svg { min-width: 620px; }
  .pewag-chart-legend { flex-direction: column; align-items: flex-start; gap: 5px; }
  .pewag-dashboard-table thead { display: none; }
  .pewag-dashboard-table,
  .pewag-dashboard-table tbody,
  .pewag-dashboard-table tr,
  .pewag-dashboard-table td { display: block; width: 100%; }
  .pewag-dashboard-table tr { position: relative; margin-bottom: 10px; padding: 10px 10px 54px 10px; border: 1px solid var(--dashboard-border); border-radius: 9px; }
  .pewag-dashboard-table tbody td { display: grid; grid-template-columns: minmax(105px, 42%) 1fr; gap: 8px; padding: 6px 0 !important; border: 0 !important; }
  .pewag-dashboard-table tbody td::before { content: attr(data-label); color: #7d8993; font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .pewag-dashboard-table tbody td:last-child { position: absolute; right: 8px; bottom: 9px; display: flex; justify-content: flex-end; align-items: center; width: auto; padding: 0 !important; }
  .pewag-dashboard-table tbody td:last-child::before { display: none; }
}

@media (max-width: 440px) {
  .pewag-dashboard-kpis { grid-template-columns: 1fr; }
  .pewag-dashboard-updated { font-size: 10px; }
  .pewag-dashboard-refresh span { display: none; }
  .pewag-dashboard-panel-head > .btn { padding: 6px 8px; }
}


/* User form layout: prevent Select2/open dropdown from causing horizontal grid shift. */
.pewag-user-form,
.pewag-user-form > .row {
  width: 100%;
  max-width: 100%;
}
.pewag-user-form {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.pewag-user-form .select2-selection__rendered {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
