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

:root {
  --primary: #e85d04;
  --primary-dark: #bf3d00;
  --primary-light: #ffba08;
  --secondary: #9a031e;
  --dark: #370617;
  --brown: #6f2d0a;
  --white: #ffffff;
  --gray-100: #fefae0;
  --gray-200: #f8f4e6;
  --gray-300: #e0d8c8;
  --gray-500: #a69a86;
  --gray-700: #5e5343;
  --gray-900: #2d2416;
  --success: #2a9d8f;
  --warning: #f4a261;
  --danger: #e76f51;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 3px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  background: var(--gray-100);
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
  background: var(--dark);
  color: var(--white);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  color: var(--gray-300);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
}

.nav-login {
  background: var(--primary-light);
  color: var(--dark) !important;
  font-weight: 600;
}

.nav-user {
  color: var(--gray-500);
  font-size: 0.82rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}

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

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: heroDrift 30s linear infinite;
}

@keyframes heroDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(30px, 30px); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.btn-lg {
  padding: 0.85rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h1 {
  font-size: 1.6rem;
  color: var(--dark);
  font-weight: 800;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  background: var(--gray-200);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-danger:hover { background: #d45d3f; }

.btn-warning {
  background: var(--warning);
  color: var(--dark);
  border-color: var(--warning);
}

.btn-warning:hover { background: #e0913f; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,93,4,0.12);
}

textarea { resize: vertical; }

.form-group input[type="file"] {
  padding: 0.5rem;
  border-style: dashed;
  background: var(--gray-200);
  cursor: pointer;
}

.form-container {
  max-width: 650px;
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Image preview */
.image-preview {
  margin-bottom: 0.75rem;
}

.preview-thumb {
  max-width: 200px;
  max-height: 150px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
  margin-bottom: 0.5rem;
}

.preview-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error {
  background: #fce4e4;
  color: var(--danger);
  border: 1px solid #f5c6c6;
}

/* Tables */
.table-container {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--gray-200);
}

.table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-300);
  font-weight: 700;
}

.table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
  vertical-align: middle;
}

.table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--gray-300);
  border-bottom: none;
  font-size: 1.05rem;
}

.table tr:hover { background: var(--gray-100); }
.table tbody tr.inactive-row { opacity: 0.45; }

.img-cell { width: 60px; padding: 0.5rem !important; }
.table-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.table-thumb-placeholder {
  width: 50px;
  height: 50px;
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gray-500);
}

.text-muted { color: var(--gray-500); }

.actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.empty-cell {
  text-align: center;
  color: var(--gray-500);
  padding: 2.5rem !important;
  font-size: 0.95rem;
}

.total-cell {
  color: var(--primary);
  font-size: 1.15rem;
}

/* Category badges */
.cat-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.cat-burgers { background: #fce4d6; color: #7f4f24; }
.cat-hotdogs { background: #ffe066; color: #8a6d00; }
.cat-sides { background: #d8f3dc; color: #2d6a4f; }
.cat-drinks { background: #caf0f8; color: #0077b6; }
.cat-desserts { background: #fae0e4; color: #9d4edd; }
.cat-salads { background: #d4edda; color: #155724; }
.cat-other { background: #e2eafc; color: #3a5a9c; }

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

.badge-active { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.login-logo {
  font-size: 2.2rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 0.25rem;
  font-weight: 900;
}

.login-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.login-form .form-group { margin-bottom: 1rem; }
.login-form .btn { margin-top: 0.5rem; padding: 0.85rem; font-size: 1rem; font-weight: 700; }

/* POS Layout */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  align-items: start;
}

.pos-products h3,
.pos-receipt h3 {
  font-size: 1.15rem;
  color: var(--dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.pos-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.85rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,93,4,0.1);
}

.cat-filter {
  padding: 0.6rem 0.85rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--white);
  cursor: pointer;
  min-width: 150px;
}

/* Product grid */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
}

.product-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  overflow: hidden;
  font-family: inherit;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232,93,4,0.15);
}

.product-card:active {
  transform: scale(0.97);
}

.product-card-img {
  width: 100%;
  height: 90px;
  overflow: hidden;
  background: var(--gray-200);
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-placeholder-sm {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-200) 100%);
}

.product-card-name {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.4rem 0.35rem 0;
  line-height: 1.3;
}

.product-card-price {
  display: block;
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 800;
  padding: 0 0.35rem 0.5rem;
}

/* POS Receipt */
.pos-receipt {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  position: sticky;
  top: 80px;
}

.cart-items { min-height: 130px; }

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--gray-200);
  gap: 0.5rem;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.78rem;
  color: var(--gray-500);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.cart-item-qty button {
  width: 30px;
  height: 30px;
  border: 2px solid var(--gray-300);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.cart-item-qty button:hover {
  background: var(--gray-200);
  border-color: var(--primary);
}

.cart-item-qty span {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
}

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

.cart-summary {
  text-align: right;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.cart-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 3px solid var(--dark);
  text-align: right;
  font-size: 1.3rem;
  font-weight: 800;
}

.cart-total span { color: var(--primary); }

.empty-cart {
  text-align: center;
  color: var(--gray-500);
  padding: 2rem 0;
  font-size: 0.9rem;
}

/* Invoice meta */
.invoice-meta {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.meta-item {
  font-size: 0.9rem;
}

.meta-item strong {
  color: var(--dark);
  margin-right: 0.3rem;
}

/* Catalog / Menu */
.menu-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 5px solid var(--primary);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.catalog-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all var(--transition);
}

.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.catalog-card-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--gray-200);
}

.catalog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.catalog-card:hover .catalog-card-img img {
  transform: scale(1.05);
}

.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.3;
  width: 60px;
  height: 60px;
  background: var(--gray-500);
  border-radius: 50%;
}

.catalog-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.catalog-card-body h3 {
  font-size: 1.05rem;
  color: var(--dark);
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.catalog-desc {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.catalog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.catalog-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--gray-200);
  border-radius: 50%;
}

.empty-state h3 {
  font-size: 1.3rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  background: var(--dark);
  color: var(--gray-500);
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.footer p {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.footer-small {
  font-size: 0.78rem;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero p { font-size: 1rem; }

  .nav-links { gap: 0.15rem; }
  .nav-link { font-size: 0.78rem; padding: 0.3rem 0.55rem; }
  .nav-user { display: none; }

  .pos-layout { grid-template-columns: 1fr; }
  .pos-receipt { position: static; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
  .product-card-img { height: 70px; }

  .table th, .table td { padding: 0.5rem; font-size: 0.8rem; }

  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .catalog-card-img { height: 140px; }

  .invoice-meta { flex-direction: column; gap: 0.5rem; }
  .product-table .actions-cell { flex-direction: column; }
}

@media (max-width: 480px) {
  .container { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .pos-search { flex-direction: column; }
  .cat-filter { min-width: auto; }
  .form-container { padding: 1.2rem; }
  .login-card { padding: 1.5rem; }
}
