/* Kad Kita demo - design tokens + base components */
:root {
  --ivory: #fbf7ef;
  --ivory-2: #f3ede0;
  --paper: #fffdf8;
  --sage-900: #26382d;
  --sage-700: #3f5a48;
  --sage-600: #4e6b58;
  --sage-100: #e4ebe2;
  --gold: #b08d47;
  --gold-deep: #8a6c31;
  --gold-soft: #efe3c6;
  --ink: #222b25;
  --ink-2: #55605a;
  --ink-3: #85908a;
  --line: #e1d9c8;
  --danger: #b3402f;
  --danger-soft: #f6e2dd;
  --success: #2f7a4f;
  --success-soft: #dcefe3;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(38, 56, 45, 0.06), 0 2px 8px rgba(38, 56, 45, 0.05);
  --shadow-2: 0 4px 12px rgba(38, 56, 45, 0.08), 0 16px 32px rgba(38, 56, 45, 0.1);

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Inter", "Segoe UI", sans-serif;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.5rem;
  --t-3xl: 3.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg, iframe { max-width: 100%; }
a { color: var(--sage-700); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--s-3);
  color: var(--sage-900);
}
h1 { font-size: clamp(2.25rem, 7vw, var(--t-3xl)); }
h2 { font-size: clamp(1.75rem, 5vw, var(--t-2xl)); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
p { margin: 0 0 var(--s-4); }
.muted { color: var(--ink-2); }
.eyebrow {
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: var(--s-3);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* layout */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--s-4); }
.section { padding: var(--s-12) 0; }
.section--tint { background: var(--ivory-2); }
.section__head { max-width: 560px; margin-bottom: var(--s-8); }
.grid-2, .grid-3 { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-6);
  font: 600 var(--t-sm)/1 var(--font-ui);
  border: 1px solid var(--sage-700); border-radius: var(--r-md);
  background: var(--sage-700); color: var(--paper);
  text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--sage-900); border-color: var(--sage-900); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--sage-700); }
.btn--ghost { background: transparent; color: var(--sage-700); border-color: var(--line); }
.btn--ghost:hover { background: var(--sage-100); border-color: var(--sage-600); box-shadow: none; }
.btn--small { min-height: 32px; padding: 0 var(--s-3); font-size: var(--t-xs); }
.btn--block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: var(--s-6);
}
.card--raised { box-shadow: var(--shadow-2); }
.card__title { margin-bottom: var(--s-2); }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 2px var(--s-3); border-radius: var(--r-pill);
  font-size: var(--t-xs); font-weight: 600; line-height: 1.6;
  background: var(--ivory-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip--draf { background: var(--ivory-2); color: var(--ink-2); }
.chip--dihantar { background: var(--gold-soft); color: var(--gold-deep); border-color: #e0cf9f; }
.chip--dibayar { background: var(--success-soft); color: var(--success); border-color: #bfdcca; }
.chip--proof { background: #f1e6c9; color: var(--gold-deep); border-color: #dfcb98; }
.chip--cetak { background: var(--sage-100); color: var(--sage-700); border-color: #c7d4c6; }
.chip--hantar { background: var(--sage-700); color: var(--paper); border-color: var(--sage-700); }
.chip--selesai { background: var(--success); color: var(--paper); border-color: var(--success); }
.chip--live { background: var(--success-soft); color: var(--success); border-color: #bfdcca; }
.chip--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* forms */
.label { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--ink); margin-bottom: var(--s-1); }
.hint { font-size: var(--t-xs); color: var(--ink-3); margin-top: var(--s-1); }
.input, .select, .textarea {
  display: block; width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3);
  font: var(--t-base)/1.4 var(--font-ui); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 88px; resize: vertical; }
.select {
  appearance: none; padding-right: var(--s-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2355605a' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--s-3) center;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--sage-600); box-shadow: 0 0 0 3px var(--sage-100);
}
.field { margin-bottom: var(--s-4); }
.field-row { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 480px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* table (stacks to cards under 640px) */
.table-wrap { width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th {
  text-align: left; padding: var(--s-3) var(--s-4);
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-2); border-bottom: 1px solid var(--line); background: var(--ivory-2);
}
.table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--ivory); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
    margin-bottom: var(--s-3); padding: var(--s-2) 0;
  }
  .table td {
    display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
    border-bottom: 0; padding: var(--s-2) var(--s-4); text-align: right;
  }
  .table td::before {
    content: attr(data-label); font-size: var(--t-xs); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); text-align: left;
  }
  .table td[data-label=""]::before { content: none; }
}

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 247, 239, 0.97);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: var(--s-4); }
.brand {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-display); font-size: 1.625rem; font-weight: 700;
  color: var(--sage-900); text-decoration: none;
}
.brand svg { width: 24px; height: 24px; color: var(--gold); }
.nav { display: flex; align-items: center; gap: var(--s-6); }
.nav a:not(.btn) {
  color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500;
  padding: var(--s-2) 0; border-bottom: 2px solid transparent;
}
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--sage-900); border-bottom-color: var(--gold); }
.nav__cart { display: inline-flex; align-items: center; gap: var(--s-2); }
.nav__cart svg { width: 20px; height: 20px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--gold); color: var(--paper); font-size: var(--t-xs); font-weight: 700;
}
.hamburger {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--sage-900); cursor: pointer;
}
.hamburger svg { width: 22px; height: 22px; }
@media (max-width: 767px) {
  .hamburger { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ivory); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2);
    padding: var(--s-2) var(--s-4) var(--s-4);
  }
  .topbar.is-open .nav { display: flex; }
  .nav a:not(.btn) { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
}

/* footer */
.footer { background: var(--sage-900); color: #d9e2d8; padding: var(--s-12) 0 var(--s-8); margin-top: var(--s-16); }
.footer a { color: #d9e2d8; text-decoration: none; }
.footer a:hover { color: var(--gold-soft); text-decoration: underline; }
.footer .brand { color: var(--paper); }
.footer h4 { color: var(--gold-soft); font-family: var(--font-ui); font-size: var(--t-xs); letter-spacing: 0.14em; text-transform: uppercase; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: var(--s-2); font-size: var(--t-sm); }
.footer__grid { display: grid; gap: var(--s-8); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer__note { margin-top: var(--s-8); padding-top: var(--s-4); border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: var(--t-xs); color: #a9b8a8; }

/* empty state */
.empty-state {
  text-align: center; padding: var(--s-12) var(--s-6);
  border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--paper);
}
.empty-state svg { width: 40px; height: 40px; color: var(--gold); margin-bottom: var(--s-3); }
.empty-state h3 { margin-bottom: var(--s-2); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: var(--s-6); z-index: 100;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px);
  background: var(--sage-900); color: var(--paper);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  font-size: var(--t-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast--danger { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
