/* Biz Ops Hub — Light-Mode, Mobile-First, Bilingual (Khmer/EN) Stylesheet */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --primary: #0369a1;
  --primary-hover: #075985;
  --primary-soft: #e0f2fe;
  --success: #047857;
  --success-hover: #065f46;
  --success-soft: #d1fae5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --danger: #be123c;
  --danger-soft: #ffe4e6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --font-sans: "Kantumruy Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

/* Header & Navigation */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 34px;
  transition: background 0.15s, color 0.15s;
}

.lang-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 960px) {
  .nav-links {
    width: auto;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
}

.nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* Main Layout */
main {
  padding: 20px 0 48px;
}

/* AdSense Placeholder Slots */
.ad-slot-wrap {
  margin: 16px 0 24px;
}

.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 76px;
}

.ad-slot-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Hero Section */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .hero {
    padding: 40px 36px;
  }
}

.eyebrow {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 1.65rem;
  line-height: 1.35;
  color: var(--text);
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 2.15rem;
  }
}

.hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 760px;
}

/* Native House Ad — Amara ERP */
.house-ad {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
  border: 1px solid #a7f3d0;
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .house-ad {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
  }
}

.house-ad-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.house-ad h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  color: var(--text);
}

.house-ad p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
  max-width: 680px;
}

.house-ad-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  min-height: 44px;
  transition: background 0.15s;
}

.house-ad-cta:hover {
  background: var(--success-hover);
  text-decoration: none;
  color: #ffffff;
}

/* Cards & Grids */
.section-title {
  margin: 32px 0 16px;
  font-size: 1.28rem;
  color: var(--text);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.tool-card h2 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  color: var(--text);
}

.tool-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary);
}

/* Guide Box (Hybrid Knowledge Guide) */
.guide-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .guide-card {
    padding: 24px 28px;
  }
}

.guide-card h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--primary-hover);
}

.guide-card p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.guide-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.94rem;
}

.guide-list li {
  margin-bottom: 6px;
}

/* Forms & Controls */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 768px) {
  .form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.15);
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

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

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

.btn-success {
  background: var(--success);
  color: #ffffff;
}

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

.btn-outline {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--surface-muted);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fecdd3;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 0.85rem;
}

.btn-danger-ghost:hover {
  background: var(--danger-soft);
}

.btn-sm {
  padding: 7px 12px;
  min-height: 36px;
  font-size: 0.86rem;
}

/* Template Pills */
.template-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill-btn {
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s;
}

.pill-btn:hover, .pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Checklist & Table Items */
.task-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.task-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--success);
  cursor: pointer;
  flex-shrink: 0;
}

.task-row .task-text {
  flex: 1 1 200px;
}

.task-row .task-time {
  width: 110px;
}

/* Scorecard Questions */
.question-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 12px;
}

.question-text {
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-btn {
  flex: 1 1 90px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 42px;
}

.choice-btn.selected-yes {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.choice-btn.selected-partial {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.choice-btn.selected-no {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

/* Results / Verdicts */
.verdict-box {
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
  border: 1px solid var(--border);
}

.verdict-green {
  background: var(--success-soft);
  border-color: #6ee7b7;
  color: #064e3b;
}

.verdict-yellow {
  background: var(--amber-soft);
  border-color: #fcd34d;
  color: #78350f;
}

.verdict-red {
  background: var(--danger-soft);
  border-color: #fda4af;
  color: #881337;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.kpi-label {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.kpi-value.positive {
  color: var(--success);
}

.kpi-value.negative {
  color: var(--danger);
}

/* Responsive Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: #ffffff;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-muted);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Print / Save PDF Rules */
@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }
  .site-header,
  .ad-slot-wrap,
  .house-ad,
  .btn-row,
  .template-bar,
  .no-print,
  .site-footer {
    display: none !important;
  }
  .card, .guide-card, .verdict-box {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
  }
  main {
    padding: 0;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
}
