/* ===================================================================
   RYLICH PANORAMA HOTEL - FINANCIAL CONTROLLER (FC) AR PORTAL
   Exact Design Concept & Palette based on FC Web:
   - Deep Maroon: #4A0E17, #6B1724
   - Luxury Gold: #D4AF37, #E5C158
   - Warm Ivory Cream: #FAF8F5
   - Fonts: 'Cinzel' (Serif) & 'Inter' (Sans)
   =================================================================== */

:root {
  --maroon: #4A0E17;
  --maroon-light: #6B1724;
  --maroon-hover: #380A11;
  --gold: #D4AF37;
  --gold-light: #E5C158;
  --gold-bg: rgba(212, 175, 55, 0.12);
  --bg-main: #FAF8F5;          /* Cream Ivory */
  --card-bg: #FFFFFF;
  --text-main: #2E2325;
  --text-muted: #6E6263;
  --border-color: #ECE5DA;
  --emerald: #1E7A56;
  --emerald-bg: #E8F5EE;
  --rose: #A3283B;
  --rose-bg: #FDF0F2;
  --amber: #D97706;
  --amber-bg: #FFFBEB;
  --blue: #2563EB;
  --blue-bg: #EFF6FF;
  --shadow-sm: 0 1px 3px rgba(74, 14, 23, 0.05);
  --shadow-md: 0 4px 16px rgba(74, 14, 23, 0.08);
  --shadow-lg: 0 10px 25px rgba(74, 14, 23, 0.12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

svg {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* SIDEBAR (.sb) */
.sb {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--maroon);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  transition: 0.25s ease;
}

.sb-header {
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.sb-brand {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sb-subbrand {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3px;
  font-weight: 500;
}

.sb-domain {
  font-size: 9.5px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sb-user {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--maroon-light);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.sb-uname {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
}

.sb-urole {
  font-size: 10px;
  color: var(--gold);
  font-weight: 500;
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-sec {
  padding: 10px 20px 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.ni {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9.5px 20px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: 0.15s ease;
  width: 100%;
  text-align: left;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  user-select: none;
}

.ni:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #fff;
}

.ni.active {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 600;
}

.ni svg {
  width: 14px;
  height: 14px;
}

.ni-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold);
}

.ni.active .ni-badge {
  background: var(--gold);
  color: var(--maroon);
}

.sb-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* LAYOUT (.layout) */
.layout {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
}

/* TOPBAR (.topbar) */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(251, 248, 245, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
}

.tb-title {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.3px;
}

.tb-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* MAIN CONTENT */
.main-content {
  padding: 28px 30px;
  flex: 1;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: 0.18s ease;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}

.btn svg {
  width: 13px;
  height: 13px;
}

.btn-maroon {
  background: var(--maroon);
  color: var(--gold);
}

.btn-maroon:hover {
  background: var(--maroon-light);
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--gold);
  color: var(--maroon);
  font-weight: 700;
}

.btn-gold:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--maroon);
  color: var(--maroon);
}

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}

.btn-emerald:hover {
  background: #155e41;
}

.btn-rose {
  background: var(--rose);
  color: #fff;
}

.btn-rose:hover {
  background: #8b1d2e;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.b-emerald { background: var(--emerald-bg); color: var(--emerald); }
.b-rose { background: var(--rose-bg); color: var(--rose); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-blue { background: var(--blue-bg); color: var(--blue); }
.b-maroon { background: var(--maroon); color: var(--gold); }
.b-gold { background: var(--gold-bg); color: #8c6d17; border: 1px solid rgba(212, 175, 55, 0.4); }

/* CARDS */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--maroon);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Domain Switcher (AR Event vs AR Kamar) */
.domain-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.domain-tab {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.domain-tab:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.domain-tab.active {
  background: linear-gradient(135deg, var(--maroon) 0%, #380a11 100%);
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(74, 14, 23, 0.28);
}
.domain-tab.active .domain-title {
  color: var(--gold-light);
}
.domain-tab.active .domain-val {
  color: #FFFFFF;
}
.domain-tab.active .domain-sub {
  color: rgba(255, 255, 255, 0.7);
}
.domain-tab.active .badge-domain {
  background: rgba(212, 175, 55, 0.25);
  color: var(--gold-light);
  border: 1px solid var(--gold);
}
.domain-title {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.domain-val {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
}
.domain-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.badge-domain {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-main);
  color: var(--maroon);
  border: 1px solid var(--border-color);
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: var(--card-accent, var(--maroon));
}

.kpi-card.c-maroon { --card-accent: var(--maroon); }
.kpi-card.c-rose { --card-accent: var(--rose); }
.kpi-card.c-gold { --card-accent: var(--gold); }
.kpi-card.c-emerald { --card-accent: var(--emerald); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-bg);
  color: var(--maroon);
}

.kpi-val {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* AGING BOXES */
.aging-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.aging-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aging-card:hover, .aging-card.active {
  border-color: var(--ag-color, var(--maroon));
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.aging-card.ag-current { --ag-color: var(--emerald); }
.aging-card.ag-m30 { --ag-color: var(--blue); }
.aging-card.ag-m60 { --ag-color: var(--amber); }
.aging-card.ag-m90 { --ag-color: var(--rose); }

.aging-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.aging-amount {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ag-color, var(--maroon));
}

.aging-track {
  height: 5px;
  background: rgba(74, 14, 23, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}

.aging-fill {
  height: 100%;
  background: var(--ag-color, var(--maroon));
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* CONTROLS & SEARCH BAR */
.controls-bar {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-main);
  font-size: 12.5px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--maroon);
  background: #fff;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-filter {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  background: #fff;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.select-filter:focus {
  border-color: var(--maroon);
}

/* DATA TABLE */
.table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.fc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.fc-table th {
  background: #F5EFEB;
  color: var(--maroon);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--border-color);
  white-space: nowrap;
}

.fc-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.fc-table th.sortable:hover {
  color: var(--maroon);
  background: rgba(136, 19, 55, 0.06);
}

.fc-table th.sortable:hover svg {
  opacity: 1 !important;
}

.fc-table th.sortable[data-sort].sort-active,
.fc-table th.sortable:focus {
  color: var(--maroon);
  background: rgba(136, 19, 55, 0.08);
}

.fc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.fc-table tbody tr {
  transition: background 0.15s ease;
}

.fc-table tbody tr:hover {
  background: #FDF9F6;
}

.cust-name {
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.cust-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.amount-val {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13.5px;
}

/* PAGINATION */
.table-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  background: #FAF7F3;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  padding: 5px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border-color);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--maroon);
  color: var(--maroon);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(46, 35, 37, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-backdrop.open,
.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-card,
.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  background: var(--maroon);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #FAF8F5;
}

/* FORM ELEMENTS */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full {
  grid-column: span 2;
}

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  padding: 8.5px 12px;
  background: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--maroon);
}

textarea.form-control {
  min-height: 75px;
  resize: vertical;
}

/* STATEMENT OF ACCOUNT (SOA) PRINT SHEET */
.soa-sheet {
  background: #FFFFFF;
  color: #2E2325;
  padding: 36px 40px;
  border-radius: var(--radius);
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.soa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2.5px solid var(--maroon);
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.soa-hotel h2 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.5px;
}

.soa-hotel p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.soa-doc-title {
  text-align: right;
}

.soa-doc-title h3 {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  background: var(--maroon);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
}

.soa-doc-title p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.soa-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px 18px;
  background: #FAF8F5;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 12px;
}

.soa-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.soa-table th {
  background: #F5EFEB;
  color: var(--maroon);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
}

.soa-table td {
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  font-size: 12px;
}

.soa-total-row td {
  font-weight: 700;
  background: #FAF8F5;
  font-size: 13px;
  color: var(--maroon);
}

.soa-notes-box {
  background: var(--amber-bg);
  border-left: 3.5px solid var(--amber);
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 11.5px;
  color: #78350f;
  margin-bottom: 28px;
}

.soa-signatures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-top: 30px;
  text-align: center;
}

.soa-sign-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.soa-sign-line {
  margin-top: 55px;
  width: 170px;
  border-bottom: 1.5px solid var(--text-main);
  padding-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.soa-sign-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 11px 16px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.25s ease;
}

.toast.success { border-color: var(--emerald); }
.toast.success svg { color: var(--emerald); }
.toast.danger { border-color: var(--rose); }
.toast.danger svg { color: var(--rose); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* PRINT */
@media print {
  .sb, .topbar, .controls-bar, .kpi-grid, .aging-grid, .card-header, .table-footer, .modal-backdrop, .toast-container, button, .domain-switcher, .bottom-action-bar, .soa-print-btn-bar {
    display: none !important;
  }
  .layout {
    margin-left: 0 !important;
  }
  .main-content {
    padding: 0 !important;
  }
  .soa-sheet, .receipt-sheet {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}

/* TRANSACTION INPUT & DATABASE STYLES */
.input-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .input-hub-grid {
    grid-template-columns: 1fr;
  }
}

.calc-preview-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.calc-row:last-child {
  border-bottom: none;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1.5px solid var(--border-color);
}

.calc-row .label {
  color: var(--text-muted);
}

.calc-row .val {
  font-weight: 700;
  color: var(--text-main);
}

.calc-row.final .val {
  font-size: 15px;
  font-family: 'Cinzel', serif;
}

/* KUITANSI PEMBAYARAN RESMI */
.receipt-sheet {
  background: #FFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 32px;
  max-width: 650px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
  font-family: 'Inter', sans-serif;
  color: #1E293B;
  position: relative;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--maroon);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.receipt-brand-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--maroon);
}

.receipt-doc-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
}

.receipt-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 55px;
  font-weight: 900;
  color: rgba(30, 122, 86, 0.08);
  pointer-events: none;
  border: 4px dashed rgba(30, 122, 86, 0.15);
  padding: 8px 24px;
  border-radius: 12px;
}

.receipt-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 14px;
  font-size: 13px;
  margin-bottom: 22px;
}

.receipt-label {
  color: #64748B;
  font-weight: 500;
}

.receipt-val {
  color: #0F172A;
  font-weight: 600;
}

.receipt-amount-box {
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.receipt-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.receipt-sig-col {
  text-align: center;
  width: 200px;
}

.receipt-sig-space {
  height: 60px;
}

/* SEARCHABLE ACCOUNT PICKER */
.search-account-container {
  position: relative;
  margin-bottom: 16px;
}

.quick-filter-chips {
  display: flex;
  gap: 6px;
}

.chip {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: var(--gold);
  color: var(--maroon);
}

.chip.active {
  background: var(--maroon);
  color: #FFF;
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(74, 14, 23, 0.2);
}

.search-picker-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-picker-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-picker-input {
  padding-left: 36px !important;
  padding-right: 32px !important;
  font-size: 13px !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: 8px !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.search-picker-input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px var(--gold-bg) !important;
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
}

.clear-search-btn:hover {
  color: var(--rose);
  background: var(--rose-bg);
}

/* Selected Account Banner */
.selected-account-banner {
  background: #FFFDF9;
  border: 1.5px solid var(--gold);
  border-radius: 9px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.12);
  animation: fadeIn 0.2s ease-out;
}

/* Dropdown Results List */
.account-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #FFF;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  margin-top: 6px;
  z-index: 150;
  overflow: hidden;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.account-picker-header {
  padding: 8px 14px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--maroon);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-picker-list {
  overflow-y: auto;
  max-height: 275px;
}

.picker-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease;
}

.picker-item:last-child {
  border-bottom: none;
}

.picker-item:hover, .picker-item.highlighted {
  background: #FFF8E7; /* Light gold tint */
}

.picker-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 65%;
}

.picker-cust-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.picker-cust-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-item-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.picker-balance {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--rose);
}

.picker-empty-state {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* FILE UPLOAD & PROOF VIEWER STYLES */
.file-upload-zone {
  border: 2px dashed var(--gold);
  border-radius: 10px;
  padding: 18px 16px;
  background: var(--bg-main);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: center;
}

.file-upload-zone:hover {
  border-color: var(--maroon);
  background: #FFFDF8;
}

.upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--maroon);
  flex-shrink: 0;
}

.upload-text strong {
  display: block;
  font-size: 12.5px;
  color: var(--maroon);
}

.upload-text p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-preview-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
}

.file-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-preview-thumb-wrapper {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-meta {
  font-size: 11px;
  color: var(--emerald);
  font-weight: 600;
  margin-top: 2px;
}

.file-remove-btn {
  padding: 4px 10px;
  font-size: 11px;
  color: var(--rose);
  border-color: rgba(163, 40, 59, 0.3);
}

.file-remove-btn:hover {
  background: var(--rose-bg);
  color: var(--rose);
}

/* Badge Bukti Transfer di Tabel Transaksi */
.badge-proof {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #E8F5EE;
  color: #1E7A56;
  border: 1px solid rgba(30, 122, 86, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 3px;
}

.badge-proof:hover {
  background: #1E7A56;
  color: #FFF;
  box-shadow: 0 2px 6px rgba(30, 122, 86, 0.3);
}

/* Proof Viewer Modal Content */
.proof-viewer-box {
  background: #0F172A;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 520px;
  overflow: auto;
}

.proof-viewer-img {
  max-width: 100%;
  max-height: 480px;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  object-fit: contain;
}

.proof-details-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 12px;
}

/* SEGMENT BADGES */
.badge-segment-gov {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-segment-comp {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.badge-segment-ota {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.badge-segment-ind {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

/* PROPER AR REPORT STYLES (EXECUTIVE USALI HOTEL STANDARD) */
.report-page-sheet {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  padding: 40px 48px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  margin: 0 auto 40px auto;
  max-width: 1240px;
}

.report-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2.5px solid #0F172A;
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.report-hotel-title {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 800;
  color: #6B1D2F;
  letter-spacing: 1.5px;
}

.report-doc-title {
  font-family: 'Cinzel', serif;
  font-size: 16.5px;
  font-weight: 800;
  color: #0F172A;
  text-align: right;
  letter-spacing: 0.5px;
}

.report-segment-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.report-seg-card {
  padding: 16px 18px;
  border-radius: 10px;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.report-seg-card.gov { border-left: 5px solid #1D4ED8; background: #F0F7FF; }
.report-seg-card.comp { border-left: 5px solid #6D28D9; background: #F8F5FF; }
.report-seg-card.ota { border-left: 5px solid #059669; background: #ECFDF5; }
.report-seg-card.ind { border-left: 5px solid #D97706; background: #FFFBEB; }

.report-seg-name {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.6px;
}

.report-seg-val {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}

.report-seg-sub {
  font-size: 11.5px;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
  font-size: 12.5px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
}

.report-matrix-table th {
  background: #0F172A !important;
  color: #FFFFFF !important;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 11.5px;
  border: 1px solid #334155;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.report-matrix-table td {
  padding: 9px 14px;
  border: 1px solid #E2E8F0;
  color: #1E293B;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.report-matrix-table tr:nth-child(even) {
  background-color: #F8FAFC;
}

.report-matrix-table tr:hover {
  background-color: #F1F5F9;
}

.report-matrix-table tr.total-row {
  background: #F1F5F9;
  font-weight: 800;
  border-top: 2px solid #0F172A;
}

.report-matrix-table tr.grand-total-row {
  background: #FEF2F2 !important;
  font-weight: 800;
  color: #881337 !important;
  border-top: 2.5px solid #881337;
  border-bottom: 2.5px solid #881337;
  font-size: 13px;
}

.report-matrix-table tr.grand-total-row td {
  color: #881337 !important;
  font-weight: 800;
}

.report-sign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1.5px solid #CBD5E1;
  text-align: center;
}

.report-sign-box {
  padding: 0 10px;
}

.report-sign-role {
  font-size: 12px;
  color: #475569;
  margin-bottom: 60px;
  line-height: 1.5;
}

.report-sign-name {
  font-weight: 700;
  font-size: 12.5px;
  color: #0F172A;
  border-top: 1.5px solid #0F172A;
  padding-top: 8px;
  display: inline-block;
  min-width: 180px;
}

@media print {
  body {
    background: #FFF !important;
    color: #000 !important;
  }
  .sidebar, .topbar, .controls-bar, .report-actions-bar, .domain-switcher, .toast-container, .bottom-action-bar {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .report-page-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
  }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .aging-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sb {
    transform: translateX(-260px);
  }
  .sb.open {
    transform: translateX(0);
  }
  .layout {
    margin-left: 0;
  }
  .kpi-grid, .aging-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: span 1;
  }
}

/* Debtor 360 Side Panel for New AR Form */
.add-ar-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto 24px;
}

@media (max-width: 1100px) {
  .add-ar-layout-grid {
    grid-template-columns: 1fr;
  }
}

.debtor-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.debtor-tab-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.debtor-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.debtor-tab-btn.active {
  color: var(--maroon);
  font-weight: 700;
  border-bottom-color: var(--maroon);
  background: rgba(136, 19, 55, 0.04);
}

.debtor-event-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.debtor-event-item:hover {
  border-color: var(--maroon);
  box-shadow: var(--shadow-sm);
}

.debtor-event-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.debtor-event-title {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-primary);
}

.debtor-event-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.debtor-event-amounts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.debtor-event-balance {
  font-size: 13px;
  font-weight: 800;
  color: var(--rose);
  font-family: 'Cinzel', serif;
}

.debtor-fu-item {
  background: var(--bg-surface);
  border-left: 3px solid var(--maroon);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* Collection Management & Method Chips (WA, Tlp, Visit) */
.method-chip-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.method-chip-radio {
  display: none;
}

.method-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.method-chip-label:hover {
  border-color: var(--maroon);
  background: rgba(136, 19, 55, 0.03);
}

.method-chip-radio:checked + .method-chip-label {
  border-color: var(--maroon);
  background: #FFF1F2;
  color: var(--maroon);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--maroon);
}

.badge-method-wa,
.badge-method-tlp,
.badge-method-visit,
.badge-method-email {
  background: #F1F5F9;
  color: var(--text-primary);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #E2E8F0;
}

/* Forecast Card & Schedule */
.forecast-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.forecast-card-item.overdue {
  border-left-color: var(--rose);
  background: #FFF5F5;
}

.forecast-date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 75px;
  padding: 6px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  text-align: center;
}

/* Collection Activity 2-Column Layout */
.collection-activity-layout-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1150px) {
  .collection-activity-layout-grid {
    grid-template-columns: 1fr;
  }
}

.last-status-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.col-side-scroll-body {
  padding: 16px 20px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 580px;
  max-height: 800px;
}

.col-side-scroll-body::-webkit-scrollbar {
  width: 5px;
}

.col-side-scroll-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* Payment Forecast Monthly Calendar */
.calendar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.calendar-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-month-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-month-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFF;
  border: 1.5px solid #BBF7D0;
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* HORIZONTAL WEEKLY FORECAST SUMMARY STRIP (BELOW CALENDAR) */
.calendar-weeks-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 20px;
  background: #F8FAFC;
  border-top: 1.5px solid var(--border-color);
}

.week-summary-card {
  background: #FFF;
  border: 1px solid var(--border-color);
  border-left: 3.5px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.week-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.week-summary-card.has-inflow {
  border-left-color: var(--emerald);
  background: #F0FDF4;
}

.week-summary-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.week-summary-amount {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 800;
  color: #334155;
  margin: 4px 0 2px;
}

.week-summary-card.has-inflow .week-summary-amount {
  color: #15803D;
}

.week-summary-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* 8-COLUMN GRID (7 DAYS + 1 WEEK TOTAL) */
.calendar-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 1.25fr;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-muted);
}

.calendar-weekday-item {
  padding: 10px 4px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 1.25fr;
  background: var(--border-color);
  gap: 1px;
}

.calendar-week-total-cell {
  background: #FAF5FF;
  border-left: 2px solid #E9D5FF;
  min-height: 118px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-week-total-cell.has-inflow {
  background: #ECFDF5;
  border-left: 2.5px solid var(--emerald);
}

.calendar-week-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--maroon);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.calendar-week-range {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

.calendar-week-amount {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
}

.calendar-week-total-cell.has-inflow .calendar-week-amount {
  color: #15803D;
}

.calendar-week-badge {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
  display: block;
}

.calendar-day-cell {
  background: var(--bg-card);
  min-height: 118px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day-cell:hover {
  background: #FFFDF5;
  box-shadow: inset 0 0 0 1.5px var(--gold);
  z-index: 2;
}

.calendar-day-cell.other-month {
  background: #F8FAFC;
  opacity: 0.4;
  cursor: default;
}

.calendar-day-cell.is-today {
  background: #FFF7ED;
  box-shadow: inset 0 0 0 2px var(--maroon);
}

.calendar-day-cell.has-forecast {
  background: #F0FDF4;
}

.calendar-day-cell.has-forecast:hover {
  background: #DCFCE7;
}

.calendar-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.calendar-day-cell.is-today .calendar-day-num {
  color: var(--maroon);
  font-weight: 900;
  display: inline-block;
  background: #FFE4E6;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 22px;
}

.calendar-promise-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #FEF3C7;
  color: #92400E;
  border-left: 2px solid var(--gold);
}

.calendar-promise-pill.is-wa {
  background: #DCFCE7;
  color: #166534;
  border-left-color: #22C55E;
}

.calendar-promise-pill.is-visit {
  background: #F3E8FF;
  color: #6B21A8;
  border-left-color: #A855F7;
}

.calendar-day-bottom-total {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed #CBD5E1;
  font-size: 11px;
  font-weight: 800;
  color: var(--emerald);
  font-family: 'Cinzel', serif;
  text-align: right;
}

/* GLOBAL STICKY BOTTOM ACTION BAR */
.bottom-action-bar {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: 12px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 95;
  gap: 16px;
  transition: all 0.2s ease;
}

.bottom-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bottom-bar-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Cinzel', serif;
  font-size: 13.5px;
  color: var(--maroon);
}

.bottom-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.bottom-bar-info {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .bottom-action-bar {
    padding: 12px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .bottom-bar-actions {
    justify-content: center;
  }
  .bottom-bar-left {
    justify-content: center;
  }
}

/* ================= AR GROUP STYLES ================= */

/* Accordion wrapper */
.ar-group-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Each accordion row */
.ar-group-acc-row {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: background 0.15s ease;
}

.ar-group-acc-row:last-child {
  border-bottom: none;
}

.ar-group-acc-row.expanded {
  background: var(--bg-surface);
}

/* Clickable header button */
.ar-group-acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.ar-group-acc-header:hover {
  background: rgba(136, 19, 55, 0.03);
}

.ar-group-acc-row.expanded .ar-group-acc-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(136, 19, 55, 0.04);
}

.ar-group-acc-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ar-group-acc-chevron {
  color: var(--maroon);
  flex-shrink: 0;
  transition: transform 0.25s ease;
  display: flex;
  align-items: center;
}

.ar-group-acc-name {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ar-group-acc-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.ar-group-acc-right {
  text-align: right;
  flex-shrink: 0;
}

.ar-group-acc-total {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--rose);
  margin-bottom: 3px;
}

/* Collapsible body */
.ar-group-acc-body {
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ar-group-acc-members {
  padding: 10px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.ar-group-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s ease;
}

.ar-group-row:hover {
  background: #F8FAFC;
}

.ar-group-row.selected {
  background: #F0FDF4;
  border-bottom-color: #BBF7D0;
}

.ar-group-row.selected:hover {
  background: #DCFCE7;
}

.ar-group-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--maroon);
  cursor: pointer;
  flex-shrink: 0;
}

.ar-group-row-body {
  flex: 1;
  min-width: 0;
}

/* AR Group Card (in List View) */
.ar-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--maroon);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.ar-group-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ar-group-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.ar-group-card-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.ar-group-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.ar-group-members-preview {
  padding: 12px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.ar-group-member-row {
  display: flex;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed #F1F5F9;
}

.ar-group-member-row:last-child {
  border-bottom: none;
}

.ar-group-card-actions {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  background: #FAFAFA;
  flex-wrap: wrap;
}

/* ==========================================================================
   ADMIN LOGIN SCREEN (AUTH)
   ========================================================================== */
.login-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(ellipse at 50% 25%, #4A0E17 0%, #29060B 60%, #120204 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.login-container-card {
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.65), 0 0 50px rgba(212, 175, 55, 0.15);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  padding: 36px 32px 28px;
  position: relative;
  animation: loginCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardFadeIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-halo {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #4A0E17 0%, #2A080D 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(74, 14, 23, 0.4), 0 0 0 3px rgba(212, 175, 55, 0.4);
}

.login-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.login-brand-title {
  font-family: 'Cinzel', serif;
  font-size: 16.5px;
  font-weight: 700;
  color: #4A0E17;
  letter-spacing: 1.5px;
  margin: 0 0 4px 0;
}

.login-brand-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.login-auth-tag {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #8C6F14;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.login-form-group {
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: #94A3B8;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  font-size: 13.5px;
  color: #1E293B;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
}

.login-input:focus {
  background: #FFFFFF;
  border-color: #4A0E17;
  box-shadow: 0 0 0 3px rgba(74, 14, 23, 0.12);
}

.login-pwd-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.login-pwd-toggle:hover {
  color: #4A0E17;
}

.login-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 12px;
}

.login-remember-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748B;
  cursor: pointer;
  user-select: none;
}

.login-remember-label input[type="checkbox"] {
  accent-color: #4A0E17;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.login-submit-btn {
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(135deg, #721C24 0%, #4A0E17 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(74, 14, 23, 0.35);
  transition: all 0.2s ease;
}

.login-submit-btn:hover {
  background: linear-gradient(135deg, #8B2630 0%, #5C121D 100%);
  box-shadow: 0 6px 20px rgba(74, 14, 23, 0.45);
  transform: translateY(-1px);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-error-box {
  background: #FFF1F2;
  border: 1px solid #FDA4AF;
  color: #BE123C;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  line-height: 1.4;
  text-align: center;
}

.shake-anim {
  animation: loginShake 0.4s ease-in-out;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: #94A3B8;
  border-top: 1px solid #F1F5F9;
  padding-top: 14px;
}





