/* KHAVINDO V3 — V2 visual foundation (Tahap 10).
   Styling only. No change to permissions, routes, stock, SPK, QC, or Export. */
:root {
  --kh-dark: #123d2b;
  --kh-nav: #126b40;
  --kh-primary: #198754;
  --kh-primary-hover: #157347;
  --kh-body: #f4f6f5;
  --kh-text: #173d2b;
  --kh-muted: #6b7d74;
  --kh-border: #dcebe2;
  --kh-white: #ffffff;
}

html { color-scheme: light; }
body { margin: 0; background: var(--kh-body); color: var(--kh-text); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.55; }

/* Follow V2 navbar identity while retaining every existing V3 link and permission gate. */
body > header {
  min-height: 64px; height: auto;
  background: var(--kh-nav); color: var(--kh-white);
  padding: 12px 24px; gap: 6px;
  display: flex; flex-wrap: wrap; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  position: relative; z-index: 20;
}
body > header > b {
  display: flex; flex-direction: column; justify-content: center;
  margin-right: 18px; min-height: 38px;
  font-size: 20px; line-height: 1.2; font-weight: 800;
  letter-spacing: 1px; white-space: nowrap;
}
body > header > b small {
  display: block; margin-top: 3px;
  font-size: 9px !important; letter-spacing: 1.1px;
  font-weight: 500; opacity: .86;
}
body > header > a {
  display: inline-flex; align-items: center;
  min-height: 35px; padding: 9px 10px;
  text-decoration: none; border-radius: 7px;
  color: rgba(255,255,255,.88);
  font-size: 12px; font-weight: 600;
  line-height: 1.25; transition: background-color .15s ease;
}
body > header > a:hover,
body > header > a:focus-visible { background: rgba(255,255,255,.14); color: #fff; outline: none; }
body > header > span[style*="margin-left:auto"] { margin-left: auto !important; padding: 0 8px; color: #fff; font-size: 12px; font-weight: 600; }
body > header > form { margin: 0; }
body > header > form button.secondary {
  background: transparent; color: #fff; padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.30); border-radius: 7px; font-size: 12px;
}
body > header > form button.secondary:hover { background: rgba(255,255,255,.13); }

/* Main app canvas and typography. */
body > main { max-width: 1600px; padding: 28px 24px 65px; margin: 0 auto; }
h1 { margin: 0 0 17px; font-size: 25px; line-height: 1.3; color: var(--kh-text); font-weight: 700; }
h2 { margin: 0 0 12px; font-size: 16px; line-height: 1.35; color: var(--kh-text); }
.muted { font-size: 12px; color: var(--kh-muted); }

/* Keep existing V3 grid semantics but match V2 visual density. */
.card {
  padding: 19px; margin: 14px 0;
  border: 1px solid var(--kh-border); border-radius: 8px;
  background: #fff; box-shadow: 0 1px 4px rgba(12,51,29,.045);
}
.grid { gap: 12px; }
.flex { gap: 10px; }
.notice {
  background: #f0f8f3; border-left: 4px solid var(--kh-primary);
  padding: 12px 14px; border-radius: 5px; color: #315c44; font-size: 12px;
}

label { margin: 10px 0 5px; color: var(--kh-text); font-size: 11px; font-weight: 700; }
input, select, textarea {
  min-height: 36px; width: 100%; padding: 8px 10px;
  background: #fff; color: var(--kh-text);
  font-size: 12px; border: 1px solid #cbdad2; border-radius: 5px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--kh-primary);
  box-shadow: 0 0 0 3px rgba(25,135,84,.10);
}
button, .button {
  background: var(--kh-primary); color: #fff; padding: 9px 14px;
  border: 1px solid transparent; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
button:hover:not(:disabled), .button:hover { background: var(--kh-primary-hover); color: #fff; }
button.secondary, .button.secondary { background: #ecf5ef; color: #17643f; border-color: #cfdfd4; }
button.secondary:hover:not(:disabled), .button.secondary:hover { background: #ddecdf; color: #125e35; }
button:disabled { cursor: not-allowed; opacity: .6; }

/* V2-style operational tables. */
.scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: #fff; background: var(--kh-dark); padding: 11px 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
td { border-bottom: 1px solid #e3ece7; padding: 10px 12px; vertical-align: middle; }
tr:nth-child(even) td { background: #fafcfb; }
tr:hover td { background: #f1f8f4; }
.pill { display: inline-block; padding: 4px 8px; background: #e8f3ec; border-radius: 5px; font-size: 11px; }
.ok { border: 1px solid #b9ddc8; background: #e0f1e7; color: #17643f; padding: 11px 13px; border-radius: 6px; }
.err { border: 1px solid #edb9be; background: #f8dadd; color: #842029; padding: 11px 13px; border-radius: 6px; }

@media (max-width: 1120px) {
  body > header { gap: 7px; padding: 12px 16px; }
  body > header > b { width: 100%; margin-right: 0; }
  body > header > span[style*="margin-left:auto"] { margin-left: 0 !important; }
  body > main { padding: 20px 16px 50px; }
}
@media (max-width: 650px) {
  body > header > a { padding: 7px 9px; font-size: 11px; }
  body > header > span[style*="margin-left:auto"] { width: 100%; padding: 6px 0 0; }
  body > main { padding: 16px 12px 40px; }
  .card { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  th, td { padding: 8px; }
}
