:root{
  --bg:#f6f8fb;
  --panel:#ffffff;
  --card:#ffffff;

  --text:#0f172a;
  --muted:#64748b;
  --line:rgba(15,23,42,0.10);

  /* BPA brand */
  --brand:#0f766e;     /* deep teal/green */
  --brand2:#14b8a6;    /* lighter teal */
  --brand3:#063a2a;    /* dark green for headers */
  --brandBlue:#0b74c9; /* logo blue */
  --soft:rgba(20,184,166,0.14);

  /* Accent */
  --yellow:#ffd54a;
  --yellowSoft:rgba(255,213,74,0.35);
  --appbarH:68px;
  --footerH:48px;

  --radius:16px;
  --shadow:0 14px 34px rgba(2,6,23,0.10);
  --shadow2:0 10px 22px rgba(2,6,23,0.08);

  --font:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(1100px 650px at 15% 0%, rgba(20,184,166,0.18), transparent 50%),
    radial-gradient(900px 600px at 90% 10%, rgba(15,118,110,0.14), transparent 48%),
    var(--bg);
}

.app{display:flex; min-height:100vh;}

/* Sidebar */
.sidebar{
  width:280px;
  background: linear-gradient(180deg, #ffffff, #f7fbfb);
  border-right:1px solid var(--line);
  padding:18px 14px;
  position:sticky;
  top:0;
  height:100vh;
}

.sidebar__brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 12px 18px;
  border-bottom:1px solid var(--line);
  margin-bottom:14px;
}
.brand__mark{
  width:44px;height:44px;
  border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background: linear-gradient(135deg, rgba(20,184,166,0.18), rgba(15,118,110,0.14));
  border:1px solid rgba(15,118,110,0.18);
  color:var(--brand);
}
.brand__title{font-weight:900; line-height:1; color:var(--brand3);}
.brand__sub{font-size:12px; color:var(--muted); margin-top:2px;}

.brand__logo{width:28px; height:28px; object-fit:contain; display:block;}

.sidebar__nav{display:flex; flex-direction:column; gap:6px;}
.nav__section{
  font-size:12px;
  color:var(--muted);
  margin:14px 10px 6px;
  text-transform:uppercase;
  letter-spacing:0.08em;
}
.nav__item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  color:var(--text);
  text-decoration:none;
  border:1px solid transparent;
}
.nav__item i{font-size:18px; color:var(--muted);}
.nav__item:hover{
  background: rgba(20,184,166,0.10);
  border-color: rgba(15,118,110,0.14);
}
.nav__item.active{
  background: linear-gradient(135deg, rgba(20,184,166,0.18), rgba(15,118,110,0.14));
  border-color: rgba(15,118,110,0.18);
}
.nav__item.active i{color:var(--brand);}

/* Main */
.main{flex:1; padding:22px 22px calc(40px + var(--footerH));}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(8px);
}

.pageBrandLogo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  opacity: 0.98;
}


.page-title{font-weight:900; font-size:18px; color:var(--brand3);}
.page-sub{color:var(--muted); font-size:12px; margin-top:2px;}

/* Cards */
.cardx{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cardx-h{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
}
.cardx-b{padding:16px;}

/* Buttons */
.btn-brand{
  background: linear-gradient(135deg, var(--brand2), var(--brand));
  border:0;
  color:#052c26;
  font-weight:900;
}
.btn-brand:hover{filter:brightness(1.03);}

/* Bootstrap overrides */
.table{color:var(--text);}
.table thead th{color:var(--brand3); font-weight:800;}
.table-hover tbody tr:hover{background: rgba(20,184,166,0.08);}
.table-dark{--bs-table-bg:transparent; --bs-table-striped-bg:transparent; --bs-table-color:var(--text);}

.modal-content{
  border-radius: 16px;
  border:1px solid var(--line);
}

/* Inputs */
.form-control, .form-select{
  border-radius: 12px;
  border:1px solid rgba(15,23,42,0.12);
}
.form-control:focus, .form-select:focus{
  border-color: rgba(15,118,110,0.45);
  box-shadow: 0 0 0 0.2rem rgba(20,184,166,0.18);
}

/* DataTables */
.dataTables_wrapper .dataTables_filter input{
  border-radius: 12px;
  border:1px solid rgba(15,23,42,0.12);
}
.dataTables_wrapper .dataTables_paginate .paginate_button{
  border-radius: 10px;
}
/* Dashboard KPI cards */
.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
  padding:14px 0;
}
@media (max-width: 1100px){ .kpi-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px){ .kpi-grid{ grid-template-columns:1fr; } }

.kpi-card{
  background:#fff;
  border:1px solid rgba(15,23,42,0.10);
  border-radius:14px;
  padding:14px;
  box-shadow:0 10px 24px rgba(0,0,0,0.06);
  position:relative;
  overflow:hidden;
  min-height:92px;
}
.kpi-card:before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg, rgba(15,118,110,0.08), rgba(6,58,42,0.02));
  pointer-events:none;
}
.kpi-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  position:relative;
}

.kpi-sub{
  margin-top:6px;
  font-size:12px;
  color:#64748b;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.kpi-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(15,23,42,0.04);
  border:1px solid rgba(15,23,42,0.08);
}
.kpi-dot{
  width:8px; height:8px; border-radius:50%;
  background:#0f766e;
}
.kpi-dot.warn{ background:#f59e0b; }
.kpi-dot.bad{ background:#ef4444; }
.kpi-dot.ok{ background:#22c55e; }
.kpi-tile{
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(15,118,110,0.08), rgba(255,255,255,1) 55%);
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  min-height: 98px;
}
.kpi-label{
  font-size: 12px;
  color: var(--muted, #64748b);
  letter-spacing: .2px;
}
.kpi-value{
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 6px;
  color: #0f172a;
}
.kpi-meta{
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-top: 6px;
}

  .kpi-grid{
    display:grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap:12px;
  }
  @media (max-width: 1200px){
    .kpi-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 520px){
    .kpi-grid{ grid-template-columns: 1fr; }
  }

  .kpi-card{
    border: 1px solid rgba(15,23,42,0.10);
    border-radius: 14px;
    padding: 14px;
    background:#fff;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    min-height: 104px;
  }
  .kpi-card::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:4px;
    background: rgba(2,132,199,0.35);
  }
  .kpi-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }
  .kpi-name{
    font-size: 12px;
    color: var(--muted, #64748b);
    font-weight: 600;
  }
  .kpi-ico{
    font-size: 16px;
    color: rgba(15,23,42,0.45);
  }
  .kpi-num{
    margin-top: 6px;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.5px;
  }
  .kpi-sub{
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted, #64748b);
  }

  .kpi-good::before{ background: rgba(34,197,94,0.45); }
  .kpi-bad::before{ background: rgba(239,68,68,0.45); }
  .kpi-warn::before{ background: rgba(245,158,11,0.55); }
  .kpi-info::before{ background: rgba(14,165,233,0.45); }
  .kpi-neutral::before{ background: rgba(100,116,139,0.45); }
  .appbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid rgba(15,23,42,0.10);
  background:#fff;
}
.appbar__title{ font-weight:800; }
/* Top appbar user chip */
.appbar__right{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
}

.appbarUser{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(15,23,42,0.08);
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.appbarUser__avatar{
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background: rgba(13,110,253,0.10);
  color:#0d6efd;
  flex:0 0 auto;
}

.appbarUser__meta{
  min-width:0;
  line-height:1.1;
}

.appbarUser__name{
  font-weight:800;
  font-size:13px;
  color:#0f172a;
  max-width:240px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.appbarUser__sub{
  font-size:11px;
  color:#64748b;
  margin-top:2px;
}

.appbarUser__logout{
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  border:1px solid rgba(15,23,42,0.10);
  color:#0f172a;
  text-decoration:none;
}

.appbarUser__logout:hover{
  background: rgba(15,23,42,0.04);
}

/* ================================
   App header (fixed) and layout
================================ */

.appbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--appbarH);
  display: flex;
  align-items: center;
  z-index: 1030;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--brand3), var(--brand) 55%, var(--brandBlue));
  border-bottom: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 16px 34px rgba(2,6,23,0.16);
}

.appbar__inner{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.appbarBrand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.appbarBrand__mark{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: #ffffff;
  flex: 0 0 auto;
}

.appbarBrand__img{
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}


.appbarBrand__text{ display: inline-flex; flex-direction: column; line-height: 1.05; }
.appbarBrand__title{ font-weight: 900; font-size: 14px; color: #ffffff; }
.appbarBrand__sub{ font-size: 11px; color: rgba(255,255,255,0.78); margin-top: 2px; }

/* Header controls on dark background */
.appbarBrand{ color:#ffffff; }
.appbarBrand:hover{ color:#ffffff; }
.appbar .btn{ color: rgba(255,255,255,0.92); }
.appbar .btn-outline-secondary{
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.92);
}
.appbar .btn-outline-secondary:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.30);
  color: #ffffff;
}

.hdrUserBtn{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:14px;
  background: var(--yellow);
  border: 1px solid rgba(15,23,42,0.14);
  box-shadow: 0 10px 24px rgba(2,6,23,0.10);
  cursor:pointer;
  color:#0f172a;
}
.hdrUserBtn:hover{ filter: brightness(0.98); }
.hdrUserBtn:focus{ box-shadow: 0 0 0 3px var(--yellowSoft); }

.hdrUserDot{
  width:30px;
  height:30px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background: rgba(15,23,42,0.10);
}
.hdrUserTxt{ display:flex; flex-direction:column; line-height:1.05; }
.hdrUserName{ font-weight:900; font-size:13px; }
.hdrUserProv{ font-size:11px; color: rgba(15,23,42,0.72); margin-top:2px; }
.hdrUserMenu{
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.10);
  box-shadow: 0 16px 34px rgba(2,6,23,0.16);
  min-width: 240px;
}

.app{
  display: flex;
  min-height: 100vh;
  padding-top: var(--appbarH);
}

.sidebar{
  top: var(--appbarH);
  height: calc(100vh - var(--appbarH) - var(--footerH));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================================
   Footer
================================ */

.appFooter{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footerH);
  z-index: 1025;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, var(--brand3), var(--brand) 55%, var(--brandBlue));
  border-top: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 -14px 30px rgba(2,6,23,0.14);
}

.appFooter__inner{
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.appFooter__left{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.appFooter__mark{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  flex: 0 0 auto;
}

.appFooter__img{
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.appFooter__text{
  color: rgba(255,255,255,0.88);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appFooter__right{
  color: rgba(255,255,255,0.75);
  font-size: 12px;
}

/* Login footer bar */
.authFooter{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footerH);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--brand3), var(--brand) 55%, var(--brandBlue));
  border-top: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.88);
  font-size: 12px;
  padding: 0 14px;
}

.sidebar__brand{ flex: 0 0 auto; }

.sidebar__nav{
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
  padding-bottom: 14px;
}

/* Sidebar scrollbar */
.sidebar__nav{ scrollbar-width: thin; scrollbar-color: rgba(15,23,42,0.20) transparent; }
.sidebar__nav::-webkit-scrollbar{ width: 10px; }
.sidebar__nav::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,0.18);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.sidebar__nav::-webkit-scrollbar-thumb:hover{ background: rgba(15,23,42,0.26); }


@media (max-width: 720px){
  .appbarBrand__sub{ display: none; }
  .appbarBrand__title{ font-size: 13px; }
}

/* ================================
   Auth screen
================================ */

body.auth{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 14px calc(var(--footerH) + 18px) 14px;
}

.auth-wrap{
  width: min(980px, 96vw);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 980px){
  .auth-wrap{ grid-template-columns: 1fr; }
}

.auth-side{
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 20px;
  background: rgba(255,255,255,0.82);
  box-shadow: var(--shadow2);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.auth-side::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 320px at 10% 10%, rgba(20,184,166,0.16), transparent 60%),
    radial-gradient(420px 280px at 90% 30%, rgba(255,213,74,0.22), transparent 55%);
  pointer-events: none;
}

.auth-brand{ position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.auth-mark{
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(20,184,166,0.22), rgba(6,58,42,0.10));
  border: 1px solid rgba(15,118,110,0.18);
  color: var(--brand);
}

.auth-logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.auth-logoBig{
  width: min(360px, 100%);
  height: 64px;
  object-fit: contain;
  display:block;
  margin-bottom: 10px;
}

.auth-brand-title{ font-weight: 900; font-size: 18px; color: var(--brand3); }
.auth-brand-sub{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.auth-side-card{
  position: relative;
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.78);
  padding: 14px;
}

.auth-side-title{ font-weight: 900; color: var(--brand3); }
.auth-side-text{ margin-top: 6px; color: var(--muted); font-size: 13px; }

.auth-bullets{
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.auth-bullets li{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.70);
  font-size: 13px;
}

.auth-bullets i{ color: var(--brand); font-size: 16px; }

.auth-foot{ position: relative; margin-top: 14px; }

.auth-card{
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 20px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-card-h{
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(135deg, rgba(20,184,166,0.10), rgba(255,255,255,0.65));
}

.auth-title{ font-weight: 900; font-size: 18px; color: var(--brand3); }
.auth-sub{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.auth-card-b{ padding: 16px; }

.auth .input-group-text{ border-radius: 12px; }
.auth .form-control{ border-radius: 12px; }



/* ================================
   Pro polish
================================ */

/* Crisp type */
body{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links */
a{ color: var(--brand); }
a:hover{ color: var(--brand3); }

/* Better focus */
:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.22);
  border-radius: 10px;
}

/* Smooth micro-interactions */
.btn,
.nav__item,
.cardx,
.kpi-card,
.kpi-tile,
.form-control,
.form-select,
.modal-content,
.dropdown-menu,
.dropdown-item{
  transition:
    background-color .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease,
    color .15s ease,
    opacity .15s ease;
}

@media (prefers-reduced-motion: reduce){
  .btn,
  .nav__item,
  .cardx,
  .kpi-card,
  .kpi-tile,
  .form-control,
  .form-select,
  .modal-content,
  .dropdown-menu,
  .dropdown-item{ transition: none; }
}

/* Cards */
.cardx:hover{
  box-shadow: 0 18px 46px rgba(2,6,23,0.12);
  transform: translateY(-1px);
}
.kpi-card:hover,
.kpi-tile:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 46px rgba(2,6,23,0.10);
}

/* Buttons */
.btn{ border-radius: 12px; font-weight: 800; }
.btn-sm{ border-radius: 10px; font-weight: 800; }
.btn:focus{ box-shadow: 0 0 0 0.2rem rgba(20,184,166,0.18); }

/* Dropdown */
.dropdown-menu{
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: 0 18px 46px rgba(2,6,23,0.14);
  padding: 8px;
}
.dropdown-item{
  border-radius: 12px;
  padding: 10px 12px;
}
.dropdown-item:hover{ background: rgba(20,184,166,0.12); }
.dropdown-item:active{ background: rgba(20,184,166,0.18); color: #0f172a; }

/* Modals */
.modal-header{
  background: linear-gradient(135deg, rgba(20,184,166,0.10), rgba(255,255,255,0.86));
  border-bottom: 1px solid rgba(15,23,42,0.08);
}
.modal-title{ font-weight: 900; color: var(--brand3); }
.modal-footer{ border-top: 1px solid rgba(15,23,42,0.08); }

/* Tables */
.table{ --bs-table-border-color: rgba(15,23,42,0.10); }
.table td, .table th{ vertical-align: middle; }
.table thead th{ background: rgba(15,118,110,0.06); }

/* DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select{
  padding: 8px 10px;
  height: auto;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{
  background: rgba(20,184,166,0.16) !important;
  border: 1px solid rgba(15,118,110,0.22) !important;
  color: #0f172a !important;
}

/* Alerts and badges */
.alert{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: 0 10px 24px rgba(2,6,23,0.06);
}
.badge{ border-radius: 999px; font-weight: 800; }

/* Placeholder and selection */
::selection{ background: rgba(20,184,166,0.22); }
::placeholder{ color: rgba(100,116,139,0.78); }
