/* ════════════════════════════════════════════════════════════════
   CloudLedgerAI — Purchases Module & Transaction Drawer Stylesheet
   Prefix: zb- / im- (Enterprise ERP styling for Purchase Orders,
   Purchase Bills, Vendor Credits, Line Items Table, and Drawers)
   ════════════════════════════════════════════════════════════════ */

/* ── 1. Drawer Overlay & Sliding Animation ───────────────────────────── */
#purchase-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1050;
  display: none;
  opacity: 0;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  justify-content: flex-end;
}

#purchase-drawer-overlay.open,
#purchase-drawer-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#purchase-drawer {
  position: relative;
  width: min(1040px, 98vw);
  height: 100%;
  max-height: 100vh;
  background: #ffffff;
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  border-left: 1px solid #e2e8f0;
}

#purchase-drawer-overlay.open #purchase-drawer,
#purchase-drawer-overlay.active #purchase-drawer,
#purchase-drawer.open {
  transform: translateX(0) !important;
}

/* ── 2. Drawer Header ────────────────────────────────────────────────── */
.zb-bill-drawer .im-drawer-head {
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.zb-drawer-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
  flex-shrink: 0;
}

.zb-bill-drawer .im-drawer-title {
  margin: 0;
  font-size: 18.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.4px;
}

.zb-bill-drawer .im-page-sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 400;
}

.zb-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.zb-drawer-close:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
  transform: rotate(90deg);
}

/* ── 3. Drawer Form & Inputs Reset ───────────────────────────────────── */
.zb-drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 74px);
  overflow: hidden;
}

.zb-drawer-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 28px 30px;
  background: #fcfcfd;
}

.zb-bill-drawer .im-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 30px;
  background: #fcfcfd;
}

/* Base Form Control System */
.im-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.im-label.required::after {
  content: '*';
  color: #ef4444;
  font-weight: 700;
  margin-left: 2px;
}

.im-input,
.im-select,
textarea.im-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  background: #ffffff;
  color: #0f172a;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.im-input:hover,
.im-select:hover,
textarea.im-input:hover {
  border-color: #94a3b8;
}

.im-input:focus,
.im-select:focus,
textarea.im-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

.im-input::placeholder,
textarea.im-input::placeholder {
  color: #94a3b8;
}

.im-input.font-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* Custom styled dropdown arrow for im-select */
.im-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px 15px;
  padding-right: 32px;
  cursor: pointer;
}

/* Date input picker styling */
input[type="date"].im-input {
  position: relative;
  cursor: pointer;
}

input[type="date"].im-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

input[type="date"].im-input:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Icon button reset */
.im-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
  padding: 0;
  flex-shrink: 0;
}

.im-icon-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ── 4. Vendor Selection Row & Badges ────────────────────────────────── */
.zb-form-row-vendor {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.zb-badge-currency {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.zb-btn-clear-vendor {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  font-size: 12px;
}

.zb-btn-clear-vendor:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
}

.zb-vendor-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zb-vendor-detail-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Address Card Preview */
.zb-addr-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.zb-addr-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 5px;
}

.zb-addr-edit {
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 4px;
}

.zb-addr-edit:hover {
  background: #eff6ff;
}

.zb-remarks-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 12px;
}

/* ── 5. Metadata Grid & Attachment Pill ──────────────────────────────── */
.zb-attach-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.zb-attach-badge:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.zb-toolbar-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 8px 14px;
}

.zb-currency-calc-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.zb-currency-calc-note .edit-ico {
  color: #2563eb;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.zb-currency-calc-note .edit-ico:hover {
  background: #eff6ff;
}

/* ── 6. Line Items Table (No Squishing Guaranteed) ───────────────────── */
.zb-table-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 10px;
}

.zb-table-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.zb-table-section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: #2563eb;
  border-radius: 2px;
  display: inline-block;
}

.zb-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  background: #ffffff;
}

.zb-item-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 940px;
  font-size: 12.5px;
}

.zb-item-table th {
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.zb-item-table th.text-right {
  text-align: right;
}

.zb-item-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  background: #ffffff;
  transition: background 0.1s ease;
}

.zb-item-table tr:hover td {
  background: #fafbff;
}

.zb-item-table tr:last-child td {
  border-bottom: none;
}

/* Column form element specifics */
.zb-col-idx {
  width: 28px;
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
  padding-top: 16px !important;
}

.zb-col-item {
  min-width: 260px;
}

.zb-col-item .im-select {
  font-size: 12px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-weight: 500;
}

.zb-col-item .zb-item-name {
  font-size: 12px;
  padding: 5px 8px;
  margin-bottom: 4px;
}

.zb-col-item .zb-item-desc {
  font-size: 11.5px;
  padding: 4px 8px;
  color: #64748b;
  background: #fafbff;
}

.zb-col-account {
  min-width: 190px;
}

.zb-col-account .im-select {
  font-size: 12px;
  padding: 6px 8px;
}

.zb-col-qty {
  width: 85px;
  min-width: 85px;
}

.zb-col-qty .im-input {
  font-size: 12.5px;
  padding: 6px 8px;
  text-align: right;
  font-family: var(--font-mono);
}

.zb-col-rate {
  width: 125px;
  min-width: 125px;
}

.zb-col-rate .im-input {
  font-size: 12.5px;
  padding: 6px 8px;
  text-align: right;
  font-family: var(--font-mono);
  width: 100%;
}

.zb-col-cwt {
  width: 90px;
  min-width: 90px;
  text-align: center;
  padding-top: 15px !important;
}

.zb-col-customer {
  min-width: 150px;
}

.zb-col-customer .im-select {
  font-size: 12px;
  padding: 6px 8px;
}

.zb-col-amount {
  width: 110px;
  min-width: 110px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  padding-top: 15px !important;
  white-space: nowrap;
}

.zb-col-del {
  width: 34px;
  text-align: center;
  padding-top: 12px !important;
}

.zb-line-del-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.zb-line-del-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
}

/* Add row button */
.zb-btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 8px 16px;
  background: #eff6ff;
  border: 1.5px dashed #93c5fd;
  border-radius: 9px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zb-btn-add-row:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

/* ── 7. Bottom Section (Notes, Terms & Order Summary) ────────────────── */
.zb-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  margin-top: 24px;
  align-items: start;
}

.zb-notes-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  margin-bottom: 12px;
}

.zb-notes-card:last-child {
  margin-bottom: 0;
}

.zb-notes-card textarea.im-input {
  resize: vertical;
  min-height: 58px;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 8px;
}

/* Summary Card */
.zb-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.zb-summary-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}

.zb-summary-card .bd-kv {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 5px 0;
  color: #475569;
}

.zb-summary-card .bd-kv span:last-child {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #0f172a;
}

.zb-discount-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  overflow: hidden;
}

.zb-discount-group input {
  width: 52px;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 6px;
  font-size: 12px;
  text-align: right;
}

.zb-input-suffix {
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-left: 1px solid #e2e8f0;
}

.zb-input-calc {
  width: 90px !important;
  text-align: right;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

.zb-roundoff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  margin: 8px 0;
  padding-top: 4px;
}

.zb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.zb-total-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.zb-total-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.zb-total-val {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
  letter-spacing: -0.5px;
}

/* ── 8. Drawer Footer Actions ────────────────────────────────────────── */
.zb-drawer-footer {
  margin-top: auto;
  padding: 16px 28px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.03);
  flex-shrink: 0;
}

.zb-foot-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zb-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid #1d4ed8;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zb-btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.42);
}

.zb-btn-draft {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zb-btn-draft:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.zb-btn-cancel {
  background: transparent;
  color: #64748b;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zb-btn-cancel:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.zb-foot-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 14px;
}

.zb-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.zb-meta-pill a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.zb-meta-pill a:hover {
  text-decoration: underline;
}

.zb-recurring-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.zb-recurring-link:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════
   DARK MODE OVERRIDES (Purchase Orders, Vendor Credits & Bills)
   ══════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .zb-form-card,
[data-theme="dark"] .zb-summary-box,
[data-theme="dark"] .zb-drawer-footer {
  background: #1e293b !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .zb-btn-draft {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
[data-theme="dark"] .zb-btn-draft:hover {
  background: #334155 !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .zb-btn-cancel:hover {
  background: #334155 !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .zb-meta-pill {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .zb-meta-pill a {
  color: #60a5fa !important;
}

@media (max-width: 840px) {
  .zb-bottom-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Purchase Module KPI Strip & Bento Summary Cards ───────────── */
.im-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.im-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}
.im-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.12);
  border-color: #cbd5e1;
}
.im-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}
.im-kpi:hover .im-kpi-icon {
  transform: scale(1.06);
}
.im-kpi-icon svg {
  display: block;
  flex-shrink: 0;
}
.im-kpi-indigo { background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(79, 70, 229, 0.08)); color: #4f46e5; border: 1px solid rgba(99, 102, 241, 0.22); }
.im-kpi-rose   { background: linear-gradient(135deg, rgba(225, 29, 72, 0.16), rgba(244, 63, 94, 0.08));  color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.22); }
.im-kpi-green  { background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(5, 150, 105, 0.08)); color: #059669; border: 1px solid rgba(16, 185, 129, 0.22); }
.im-kpi-amber  { background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.08)); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.22); }
.im-kpi-teal   { background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(13, 148, 136, 0.08)); color: #0d9488; border: 1px solid rgba(20, 184, 166, 0.22); }

.im-kpi-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.im-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.im-kpi-value, .im-kpi-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-primary, #0f172a);
  margin-top: 4px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.im-kpi-sub {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .im-kpi {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28) !important;
}
[data-theme="dark"] .im-kpi:hover {
  border-color: #475569 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}
[data-theme="dark"] .im-kpi-label { color: #94a3b8 !important; }
[data-theme="dark"] .im-kpi-value, [data-theme="dark"] .im-kpi-val { color: #f8fafc !important; }
[data-theme="dark"] .im-kpi-sub { color: #64748b !important; }
[data-theme="dark"] .im-kpi-indigo { background: rgba(99, 102, 241, 0.2) !important; color: #a5b4fc !important; }
[data-theme="dark"] .im-kpi-rose   { background: rgba(225, 29, 72, 0.2) !important;  color: #fb7185 !important; }
[data-theme="dark"] .im-kpi-green  { background: rgba(16, 185, 129, 0.2) !important; color: #6ee7b7 !important; }
[data-theme="dark"] .im-kpi-amber  { background: rgba(245, 158, 11, 0.2) !important; color: #fcd34d !important; }
[data-theme="dark"] .im-kpi-teal   { background: rgba(20, 184, 166, 0.2) !important; color: #5eead4 !important; }
