/* Artha-Desk Modern Design System */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0f172a;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --surface: #ffffff;
  --background: #f8fafc;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Odia", sans-serif;
  --radius: 10px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header & Top Bar */
.topbar {
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: #94a3b8;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: #1e293b;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Store Badge & Mode Pill */
.store-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1e293b;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.mode-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.mode-regular { background: #059669; color: #fff; }
.mode-composition { background: #d97706; color: #fff; }
.mode-unregistered { background: #64748b; color: #fff; }

.btn-lang {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-lang:hover {
  background: #334155;
}

/* Flash Messages */
.flash-container {
  padding: 0.75rem 1.5rem 0;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Main Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* POS Layout Grid */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.25rem;
  height: calc(100vh - 75px);
  padding: 1rem 1.5rem;
}

@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }
  .card {
    padding: 1rem;
  }
  table.data-table th,
  table.data-table td {
    padding: 0.5rem 0.75rem;
  }
  .payment-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  .pos-layout {
    padding: 0.75rem;
  }
}

.product-pane {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.product-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
}

.category-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-top: 0.75rem;
  scrollbar-width: thin;
}

.cat-chip {
  padding: 0.35rem 0.85rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.cat-chip.active, .cat-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.product-grid {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  align-content: start;
}

.product-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
  position: relative;
}

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

.product-card.out-of-stock {
  opacity: 0.6;
  background: #f8fafc;
  pointer-events: none;
}

.product-name-en {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.3;
}

.product-name-or {
  font-size: 0.82rem;
  color: #0369a1;
  margin-top: 0.2rem;
  font-weight: 500;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
}

.stock-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
}

.stock-tag.low {
  background: #fffbeb;
  color: #b45309;
}

/* Cart Pane */
.cart-pane {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cart-header {
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.cart-item-info {
  flex: 1;
  padding-right: 0.5rem;
}

.cart-item-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: #e2e8f0;
}

.qty-val {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
}

.cart-item-total {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 65px;
  text-align: right;
}

/* Cart Footer & Checkout */
.cart-footer {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.summary-row.grand-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0.5rem 0 0.85rem;
  padding-top: 0.5rem;
  border-top: 2px dashed var(--border);
}

.payment-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.pay-btn {
  padding: 0.45rem 0.2rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.pay-btn.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-checkout {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.btn-checkout:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-checkout:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Forms & Inputs */
.form-input,
.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font-family);
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-top: 2rem;
}

.modal-header {
  padding: 1.1rem 1.5rem;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-header .btn-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-box form {
  padding: 1.5rem;
}

/* Standard Buttons & Cards */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f5f9; color: var(--text-main); border-color: var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #ef4444; color: #fff; }

.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.table-responsive {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

table.data-table th {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

table.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

table.data-table tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #ecfdf5; color: #047857; }
.badge-warning { background: #fffbeb; color: #b45309; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-info { background: #eff6ff; color: #1d4ed8; }
.badge-error { background: #fef2f2; color: #b91c1c; }

/* Thermal Receipt Styling */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .no-print {
    display: none !important;
  }
}
