/* ══════════════════════════════════════════════════════════════
   BLISS ACCOUNTING — MASTER STYLESHEET
   Pixel-matched to bliss-dashboard.html prototype
══════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --sage:       #7BAE7F;
  --forest:     #2F5D50;
  --forest-lt:  #3a7262;
  --warm-white: #FAFBF8;
  --soft-gray:  #EEF2EC;
  --charcoal:   #2A2E2B;
  --teal:       #5FA8A0;
  --olive:      #92A87D;
  --gold:       #D6B66B;
  --gold-lt:    #e8cc91;
  --sidebar-w:  228px;
  --radius:     12px;
  --shadow-sm:  0 1px 3px rgba(42,46,43,.06), 0 1px 8px rgba(42,46,43,.04);
  --shadow:     0 4px 20px rgba(42,46,43,.08), 0 1px 4px rgba(42,46,43,.05);
  --shadow-lg:  0 8px 40px rgba(42,46,43,.12);
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--warm-white);
  color: var(--charcoal);
  height: 100vh;
  overflow: hidden;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #cfdece;
  border-right: none;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(47,93,80,.15);
  margin-bottom: 8px;
}

.logo-mark {
  width: 34px; height: 34px;
  background: var(--forest);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 18px; height: 18px; }

.logo-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  color: var(--forest);
  letter-spacing: -.3px;
}

.sidebar-section { padding: 6px 12px; margin-top: 8px; }

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(47,93,80,.5);
  padding: 6px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--forest);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  margin-bottom: 1px;
}
.nav-item:hover { background: rgba(47,93,80,.12); color: var(--forest); text-decoration: none; }
.nav-item.active {
  background: var(--forest);
  color: white;
  font-weight: 700;
}
.nav-item.active::before {
  display: none;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--forest); }
.nav-item:hover svg { color: var(--forest); }
.nav-item.active svg { color: white; }

.nav-badge {
  margin-left: auto;
  background: var(--forest);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(47,93,80,.15);
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.user-card:hover { background: rgba(47,93,80,.12); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--forest);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { color: var(--forest); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(47,93,80,.6); font-size: 11px; }

/* ── MAIN ────────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  height: 60px;
  background: var(--warm-white);
  border-bottom: 1px solid var(--soft-gray);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  color: var(--charcoal);
  flex: 1;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--soft-gray);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 7px 14px;
  width: 260px;
  transition: all var(--transition);
  cursor: pointer;
  /* Anchor the company badge on the left; push search + all actions to the
     right edge so the bar reads right-justified instead of bunched left. */
  margin-left: auto;
}
.topbar-search:focus-within {
  border-color: var(--sage);
  background: white;
  box-shadow: 0 0 0 3px rgba(123,174,127,.12);
}
.topbar-search svg { color: #888; width: 15px; height: 15px; flex-shrink: 0; }
.topbar-search input {
  border: none; background: transparent; outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: var(--charcoal);
  width: 100%;
}
.topbar-search input::placeholder { color: #aaa; }

.ai-pill {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--forest) 0%, var(--teal) 100%);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 2px 8px rgba(47,93,80,.25);
}
.ai-pill:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(47,93,80,.3); }
.ai-pill .dot {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform: scale(1); }
  50%      { opacity:.6; transform: scale(1.3); }
}

.topbar-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--soft-gray);
  background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.topbar-icon:hover { border-color: var(--sage); background: var(--soft-gray); }
.topbar-icon svg { width: 16px; height: 16px; color: #666; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  border: 1.5px solid var(--warm-white);
}

/* ── CONTENT ─────────────────────────────────────────────────── */
.content { padding: 18px 32px 28px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary {
  background: var(--forest); color: white;
  box-shadow: 0 2px 8px rgba(47,93,80,.25);
}
.btn-primary:hover { background: var(--forest-lt); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(47,93,80,.3); color: white; text-decoration: none; }
.btn-secondary { background: white; color: var(--charcoal); border: 1.5px solid var(--soft-gray); }
.btn-secondary:hover { border-color: var(--sage); background: var(--soft-gray); text-decoration: none; color: var(--charcoal); }
.btn-ghost { background: transparent; color: #888; border: 1.5px solid var(--soft-gray); }
.btn-ghost:hover { border-color: #ccc; color: var(--charcoal); text-decoration: none; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-danger { background: #c0392b; color: white; }
.btn-danger:hover { background: #a93226; color: white; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label { font-size: 11.5px; font-weight: 600; color: #888; letter-spacing: .2px; }
.form-label .req { color: var(--teal); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1.5px solid var(--soft-gray);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px; color: var(--charcoal);
  outline: none;
  transition: all var(--transition);
  background: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(123,174,127,.12);
}
.form-input::placeholder, .form-textarea::placeholder { color: #ccc; }
.form-select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.form-textarea { resize: vertical; min-height: 70px; font-size: 13px; }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--soft-gray);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}
.card-header {
  display: flex; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--soft-gray);
  gap: 10px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--charcoal); flex: 1; }
.card-subtitle { font-size: 12px; color: #999; margin-top: 1px; }
.card-action {
  font-size: 12px; color: var(--forest); font-weight: 500;
  cursor: pointer; padding: 5px 10px; border-radius: 6px;
  transition: background var(--transition);
  border: none; background: transparent; font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}
.card-action:hover { background: var(--soft-gray); }

/* ── TABLE ───────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
  color: #aaa; background: var(--soft-gray);
  border-bottom: 1px solid #e4e8e2;
}
.data-table td {
  padding: 13px 20px;
  border-bottom: 1px solid #f2f4f0;
  font-size: 13px; color: var(--charcoal);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); cursor: pointer; }
.data-table tbody tr:hover td { background: #fafcf9; }

/* ── STATUS PILLS ────────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.status-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }
.status-pill.paid    { background: rgba(123,174,127,.12); color: #4a8c4e; }
.status-pill.paid::before    { background: var(--sage); }
.status-pill.pending, .status-pill.sent { background: rgba(95,168,160,.12); color: #2e7d74; }
.status-pill.pending::before, .status-pill.sent::before { background: var(--teal); }
.status-pill.partial { background: rgba(146,168,125,.12); color: #5a7840; }
.status-pill.partial::before { background: var(--olive); }
.status-pill.overdue { background: rgba(200,80,80,.08); color: #b84040; }
.status-pill.overdue::before { background: #d45555; }
.status-pill.draft   { background: rgba(150,150,150,.1); color: #888; }
.status-pill.draft::before   { background: #bbb; }
.status-pill.voided  { background: rgba(200,80,80,.08); color: #b84040; }
.status-pill.voided::before  { background: #d45555; }
.status-pill.posted  { background: rgba(123,174,127,.12); color: #4a8c4e; }
.status-pill.posted::before  { background: var(--sage); }

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.page-heading { font-family: 'DM Sans', sans-serif; font-size: 26px; color: var(--charcoal); line-height: 1.2; }
.page-sub { font-size: 13px; color: #999; margin-top: 3px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ── PERIOD BAR ──────────────────────────────────────────────── */
.period-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.period-tabs { display: flex; background: var(--soft-gray); border-radius: 8px; padding: 3px; gap: 2px; }
.period-tab {
  padding: 5px 14px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; cursor: pointer; color: #888;
  transition: all var(--transition); border: none; background: transparent;
  font-family: 'DM Sans', sans-serif;
}
.period-tab.active { background: white; color: var(--charcoal); box-shadow: var(--shadow-sm); }

/* ── KPI CARDS ───────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: white; border: 1px solid var(--soft-gray);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  position: relative; overflow: hidden;
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }
.kpi-card.green::after  { background: var(--sage); }
.kpi-card.teal::after   { background: var(--teal); }
.kpi-card.gold::after   { background: var(--gold); }
.kpi-card.olive::after  { background: var(--olive); }
.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-label { font-size: 12px; font-weight: 500; color: #888; letter-spacing: .2px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.kpi-icon.green  { background: rgba(123,174,127,.12); color: var(--sage); }
.kpi-icon.teal   { background: rgba(95,168,160,.12);  color: var(--teal); }
.kpi-icon.gold   { background: rgba(214,182,107,.12); color: var(--gold); }
.kpi-icon.olive  { background: rgba(146,168,125,.12); color: var(--olive); }
.kpi-icon svg { width: 15px; height: 15px; }
.kpi-value { font-family: 'DM Sans', sans-serif; font-size: 28px; color: var(--charcoal); line-height: 1; margin-bottom: 8px; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 20px; }
.kpi-delta.up   { background: rgba(123,174,127,.12); color: #4a8c4e; }
.kpi-delta.down { background: rgba(200,80,80,.08);   color: #b84040; }
.kpi-delta svg { width: 11px; height: 11px; }
.kpi-margin { font-size: 11.5px; color: #bbb; margin-top: 4px; }

/* ── MINI CHART BARS ─────────────────────────────────────────── */
.mini-chart { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: 10px; }
.bar { flex: 1; border-radius: 3px 3px 0 0; min-width: 4px; transition: opacity var(--transition); }
.bar:hover { opacity: .75; }

/* ── AI BANNER ───────────────────────────────────────────────── */
.ai-banner {
  background: linear-gradient(135deg, var(--forest) 0%, #3d7a6a 60%, var(--teal) 100%);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 20px rgba(47,93,80,.2);
}
.ai-banner::before { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.04); }
.ai-banner::after  { content: ''; position: absolute; right: 60px; bottom: -60px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.03); }
.ai-icon-wrap { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-icon-wrap svg { width: 22px; height: 22px; color: var(--gold); }
.ai-banner-body { flex: 1; }
.ai-banner-title { font-family: 'DM Sans', sans-serif; font-size: 16px; color: white; margin-bottom: 3px; }
.ai-banner-sub { font-size: 12.5px; color: rgba(255,255,255,.65); }
.ai-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px; padding: 5px 12px;
  font-size: 12px; color: rgba(255,255,255,.85);
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap; font-family: 'DM Sans', sans-serif; font-weight: 500;
  text-decoration: none;
}
.ai-chip:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.25); color: white; text-decoration: none; }
.ai-chip svg { width: 12px; height: 12px; }

/* ── BOTTOM GRID ─────────────────────────────────────────────── */
.bottom-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }

/* ── AMOUNT ──────────────────────────────────────────────────── */
.amount { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.amount.pos { color: #4a8c4e; font-weight: 500; }
.amount.neg { color: #b84040; }

/* ── METERS ──────────────────────────────────────────────────── */
.meters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 20px; }
.meter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.meter-label { font-size: 12px; color: #888; font-weight: 500; }
.meter-value { font-size: 14px; font-weight: 600; color: var(--charcoal); font-feature-settings: "tnum"; }
.meter-bar-bg { height: 6px; background: var(--soft-gray); border-radius: 20px; overflow: hidden; }
.meter-bar-fill { height: 100%; border-radius: 20px; transition: width .6s ease; }
.meter-sub { font-size: 11px; color: #bbb; margin-top: 4px; }

/* ── ACTIVITY FEED ───────────────────────────────────────────── */
.activity-feed { padding: 4px 0; }
.activity-item { display: flex; gap: 12px; padding: 12px 20px; transition: background var(--transition); cursor: pointer; align-items: flex-start; }
.activity-item:hover { background: #fafcf9; }
.activity-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.activity-dot svg { width: 14px; height: 14px; }
.activity-dot.invoice { background: rgba(95,168,160,.12);  color: var(--teal); }
.activity-dot.payment { background: rgba(123,174,127,.12); color: var(--sage); }
.activity-dot.bill    { background: rgba(214,182,107,.12); color: #a07c20; }
.activity-dot.ai      { background: rgba(47,93,80,.1);     color: var(--forest); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--charcoal); line-height: 1.4; }
.activity-time { font-size: 11.5px; color: #bbb; margin-top: 2px; }
.activity-amount { font-size: 13px; font-weight: 600; color: var(--charcoal); white-space: nowrap; font-feature-settings: "tnum"; }

/* ── DIVIDER ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--soft-gray); margin: 0 20px; }

/* ── TABLE FOOTER ────────────────────────────────────────────── */
.table-footer { display: flex; align-items: center; padding: 14px 20px; border-top: 1px solid var(--soft-gray); gap: 12px; }
.table-info { font-size: 12.5px; color: #aaa; flex: 1; }
.pagination { display: flex; gap: 4px; }
.page-btn {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1.5px solid var(--soft-gray); background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12.5px; color: #666;
  transition: all var(--transition); font-family: 'DM Sans', sans-serif;
}
.page-btn:hover { border-color: var(--sage); }
.page-btn.active { background: var(--forest); border-color: var(--forest); color: white; }
.page-btn svg { width: 13px; height: 13px; }

/* ── ROW ACTIONS ─────────────────────────────────────────────── */
.row-actions { display: flex; gap: 6px; opacity: 0; transition: opacity var(--transition); }
.data-table tbody tr:hover .row-actions { opacity: 1; }
.row-btn {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1.5px solid var(--soft-gray); background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.row-btn:hover { border-color: var(--sage); background: var(--soft-gray); }
.row-btn svg { width: 13px; height: 13px; color: #777; }

/* ── FLASH MESSAGES ──────────────────────────────────────────── */
.flash-container { position: fixed; top: 20px; right: 20px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; max-width: 380px; pointer-events: none; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  animation: slideIn .22s cubic-bezier(.2,.8,.3,1);
  pointer-events: all;
}
@keyframes slideIn { from { opacity:0; transform: translateX(30px) scale(.97); } to { opacity:1; transform: translateX(0) scale(1); } }
@keyframes slideOut { from { opacity:1; transform: translateX(0); max-height:80px; margin-bottom:0; } to { opacity:0; transform: translateX(30px); max-height:0; margin-bottom:-8px; } }
.flash.dismissing { animation: slideOut .25s ease forwards; }
.flash-icon { flex-shrink: 0; margin-top: 1px; }
.flash-body { flex: 1; }
.flash-title { font-weight: 600; margin-bottom: 1px; }
.flash-msg { font-weight: 400; opacity: .9; }
.flash button { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .6; padding: 0; line-height: 1; color: inherit; flex-shrink: 0; margin-top: 1px; }
.flash button:hover { opacity: 1; }
.flash-success { background: var(--forest); color: white; }
.flash-error   { background: #b83030;      color: white; }
.flash-warning { background: #a07020;      color: white; }
.flash-info    { background: var(--teal);  color: white; }

/* Confirm dialog styles handled inline in JS */


/* ── AI MODAL ────────────────────────────────────────────────── */
.ai-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(42,46,43,.4); backdrop-filter: blur(4px);
  z-index: 100; align-items: center; justify-content: center;
}
.ai-modal-backdrop.open { display: flex; }
.ai-modal {
  background: white; border-radius: 16px; width: 580px; max-width: 95vw;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: fadeUp .25s ease;
}
@keyframes fadeUp { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }
.ai-modal-header {
  background: linear-gradient(135deg, var(--forest), var(--teal));
  padding: 20px 24px; display: flex; align-items: center; gap: 12px;
}
.ai-modal-header-icon { width: 36px; height: 36px; background: rgba(255,255,255,.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.ai-modal-header-icon svg { width: 18px; height: 18px; color: var(--gold); }
.ai-modal-title { font-family: 'DM Sans', sans-serif; font-size: 18px; color: white; flex: 1; }
.ai-modal-close { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.12); border: none; cursor: pointer; color: white; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.ai-modal-close:hover { background: rgba(255,255,255,.22); }
.ai-modal-close svg { width: 14px; height: 14px; }
.ai-modal-body { padding: 20px 24px; }
.ai-prompt-area {
  width: 100%; border: 1.5px solid var(--soft-gray); border-radius: 10px;
  padding: 12px 16px; font-family: 'DM Sans', sans-serif; font-size: 14px;
  color: var(--charcoal); resize: none; outline: none; height: 80px;
  transition: border-color var(--transition); background: var(--warm-white);
}
.ai-prompt-area:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(123,174,127,.12); }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.ai-suggestion {
  font-size: 12.5px; background: var(--soft-gray);
  border: 1px solid #e4e8e2; border-radius: 20px; padding: 5px 12px;
  cursor: pointer; color: var(--charcoal); transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.ai-suggestion:hover { background: var(--forest); color: white; border-color: var(--forest); }
.ai-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--soft-gray); }

/* ── AUTH PAGES ──────────────────────────────────────────────── */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--forest) 0%, var(--teal) 100%);
}
.auth-card { background: white; border-radius: 16px; padding: 40px; width: 420px; max-width: 95vw; box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-heading { font-family: 'DM Sans', sans-serif; font-size: 26px; color: var(--charcoal); margin-bottom: 6px; }
.auth-sub { font-size: 13.5px; color: #999; margin-bottom: 24px; }

/* ── QUICK ACTIONS ───────────────────────────────────────────── */
.quick-actions { display: flex; gap: 10px; margin-bottom: 24px; }
.quick-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); border: none; font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}
.quick-btn svg { width: 15px; height: 15px; }
.quick-btn.primary { background: var(--forest); color: white; box-shadow: 0 2px 8px rgba(47,93,80,.25); }
.quick-btn.primary:hover { background: var(--forest-lt); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(47,93,80,.3); color: white; }
.quick-btn.secondary { background: white; color: var(--charcoal); border: 1.5px solid var(--soft-gray); }
.quick-btn.secondary:hover { border-color: var(--sage); background: var(--soft-gray); color: var(--charcoal); }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dde2db; border-radius: 20px; }

/* ══════════════════════════════════════════════════════════════
   INVOICE-SPECIFIC STYLES
══════════════════════════════════════════════════════════════ */

/* Summary strip */
.summary-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:24px;}
.summary-card{background:white;border:1px solid var(--soft-gray);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow-sm);position:relative;overflow:hidden;transition:all var(--transition);cursor:default;}
.summary-card::after{content:'';position:absolute;bottom:0;left:0;right:0;height:3px;}
.summary-card.all::after{background:var(--charcoal);}
.summary-card.outstanding::after{background:var(--teal);}
.summary-card.overdue::after{background:#d45555;}
.summary-card.draft::after{background:#ccc;}
.summary-card:hover{box-shadow:var(--shadow);transform:translateY(-1px);}
.sc-label{font-size:11.5px;font-weight:500;color:#999;margin-bottom:6px;}
.sc-value{font-family:'DM Sans',sans-serif;font-size:22px;color:var(--charcoal);}
.sc-count{font-size:11.5px;color:#bbb;margin-top:3px;}

/* Filter bar */
.filter-bar{display:flex;align-items:center;gap:10px;margin-bottom:16px;flex-wrap:wrap;}
.filter-tabs{display:flex;background:var(--soft-gray);border-radius:8px;padding:3px;gap:2px;}
.filter-tab{padding:5px 14px;border-radius:6px;font-size:12.5px;font-weight:500;cursor:pointer;color:#888;transition:all var(--transition);border:none;background:transparent;font-family:'DM Sans',sans-serif;white-space:nowrap;}
.filter-tab.active{background:white;color:var(--charcoal);box-shadow:var(--shadow-sm);}
.filter-select{border:1.5px solid var(--soft-gray);background:white;border-radius:8px;padding:6px 30px 6px 12px;font-size:12.5px;font-family:'DM Sans',sans-serif;color:var(--charcoal);outline:none;cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;transition:border-color var(--transition);}
.filter-select:focus{border-color:var(--sage);}
.filter-search{display:flex;align-items:center;gap:8px;background:white;border:1.5px solid var(--soft-gray);border-radius:8px;padding:6px 12px;margin-left:auto;transition:all var(--transition);}
.filter-search:focus-within{border-color:var(--sage);box-shadow:0 0 0 3px rgba(123,174,127,.10);}
.filter-search svg{width:14px;height:14px;color:#bbb;flex-shrink:0;}
.filter-search input{border:none;background:transparent;outline:none;font-family:'DM Sans',sans-serif;font-size:13px;color:var(--charcoal);width:180px;}

/* Invoice table specifics */
.check-col{width:40px;padding-right:0 !important;}
input[type=checkbox]{width:15px;height:15px;accent-color:var(--forest);cursor:pointer;}
.inv-num{font-weight:600;color:var(--forest);}
.customer-name{font-weight:500;}
.customer-email{font-size:11.5px;color:#bbb;margin-top:1px;}
.due-date{font-size:12.5px;}
.due-date.overdue{color:#b84040;font-weight:500;}
.due-date.soon{color:#c08020;}
.sortable{cursor:pointer;user-select:none;}
.sortable:hover{color:#777 !important;}
.sort-icon{margin-left:4px;opacity:.4;font-size:10px;}
.sorted .sort-icon{opacity:1;color:var(--forest);}

/* Bulk bar */
.bulk-bar{display:none;align-items:center;gap:12px;background:var(--forest);border-radius:10px;padding:10px 18px;margin-bottom:14px;animation:slideDown .2s ease;}
.bulk-bar.visible{display:flex;}
@keyframes slideDown{from{opacity:0;transform:translateY(-6px);}to{opacity:1;transform:translateY(0);}}
.bulk-count{color:white;font-size:13px;font-weight:500;flex:1;}
.bulk-btn{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);color:rgba(255,255,255,.9);border-radius:7px;padding:6px 12px;font-size:12.5px;font-weight:500;cursor:pointer;transition:all var(--transition);font-family:'DM Sans',sans-serif;}
.bulk-btn:hover{background:rgba(255,255,255,.2);}
.bulk-btn svg{width:13px;height:13px;}
.bulk-cancel{background:transparent;border:none;color:rgba(255,255,255,.5);cursor:pointer;font-size:12px;font-family:'DM Sans',sans-serif;transition:color var(--transition);}
.bulk-cancel:hover{color:white;}

/* Create invoice layout */
.create-layout{display:grid;grid-template-columns:1fr 320px;gap:20px;align-items:start;position:relative;}
.form-card{background:white;border:1px solid var(--soft-gray);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:visible;margin-bottom:16px;position:relative;z-index:1;}
.form-card:focus-within{z-index:100;}
.form-section{padding:24px;position:relative;}
.form-section+.form-section{border-top:1px solid var(--soft-gray);}
.form-section-title{font-size:13px;font-weight:600;color:var(--charcoal);margin-bottom:16px;display:flex;align-items:center;gap:8px;}
.form-section-title svg{width:15px;height:15px;color:var(--teal);}
.form-grid{display:grid;gap:14px;}
.form-grid-2{grid-template-columns:1fr 1fr;}
.form-grid-3{grid-template-columns:1fr 1fr 1fr;}
.form-group.full{grid-column:1/-1;}
.form-label .req{color:var(--teal);}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}

/* Customer autocomplete */
.customer-autocomplete{position:relative;}
.autocomplete-dropdown{display:none;position:absolute;top:100%;left:0;right:0;background:white;border:1.5px solid var(--soft-gray);border-top:none;border-radius:0 0 10px 10px;box-shadow:0 8px 30px rgba(42,46,43,.15);z-index:10001;box-sizing:border-box;overflow-y:auto;max-height:300px;}
.autocomplete-dropdown.open{display:block;}
.customer-autocomplete{position:relative;}
.vendor-autocomplete{position:relative;}
.autocomplete-item{padding:10px 14px;cursor:pointer;transition:background var(--transition);display:flex;align-items:center;gap:10px;}
.autocomplete-item:hover{background:var(--soft-gray);}
.autocomplete-avatar{width:28px;height:28px;border-radius:50%;background:var(--sage);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;color:white;flex-shrink:0;}
.autocomplete-name{font-size:13px;font-weight:500;}
.autocomplete-email{font-size:11px;color:#bbb;}
.add-customer-item{padding:10px 14px;display:flex;align-items:center;gap:8px;color:var(--forest);font-size:13px;font-weight:500;cursor:pointer;border-top:1px solid var(--soft-gray);transition:background var(--transition);}
.add-customer-item:hover{background:var(--soft-gray);}
.add-customer-item svg{width:14px;height:14px;}

/* Line items table */
.line-items-table{width:100%;border-collapse:collapse;}
.line-items-table th{text-align:left;padding:8px 10px;font-size:10.5px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;color:#bbb;border-bottom:1.5px solid var(--soft-gray);}
.line-items-table th:last-child{text-align:right;}
.line-items-table td{padding:8px 6px;vertical-align:middle;border-bottom:1px solid #f4f6f2;}
.line-items-table tr:last-child td{border-bottom:none;}
.line-input{width:100%;border:1.5px solid transparent;border-radius:6px;padding:7px 9px;font-family:'DM Sans',sans-serif;font-size:13px;color:var(--charcoal);outline:none;background:transparent;transition:all var(--transition);}
.line-input:focus{border-color:var(--sage);background:white;box-shadow:0 0 0 3px rgba(123,174,127,.08);}
.line-input:hover:not(:focus){background:var(--soft-gray);}
.line-input.text-right{text-align:right;}
.col-desc{width:38%;}
.col-qty{width:10%;}
.col-price{width:14%;}
.col-tax{width:10%;}
.col-amount{width:14%;text-align:right;font-feature-settings:"tnum";font-size:13px;font-weight:500;color:var(--charcoal);padding-right:10px;}
.col-del{width:40px;text-align:center;}
.line-delete-btn{width:26px;height:26px;border-radius:6px;border:none;background:transparent;color:#ccc;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--transition);}
.line-delete-btn:hover{background:rgba(200,80,80,.08);color:#c0392b;}
.line-delete-btn svg{width:13px;height:13px;}
.add-line-btn{display:flex;align-items:center;gap:7px;color:var(--forest);font-size:13px;font-weight:500;cursor:pointer;padding:10px 0;border:none;background:transparent;font-family:'DM Sans',sans-serif;transition:color var(--transition);}
.add-line-btn:hover{color:var(--forest-lt);}
.add-line-btn svg{width:15px;height:15px;}

/* Totals */
.totals-block{margin-top:4px;border-top:1.5px solid var(--soft-gray);padding-top:14px;}
.totals-row{display:flex;justify-content:space-between;align-items:center;padding:4px 10px 4px 0;font-size:13px;}
.totals-row.total-line{font-size:15px;font-weight:700;color:var(--charcoal);border-top:1.5px solid var(--soft-gray);margin-top:8px;padding-top:10px;}
.totals-label{color:#888;}
.totals-value{font-feature-settings:"tnum";font-weight:500;}

/* Panel cards (right sidebar) */
.panel-card{background:white;border:1px solid var(--soft-gray);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:visible;margin-bottom:14px;}
.panel-header{padding:14px 18px;border-bottom:1px solid var(--soft-gray);font-size:13px;font-weight:600;color:var(--charcoal);display:flex;align-items:center;gap:8px;}
.panel-header svg{width:14px;height:14px;color:var(--teal);}
.panel-body{padding:16px 18px;}
.preview-total{font-family:'DM Sans',sans-serif;font-size:32px;color:var(--charcoal);line-height:1;margin-bottom:4px;}
.preview-sub{font-size:12px;color:#bbb;}
.preview-customer{display:flex;align-items:center;gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid var(--soft-gray);}
.preview-avatar{width:32px;height:32px;border-radius:50%;background:var(--sage);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:white;flex-shrink:0;}
.preview-cname{font-size:13px;font-weight:500;}
.preview-cemail{font-size:11.5px;color:#bbb;}

/* Steps */
.steps{display:flex;align-items:center;gap:0;margin-bottom:24px;}
.step{display:flex;align-items:center;gap:8px;flex:1;}
.step:last-child{flex:0;}
.step-dot{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;flex-shrink:0;transition:all var(--transition);}
.step-dot.done{background:var(--forest);color:white;}
.step-dot.active{background:var(--sage);color:white;box-shadow:0 0 0 4px rgba(123,174,127,.2);}
.step-dot.pending{background:var(--soft-gray);color:#bbb;}
.step-label{font-size:12px;font-weight:500;color:#aaa;white-space:nowrap;}
.step.active .step-label{color:var(--charcoal);}
.step.done .step-label{color:var(--forest);}
.step-line{flex:1;height:1.5px;background:var(--soft-gray);margin:0 8px;}
.step-line.done{background:var(--forest);}

/* Notice */
.notice{background:rgba(95,168,160,.08);border:1px solid rgba(95,168,160,.2);border-radius:8px;padding:10px 14px;display:flex;gap:10px;align-items:flex-start;}
.notice svg{width:15px;height:15px;color:var(--teal);flex-shrink:0;margin-top:1px;}
.notice-text{font-size:12.5px;color:#2e7d74;line-height:1.5;}

/* Toggle */
.toggle-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
.toggle-label{font-size:13px;color:var(--charcoal);}
.toggle{position:relative;width:36px;height:20px;cursor:pointer;}
.toggle input{opacity:0;width:0;height:0;}
.toggle-slider{position:absolute;inset:0;background:#ddd;border-radius:20px;transition:background var(--transition);}
.toggle-slider::before{content:'';position:absolute;width:14px;height:14px;left:3px;top:3px;background:white;border-radius:50%;transition:transform var(--transition);}
.toggle input:checked+.toggle-slider{background:var(--sage);}
.toggle input:checked+.toggle-slider::before{transform:translateX(16px);}

/* Breadcrumb */
.breadcrumb{display:flex;align-items:center;gap:6px;margin-bottom:6px;}
.bc-back{background:none;border:none;cursor:pointer;color:#aaa;font-size:13px;font-family:'DM Sans',sans-serif;display:flex;align-items:center;gap:4px;padding:0;transition:color var(--transition);}
.bc-back:hover{color:var(--forest);}
.bc-sep{color:#ddd;font-size:13px;}
.bc-current{font-size:13px;color:var(--charcoal);font-weight:500;}
/* The final breadcrumb segment always repeats the page heading directly below
   it. Hide it (and its leading separator) so the page title appears once; the
   breadcrumb stays as an ancestor/back trail. */
.breadcrumb .bc-current{display:none;}
.breadcrumb .bc-sep:has(+ .bc-current){display:none;}
/* Breadcrumb relocated into the top bar (moved there by the layout script),
   sitting just right of the company pill with a thin divider. */
.topbar .breadcrumb.in-topbar{margin:0;padding-left:16px;border-left:1px solid var(--soft-gray);white-space:nowrap;}

/* SearchableSelect styles handled inline in JS */

/* ── PRINT STYLES ────────────────────────────────────────────── */
@media print {
  .sidebar,
  .topbar,
  .page-actions,
  .flash-container,
  #layout-two,
  #bs-kpis,
  #bs-equation,
  .page-header,
  form,
  button,
  a.btn { display: none !important; }

  body { background: white !important; margin: 0 !important; display: block !important; height: auto !important; overflow: visible !important; }
  .main { width: 100% !important; display: block !important; height: auto !important; overflow: visible !important; }
  .content { padding: 0 20px !important; height: auto !important; overflow: visible !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; border-radius: 0 !important; }
  #layout-single { display: block !important; }

  @page { margin: 1.5cm 2cm; size: letter portrait; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* ── AI CHAT ─────────────────────────────────────────────────── */
@keyframes thinking {
  0%, 100% { opacity: .3; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.3); }
}
.ai-modal { width: 620px; max-width: 95vw; max-height: 80vh; display: flex; flex-direction: column; }
.ai-modal-backdrop.open { display: flex; }

/* ── BANK RULES ──────────────────────────────────────────────── */
.rule-match { background: rgba(95,168,160,.04) !important; }
.rule-match:hover { background: rgba(95,168,160,.08) !important; }

/* ── NAV GROUPS (Two Clicks to Paradise) ──────────────────── */
.sidebar a { color: inherit; text-decoration: none; }
.nav-group { }
.nav-children { padding-left: 12px; margin-bottom: 2px; }
.nav-child {
  display: block;
  padding: 5px 10px 5px 28px;
  font-size: 12.5px;
  color: rgba(47,93,80,.75);
  text-decoration: none !important;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
  position: relative;
  margin-bottom: 1px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}
.nav-child::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(47,93,80,.3);
}
.nav-child:hover { background: rgba(47,93,80,.1); color: var(--forest); text-decoration: none !important; }
.nav-child.active { color: var(--forest); font-weight: 700; background: rgba(47,93,80,.12); text-decoration: none !important; }
.nav-child.active::before { background: var(--forest); }

/* ── Duplicate detection warnings ───────────────────────── */
.dupe-banner {
  display: none;
  background: rgba(214,182,107,.1);
  border: 1.5px solid rgba(214,182,107,.4);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0 4px;
  animation: dupeSlideIn .2s ease;
}
.dupe-banner.high {
  background: rgba(184,64,64,.07);
  border-color: rgba(184,64,64,.3);
}
@keyframes dupeSlideIn {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}
.dupe-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #8a6200;
  margin-bottom: 8px;
}
.dupe-banner.high .dupe-banner-title { color: #8a2020; }
.dupe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: white;
  border-radius: 7px;
  margin-bottom: 5px;
  font-size: 12.5px;
  border: 1px solid rgba(0,0,0,.06);
}
.dupe-item:last-child { margin-bottom: 0; }
.dupe-item-name { font-weight: 500; color: var(--charcoal); }
.dupe-item-match { color: #aaa; font-size: 12px; margin-top: 1px; }
.dupe-item-link {
  font-size: 12px;
  color: var(--teal);
  text-decoration: none;
  white-space: nowrap;
  margin-left: 12px;
  flex-shrink: 0;
}
.dupe-item-link:hover { text-decoration: underline; }

/* ── Quick Create menu items ─────────────────────────────── */
.qc-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--charcoal);
  border-radius: 8px;
  font-size: 13px;
  transition: background .1s;
  white-space: nowrap;
}
.qc-item:hover {
  background: var(--soft-gray);
  color: var(--forest);
}
.qc-item svg {
  flex-shrink: 0;
  color: #aaa;
  transition: color .1s;
}
.qc-item:hover svg { color: var(--forest); }

/* ── Vendor/detail page layout ───────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 340px;
  grid-template-rows: auto auto;
  gap: 16px;
  align-items: start;
}
.dl-main  { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 16px; }
.dl-side  { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 16px; position: relative; overflow: visible; }
.dl-notes { grid-column: 1 / -1; grid-row: 2; }
.panel-card { background: var(--card-bg, white); border: 1.5px solid var(--soft-gray); border-radius: 12px; overflow: visible !important; }
.panel-body { padding: 14px 16px; }
.vd-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #bbb; margin-bottom: 10px; }
.ap-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; }
.ap-row .amt { font-weight: 600; }
.ap-row.red .amt { color: #b84040; }
.ap-divide { border: none; border-top: 1px solid var(--soft-gray); margin: 8px 0; }

/* Item search results */
.item-result-row { display:flex; justify-content:space-between; align-items:center; padding:9px 12px; cursor:pointer; font-size:12.5px; border-bottom:1px solid #f0f0ec; }
.item-result-row:hover { background:var(--soft-gray); }
.item-result-row:last-child { border-bottom:none; }

/* ── Slide-out edit drawer (customers / vendors / clients) ─────────────────── */
.ed-backdrop { position:fixed; inset:0; background:rgba(42,46,43,.38); z-index:9501;
  opacity:0; visibility:hidden; transition:opacity .2s ease; }
.ed-backdrop.open { opacity:1; visibility:visible; }
.ed-drawer { position:fixed; top:0; right:0; bottom:0; width:min(560px,94vw);
  background:var(--warm-white); box-shadow:var(--shadow-lg); z-index:9502;
  transform:translateX(100%); transition:transform .26s cubic-bezier(.4,0,.2,1);
  display:flex; flex-direction:column; }
.ed-drawer.open { transform:translateX(0); }
.ed-drawer-head { display:flex; align-items:center; justify-content:space-between;
  padding:16px 22px; border-bottom:1px solid var(--soft-gray); flex-shrink:0; }
.ed-drawer-head .page-heading { font-size:18px; margin:0; }
.ed-drawer-body { flex:1; overflow-y:auto; padding:20px 22px; }
.ed-drawer-body .page-header, .ed-drawer-body .page-actions { display:none; } /* form only */
.ed-drawer-foot { display:flex; gap:10px; justify-content:flex-end;
  padding:14px 22px; border-top:1px solid var(--soft-gray); background:#fff; flex-shrink:0; }
.ed-x { background:none; border:none; cursor:pointer; color:#999; font-size:20px; line-height:1;
  width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; }
.ed-x:hover { background:var(--soft-gray); color:var(--charcoal); }
