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

:root {
  /* Palet Rasa CateringHub: Hijau Daun, Merah Cabe, Kuning Paprika */
  --leaf-900: #0F3D22;
  --leaf-800: #14532D;
  --leaf-700: #166534;
  --leaf-600: #15803D;
  --leaf-100: #DCFCE7;
  --leaf-50:  #F0FDF4;

  --chili-700: #B91C1C;
  --chili-600: #DC2626;
  --chili-100: #FEE2E2;
  --chili-50:  #FEF2F2;

  --paprika-600: #CA8A04;
  --paprika-500: #EAB308;
  --paprika-400: #FACC15;
  --paprika-100: #FEF9C3;
  --paprika-50:  #FEFCE8;

  --bg-canvas: #F4F7F5;
  --surface:   #FFFFFF;
  --surface-2: #EEF3F0;
  --ink-900:   #0F172A;
  --ink-700:   #334155;
  --ink-500:   #64748B;
  --border:    #E2E8F0;
  --border-strong: #CBD5E1;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px -6px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-canvas);
  color: var(--ink-900);
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 68px; /* Space for mobile bottom nav */
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   COMPACT STICKY APP BAR
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink-900);
  min-width: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--leaf-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 0.94rem;
  letter-spacing: -0.02em;
  color: var(--leaf-900);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.role-pill.leaf { background: var(--leaf-100); color: var(--leaf-800); }
.role-pill.chili { background: var(--chili-100); color: var(--chili-700); }
.role-pill.paprika { background: var(--paprika-100); color: #854D0E; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--leaf-800);
  color: var(--paprika-400);
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name-text {
  font-size: 0.72rem;
  font-weight: 700;
  max-width: 82px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   BUTTONS & COMPACT INPUTS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.14s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-chili { background: var(--chili-600); color: #FFFFFF; }
.btn-chili:hover:not(:disabled) { background: var(--chili-700); }

.btn-leaf { background: var(--leaf-800); color: #FFFFFF; }
.btn-leaf:hover:not(:disabled) { background: var(--leaf-900); }

.btn-paprika { background: var(--paprika-400); color: var(--leaf-900); }
.btn-paprika:hover:not(:disabled) { background: var(--paprika-500); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink-700);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-xs { padding: 5px 8px; font-size: 0.7rem; border-radius: 6px; }
.btn-sm { padding: 6px 10px; font-size: 0.74rem; border-radius: 7px; }
.btn-block { width: 100%; }

.field { margin-bottom: 10px; }
.field label {
  display: block;
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--ink-700);
  margin-bottom: 3px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.81rem;
  color: var(--ink-900);
  background: var(--surface);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--leaf-700);
  box-shadow: 0 0 0 2.5px rgba(22, 101, 52, 0.14);
}

.pw-meter {
  height: 3.5px;
  background: var(--border);
  border-radius: 4px;
  margin-top: 5px;
  overflow: hidden;
}
.pw-meter-fill { height: 100%; width: 0%; transition: 0.2s; }
.pw-hint { font-size: 0.67rem; color: var(--ink-500); margin-top: 3px; }

/* ==========================================================================
   1-GATE UNIFIED AUTH & ROLE SELECTOR GRID
   ========================================================================== */
.auth-overlay {
  min-height: calc(100vh - 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px 30px;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.auth-tab {
  padding: 7px;
  border: none;
  background: transparent;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--ink-500);
  border-radius: 6px;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--leaf-900);
  box-shadow: var(--shadow-xs);
}

/* 4-Role Visual Selector Grid */
.role-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 11px;
}

.role-opt {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  transition: 0.14s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.role-opt-icon {
  font-size: 1rem;
  line-height: 1;
}

.role-opt-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-900);
  line-height: 1.15;
}

.role-opt-sub {
  font-size: 0.62rem;
  color: var(--ink-500);
}

.role-opt.selected {
  border-color: var(--leaf-700);
  background: var(--leaf-50);
}
.role-opt.selected .role-opt-title {
  color: var(--leaf-900);
}

.security-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  background: var(--leaf-50);
  border: 1px solid var(--leaf-100);
  border-radius: 7px;
  font-size: 0.67rem;
  color: var(--leaf-800);
  margin-bottom: 12px;
}

.verify-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--paprika-100);
  color: #854D0E;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.35rem;
}

/* ==========================================================================
   MAIN CONTAINER, BENTO KPI & COMPACT CARDS
   ========================================================================== */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

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

.page-header h1 {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.page-header p {
  font-size: 0.74rem;
  color: var(--ink-500);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  box-shadow: var(--shadow-xs);
}
.bento-card.accent-leaf { border-top: 2.5px solid var(--leaf-700); }
.bento-card.accent-chili { border-top: 2.5px solid var(--chili-600); }
.bento-card.accent-paprika { border-top: 2.5px solid var(--paprika-500); }

.bento-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bento-value {
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--ink-900);
  margin-top: 2px;
}

/* Top Segmented Nav (Desktop) & Bottom App Bar (Mobile) */
.seg-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  scrollbar-width: none;
}
.seg-nav::-webkit-scrollbar { display: none; }

.seg-btn {
  padding: 7px 11px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-500);
  cursor: pointer;
  white-space: nowrap;
}
.seg-btn.active {
  color: var(--leaf-800);
  border-bottom-color: var(--chili-600);
}

/* Mobile Bottom App Bar */
.bottom-nav {
  display: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 12px;
}

.panel-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-head h2 {
  font-size: 0.86rem;
  font-weight: 800;
}

.panel-body {
  padding: 12px;
}

.table-scroll { overflow-x: auto; }

.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}
.modern-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--ink-700);
  font-weight: 700;
  font-size: 0.67rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.modern-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.modern-table tr:last-child td { border-bottom: none; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.64rem;
  font-weight: 700;
}
.tag-leaf { background: var(--leaf-100); color: var(--leaf-800); }
.tag-chili { background: var(--chili-100); color: var(--chili-700); }
.tag-paprika { background: var(--paprika-100); color: #854D0E; }
.tag-slate { background: var(--surface-2); color: var(--ink-700); }

/* ==========================================================================
   PHOTO PACKAGE CARDS (SUPER COMPACT 2-COL ON MOBILE)
   ========================================================================== */
.vendor-pill-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.vendor-pill-bar::-webkit-scrollbar { display: none; }

.v-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.v-chip.active {
  background: var(--leaf-800);
  color: #FFFFFF;
  border-color: var(--leaf-800);
}

.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.pkg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.pkg-card:hover {
  border-color: var(--leaf-600);
  transform: translateY(-1px);
}

.pkg-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--leaf-800), var(--leaf-600));
  overflow: hidden;
}

.pkg-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pkg-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--paprika-400);
  font-size: 1.6rem;
}

.pkg-badge-tl {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  font-size: 0.61rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

.pkg-badge-tr {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--paprika-400);
  color: var(--leaf-900);
  font-size: 0.61rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
}

.pkg-body {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.pkg-vendor-tag {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--leaf-700);
  margin-bottom: 2px;
}

.pkg-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-900);
  line-height: 1.25;
  margin-bottom: 4px;
}

.pkg-desc {
  font-size: 0.7rem;
  color: var(--ink-500);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.pkg-footer {
  border-top: 1px solid var(--border);
  padding-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pkg-price {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--leaf-800);
  line-height: 1.1;
}

.pkg-minpax {
  font-size: 0.62rem;
  color: var(--ink-500);
}

/* ==========================================================================
   BOTTOM-SHEET ORDER MODAL & TOAST
   ========================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-box {
  background: var(--surface);
  width: 100%;
  max-width: 500px;
  border-radius: 18px 18px 0 0;
  padding: 14px 16px 22px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; padding: 16px; }
  .sheet-box { border-radius: 16px; }
}

.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--ink-900);
  color: #FFFFFF;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border-left: 3.5px solid var(--paprika-400);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 9999;
  max-width: 92vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   MOBILE SUPER COMPACT OVERRIDES (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .topbar { height: 48px; padding: 0 10px; }
  .brand-sub { display: none; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .bento-card { padding: 8px 10px; }
  .bento-value { font-size: 0.96rem; }

  /* Super compact 2-column package cards on phone */
  .pkg-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .pkg-body { padding: 7px 8px 8px; }
  .pkg-title { font-size: 0.77rem; }
  .pkg-desc { font-size: 0.65rem; -webkit-line-clamp: 2; }
  .pkg-price { font-size: 0.76rem; }
  .pkg-footer { flex-direction: column; align-items: stretch; gap: 5px; }
  .pkg-footer .btn { width: 100%; padding: 6px 8px; font-size: 0.71rem; }

  /* Hide top seg-nav when bottom app bar is active */
  .has-bottom-nav .seg-nav { display: none; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 920;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.04);
  }

  .bnav-item {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ink-500);
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 2px;
  }
  .bnav-item span.ico { font-size: 1.05rem; line-height: 1; }
  .bnav-item.active { color: var(--chili-600); }
}
