:root {
  --primary: #f4ad21;
  --secondary: #53c2bf;
  --accent: #5db3ea;
  --dark: #0f172a;
  --dark-2: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #eef4f8;
  --panel: rgba(255,255,255,.94);
  --border: rgba(15,23,42,.08);
  --shadow: 0 16px 40px rgba(15,23,42,.08);
  --sidebar-w: 294px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #edf5f9 0%, #f7fafc 100%);
  overflow-x: hidden;
}
a { text-decoration: none; }
img { max-width: 100%; display: block; }

.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f172a 0%, #091224 100%);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.05);
  z-index: 1000;
}
.brand-wrap {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 4px 10px;
}
.brand-logo {
  object-fit: contain;
  border-radius: 24px;
}
.brand-logo-company {
  width: 192px;
  height: 108px;
  background: rgba(255,255,255,.98);
  padding: 8px 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,.16);
}
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar-nav .nav-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  color: rgba(255,255,255,.84);
  font-weight: 700;
  font-size: .98rem;
  border-radius: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: .18s ease;
}
.sidebar-nav .nav-link i {
  width: 22px;
  text-align: center;
  font-size: 1.16rem;
  flex: 0 0 22px;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(83,194,191,.28), rgba(244,173,33,.18));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 2px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.55);
}

.content-area {
  margin-left: var(--sidebar-w);
  min-width: 0;
  padding: 22px;
}
.content-inner {
  width: min(100%, 1480px);
  margin: 0 auto;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.topbar {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,253,.96));
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 18px 42px rgba(15,23,42,.08);
}
.page-title {
  font-size: clamp(1.9rem, 2.2vw, 2.5rem);
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
}
.page-subtitle { color: var(--muted); }
.user-chip {
  min-width: 220px;
  background: linear-gradient(135deg, rgba(83,194,191,.10), rgba(244,173,33,.08));
  border: 1px solid rgba(83,194,191,.14);
  border-radius: 20px;
  padding: 10px 14px;
  display: grid;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.user-chip i { font-size: 1.12rem; }
.user-chip span { font-weight: 800; }
.user-chip small { color: var(--muted); }

.topbar-title-group {
  min-width: 0;
}
.topbar-title-group .page-subtitle {
  margin-top: 6px;
  font-size: .96rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.module-page { min-width: 0; }
.module-card,
.kpi-card,
.login-card,
.login-feature,
.footer-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.module-card {
  padding: 22px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.module-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(15,23,42,.09);
}
.widget-title { font-size: 1.02rem; font-weight: 800; }
.small-muted { color: var(--muted); font-size: .92rem; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.badge-soft, .stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(83,194,191,.10);
  border: 1px solid rgba(83,194,191,.18);
  color: #0f766e;
  font-weight: 700;
}
.table-responsive {
  border-radius: 18px;
  overflow: auto hidden;
}
.table { margin-bottom: 0; }
.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  border-bottom-width: 1px;
}
.table td, .table th { vertical-align: middle; background: transparent; }
.compact-table td, .compact-table th { padding-top: .9rem; padding-bottom: .9rem; }
.table tbody tr:hover { background: rgba(83,194,191,.04); }

.kpi-card {
  padding: 22px;
  min-height: 134px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(249,252,253,.94));
}
.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(83,194,191,.18), rgba(244,173,33,.16));
  color: var(--dark);
  font-size: 1.35rem;
  flex: 0 0 56px;
}
.kpi-content { min-width: 0; }
.kpi-value {
  font-size: clamp(1.6rem, 1.9vw, 2rem);
  line-height: 1.05;
  font-weight: 800;
  word-break: break-word;
}
.kpi-label { color: var(--muted); font-weight: 700; }
.kpi-meta { color: #16a34a; font-size: .9rem; font-weight: 700; }

.form-control, .form-select {
  border-radius: 14px;
  min-height: 46px;
  border-color: rgba(15,23,42,.12);
}
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 .25rem rgba(83,194,191,.14);
  border-color: rgba(83,194,191,.45);
}
.btn { border-radius: 14px; font-weight: 700; }
.btn-primary {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border: 0;
}
.btn-warning-soft {
  background: rgba(244,173,33,.12);
  color: #9a6700;
  border: 1px solid rgba(244,173,33,.24);
}
.line-items {
  background: linear-gradient(180deg,#fbfdff,#f7fafc);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 22px;
  padding: 16px;
}
.line-items .line-item-row {
  border: 1px dashed rgba(15,23,42,.12);
  border-radius: 18px;
  background: #fff;
  padding: 15px;
  margin-bottom: 12px;
}
.line-items .line-item-row:last-child { margin-bottom: 0; }
.report-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(15,23,42,.08);
}
.report-list li:last-child { border-bottom: 0; }

/* Dashboard */
.module-dashboard .dashboard-hero .dashboard-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, .95fr);
  gap: 24px;
  align-items: stretch;
}
.dashboard-hero-main {
  min-width: 0;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dashboard-hero-side {
  min-width: 0;
}
.report-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(15,23,42,.08);
}
.report-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.report-list li span {
  min-width: 0;
}
.btn-outline-danger.btn-sm {
  min-height: 42px;
  padding-inline: 15px;
  border-radius: 14px;
}
.module-dashboard .dashboard-hero {
  padding: 26px;
  overflow: hidden;
}
.module-dashboard .dashboard-hero > .d-flex {
  display: grid !important;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .9fr);
  gap: 22px;
  align-items: stretch;
}
.module-dashboard h2 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 2.35vw, 2.45rem);
  line-height: 1.08;
  font-weight: 800;
  max-width: 13ch;
}
.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(83,194,191,.08);
  border: 1px solid rgba(83,194,191,.18);
  color: #0f766e;
  font-weight: 700;
}
.dashboard-highlight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: stretch;
}
.dashboard-mini-card {
  min-width: 0;
  min-height: 148px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,.08);
  background: linear-gradient(180deg,#fff,#fbfdff);
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: space-between;
  gap: 10px;
}
.dashboard-mini-card .small-muted {
  display: block;
  margin-bottom: 8px;
  font-size: .98rem;
}
.dashboard-mini-card .fw-bold {
  font-size: clamp(1.52rem, 1.75vw, 1.95rem) !important;
  line-height: 1.12;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.kpi-row.kpi-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 18px;
  align-items: stretch;
}
.dashboard-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr) minmax(300px, .72fr);
  gap: 18px;
  align-items: stretch;
}
canvas[data-chart-config] {
  width: 100% !important;
  max-width: 100%;
}

/* Services KPI horizontal */
.service-kpi-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.service-kpi-card {
  min-width: 0;
  padding: 20px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(245,249,252,.98));
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 14px 34px rgba(15,23,42,.06);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.service-kpi-card .value {
  font-size: clamp(1.7rem, 2.05vw, 2.3rem);
  font-weight: 800;
  line-height: 1;
  margin-top: 4px;
  text-align: right;
  white-space: nowrap;
}
.service-kpi-card .label { color: var(--muted); font-weight: 700; }
.service-kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, rgba(83,194,191,.92), rgba(93,179,234,.65));
}
.service-kpi-card.accent::before {
  background: linear-gradient(180deg, rgba(244,173,33,.92), rgba(83,194,191,.72));
}
.service-kpi-card .metric-label {
  font-size: 1rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 4px;
}
.service-kpi-card .metric-note {
  color: #64748b;
  font-size: .92rem;
  line-height: 1.45;
  max-width: 28ch;
}
.service-kpi-card .metric-value {
  font-size: clamp(1.65rem, 2vw, 2.35rem);
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
  text-align: right;
  white-space: nowrap;
}
.service-kpi-card.accent .metric-value {
  color: #0f766e;
}
.dashboard-hero-main .badge-soft {
  width: fit-content;
  max-width: 100%;
}
.dashboard-hero-main h2 {
  text-wrap: balance;
}
.dashboard-mini-card > .small-muted {
  min-height: 40px;
}
.dashboard-mini-card > .fw-bold {
  display: block;
  min-height: 3.2rem;
}

/* Footer */
.footer-panel { padding: 18px 22px; }
.footer-logo-company {
  width: 64px;
  height: 64px;
  padding: 6px;
  background: #fff;
  border-radius: 16px;
  object-fit: contain;
}
.footer-address { white-space: nowrap; }

/* Login */
body.login-page { overflow-x: hidden; }
.login-wrap {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  background: radial-gradient(circle at top left, rgba(83,194,191,.15), transparent 30%), linear-gradient(145deg, #eefbfb 0%, #f7f9fc 50%, #f0f4ff 100%);
}
.login-hero {
  padding: 44px 48px 28px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: space-between;
  gap: 10px;
  min-width: 0;
}
.login-brand {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.login-brand-main {
  width: 150px;
  height: 150px;
  object-fit: contain;
  background: rgba(255,255,255,.96);
  padding: 8px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  flex: 0 0 150px;
}
.login-card {
  width: min(470px, 92%);
  padding: 32px;
}
.login-feature { padding: 18px; }
.login-footer {
  padding: 16px 20px;
}

.print-shell { background:#fff; max-width:960px; margin:0 auto; padding:32px; }
.print-head { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; margin-bottom:28px; }
.print-logo { width:120px; background:#fff; border-radius:18px; padding:6px; }
.print-box { border:1px solid #dbe4ef; border-radius:16px; padding:14px; }
.print-actions { position:sticky; top:0; z-index:5; background:#f8fafc; border-bottom:1px solid #e5e7eb; padding:14px; margin-bottom:20px; }
@media print {
  .print-actions { display:none !important; }
  body { background:#fff; }
  .print-shell { max-width:none; padding:0; }
}

/* Responsive */
@media (max-width: 1500px) {
  .dashboard-grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dashboard-grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1260px) {
  :root { --sidebar-w: 276px; }
  .brand-logo-company { width: 182px; height: 102px; }
  .module-dashboard .dashboard-hero .dashboard-hero-layout { grid-template-columns: 1fr; }
  .module-dashboard h2 { max-width: none; }
  .dashboard-grid-2,
  .dashboard-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .kpi-row,
  .service-kpi-stack { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 991.98px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .sidebar-nav {
    overflow: visible;
  }
  .content-area { margin-left: 0; padding: 16px; }
  .content-inner { width: 100%; }
  .topbar { padding: 16px 18px; }
  .brand-logo-company { width: 168px; height: 96px; }
  .login-hero { padding: 24px; }
  .login-brand { flex-direction: column; }
  .login-brand-main { width: 128px; height: 128px; flex-basis: 128px; }
}
@media (max-width: 767.98px) {
  .kpi-row,
  .dashboard-highlight,
  .service-kpi-stack { grid-template-columns: 1fr; }
  .page-title { font-size: 1.4rem; }
  .module-card { padding: 18px; }
  .module-dashboard h2 { font-size: 1.95rem; }
  .footer-address { white-space: normal; }
}
@media (max-width: 575.98px) {
  .content-area { padding: 12px; }
  .sidebar { padding: 12px; }
  .sidebar-nav .nav-link { font-size: .95rem; min-height: 48px; }
  .brand-logo-company { width: 154px; height: 90px; }
  .login-card { padding: 24px; }
  .login-hero { padding: 18px; }
}


/* Global corporate alignment */
.module-page {
  display: grid;
  gap: 22px;
}
.row-stack {
  --bs-gutter-x: 1.25rem;
  --bs-gutter-y: 1.25rem;
}
.module-page .module-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.985), rgba(248,251,253,.96));
  border-radius: 26px;
}
.module-page .module-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(83,194,191,.68), rgba(93,179,234,.38), rgba(244,173,33,.34));
  opacity: .9;
}
.module-page .section-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.module-page .widget-title {
  font-size: 1.08rem;
  letter-spacing: -.01em;
}
.module-page .small-muted {
  color: #6f7b8c;
}
.module-page .form-label {
  font-size: .85rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: .5rem;
}
.module-page .form-control,
.module-page .form-select {
  background: rgba(255,255,255,.92);
}
.module-page .btn-sm {
  min-height: 38px;
  padding-inline: .95rem;
}
.module-page .table-responsive {
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}
.module-page .table {
  --bs-table-bg: transparent;
}
.module-page .table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fb;
  border-bottom: 1px solid rgba(15,23,42,.08);
  padding-top: 1rem;
  padding-bottom: 1rem;
  font-size: .76rem;
  color: #64748b;
}
.module-page .table tbody td {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-color: rgba(15,23,42,.06);
}
.module-page .table tbody tr:nth-child(even) {
  background: rgba(148,163,184,.045);
}
.module-page .table tbody tr:hover {
  background: rgba(83,194,191,.07);
}
.module-page .badge {
  border-radius: 999px;
  padding: .55rem .8rem;
  font-weight: 700;
}
.module-page .empty-state,
.module-page .helper-card {
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(83,194,191,.07), rgba(255,255,255,.9));
  border: 1px dashed rgba(83,194,191,.24);
}
.module-page .module-card .btn-outline-secondary,
.module-page .module-card .btn-outline-primary,
.module-page .module-card .btn-outline-danger {
  border-width: 1px;
}
.module-page .module-card .btn-outline-secondary:hover,
.module-page .module-card .btn-outline-primary:hover,
.module-page .module-card .btn-outline-danger:hover {
  transform: translateY(-1px);
}
.footer-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,252,.96));
}
.footer-panel .fw-semibold {
  color: #0f172a;
}
@media (max-width: 991.98px) {
  .module-page { gap: 18px; }
  .module-page .module-card { padding: 18px; border-radius: 22px; }
  .module-page .section-head { padding-bottom: 12px; }
  .module-page .table thead th,
  .module-page .table tbody td { white-space: nowrap; }
}


@media (min-width: 992px) {
  .sidebar-nav {
    padding-bottom: 4px;
  }
  .sidebar-footer .small {
    font-size: .78rem;
    line-height: 1.35;
  }
}


/* v5 dashboard tightening */
.dashboard-hero-title {
  max-width: 19ch !important;
  font-size: clamp(1.55rem, 2.1vw, 2.2rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -.02em;
}
.dashboard-hero-title br {
  display: block;
}
.dashboard-hero-main {
  max-width: 860px;
}
.dashboard-highlight {
  align-items: stretch;
}
.dashboard-mini-card {
  justify-content: space-between;
}
.dashboard-mini-card .small-muted {
  min-height: auto;
  margin-bottom: 0;
}
.dashboard-mini-card .kpi-amount,
.dashboard-mini-card .fw-bold.kpi-amount,
.kpi-card .kpi-value {
  display: block;
  white-space: nowrap;
  word-break: normal !important;
  overflow-wrap: normal !important;
  letter-spacing: -.02em;
}
.dashboard-mini-card .kpi-amount {
  font-size: clamp(1.28rem, 1.55vw, 1.72rem) !important;
  line-height: 1.05 !important;
}
.kpi-card .kpi-value {
  font-size: clamp(1.4rem, 1.75vw, 1.9rem);
}
@media (max-width: 1400px) {
  .dashboard-mini-card .kpi-amount {
    font-size: clamp(1.18rem, 1.45vw, 1.58rem) !important;
  }
}
@media (max-width: 1200px) {
  .dashboard-hero-title {
    max-width: none !important;
  }
  .dashboard-mini-card .kpi-amount,
  .kpi-card .kpi-value {
    white-space: normal;
  }
}


.kpi-row-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.kpi-row-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.kpi-card{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:22px;padding:20px;box-shadow:0 10px 30px rgba(15,23,42,.05)}.kpi-label{font-size:.85rem;color:#64748b;font-weight:700}.kpi-value{font-size:clamp(1.5rem,2vw,2.2rem);font-weight:800;line-height:1.1;white-space:nowrap}.kpi-meta{font-size:.82rem;color:#94a3b8}.dashboard-highlight{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.dashboard-mini-card{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:18px;padding:16px}.metric-strip{display:flex;gap:10px;flex-wrap:wrap}.metric-chip{display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.86);padding:10px 14px;border-radius:999px;border:1px solid rgba(15,23,42,.08)}.dashboard-hero-layout{display:grid;grid-template-columns:1.55fr 1fr;gap:24px;align-items:stretch}.dashboard-hero{background:linear-gradient(135deg,#edf8f7,#f8fbff)}@media (max-width:1200px){.kpi-row-4,.kpi-row-3,.dashboard-highlight,.dashboard-hero-layout{grid-template-columns:1fr 1fr}}@media (max-width:768px){.kpi-row-4,.kpi-row-3,.dashboard-highlight,.dashboard-hero-layout{grid-template-columns:1fr}}

.stock-page-stack{display:grid;gap:24px}
.stock-wide-card{padding:24px}
.stock-section-head{align-items:center}
.stock-form-grid .form-control,.stock-form-grid .form-select{height:48px}
.stock-form-grid textarea.form-control{height:auto;min-height:48px}
.stock-form-actions{display:flex;justify-content:flex-end;padding-top:4px}
.stock-kpi-card .kpi-value{white-space:nowrap}
.stock-filter-row .btn{min-height:46px}
.module-stock .table tbody tr td:last-child{min-width:138px}
@media (max-width: 992px){
  .stock-section-head{align-items:flex-start}
  .stock-form-actions{justify-content:stretch}
  .stock-form-actions .btn{width:100%}
}


.preset-packages {
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.96));
}
.preset-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}
.preset-package-btn {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-height: 64px;
    border-radius: 14px;
    text-align: left;
}
.preset-package-btn strong {
    white-space: nowrap;
}
.package-form-card {
    padding: 16px;
    border: 1px dashed rgba(59, 130, 246, 0.35);
    border-radius: 18px;
    background: rgba(59, 130, 246, 0.03);
}

.package-board-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.01), rgba(59, 130, 246, 0.02));
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 22px;
    padding: 18px;
}
.package-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.package-board-count {
    min-width: 88px;
    text-align: center;
    font-weight: 700;
    font-size: .95rem;
    color: #0f766e;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.18);
}
.package-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.package-item-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}
.package-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.package-item-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}
.package-status-badge {
    white-space: nowrap;
    padding: .55rem .8rem;
}
.package-price-preview {
    font-size: 1.65rem;
    line-height: 1.1;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 14px;
}
.package-edit-form .form-label {
    margin-bottom: .4rem;
}
.module-settings .package-form-card,
.module-settings .package-item-card {
    min-height: 100%;
}
@media (max-width: 1199.98px) {
    .package-board-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 575.98px) {
    .package-board-card,
    .package-item-card,
    .package-form-card {
        padding: 14px;
        border-radius: 18px;
    }
    .package-price-preview {
        font-size: 1.45rem;
    }
}


.dashboard-notice-card{border:1px solid rgba(37,99,235,.08);transition:.2s ease;}
.dashboard-notice-card:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(15,23,42,.08);} 
canvas[data-chart-config]{width:100% !important;max-height:260px;}
.package-settings-grid,.card-soft-grid{align-items:stretch;}
.stock-filter-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
@media (max-width: 1199px){.stock-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media (max-width: 767px){.stock-filter-grid{grid-template-columns:1fr;}}


.stock-filter-card {
  padding: 18px 20px;
}
.stock-filter-head {
  margin-bottom: 12px;
}
.stock-filter-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.stock-filter-compact {
  display: grid;
  gap: 12px;
}
.stock-filter-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.stock-filter-search {
  min-width: 0;
}
.stock-filter-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.stock-filter-details {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248,250,252,.9), rgba(255,255,255,.98));
  overflow: hidden;
}
.stock-filter-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 800;
  color: var(--dark);
}
.stock-filter-details summary::-webkit-details-marker {
  display: none;
}
.stock-filter-details summary span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.stock-filter-details summary small {
  color: var(--muted);
  font-weight: 600;
}
.stock-filter-details[open] summary {
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.stock-filter-grid.compact-mode {
  padding: 14px 16px 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stock-filter-grid.compact-mode .form-label {
  margin-bottom: 6px;
  font-size: .86rem;
}
.stock-filter-grid.compact-mode .form-control,
.stock-filter-grid.compact-mode .form-select {
  min-height: 42px;
}
@media (max-width: 1199.98px) {
  .stock-filter-grid.compact-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 991.98px) {
  .stock-filter-main {
    grid-template-columns: 1fr;
  }
  .stock-filter-actions {
    width: 100%;
  }
  .stock-filter-actions .btn {
    flex: 1 1 180px;
  }
  .stock-filter-grid.compact-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .stock-filter-card {
    padding: 16px;
  }
  .stock-filter-details summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .stock-filter-grid.compact-mode {
    grid-template-columns: 1fr;
  }
}


.service-packages-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.service-packages-sidebar {
    position: sticky;
    top: 86px;
}
.service-packages-content {
    min-width: 0;
}
.package-form-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}
.package-settings-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.package-item-card-inline {
    padding: 16px 16px 14px;
}
.package-item-summary {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.22);
}
.package-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.package-meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #334155;
    font-size: .85rem;
    font-weight: 700;
}
.package-edit-form-inline .form-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #64748b;
}
.package-edit-note {
    margin-top: -2px;
}
@media (max-width: 1199.98px) {
    .service-packages-layout {
        grid-template-columns: 1fr;
    }
    .service-packages-sidebar {
        position: static;
    }
}


/* Sales + accounts refinement */
.sales-kpi-row,.accounts-kpi-row{margin-bottom:4px}
.sales-layout,.accounts-layout{align-items:flex-start}
.sales-form-card,.accounts-form-card{padding:24px}
.sales-form-wrap,.accounts-form-grid{align-items:flex-start}
.sales-side-stack,.accounts-side-stack{display:grid;gap:24px}
.sales-top-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px;padding:18px;border:1px solid rgba(15,23,42,.06);border-radius:22px;background:linear-gradient(180deg,rgba(248,251,253,.86),rgba(255,255,255,.96))}
.sales-top-grid>div{grid-column:span 3;min-width:0}
.sales-top-grid>.span-6{grid-column:span 6}
.sales-top-grid>.span-12{grid-column:1/-1}
.sales-helper-card{padding:18px 20px}
.sales-helper-actions .form-control{min-width:240px}
.sales-remove-btn{min-width:140px}
.sales-table-wrap,.accounts-table-wrap{max-height:560px;overflow:auto}
.sales-history-list,.metric-list{display:grid;gap:10px}
.metric-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border:1px solid rgba(15,23,42,.06);border-radius:18px;background:rgba(255,255,255,.78)}
.card-soft-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.info-card{padding:20px;border:1px solid rgba(15,23,42,.08);border-radius:22px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(247,250,252,.96));box-shadow:0 12px 30px rgba(15,23,42,.05)}
.info-card .title{font-size:1rem;font-weight:800;color:#0f172a;margin-bottom:6px}
.accounts-mini-grid{margin-bottom:0}
.accounts-form-card{position:sticky;top:18px}
.accounts-form-grid .form-control,.accounts-form-grid .form-select,.sales-top-grid .form-control,.sales-top-grid .form-select{height:48px}
.accounts-form-grid input[type="date"],.sales-top-grid input[type="date"]{padding-right:.85rem}
@media (max-width: 1399.98px){.sales-top-grid>div{grid-column:span 4}.sales-top-grid>.span-6{grid-column:span 6}}
@media (max-width: 1199.98px){.card-soft-grid{grid-template-columns:1fr}.accounts-form-card{position:static}.sales-table-wrap,.accounts-table-wrap{max-height:none}}
@media (max-width: 991.98px){.sales-top-grid>div,.sales-top-grid>.span-6{grid-column:span 6}.sales-helper-actions{width:100%}.sales-helper-actions .form-control{min-width:0;flex:1 1 auto}}
@media (max-width: 767.98px){.sales-top-grid>div,.sales-top-grid>.span-6,.sales-top-grid>.span-12{grid-column:1/-1}.sales-form-card,.accounts-form-card,.info-card{padding:18px}.sales-remove-btn{width:100%}}


/* Accounts page refinement */
.accounts-hero {
  padding: 24px 26px;
  background: linear-gradient(135deg, rgba(15,23,42,.98), rgba(24,58,88,.96) 48%, rgba(83,194,191,.92));
  color: #fff;
}
.accounts-hero::before { opacity: .35; }
.accounts-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr);
  gap: 22px;
  align-items: center;
}
.accounts-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .82rem;
  font-weight: 800;
}
.accounts-hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.02em;
}
.accounts-hero .small-muted { color: rgba(255,255,255,.82) !important; }
.accounts-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.accounts-hero-stat {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
}
.accounts-hero-stat span {
  display: block;
  font-size: .8rem;
  color: rgba(255,255,255,.76);
  margin-bottom: 8px;
  font-weight: 700;
}
.accounts-hero-stat strong {
  font-size: 1.2rem;
  line-height: 1.1;
}
.module-accounts .accounts-form-card {
  height: 100%;
}
.module-accounts .accounts-form-grid .form-control,
.module-accounts .accounts-form-grid .form-select {
  min-height: 48px;
  border-radius: 14px;
}
.module-accounts .accounts-side-stack {
  display: grid;
  gap: 20px;
}
.module-accounts .accounts-table-wrap {
  max-height: 480px;
}
.module-accounts .compact-table tbody td:last-child {
  white-space: nowrap;
}
.accounts-bottom-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.accounts-insight-card {
  padding: 20px;
  border: 1px solid rgba(15,23,42,.07);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,250,252,.95));
  box-shadow: 0 16px 38px rgba(15,23,42,.05);
}
.accounts-insight-card .insight-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.accounts-insight-card .title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.accounts-insight-card .metric-list {
  display: grid;
  gap: 10px;
}
.accounts-insight-card .metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(148,163,184,.07);
  border: 1px solid rgba(148,163,184,.12);
}
.accounts-insight-card .empty-state {
  padding: 16px 18px;
  border-radius: 16px;
}
@media (max-width: 1399.98px) {
  .accounts-hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 991.98px) {
  .accounts-bottom-insights,
  .accounts-hero-stats { grid-template-columns: 1fr; }
  .module-accounts .accounts-table-wrap { max-height: none; }
}


.module-accounts .accounts-kpi-row{margin-bottom:22px}
.module-accounts .accounts-form-card,.module-accounts .accounts-side-stack>.module-card,.module-accounts .accounts-insight-card{backdrop-filter:saturate(140%) blur(2px)}
.module-accounts .accounts-side-stack{display:grid;gap:18px}
.module-accounts .accounts-table-wrap{border-radius:18px;border:1px solid rgba(148,163,184,.16);overflow:hidden;background:#fff}
.module-accounts .compact-table thead th{background:linear-gradient(180deg,#f8fafc,#f1f5f9);font-size:.78rem;letter-spacing:.02em;text-transform:uppercase;color:#64748b;border-bottom:1px solid rgba(148,163,184,.18)}
.module-accounts .compact-table tbody tr:hover{background:rgba(15,118,110,.035)}
.module-accounts .compact-table tbody td{vertical-align:middle}
.module-accounts .accounts-bottom-insights{margin-top:4px}
.module-accounts .accounts-insight-card{background:linear-gradient(180deg,rgba(248,250,252,.96),rgba(255,255,255,.98));border:1px solid rgba(148,163,184,.18);box-shadow:0 14px 34px rgba(15,23,42,.06)}


.stock-table-wrap {
  border: 1px solid rgba(15,23,42,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,250,252,.9));
}
.stock-table tbody tr td {
  border-color: rgba(15,23,42,.06);
}
.stock-action-group {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.empty-state-inline {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: .75rem;
}
.empty-state-inline i {
  font-size: 2rem;
  color: var(--secondary);
}
@media (max-width: 767.98px) {
  .stock-action-group {
    width: 100%;
    justify-content: flex-end;
  }
  .stock-action-group .btn,
  .stock-action-group form {
    width: 100%;
  }
  .stock-action-group form .btn {
    width: 100%;
  }
}

/* Bulk stock import */
.stock-import-card {
  padding: 22px;
  border: 1px solid rgba(15,23,42,.08);
  background: linear-gradient(135deg, rgba(83,194,191,.07), rgba(255,255,255,.96));
}
.stock-import-card .btn-outline-primary {
  border-width: 1px;
}
.stock-import-card code {
  background: rgba(15,23,42,.06);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .85em;
}
.import-hints {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.import-hints .hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.72);
  color: #0f172a;
}
.import-hints .hint i {
  color: #0f766e;
  font-size: 1.05rem;
  margin-top: 1px;
}
@media (max-width: 991.98px) {
  .import-hints { grid-template-columns: 1fr; }
}
