/* ==========================================================
   KelabuCRM Master UI Kit
   Version 1.0 — By Aurora Cloud Works
   Design Language: Modern Minimal SaaS
   ========================================================== */

/* ========== 1. FONT & BASE RESET ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f9fafb;
  color: #111827;
  line-height: 1.5;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
}

/* Scrollbar aesthetic */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* ========== 2. TYPOGRAPHY ========== */
h1, h2, h3 {
  color: #111827;
  font-weight: 600;
}
h1 { font-size: 26px; margin-bottom: 16px; }
h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 10px; }

/* ========== 3. BUTTONS ========== */
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  height: 38px;
}
.btn:active {
  transform: scale(0.97);
}

/* Primary Blue */
.btn-primary {
  background: #2563eb;
  color: white;
}
.btn-primary:hover {
  background: #1d4ed8;
}

/* Danger Red */
.btn-danger {
  background: #ef4444;
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

/* Secondary / Neutral */
.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}
.btn-secondary:hover {
  background: #d1d5db;
}

/* Icon alignment */
.btn i {
  margin-right: 6px;
  pointer-events: none;
}

/* Floating Add Button (mobile) */
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  z-index: 999;
  transition: background 0.2s;
}
.fab:hover { background: #1e40af; }

/* ========== 4. CARD & SECTION WRAPPER ========== */
.card, .table-wrapper {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  padding: 20px;
  margin-bottom: 20px;
}

/* Header bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}

/* ========== 5. TABLE DESIGN ========== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background: #2563eb;
  color: #ffffff;
}

th, td {
  text-align: center;
  padding: 12px 10px;
  border-bottom: 1px solid #f1f1f1;
}

tbody tr:nth-child(even) td {
  background: #f9fafb;
}

tbody tr:hover td {
  background: #eef2ff;
}

.no-data {
  text-align: center;
  padding: 20px;
  font-style: italic;
  color: #9ca3af;
}

/* ========== 6. FORMS ========== */
label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Inline form layout */
.form-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========== 7. STATUS TAGS ========== */
.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.status-active { background: #f59e0b; }
.status-complete { background: #16a34a; }
.status-pending { background: #6b7280; }

/* ========== 8. FILTER & ACTION BARS ========== */
.filter-bar,
.actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #ffffff;
  flex: 1;
  font-size: 14px;
}

/* ========== 9. MODAL ========== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: fadeIn 0.25s ease-out;
  border: 1px solid #e5e7eb;
}

.modal-content h3 {
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 10. RESPONSIVE ========== */
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  h2 { font-size: 18px; }
  table { font-size: 12px; }
  .btn { font-size: 12px; padding: 6px 12px; }
  th, td { padding: 8px; }
  .fab { display: flex; }
}

@media (min-width: 769px) {
  .fab { display: none; }
}

/* ========== 11. ANIMATIONS ========== */
@keyframes fadeInRow {
  from { background-color: #dbeafe; }
  to { background-color: white; }
}
.fade-in-row td {
  animation: fadeInRow 1s ease;
}

/* ========== 12. UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ================================
   Live Session Detail Info Section
================================ */
.live-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-item label {
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-value {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  color: #111827;
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* Status badge */
.info-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  width: fit-content;
  color: #fff;
}
.info-badge.active {
  background: #2563eb;
}
.info-badge.completed {
  background: #16a34a;
}
.info-badge.pending {
  background: #9ca3af;
}

.table-wrapper h3 {
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  font-weight: 600;
}

/* ================================
   Live Lock Fast Entry Section
================================ */
.lock-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.lock-input {
  flex: 1;
  max-width: 280px;
  font-size: 18px;
  font-weight: 600;
  padding: 10px 14px;
  border: 2px solid #2563eb;
  border-radius: 10px;
  color: #111827;
  background: #ffffff;
  transition: 0.2s;
}

.lock-input:focus {
  background: #f0f9ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.lock-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.lock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ================================
   Lock Table Scrollable Container
================================ */
.lock-table-container {
  max-height: 320px; /* boleh adjust ikut keperluan */
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-top: 10px;
}

/* Scrollbar aesthetic (match theme) */
.lock-table-container::-webkit-scrollbar {
  width: 8px;
}
.lock-table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
.lock-table-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.lock-table-container {
  scroll-behavior: smooth;
}

/* ================================
   Lock Confirmation Animation
================================ */
@keyframes confirmHighlight {
  0% { background-color: #bbf7d0; }   /* light green */
  100% { background-color: transparent; }
}

.fade-in-row td {
  animation: confirmHighlight 1.2s ease;
}

/* ================================
   Customer Status Icon Buttons
================================ */
.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  margin: 0 2px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  transform: scale(1.2);
}

.icon-btn i {
  font-size: 16px;
}

/* Color references */
.text-gray { color: #9ca3af; }
.text-success { color: #16a34a; }
.text-primary { color: #2563eb; }
.text-indigo-500 { color: #6366f1; }
.text-pink-500 { color: #ec4899; }

/* ================================
   Customer Status Buttons (Square)
================================ */
.status-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  margin: 0 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-btn i {
  pointer-events: none;
}

.status-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 🟡 Active state (normal action) */
.status-btn.active {
  background-color: #facc15; /* amber-400 */
  border-color: #f59e0b;
  color: #111827;
}

/* ⛔ Special active-block (Joy Blocked) */
.status-btn.active-block {
  background-color: #ef4444;
  border-color: #b91c1c;
  color: #ffffff;
}

/* Tooltip fix */
.status-btn[title] {
  position: relative;
}

/* Highlighted summary boxes inside live info */
.info-item.highlight {
  background: #fefce8; /* soft yellow background */
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px;
}

.info-item.highlight .info-value {
  background: #fff;
  border: none;
  font-weight: 700;
  font-size: 16px;
}

.info-item.highlight .info-label {
  font-weight: 500;
}

.text-success {
  color: #16a34a;
}

@keyframes flashMoney {
  0% { background-color: #bbf7d0; }
  100% { background-color: transparent; }
}
.flash-money {
  animation: flashMoney 0.8s ease;
}

.status-edit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-edit select {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  font-size: 14px;
  color: #111827;
  cursor: pointer;
  transition: 0.2s;
}

.status-edit select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

@keyframes flashStatus {
  0% { background-color: #fef9c3; }
  100% { background-color: transparent; }
}
.flash-status {
  animation: flashStatus 0.8s ease;
}


/* MAIN LAYOUT */
.pos-container {
  display: flex;
  gap: 20px;
  height: 78vh;
}

/* LEFT PANEL */
.pos-left {
  flex: 0.45;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow-y: auto;
}

/* RIGHT PANEL */
.pos-right {
  flex: 0.55;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

/* TITLES */
.pos-section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 15px;
}

/* FIELDS */
.pos-field {
  margin-bottom: 15px;
}

.pos-live-id {
  font-size: 20px;
  font-weight: 600;
  background: #e5e7eb;
  padding: 10px;
  border-radius: 8px;
}

.pos-input-large,
.pos-textarea-large {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  resize: none;
}

/* BUTTON ROW */
.pos-button-row {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.pos-btn-primary,
.pos-btn-danger {
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 8px;
  color: white;
  border: none;
}

.pos-btn-primary {
  background: #2563eb;
}
.pos-btn-danger {
  background: #ef4444;
}

/* PRICE ENTRY */
.pos-entry-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.pos-input-big {
  flex: 1;
  padding: 14px;
  font-size: 18px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.pos-btn-add {
  background: #10b981;
  border: none;
  border-radius: 10px;
  font-size: 22px;
  color: #fff;
  padding: 10px 18px;
}

/* TOTALS */
.pos-totals {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.totals-right button {
  padding: 8px 14px;
  font-size: 14px;
}

/* LOCK LIST TABLE */
.pos-lock-list {
  overflow-y: auto;
  height: 100%;
}

.pos-table {
  width: 100%;
  border-collapse: collapse;
}

.pos-table th, .pos-table td {
  padding: 12px;
  text-align: center;
}

.pos-table thead {
  background: #2563eb;
  color: white;
}

/* CHAT SUMMARY */
.pos-chat-box {
  margin-top: 20px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.pos-chat-textarea {
  width: 100%;
  height: 150px;
  padding: 12px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  resize: none;
}

.pos-chat-copy {
  text-align: right;
  margin-top: 10px;
}
