/* ============================================
   RekapKu — Tea Green Design System
   Mobile-First, Material Design inspired
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg:           #f8f9ff;
  --surface:      #ffffff;
  --surface-low:  #eff4ff;
  --surface-mid:  #e5eeff;
  --surface-high: #dce9ff;
  --surface-highest: #d3e4fe;
  --surface-bright: #f8f9ff;

  --primary:        #4a654e;
  --primary-cont:   #c8e6c9;
  --on-primary-cont:#4e6851;
  --primary-fixed:  #cceacd;

  --secondary-cont: #d6e8d7;
  --on-sec-cont:    #334d37;
  --tertiary-cont:  #e3efe4;
  --on-tert-cont:   #3f5b44;

  --on-surface:     #0b1c30;
  --on-surface-var: #434842;
  --outline:        #737971;
  --outline-var:    #c3c8c0;

  --error:          #ba1a1a;
  --error-cont:     #ffdad6;
  --on-error-cont:  #93000a;

  --radius-card: 16px;
  --radius-full: 9999px;
  --radius-lg:   12px;
  --radius-sm:   8px;
  --shadow-card: 0 2px 12px rgba(0,0,0,.03);
  --shadow-min:  0 1px 3px rgba(0,0,0,.02), 0 4px 12px rgba(0,0,0,.03);

  --topbar-h:    56px;
  --bottom-nav-h:64px;
  --sidebar-w:   240px;
  --content-max: 480px;
  --content-max-desktop: 1200px;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100dvh;
}
a { color: var(--primary); text-decoration: none; }
a:hover, a:focus, a:active { text-decoration: none; }
img { max-width: 100%; }

/* ---- MATERIAL SYMBOLS ---- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}
.ms-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ---- LAYOUT ---- */
.rk-wrapper { display: flex; min-height: 100dvh; }

/* Sidebar desktop */
.rk-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--surface-high);
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 200;
  display: none; flex-direction: column;
}
@media (min-width: 992px) {
  .rk-sidebar { display: flex; }
  .rk-main { margin-left: var(--sidebar-w); }
}
.rk-sidebar-brand {
  height: var(--topbar-h);
  padding: 0 20px;
  font-size: 22px; font-weight: 800;
  color: var(--on-surface); letter-spacing: -.5px;
  border-bottom: 1px solid var(--surface-high);
  display: flex; align-items: center; gap: 8px;
}
.rk-sidebar-brand::before {
  content: "eco";
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 1;
  color: var(--primary); font-size: 24px;
}
.rk-sidebar-section {
  font-size: 10.5px; font-weight: 700; color: var(--outline);
  padding: 16px 20px 4px; text-transform: uppercase; letter-spacing: .5px;
}
.rk-sidebar-divider { border-top: 1px solid var(--surface-high); margin: 8px 0; }
.rk-sidebar-nav { list-style: none; padding: 8px 12px; }
.rk-sidebar-nav li { margin-bottom: 2px; }
.rk-sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: var(--radius-full);
  font-size: 13.5px; font-weight: 600; color: var(--on-surface-var);
  border: 1px solid transparent;
  transition: .15s;
}
.rk-sidebar-link:hover { background: var(--surface-low); color: var(--on-surface); text-decoration: none; }
.rk-sidebar-link.active { background: var(--primary-cont); color: var(--primary); border-color: #b1ceb2; }
.rk-sidebar-link .material-symbols-outlined { font-size: 20px; }

/* ---- MAIN WRAPPER ---- */
.rk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- TOPBAR ---- */
.rk-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h); z-index: 150;
  background: rgba(248,249,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-high);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
@media (min-width: 992px) {
  .rk-topbar { left: var(--sidebar-w); }
}
.rk-topbar-brand {
  font-size: 22px; font-weight: 800; color: var(--on-surface);
  letter-spacing: -.5px; display: flex; align-items: center; gap: 8px;
}
.rk-topbar-brand::before {
  content: "eco";
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 1;
  color: var(--primary); font-size: 22px;
}
.rk-topbar-title {
  font-size: 18px; font-weight: 700; color: var(--on-surface);
}
.rk-icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-surface-var); transition: .15s;
}
.rk-icon-btn:hover { background: var(--surface-mid); }
.rk-icon-btn .material-symbols-outlined { font-size: 24px; }

/* ---- CONTENT AREA ---- */
.rk-content {
  padding-top: calc(var(--topbar-h) + 20px);
  padding-bottom: calc(var(--bottom-nav-h) + 20px);
  padding-left: 20px; padding-right: 20px;
  max-width: var(--content-max);
  margin: 0 auto; width: 100%;
}
@media (min-width: 992px) {
  .rk-content { max-width: var(--content-max-desktop); padding-bottom: 40px; }
}

/* ---- BOTTOM NAV ---- */
.rk-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--surface-high);
  display: flex; justify-content: space-around; align-items: center;
  padding: 0 8px; padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
@media (min-width: 992px) { .rk-bottom-nav { display: none; } }
.rk-bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; height: 100%;
  color: var(--on-surface-var); font-size: 10px; font-weight: 600;
  text-decoration: none; gap: 2px; position: relative;
  transition: .15s;
}
.rk-bottom-nav-item .material-symbols-outlined { font-size: 24px; }
.rk-bottom-nav-item.active { color: var(--primary); }
.rk-bottom-nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--primary); border-radius: 0 0 4px 4px;
}

/* ---- DRAWER (mobile offcanvas) ---- */
.rk-drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.3); z-index: 300;
}
.rk-drawer-overlay.show { display: block; }
.rk-drawer {
  position: fixed; top: 0; left: -100%; bottom: 0;
  width: 280px; background: var(--surface);
  z-index: 400; transition: left .25s ease;
  overflow-y: auto; display: flex; flex-direction: column;
  box-shadow: 0 12px 30px rgba(11,28,48,.18);
}
.rk-drawer.open { left: 0; }
.rk-drawer-header {
  height: var(--topbar-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--surface-high);
  display: flex; align-items: center; justify-content: space-between;
}
.rk-drawer-brand { font-size: 20px; font-weight: 800; color: var(--on-surface); }

/* ---- MODAL ---- */
.rk-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 28, 48, 0.35);
  z-index: 500;
}
.rk-modal-overlay.show { display: block; }
.rk-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(92vw, 460px);
  background: var(--surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgba(11, 28, 48, 0.22);
  z-index: 510;
  opacity: 0;
  pointer-events: none;
  transition: .15s ease;
}
.rk-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.rk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px 16px;
  border-bottom: 1px solid var(--surface-high);
}
.rk-modal-title { font-size: 16px; font-weight: 700; color: var(--on-surface); }
.rk-modal-body { padding: 16px; }

/* ---- PAGE HEADER ---- */
.rk-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.rk-page-title { font-size: 24px; font-weight: 800; color: var(--on-surface); letter-spacing: -.02em; }
.rk-page-subtitle { font-size: 13px; color: var(--outline); margin-top: 2px; }

/* ---- CARDS ---- */
.rk-card {
  background: var(--surface);
  border: 1px solid rgba(220,233,255,.5);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px; overflow: hidden;
}
.rk-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-high);
  font-size: 14px; font-weight: 700; color: var(--on-surface);
  display: flex; align-items: center; justify-content: space-between;
}
.rk-card-title { font-size: 14px; font-weight: 700; color: var(--on-surface); }
.rk-card-body { padding: 16px; }

/* ---- STAT CARDS ---- */
.rk-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}
.rk-stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-card);
  padding: 16px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 12px;
}
.rk-stat-label {
  font-size: 11.5px; font-weight: 600; color: var(--outline);
  letter-spacing: .05em;
}
.rk-stat-value {
  font-size: 20px; font-weight: 700; color: var(--on-surface);
  letter-spacing: -.02em; line-height: 1.2;
}
.rk-stat-trend {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: rgba(200,230,201,.3);
  padding: 2px 8px; border-radius: 6px;
  width: fit-content;
}
.rk-stat-trend .material-symbols-outlined { font-size: 14px; }

/* ---- ALERT ---- */
.rk-alert {
  border-radius: var(--radius-card); padding: 14px 16px;
  margin-bottom: 16px; display: flex; align-items: flex-start; gap: 12px;
}
.rk-alert-error {
  background: rgba(255,218,214,.3);
  border: 1px solid rgba(255,218,214,.5);
  color: var(--on-error-cont);
}
.rk-alert-warning {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
}
.rk-alert-info {
  background: var(--surface-low); border: 1px solid var(--surface-high); color: var(--on-surface);
}
.rk-alert-icon {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.rk-alert-error .rk-alert-icon { background: var(--error-cont); color: var(--error); }
.rk-alert-warning .rk-alert-icon { background: #fef3c7; color: #b45309; }
.rk-alert-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.rk-alert-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rk-alert-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rk-alert-list li::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--error); flex-shrink: 0;
}

/* ---- BUTTONS ---- */
.rk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; height: 48px; padding: 0 24px;
  border-radius: var(--radius-full); border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s; text-decoration: none;
  white-space: nowrap;
}
.rk-btn:hover { text-decoration: none; }
.rk-btn .material-symbols-outlined { font-size: 20px; }
.rk-btn-primary { background: var(--primary-cont); color: var(--on-primary-cont); }
.rk-btn-primary:hover { background: #b1ceb2; color: var(--on-primary-cont); }
.rk-btn-secondary { background: var(--secondary-cont); color: var(--on-sec-cont); }
.rk-btn-secondary:hover { background: #c8dfca; color: var(--on-sec-cont); }
.rk-btn-outline {
  background: transparent; color: var(--on-surface);
  border: 1px solid var(--outline);
}
.rk-btn-outline:hover { background: var(--surface-low); }
.rk-btn-danger { background: var(--error-cont); color: var(--error); }
.rk-btn-danger:hover { background: #ffb4ab; }
.rk-btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.rk-btn-sm .material-symbols-outlined { font-size: 18px; }
.rk-btn-xs { height: 30px; padding: 0 12px; font-size: 12px; }
.rk-btn-block { width: 100%; }
.rk-btn-full { width: 100%; }
.rk-btn-icon-only {
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--radius-full);
}

/* FAB */
.rk-fab {
  position: fixed; bottom: calc(var(--bottom-nav-h) + 16px); right: 20px;
  height: 56px; padding: 0 20px;
  background: var(--primary); color: #fff;
  border-radius: 16px; border: none;
  font-family: inherit; font-size: 13px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(74,101,78,.35);
  transition: .15s; text-decoration: none; z-index: 90;
}
.rk-fab:hover { background: #3d5441; color: #fff; text-decoration: none; transform: translateY(-1px); }
.rk-fab .material-symbols-outlined { font-size: 24px; }
@media (min-width: 992px) { .rk-fab { bottom: 24px; } }

/* Bottom action bar */
.rk-action-bar {
  position: fixed; bottom: var(--bottom-nav-h); left: 0; right: 0;
  background: var(--surface-bright);
  border-top: 1px solid var(--surface-high);
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 90; display: flex; flex-direction: column; gap: 10px;
}
@media (min-width: 992px) {
  .rk-action-bar { position: static; border: none; padding: 0; background: transparent; }
}
.rk-action-bar-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) {
  .rk-action-bar-row { grid-template-columns: 1fr; }
}

/* ---- BADGES ---- */
.rk-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-sm);
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
}
.rk-badge-success { background: rgba(200,230,201,.4); color: var(--on-primary-cont); }
.rk-badge-open    { background: #e5eeff; color: #35507a; }
.rk-badge-error   { background: var(--error-cont); color: var(--on-error-cont); border-radius: var(--radius-full); }
.rk-badge-warning { background: #fef3c7; color: #92400e; }
.rk-badge-info    { background: var(--surface-mid); color: var(--on-surface-var); }
.rk-badge-markup  {
  background: var(--primary-cont); color: var(--on-primary-cont);
  border-radius: var(--radius-full); padding: 2px 8px; font-size: 11px;
}

/* ---- FILTER CHIPS ---- */
.rk-chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 20px; scrollbar-width: none;
}
.rk-chips::-webkit-scrollbar { display: none; }
.rk-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid rgba(195,200,192,.5);
  font-size: 14px; font-weight: 500; color: var(--on-surface);
  white-space: nowrap; cursor: pointer; transition: .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.rk-chip:hover { background: var(--surface-low); }
.rk-chip.active { background: var(--primary-cont); border-color: #81c784; color: var(--primary); }
.rk-chip .material-symbols-outlined { font-size: 18px; }

/* ---- LIST ITEMS (PO, Nota, Invoice cards) ---- */
.rk-list { display: flex; flex-direction: column; gap: 16px; }
.rk-list-card {
  background: var(--surface);
  border: 1px solid rgba(220,233,255,.5);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer; transition: .15s;
}
.rk-list-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); transform: translateY(-1px); }
.rk-list-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.rk-list-card-title { font-size: 18px; font-weight: 700; color: var(--on-surface); margin-bottom: 4px; }
.rk-list-card-subtitle { font-size: 14px; color: var(--outline); font-family: monospace; }
.rk-list-card-meta {
  display: flex; align-items: center; gap: 20px;
  color: var(--on-surface-var); font-size: 14px;
}
.rk-list-card-meta-item { display: flex; align-items: center; gap: 4px; }
.rk-list-card-meta-item .material-symbols-outlined { font-size: 18px; color: var(--outline); }

/* Invoice list card */
.rk-invoice-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.rk-invoice-card-no { font-size: 15px; font-weight: 700; color: var(--on-surface); }
.rk-invoice-card-supplier { font-size: 13px; color: var(--outline); margin-top: 2px; }
.rk-invoice-card-amount { font-size: 16px; font-weight: 700; color: var(--on-surface); }

/* ---- FORMS ---- */
.rk-form-group { margin-bottom: 16px; }
.rk-label {
  display: block; font-size: 11.5px; font-weight: 600;
  color: var(--on-surface-var); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .05em; padding-left: 4px;
}
.rk-input, .rk-select, .rk-textarea {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1px solid var(--outline-var);
  border-radius: var(--radius-full);
  background: var(--surface); color: var(--on-surface);
  font-family: inherit; font-size: 14px; font-weight: 500;
  transition: .15s; -webkit-appearance: none;
}
.rk-textarea { height: auto; min-height: 80px; padding: 12px 16px; border-radius: 16px; resize: vertical; }
.rk-input:focus, .rk-select:focus, .rk-textarea:focus {
  outline: none; border-color: #81c784;
  box-shadow: 0 0 0 3px rgba(200,230,201,.4);
}
.rk-input-readonly { background: var(--surface-low); color: var(--on-surface-var); }
.rk-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .rk-form-row { grid-template-columns: 1fr; } }

/* Select2 overrides */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
  height: 48px; border: 1px solid var(--outline-var);
  border-radius: var(--radius-full); background: var(--surface);
  display: flex; align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 46px; padding-left: 16px; color: var(--on-surface);
  font-size: 14px; font-weight: 500;
  padding-right: 44px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; right: 12px; }
.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-low);
  color: var(--outline);
  font-weight: 700;
  line-height: 1;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
  background: var(--surface-mid);
  color: var(--on-surface);
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #81c784; box-shadow: 0 0 0 3px rgba(200,230,201,.4);
}
.select2-dropdown { border: 1px solid var(--outline-var); border-radius: 16px; box-shadow: var(--shadow-min); font-size: 14px; overflow: hidden; }
.select2-search--dropdown .select2-search__field { border: 1px solid var(--outline-var); border-radius: var(--radius-full); padding: 8px 14px; margin: 8px; width: calc(100% - 16px); }
.select2-container--default .select2-results__option--highlighted { background: var(--primary-cont); color: var(--on-primary-cont); }
.select2-results__option { padding: 10px 14px; font-weight: 500; }

/* ---- DETAIL PAGE ---- */
.rk-detail-section { margin-bottom: 4px; }
.rk-detail-supplier { font-size: 24px; font-weight: 800; color: var(--on-surface); letter-spacing: -.02em; }
.rk-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--surface-high);
  font-size: 16px;
}
.rk-detail-row:last-child { border-bottom: none; }
.rk-detail-row-label { color: var(--on-surface-var); }
.rk-detail-row-value { font-weight: 600; color: var(--on-surface); }
.rk-detail-row-link { font-weight: 600; color: var(--primary); }

/* Item list (nota detail) */
.rk-item-list { display: flex; flex-direction: column; }
.rk-item-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 0; border-bottom: 1px solid var(--surface-high);
}
.rk-item-row:last-child { border-bottom: none; }
.rk-item-row-top { display: flex; justify-content: space-between; align-items: flex-start; }
.rk-item-row-bottom { display: flex; justify-content: space-between; align-items: center; padding-left: 56px; }
.rk-item-avatar {
  width: 48px; height: 48px; border-radius: var(--radius-full);
  background: var(--surface-mid); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rk-item-avatar .material-symbols-outlined { font-size: 24px; }
.rk-item-info { flex: 1; padding-left: 12px; }
.rk-item-name { font-size: 16px; font-weight: 600; color: var(--on-surface); }
.rk-item-cat  { font-size: 14px; color: var(--outline); }
.rk-item-subtotal { font-size: 16px; font-weight: 600; color: var(--on-surface); }
.rk-item-qty  { font-size: 14px; color: var(--on-surface-var); }
.rk-item-price { font-size: 14px; color: var(--on-surface-var); }

/* ---- INVOICE ITEM CARD ---- */
.rk-inv-item-card {
  background: var(--surface);
  border: 1px solid rgba(220,233,255,.5);
  border-radius: var(--radius-card);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.rk-inv-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.rk-inv-item-name { font-size: 16px; font-weight: 600; color: var(--on-surface); }
.rk-inv-item-qty  { font-size: 14px; color: var(--on-surface-var); margin-top: 2px; }
.rk-inv-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.rk-inv-price-box { padding: 10px 12px; border-radius: var(--radius-lg); }
.rk-inv-price-box-beli { background: var(--surface-low); }
.rk-inv-price-box-jual { background: rgba(74,101,78,.05); border: 1px solid rgba(74,101,78,.1); }
.rk-inv-price-label { font-size: 11px; font-weight: 600; color: var(--on-surface-var); margin-bottom: 4px; letter-spacing: .05em; }
.rk-inv-price-value { font-size: 14px; font-weight: 600; color: var(--on-surface); }
.rk-inv-price-sub   { font-size: 11px; color: var(--on-surface-var); margin-top: 2px; }
.rk-inv-profit-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(74,101,78,.05); border: 1px solid rgba(74,101,78,.1);
  padding: 8px 12px; border-radius: var(--radius-full);
}
.rk-inv-profit-left  { display: flex; align-items: center; gap: 8px; }
.rk-inv-profit-right { display: flex; align-items: center; gap: 8px; }
.rk-inv-profit-label { font-size: 11.5px; color: var(--on-surface-var); }
.rk-inv-profit-value { font-size: 16px; font-weight: 700; color: var(--primary); }

/* Financial summary */
.rk-fin-summary {
  background: var(--surface);
  border: 1px solid rgba(220,233,255,.5);
  border-radius: var(--radius-card);
  padding: 16px; box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.rk-fin-title { font-size: 18px; font-weight: 700; color: var(--on-surface); margin-bottom: 16px; }
.rk-fin-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(195,200,192,.2);
  font-size: 14px;
}
.rk-fin-row:last-of-type { border-bottom: none; }
.rk-fin-row-label { color: var(--on-surface-var); }
.rk-fin-row-value { font-weight: 500; color: var(--on-surface); }
.rk-fin-profit-box {
  background: var(--surface-low);
  border-radius: 20px; padding: 16px; margin-top: 12px;
}
.rk-fin-profit-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 4px; }
.rk-fin-profit-label { font-size: 11.5px; font-weight: 700; color: var(--on-surface-var); text-transform: uppercase; letter-spacing: .05em; }
.rk-fin-profit-value { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }

/* ---- TOTAL SECTION (create forms) ---- */
.rk-total-section {
  background: var(--surface-low); border-radius: var(--radius-card);
  padding: 14px 16px; margin-top: 12px;
}
.rk-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 14px; color: var(--on-surface-var);
}
.rk-total-row.grand {
  border-top: 1px dashed var(--outline-var); margin-top: 8px; padding-top: 10px;
  font-size: 18px; font-weight: 800; color: var(--on-surface);
}
.rk-total-row.profit { color: var(--primary); font-weight: 700; }

/* ---- DYNAMIC ITEM ROWS (create forms) ---- */
.rk-item-form-card {
  background: var(--surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-card);
  padding: 14px; margin-bottom: 10px;
  position: relative;
}
.rk-item-form-remove {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--error-cont); color: var(--error);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.rk-item-form-remove .material-symbols-outlined { font-size: 18px; }
.rk-item-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.rk-item-remove-inline {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--error-cont);
  color: var(--error);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rk-item-remove-inline .material-symbols-outlined { font-size: 18px; }

/* ---- EMPTY STATE ---- */
.rk-empty {
  text-align: center; padding: 48px 20px; color: var(--outline);
}
.rk-empty .material-symbols-outlined { font-size: 48px; display: block; margin-bottom: 12px; color: var(--outline-var); }
.rk-empty p { font-size: 14px; font-weight: 500; }

/* ---- FLASH MESSAGE ---- */
.rk-flash {
  border-radius: var(--radius-card); padding: 12px 16px;
  margin-bottom: 16px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.rk-flash-success { background: rgba(200,230,201,.4); color: var(--primary); border: 1px solid #81c784; }
.rk-flash-danger  { background: var(--error-cont); color: var(--on-error-cont); border: 1px solid #ffb4ab; }
.rk-flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---- MISC UTILS ---- */
.rk-divider { border: none; border-top: 1px solid var(--surface-high); margin: 16px 0; }
.rk-text-muted { color: var(--outline); font-size: 13px; }
.rk-text-primary { color: var(--primary); }
.rk-text-error   { color: var(--error); }
.rk-fw-bold { font-weight: 700; }
.rk-section-title { font-size: 18px; font-weight: 700; color: var(--on-surface); margin-bottom: 12px; }
.rk-flex-between { display: flex; justify-content: space-between; align-items: center; }
.rk-gap-2 { gap: 8px; }
.rk-mt-1 { margin-top: 4px; }
.rk-mt-2 { margin-top: 8px; }
.rk-mt-3 { margin-top: 16px; }
.rk-mb-0 { margin-bottom: 0; }
.rk-pb-action { padding-bottom: calc(var(--bottom-nav-h) + 160px); }

/* ---- PRINT ---- */
@media print {
  .rk-topbar, .rk-bottom-nav, .rk-sidebar, .rk-fab, .rk-action-bar,
  .rk-drawer, .rk-drawer-overlay { display: none !important; }
  .rk-main { margin-left: 0 !important; }
  .rk-content { padding: 0 !important; max-width: 100% !important; }
}

/* ---- COMPATIBILITY TOKENS ---- */
:root {
  --color-background: var(--bg);
  --color-surface: var(--surface);
  --color-surface-container-low: var(--surface-low);
  --color-surface-container: var(--surface-mid);
  --color-surface-container-high: var(--surface-high);
  --color-surface-container-highest: var(--surface-highest);
  --color-on-surface: var(--on-surface);
  --color-on-surface-variant: var(--on-surface-var);
  --color-outline: var(--outline);
  --color-outline-variant: var(--outline-var);
  --color-primary: var(--primary);
  --color-primary-container: var(--primary-cont);
  --color-on-primary-container: var(--on-primary-cont);
  --color-secondary-container: var(--secondary-cont);
  --color-on-secondary-container: var(--on-sec-cont);
  --color-tertiary-container: var(--tertiary-cont);
  --color-on-tertiary-container: var(--on-tert-cont);
  --color-error: var(--error);
  --color-error-container: var(--error-cont);
  --color-on-error-container: var(--on-error-cont);
}

/* ---- MISSING UTILS ---- */
.rk-hidden { display: none !important; }
.rk-mb-8 { margin-bottom: 8px; }
.rk-mb-12 { margin-bottom: 12px; }
.rk-mb-16 { margin-bottom: 16px; }
.rk-mb-20 { margin-bottom: 20px; }
.rk-headline-lg { font-size: 20px; font-weight: 700; line-height: 1.35; }
.rk-headline-md { font-size: 18px; font-weight: 700; line-height: 1.35; }
.rk-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rk-text-outline { color: var(--outline); }

.rk-card-clickable { transition: .15s; }
.rk-card-clickable:hover { text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.06); transform: translateY(-1px); }

.rk-pagination { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 16px; }
.rk-page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-var);
  background: var(--surface);
  color: var(--on-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.rk-page-btn:hover { background: var(--surface-low); text-decoration: none; }

.rk-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rk-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .rk-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .rk-filter-grid { grid-template-columns: 1fr; }
}

.rk-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rk-action-bar-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.rk-action-bar-total-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--outline);
  letter-spacing: .05em;
}
.rk-action-bar-total-value {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--on-surface);
  letter-spacing: -.02em;
}
.rk-action-bar-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.rk-po-actions-toggle {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--on-surface);
}
.rk-po-actions-toggle::-webkit-details-marker { display: none; }
.rk-po-actions-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rk-po-actions-chevron { transition: transform .15s ease; }
details[open] .rk-po-actions-chevron { transform: rotate(180deg); }

/* ---- INVOICE DETAIL/CREATE ---- */
.rk-invoice-header-card,
.rk-financial-card,
.rk-source-card {
  background: var(--surface);
  border: 1px solid rgba(220,233,255,.5);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 16px;
}
.rk-invoice-header-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rk-invoice-header-label,
.rk-financial-label,
.rk-source-label {
  font-size: 11.5px;
  color: var(--outline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.rk-invoice-header-no,
.rk-source-title { font-size: 18px; font-weight: 700; color: var(--on-surface); }
.rk-source-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-low);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rk-source-content { flex: 1; min-width: 0; }
.rk-source-subtitle { font-size: 13px; color: var(--outline); margin-top: 2px; }
.rk-invoice-meta-grid,
.rk-inv-item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rk-invoice-meta-label,
.rk-inv-item-field-label { font-size: 11.5px; color: var(--outline); font-weight: 600; margin-bottom: 2px; }
.rk-invoice-meta-value,
.rk-inv-item-field-value { font-size: 14px; color: var(--on-surface); font-weight: 600; }

.rk-invoice-item-card,
.rk-inv-item-row {
  background: var(--surface);
  border: 1px solid rgba(220,233,255,.5);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
}
.rk-invoice-item-header { display: flex; align-items: start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rk-invoice-item-name { font-size: 16px; font-weight: 700; color: var(--on-surface); }
.rk-invoice-item-qty { font-size: 13px; color: var(--on-surface-var); }
.rk-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.rk-price-box { border-radius: 12px; padding: 10px; }
.rk-price-box-buy { background: var(--surface-low); }
.rk-price-box-sell { background: rgba(74,101,78,.06); border: 1px solid rgba(74,101,78,.15); }
.rk-price-box-label { font-size: 11px; color: var(--on-surface-var); font-weight: 600; margin-bottom: 4px; letter-spacing: .04em; }
.rk-price-box-value { font-size: 14px; color: var(--on-surface); font-weight: 700; }
.rk-price-box-sub { font-size: 11px; color: var(--outline); margin-top: 2px; }

.rk-markup-bar,
.rk-profit-box {
  background: rgba(74,101,78,.06);
  border: 1px solid rgba(74,101,78,.15);
  border-radius: var(--radius-full);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rk-markup-left,
.rk-markup-right { display: flex; align-items: center; gap: 6px; }
.rk-markup-label,
.rk-markup-profit-label,
.rk-profit-box-label { font-size: 11.5px; color: var(--on-surface-var); }
.rk-markup-badge { background: var(--primary-cont); color: var(--on-primary-cont); border-radius: var(--radius-full); padding: 2px 8px; font-size: 11px; font-weight: 700; }
.rk-markup-profit-value,
.rk-profit-box-value { font-size: 16px; font-weight: 700; color: var(--primary); }
.rk-markup-quick { display: flex; align-items: center; gap: 8px; }
.rk-markup-quick-label { font-size: 12px; color: var(--outline); font-weight: 600; }
.rk-markup-quick-input { width: 90px; }

.rk-item-remove {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--error-cont);
  color: var(--error);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rk-inv-item-calc {
  font-size: 13px;
  color: var(--on-surface-var);
  margin-top: 2px;
}
