/* =============================================================================
   One Vela · Design System v1
   Mediterranean editorial + liquid glass · consistent across all pages
   ============================================================================= */

:root {
  /* Colors — Mediterranean palette */
  --ink: #1a1613;
  --ink-2: #4a4038;
  --stone: #8c7f70;
  --paper: #f5f1ea;
  --paper-2: #ebe4d4;
  --cream: #faf6ee;
  --sand: #d9c9a9;
  --terracotta: #b47a5e;
  --terracotta-2: #946145;
  --olive: #6b7355;
  --good: #5e7a4e;
  --bad: #8e3a3a;
  --amber: #c27b3f;
  --blue: #3d5a7d;

  /* Typography */
  --serif: 'Cormorant Garamond', 'GT Sectra', 'Playfair Display', Georgia, serif;
  --sans: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;

  /* Radii */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 100px;

  /* Shadows */
  --sh-sm: 0 2px 8px rgba(26,22,19,.04);
  --sh: 0 8px 28px rgba(26,22,19,.06);
  --sh-lg: 0 20px 60px rgba(26,22,19,.12);
  --sh-glass: 0 8px 32px rgba(26,22,19,.06);

  /* Blur */
  --blur: saturate(180%) blur(20px);
  --blur-lg: saturate(180%) blur(24px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[x-cloak] { display: none !important; }

/* =============================================================================
   NAV — sticky liquid glass
   ============================================================================= */
.ov-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,241,234,.82);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-bottom: 1px solid rgba(26,22,19,.06);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
}
.ov-nav .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.ov-nav .brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.ov-nav .brand-mark svg { width: 100%; height: 100%; fill: var(--ink); }
.ov-nav .brand-txt { font-family: var(--serif); font-size: 19px; letter-spacing: 0.02em; text-transform: uppercase; }
.ov-nav .breadcrumb { color: var(--stone); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.ov-nav .breadcrumb b { color: var(--ink); font-weight: 600; }
.ov-nav .grow { flex: 1; }
.ov-nav a.link {
  font-size: 13.5px; color: var(--stone);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
  transition: color .2s;
  padding: 8px 6px;
}
.ov-nav a.link:hover { color: var(--terracotta); }
.ov-nav a.link.active { color: var(--terracotta); }
.ov-nav a.link.staff {
  padding: 6px 14px; border-radius: var(--r-pill);
  background: rgba(180,122,94,.1); color: var(--terracotta);
}
.ov-nav a.link.staff:hover { background: var(--terracotta); color: var(--cream); }

/* =============================================================================
   BUTTONS — liquid glass pills
   ============================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px; border-radius: var(--r-pill);
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
  cursor: pointer; text-decoration: none;
  border: 1px solid rgba(26,22,19,.12);
  background: rgba(255,255,255,.6);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--ink);
  transition: all .2s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
.btn:hover {
  background: var(--ink); color: var(--cream); border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26,22,19,.15);
}
.btn.primary { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn.primary:hover { background: var(--terracotta); border-color: var(--terracotta); }
.btn.terracotta {
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-2));
  color: var(--cream); border-color: transparent;
  box-shadow: 0 4px 14px rgba(180,122,94,.35);
}
.btn.terracotta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(180,122,94,.5); background: var(--terracotta-2); }
.btn.good { background: var(--good); color: var(--cream); border-color: var(--good); }
.btn.good:hover { background: #4a6539; border-color: #4a6539; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 16px; font-size: 13px; }
.btn.lg { padding: 12px 24px; font-size: 14px; }
.btn.xl { padding: 16px 32px; font-size: 15px; }

/* Icon-only chip button */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 15px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.6); backdrop-filter: var(--blur);
  border: 1px solid rgba(26,22,19,.08); color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.chip:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.chip.line { background: #06c755; color: white; border-color: transparent; }
.chip.line:hover { background: #05a747; }
.chip.mail { background: #0ea5e9; color: white; border-color: transparent; }
.chip.mail:hover { background: #0284c7; }

/* =============================================================================
   PANEL — liquid glass surface
   ============================================================================= */
.panel {
  background: rgba(255,255,255,.7);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-glass);
}
.panel-solid {
  background: var(--cream);
  border: 1px solid var(--paper-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
}
.panel-tinted {
  background: rgba(180,122,94,.08);
  border: 1px solid rgba(180,122,94,.15);
  border-radius: var(--r-lg);
}

/* =============================================================================
   TYPOGRAPHY — editorial
   ============================================================================= */
.h-display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.025em;
  line-height: 1;
}
.h-display em { font-style: italic; color: var(--terracotta); }
.h-section {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.015em; line-height: 1;
}
.h-section em { font-style: italic; color: var(--terracotta); }
.h-card {
  font-family: var(--serif); font-weight: 400;
  font-size: 22px; letter-spacing: -0.01em;
}
.tag-line {
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  font-weight: 600; color: var(--stone);
}
.count {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--stone); font-weight: 600;
}
.mono { font-family: var(--mono); font-size: 12.5px; }

/* =============================================================================
   FORM INPUTS
   ============================================================================= */
.input, .select, .textarea {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,.6);
  border: 1px solid var(--paper-2);
  border-radius: var(--r);
  font: inherit; font-size: 15.5px; color: var(--ink);
  transition: all .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--terracotta);
  background: white;
  box-shadow: 0 0 0 4px rgba(180,122,94,.12);
}
.textarea { resize: vertical; min-height: 60px; }
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--stone); font-weight: 600; margin-bottom: 6px;
}

/* =============================================================================
   TABLE — editorial style
   ============================================================================= */
table.tbl {
  width: 100%; border-collapse: collapse; font-size: 14.5px;
}
table.tbl th {
  padding: 14px 18px; text-align: left;
  font-size: 11.5px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--stone); font-weight: 600;
  background: rgba(0,0,0,.02); border-bottom: 1px solid var(--paper-2);
}
table.tbl th.r { text-align: right; } table.tbl th.c { text-align: center; }
table.tbl td {
  padding: 14px 18px; border-bottom: 1px solid rgba(26,22,19,.05); color: var(--ink);
}
table.tbl td.r { text-align: right; } table.tbl td.c { text-align: center; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: rgba(26,22,19,.02); }
.docno { font-family: var(--mono); font-weight: 600; font-size: 13.5px; }
.empty {
  padding: 40px 20px; text-align: center; color: var(--stone);
  font-style: italic; font-family: var(--serif); font-size: 16px;
}

/* =============================================================================
   STATUS BADGE
   ============================================================================= */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
}
.st-paid, .st-completed, .st-approved, .st-accepted { background: #dff0d8; color: #3c763d; }
.st-pending, .st-applied, .st-active, .st-draft, .st-sent { background: #faf3d8; color: #8a6d3b; }
.st-overdue, .st-rejected, .st-expired, .st-failed { background: #f7dede; color: #a94442; }
.st-cancelled, .st-waived { background: #eee; color: #666; }
.st-transferred { background: #e6d9f2; color: #5e3d7d; }
.st-pending_docs { background: #e6e6fa; color: #4b0082; }
.st-ว่าง { background: #dff0d8; color: #3c763d; }
.st-จอง { background: #faf3d8; color: #8a6d3b; }
.st-สัญญา { background: #d9e6f2; color: #3d5a7d; }
.st-ขายดาวน์ { background: #e6d9f2; color: #5e3d7d; }
.st-โอนแล้ว { background: #d9f0e6; color: #2d7d5d; }
.st-หลุดจอง { background: #f7dede; color: #a94442; }

/* =============================================================================
   MODAL
   ============================================================================= */
.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(26,22,19,.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .2s;
}
.modal {
  background: var(--cream);
  border-radius: 20px; padding: 32px;
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 40px 100px rgba(26,22,19,.3);
  animation: popUp .3s cubic-bezier(.34,1.56,.64,1);
}
.modal h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -0.02em; margin-bottom: 6px; }
.modal .sub { font-size: 13px; color: var(--stone); margin-bottom: 20px; }
.buttons {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--paper-2);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popUp { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================================================
   HERO — big magazine banner
   ============================================================================= */
.hero-editorial {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  min-height: 340px; background: var(--paper-2);
  box-shadow: var(--sh-lg);
}
.hero-editorial .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 1s; }
.hero-editorial:hover .bg { transform: scale(1.03); }
.hero-editorial::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(26,22,19,.6) 0%, rgba(26,22,19,.3) 50%, transparent 100%);
}
.hero-editorial .content {
  position: relative; z-index: 1; padding: 44px 48px; color: var(--cream);
  min-height: 340px; display: flex; flex-direction: column; justify-content: space-between;
}

/* =============================================================================
   FLOATING NAV FAB
   ============================================================================= */
.nav-fab {
  position: fixed; bottom: 20px; left: 20px; z-index: 99;
  display: flex; gap: 6px;
  background: rgba(26,22,19,.9);
  backdrop-filter: blur(12px);
  border-radius: var(--r-pill);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.nav-fab a, .nav-fab button {
  background: transparent; border: none;
  color: var(--cream); text-decoration: none;
  padding: 9px 16px; border-radius: var(--r-pill);
  cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.03em;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .2s;
}
.nav-fab a:hover, .nav-fab button:hover { background: var(--terracotta); }

/* =============================================================================
   UTILITY
   ============================================================================= */
.wrap { max-width: 1400px; margin: 0 auto; padding: 32px 24px 80px; }
.wrap-narrow { max-width: 900px; margin: 0 auto; padding: 32px 24px 80px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sec { margin-bottom: 36px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; padding: 0 4px; }

.reveal { opacity: 0; transform: translateY(20px); transition: all .6s cubic-bezier(.4,0,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
  .ov-nav { padding: 12px 16px; flex-wrap: wrap; }
  .wrap, .wrap-narrow { padding: 20px 16px 60px; }
  .modal { padding: 24px 20px; }
  .hero-editorial .content { padding: 32px 24px; }
  table.tbl { font-size: 12px; }
  table.tbl th, table.tbl td { padding: 10px 12px; }
}
