/* Sarkissian POS — 2026 blue & white */
:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-400: #94a3b8;
  --slate-600: #475569;
  --slate-800: #1e293b;
  --white: #ffffff;
  --shadow: 0 1px 3px rgb(15 23 42 / 0.06), 0 12px 40px rgb(37 99 235 / 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: linear-gradient(165deg, var(--blue-50) 0%, var(--slate-50) 45%, var(--white) 100%);
  color: var(--slate-800);
  line-height: 1.5;
}

a {
  color: var(--blue-600);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  display: grid;
  place-items: center;
  color: var(--white);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 24px rgb(37 99 235 / 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--blue-900);
}

.brand span {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--slate-600);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.select,
.input {
  font: inherit;
  border: 1px solid var(--blue-200);
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  color: var(--slate-800);
  min-height: 42px;
}

.input:focus,
.select:focus {
  outline: 2px solid var(--blue-500);
  outline-offset: 1px;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-wrap .input {
  width: 100%;
}

.btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  min-height: 42px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: var(--white);
  box-shadow: 0 4px 14px rgb(37 99 235 / 0.35);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn-ghost {
  background: var(--white);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
}

.btn-ghost:hover {
  background: var(--blue-50);
}

.btn-danger {
  background: var(--white);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 1fr 380px;
    align-items: start;
  }
}

.panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgb(255 255 255 / 0.8);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-h {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: linear-gradient(180deg, var(--white), var(--blue-50));
}

.panel-h h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-900);
}

.panel-body {
  padding: 1rem 1.1rem;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  align-items: center;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--blue-200);
  background: var(--white);
  color: var(--blue-800);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-chip:hover {
  background: var(--blue-50);
  border-color: var(--blue-300);
  text-decoration: none;
}

.category-chip.is-active {
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 2px 10px rgb(37 99 235 / 0.3);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}

.product-card {
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.75rem;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  border-color: var(--blue-300, var(--blue-200));
  box-shadow: 0 6px 20px rgb(37 99 235 / 0.12);
}

.product-card h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--slate-800);
  line-height: 1.35;
}

.price-row {
  font-size: 0.8rem;
  color: var(--slate-600);
}

.price-row strong {
  color: var(--blue-700);
}

.cart-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: min(52vh, 420px);
  overflow: auto;
}

.cart-line {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
}

.cart-line .name {
  font-weight: 600;
  font-size: 0.88rem;
}

.cart-line .meta {
  font-size: 0.75rem;
  color: var(--slate-600);
}

.cart-line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.qty-control input {
  width: 52px;
  text-align: center;
  font: inherit;
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  padding: 0.25rem;
}

.totals {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--blue-200);
  font-size: 0.95rem;
}

.totals .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.totals .grand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--blue-900);
}

.empty {
  text-align: center;
  color: var(--slate-400);
  padding: 2rem 0.5rem;
  font-size: 0.95rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.45);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 80px rgb(30 58 138 / 0.25);
  overflow: hidden;
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  padding: 1.1rem 1.2rem;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: var(--white);
}

.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.15rem 1.2rem 1.25rem;
}

.modal-body label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 0.35rem;
}

.modal-body .hint {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-top: 0.25rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.calc-display {
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -0.02em;
}

.change-pill {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-800);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Admin */
.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.admin-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--blue-200);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue-800);
}

.admin-nav a.is-active {
  background: var(--blue-600);
  color: var(--white);
  border-color: transparent;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-100);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data th,
table.data td {
  padding: 0.65rem 0.75rem;
  text-align: start;
  border-bottom: 1px solid var(--slate-100);
}

table.data th {
  background: var(--blue-50);
  font-weight: 700;
  color: var(--blue-900);
}

table.data tr:last-child td {
  border-bottom: none;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 480px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-600);
}

/* Print receipt */
@media print {
  body * {
    visibility: hidden;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 72mm;
    padding: 4mm;
    font-size: 11pt;
  }
}

.print-area {
  font-family: var(--font);
  max-width: 72mm;
  margin: 0 auto;
}

.receipt-block {
  border: 1px dashed var(--slate-400);
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--white);
}

/* RTL */
[dir="rtl"] .toolbar,
[dir="rtl"] .top-bar,
[dir="rtl"] .cart-line,
[dir="rtl"] .totals .row {
  flex-direction: row-reverse;
}

[dir="rtl"] .modal-actions {
  justify-content: flex-start;
}

[dir="rtl"] table.data th,
[dir="rtl"] table.data td {
  text-align: right;
}
