/* =============================================================
   KASDAP ONE — SHARED COMPONENTS
============================================================= */

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: .82rem; letter-spacing: -.01em;
  padding: 11px 18px; border-radius: var(--r10);
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .15s, background .2s, border-color .2s, box-shadow .2s, color .2s;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 16px; height: 16px; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: 0 6px 22px rgba(var(--accent-rgb),.32);
}
.btn-accent:hover { box-shadow: 0 10px 30px rgba(var(--accent-rgb),.46); transform: translateY(-1px); }
.btn-soft {
  background: var(--accent-soft); color: var(--accent);
  border-color: rgba(var(--accent-rgb),.22);
}
.btn-soft:hover { background: rgba(var(--accent-rgb),.20); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--surface-3); }
.btn-line { background: transparent; color: var(--text-2); border-color: var(--line-2); }
.btn-line:hover { color: var(--text); border-color: var(--line-3); }
.btn-lg { padding: 14px 24px; font-size: .9rem; border-radius: var(--r14); }
.btn-sm { padding: 7px 12px; font-size: .74rem; border-radius: var(--r6); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- icon button ---------- */
.iconbtn {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--r10); display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  transition: all .18s; position: relative;
}
.iconbtn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn.sm { width: 32px; height: 32px; border-radius: var(--r6); }
.iconbtn.sm svg { width: 15px; height: 15px; }

/* ---------- badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--ff-mono); font-size: .62rem; font-weight: 500;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb),.22); letter-spacing: .02em;
}
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .64rem; font-weight: 600; padding: 3px 8px; border-radius: var(--r6);
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line);
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.live { background: var(--emerald); animation: ksPulse 1.8s infinite; }

/* status pills */
.pill { font-family: var(--ff-mono); font-size: .6rem; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: .03em; white-space: nowrap; }
.pill.ok      { background: rgba(0,184,107,.12); color: #1ad389; border: 1px solid rgba(0,184,107,.25); }
.pill.info    { background: var(--sky-soft); color: var(--sky); border: 1px solid rgba(79,155,247,.25); }
.pill.warn    { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245,166,35,.25); }
.pill.danger  { background: var(--rose-soft); color: var(--rose); border: 1px solid rgba(251,92,126,.25); }
.pill.neutral { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: .72rem; font-weight: 600; color: var(--text-2); letter-spacing: -.01em; }
.input, .select, .textarea {
  width: 100%; background: var(--surface-2); border: 1.5px solid var(--line);
  border-radius: var(--r10); padding: 12px 14px; font-size: .86rem; color: var(--text);
  outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.12);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238190a8' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r18); }
.card-pad { padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-family: var(--ff-display); font-size: 1rem; font-weight: 700; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-pill); font-size: .76rem; font-weight: 600;
  border: 1px solid var(--line); color: var(--text-2); background: var(--surface);
  cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: rgba(var(--accent-rgb),.35); }
.chip .cnt { font-family: var(--ff-mono); font-size: .62rem; opacity: .7; }

/* ---------- qty stepper ---------- */
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r10); padding: 3px; }
.qty button { width: 28px; height: 28px; border-radius: var(--r6); display: flex; align-items: center; justify-content: center; color: var(--text); transition: background .15s; }
.qty button:hover { background: var(--surface-hi); }
.qty input { width: 42px; text-align: center; background: none; border: none; outline: none; font-family: var(--ff-mono); font-size: .82rem; font-weight: 600; color: var(--text); }

/* ---------- skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 720px 100%; animation: ksShimmer 1.3s infinite linear; border-radius: var(--r10); }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 800; background: rgba(4,7,14,.66); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: ksPop .2s ease; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r24); box-shadow: var(--shadow-3); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; animation: ksFadeUp .25s ease; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 1.15rem; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- toast ---------- */
.toast-stack { position: fixed; z-index: 950; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; max-width: 360px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: var(--r14); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); font-size: .82rem; font-weight: 500; animation: ksFadeUp .28s ease; pointer-events: auto; }
.toast .ti { width: 26px; height: 26px; border-radius: var(--r6); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast.ok .ti { background: var(--emerald-soft); color: var(--emerald); }
.toast.info .ti { background: var(--accent-soft); color: var(--accent); }
.toast.warn .ti { background: var(--amber-soft); color: var(--amber); }
.toast.err .ti { background: var(--rose-soft); color: var(--rose); }
.toast svg { width: 15px; height: 15px; }

/* ---------- product image fallback ---------- */
.pimg { position: relative; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.pimg img { width: 100%; height: 100%; object-fit: contain; }
.pimg .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-family: var(--ff-display); font-weight: 700; color: var(--text-3); text-align: center; padding: 8px; }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r10); padding: 3px; gap: 2px; }
.seg button { padding: 7px 14px; border-radius: var(--r6); font-size: .76rem; font-weight: 600; color: var(--text-2); transition: all .15s; }
.seg button.on { background: var(--surface-hi); color: var(--text); box-shadow: var(--shadow-1); }

/* divider */
.hr { height: 1px; background: var(--line); border: none; margin: 0; }
