:root {
  --le-primary: #6d4aa3;
  --le-primary-dark: #52357c;
  --le-primary-light: #ede6f7;
  --le-accent: #ff9f43;
  --le-success: #2fb380;
  --le-danger: #e5484d;
  --le-sidebar-w: 250px;
  --le-topbar-h: 60px;
}

body {
  background: #f4f2f9;
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  color: #2b2440;
}

a { text-decoration: none; }

/* ---------- App shell ---------- */
.le-shell { min-height: 100vh; display: flex; }

.le-sidebar {
  width: var(--le-sidebar-w);
  background: linear-gradient(180deg, var(--le-primary-dark), var(--le-primary));
  color: #fff;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  padding: 1rem 0;
  z-index: 1040;
  transition: transform .25s ease;
  overflow-y: auto;
}

.le-sidebar .brand {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 1.2rem 1.2rem;
  font-weight: 700; font-size: 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
  margin-bottom: .5rem;
}
.le-sidebar .brand .brand-icon {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}

.le-sidebar .nav-link {
  color: rgba(255,255,255,.85);
  padding: .65rem 1.2rem;
  border-radius: 0;
  display: flex; align-items: center; gap: .7rem;
  font-size: .95rem;
}
.le-sidebar .nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.le-sidebar .nav-link.active {
  background: rgba(255,255,255,.16);
  color: #fff;
  border-right: 3px solid var(--le-accent);
  font-weight: 600;
}
.le-sidebar .nav-section-title {
  text-transform: uppercase; font-size: .72rem; letter-spacing: .06em;
  color: rgba(255,255,255,.55); padding: 1rem 1.2rem .3rem;
}

.le-main { flex: 1; margin-left: var(--le-sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.le-topbar {
  height: var(--le-topbar-h);
  background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 1030;
}
.le-topbar .toggle-btn { display: none; border: none; background: none; font-size: 1.4rem; color: var(--le-primary); }

.le-content { padding: 1.5rem; flex: 1; }

.le-sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035;
}

@media (max-width: 991.98px) {
  .le-sidebar { transform: translateX(-100%); }
  .le-sidebar.open { transform: translateX(0); }
  .le-main { margin-left: 0; }
  .le-topbar .toggle-btn { display: inline-block; }
  .le-sidebar-backdrop.open { display: block; }
}

/* ---------- Brand banner (tenant dashboard) ---------- */
.le-brand-banner {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(120deg, var(--le-primary), var(--le-primary-dark));
  color: #fff;
  border-radius: 16px;
  padding: 1.1rem 1.4rem;
  box-shadow: 0 6px 20px rgba(90, 60, 140, .25);
}
.le-brand-banner .brand-banner-icon {
  width: 54px; height: 54px; border-radius: 12px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
  flex-shrink: 0;
}
.le-brand-banner img.brand-banner-logo { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.le-brand-banner .brand-banner-name { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.le-brand-banner .brand-banner-tagline { font-size: .82rem; opacity: .9; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Cards / KPIs ---------- */
.le-kpi-card {
  background: #fff; border-radius: 14px; padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 10px rgba(90, 60, 140, .07);
  border-left: 4px solid var(--le-primary);
  height: 100%;
}
.le-kpi-card .kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--le-primary-dark); }
.le-kpi-card .kpi-label { font-size: .82rem; color: #7a7392; text-transform: uppercase; letter-spacing: .04em; }
.le-kpi-card.accent { border-left-color: var(--le-accent); }
.le-kpi-card.success { border-left-color: var(--le-success); }
.le-kpi-card.danger { border-left-color: var(--le-danger); }

.le-panel {
  background: #fff; border-radius: 14px; padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(90, 60, 140, .07);
}

.btn-le-primary {
  background: var(--le-primary); border-color: var(--le-primary); color: #fff;
}
.btn-le-primary:hover { background: var(--le-primary-dark); border-color: var(--le-primary-dark); color: #fff; }

.table thead th { color: #7a7392; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom-width: 1px; }

.badge-status-Pending { background: #ffe3b3; color: #8a5a00; }
.badge-status-InProgress { background: #cfe3ff; color: #1a4faa; }
.badge-status-Ready { background: #d3f2e0; color: #147a4d; }
.badge-status-Delivered { background: #e2dff5; color: var(--le-primary-dark); }
.badge-status-Cancelled { background: #fbd6d6; color: #a12626; }

/* ---------- Print slip (redesigned) ---------- */
.docket {
  width: 380px;
  max-width: 100%;
  margin: 0 auto;
  border: 2px solid #2b2440;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #1f1a30;
  overflow: hidden;
}

.docket-header {
  background: var(--le-primary-dark);
  color: #fff;
  padding: 16px 18px;
}
.docket-brand-row { display: flex; align-items: center; gap: 10px; }
.docket-brand-row .washer-icon {
  width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.docket-brand-row .brand-name { font-weight: 800; font-size: 1.2rem; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; }
.docket-brand-row .tagline { font-size: .72rem; opacity: .9; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.docket-contact { margin-top: 10px; font-size: .78rem; opacity: .95; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.docket-contact .address { text-align: right; max-width: 60%; }

.docket-band {
  background: var(--le-accent);
  color: #3a2400;
  text-align: center;
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .08em;
  padding: 5px 0;
}

.docket-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 18px 6px;
}
.docket-meta .meta-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #8a83a0; }
.docket-meta .meta-value { font-weight: 700; font-size: 1rem; }
.docket-meta .sr-no { color: var(--le-primary-dark); font-size: 1.2rem; }

.service-badges { display: flex; gap: 6px; padding: 4px 18px 12px; flex-wrap: wrap; }
.service-badge {
  border: 1.5px solid #d8d2ea; border-radius: 20px; padding: 3px 12px;
  font-size: .72rem; font-weight: 600; color: #a39dbb;
}
.service-badge.on { border-color: var(--le-primary); color: var(--le-primary-dark); background: var(--le-primary-light); }

.cust-block { padding: 4px 18px 12px; border-top: 1px dashed #d8d2ea; margin-top: 4px; }
.cust-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: .85rem; }
.cust-row .cust-label { color: #8a83a0; }
.cust-row .cust-value { font-weight: 600; text-align: right; }

.items-table { width: 100%; font-size: .82rem; border-collapse: collapse; margin-top: 4px; }
.items-table thead th {
  border-top: 1px dashed #d8d2ea; border-bottom: 1px solid #d8d2ea;
  padding: 6px 18px; text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; color: #8a83a0;
}
.items-table thead th:first-child { padding-left: 18px; }
.items-table tbody td { padding: 5px 18px; }
.items-table tbody td:first-child { padding-left: 18px; }
.items-table tbody tr:not(:last-child) td { border-bottom: 1px solid #f1eef8; }

.totals-block { padding: 10px 18px 4px; border-top: 1px dashed #d8d2ea; margin-top: 6px; }
.totals-row { display: flex; justify-content: space-between; font-size: .85rem; padding: 2px 0; color: #55506c; }
.totals-row.balance { font-weight: 700; color: #2b2440; }
.totals-row.balance.due { color: var(--le-danger); }

.grand-total-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--le-primary-light);
  margin: 8px 18px 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800; font-size: 1.15rem; color: var(--le-primary-dark);
}

.remarks-block { padding: 10px 18px 0; font-size: .78rem; color: #55506c; }

.docket-footer { padding: 14px 18px 18px; text-align: center; }
.docket-footer .tear-line {
  border-top: 2px dashed #d8d2ea; margin-bottom: 12px;
}
.docket-footer .thank-you { font-weight: 700; font-size: .88rem; color: var(--le-primary-dark); }
.docket-footer .footer-note { font-size: .72rem; color: #8a83a0; margin-top: 2px; }

@media print {
  @page { size: auto; margin: 10mm; }
  .no-print { display: none !important; }
  .le-sidebar, .le-sidebar-backdrop, .le-topbar { display: none !important; }
  .le-main { margin-left: 0 !important; }
  .le-content { padding: 0; }
  body { background: #fff; }
  .docket { border: 2px solid #000; box-shadow: none; page-break-inside: avoid; }
  .docket-header { background: #2b2440 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .docket-band { background: #f0b429 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grand-total-row { background: #f1eef8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
