@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #1a4b8c;
  --primary-hover: #153e75;
  --primary-light: #eef4ff;
  --primary-border: #bfdbfe;
  --accent-blue: #2563eb;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning-bg: #fefce8;
  --warning-border: #fde047;
  --warning-text: #854d0e;
  --purple: #9333ea;
  --purple-bg: #f3e8ff;
  --sidebar-width: 240px;
  --header-height: 76px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.16);
}

body.dark-mode {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-muted: #334155;
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --primary-light: rgba(37, 99, 235, 0.18);
  --warning-bg: rgba(234, 179, 8, 0.15);
  --warning-border: rgba(234, 179, 8, 0.4);
  --warning-text: #fde047;
  --danger-bg: rgba(239, 68, 68, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==================== LOGIN SCREEN ==================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f6ff 0%, #e2ecff 50%, #f8fafc 100%);
  padding: 24px;
}

body.dark-mode .login-wrapper {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-container {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-logo-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-secondary);
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.tenant-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tenant-chip-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.tenant-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  cursor: pointer;
  transition: all 0.15s;
}

.tenant-chip:hover,
.tenant-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.demo-hint-box {
  background: var(--primary-light);
  border: 1px dashed var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--primary);
  margin-bottom: 18px;
}

/* ==================== APP SHELL LAYOUT ==================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.2s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 76px;
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .mode-label,
.app-shell.sidebar-collapsed .logout-label {
  display: none;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collapse-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--bg-muted);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.collapse-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.nav-item:hover {
  background: var(--bg-muted);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active svg {
  color: var(--primary);
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.mode-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg-muted);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--danger);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.logout-btn:hover {
  background: var(--danger-bg);
}

/* ==================== MAIN CONTENT & TOPBAR ==================== */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

.app-shell.sidebar-collapsed .main-area {
  margin-left: 76px;
}

.topbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-heading h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.page-heading p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenant-pill-badge {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.clock-pill {
  background: var(--bg-muted);
  padding: 6px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

.clock-pill span:first-child {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

.clock-pill span:last-child {
  font-size: 11px;
  color: var(--text-secondary);
}

.user-pill {
  background: var(--bg-muted);
  padding: 6px 14px 6px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info .user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.user-info .user-role {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==================== KASIR LAYOUT ==================== */
.kasir-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  padding: 20px 24px;
  align-items: start;
}

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

.catalog-filter-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 42px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
}

.category-pills {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.product-img-wrap {
  position: relative;
  width: 100%;
  height: 135px;
  background: #e2e8f0;
  overflow: hidden;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: var(--primary);
  font-weight: 700;
  font-size: 28px;
}

.product-cat-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(59, 118, 168, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.product-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 2px;
}

.product-code {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.product-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}

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

.product-stock.low-stock {
  color: var(--danger);
  font-weight: 600;
}

.add-cart-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.add-cart-btn:hover {
  background: var(--primary-hover);
}

/* ==================== RIGHT CART PANEL ==================== */
.cart-panel {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 18px;
  position: sticky;
  top: 94px;
}

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

.cart-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.cart-count-pill {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.cart-section-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cart-empty-box {
  background: var(--bg-muted);
  border-radius: 10px;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 16px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.cart-item-card {
  background: var(--bg-muted);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.cart-item-qty-price {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 2px 0;
}

.cart-item-subtotal {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.qty-btn:hover {
  color: var(--primary);
}

.qty-val {
  font-size: 12.5px;
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

.remove-item-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 2px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
}

.summary-row .label {
  color: var(--text-secondary);
}

.summary-row .val {
  font-weight: 700;
}

.discount-row {
  margin-bottom: 12px;
}

.discount-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

.discount-inputs {
  display: flex;
  gap: 8px;
}

.discount-inputs select {
  width: 64px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0 8px;
  font-size: 12.5px;
}

.discount-inputs input {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 13px;
}

.ppn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ppn-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ppn-left span {
  font-size: 12px;
  font-weight: 700;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: '';
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.dashed-hr {
  border: none;
  border-top: 1px dashed var(--border-color);
  margin: 12px 0;
}

.total-box {
  margin-bottom: 14px;
}

.total-box .label {
  font-size: 12px;
  color: var(--text-secondary);
}

.total-box .amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.payment-method-box {
  background: #f0f6ff;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 16px;
}

body.dark-mode .payment-method-box {
  background: var(--bg-muted);
}

.payment-method-box .pm-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pm-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pm-btn {
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pm-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}

.btn-pay-main {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}

.btn-pay-main:disabled {
  background: #b8bcc2;
  cursor: not-allowed;
}

.btn-clear-cart {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-clear-cart:disabled {
  border-color: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ==================== PAGE CONTAINER & TABLES ==================== */
.page-container {
  padding: 20px 24px;
}

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.top-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: all 0.15s;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-outline-neutral {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.warning-banner {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.expense-total-banner {
  background: #fff5f5;
  border: 1px solid #ef4444;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

body.dark-mode .expense-total-banner {
  background: rgba(239, 68, 68, 0.12);
}

.expense-total-banner .left-label {
  font-size: 12px;
  color: #ef4444;
  margin-bottom: 4px;
}

.expense-total-banner .left-val {
  font-size: 22px;
  font-weight: 800;
  color: #dc2626;
}

.expense-total-banner .right-count {
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-input {
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.table-search {
  width: 320px;
  max-width: 100%;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

table.pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.pos-table th {
  background: var(--bg-muted);
  color: var(--text-main);
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.pos-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.status-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: #4a7c9b;
  color: #fff;
}

.cat-expense-pill {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
}

.cat-expense-pill.listrik { background: #b45309; }
.cat-expense-pill.gaji { background: #15803d; }
.cat-expense-pill.perlengkapan { background: #9333ea; }
.cat-expense-pill.sewa { background: #1d4ed8; }
.cat-expense-pill.lainnya { background: #475569; }

.action-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
}

.action-icon-btn.edit { color: var(--primary); }
.action-icon-btn.delete { color: var(--danger); }

.table-footer-info {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==================== KPI CARDS ==================== */
.kpi-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 960px) {
  .kpi-grid-3, .kpi-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.purple { background: #f3e8ff; color: #9333ea; }
.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.red { background: #fee2e2; color: #ef4444; }
.kpi-icon.green { background: #dcfce7; color: #16a34a; }

.kpi-text .kpi-label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
}

.kpi-text .kpi-val {
  font-size: 20px;
  font-weight: 800;
}

.kpi-text.purple .kpi-label, .kpi-text.purple .kpi-val { color: #9333ea; }
.kpi-text.blue .kpi-label, .kpi-text.blue .kpi-val { color: #2563eb; }
.kpi-text.red .kpi-label, .kpi-text.red .kpi-val { color: #ef4444; }
.kpi-text.green .kpi-label, .kpi-text.green .kpi-val { color: #16a34a; }

/* ==================== CHARTS IN LAPORAN ==================== */
.charts-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
  margin-top: 16px;
}

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

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
}

.chart-card h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ==================== SETTINGS TABS ==================== */
.settings-tabs {
  display: inline-flex;
  background: var(--bg-muted);
  padding: 5px;
  border-radius: 10px;
  gap: 4px;
  margin-bottom: 18px;
}

.settings-tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.settings-section-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
  max-width: 720px;
}

.settings-section-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ==================== FORMS & MODALS ==================== */
.form-group {
  margin-bottom: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-label .req {
  color: var(--danger);
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

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

textarea.form-control {
  height: 82px;
  padding: 10px 12px;
  resize: vertical;
}

.upload-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-box {
  width: 115px;
  height: 105px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  background: var(--bg-muted);
}

.upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Modal Backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.pay-total-banner {
  background: #f0f6ff;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pay-total-banner span:last-child {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.pay-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.pay-method-card {
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pay-method-card.active {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.quick-cash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 18px;
}

.quick-cash-btn {
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.quick-cash-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.modal-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

/* Toast Notification (matches Screenshot 3 & 7) */
.toast-container {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-toast {
  background: #eef4ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  min-width: 260px;
  animation: slideInRight 0.2s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

