* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #f4f6f8; color: #1f2937; }
.topbar { background: #14532d; color: #fff; padding: 1rem 1.5rem; }
.topbar h1 { margin: 0; }
.topbar p { margin: 0.4rem 0 0; opacity: 0.9; }
.container { padding: 1rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.panel { background: #fff; border-radius: 10px; padding: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
h2, h3 { margin-top: 0; }
.form-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 0.8rem; }
input, select, button { padding: 0.6rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; }
button { background: #166534; color: #fff; border: none; cursor: pointer; }
button.secondary { background: #6b7280; }
button:hover { opacity: 0.9; }
.menu-list { max-height: 200px; overflow-y: auto; }
.menu-item { display: flex; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px solid #e5e7eb; font-size: 0.92rem; }
.search-wrap { position: relative; margin-bottom: 0.6rem; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; max-height: 180px; overflow-y: auto; z-index: 10; display: none; }
.search-results.show { display: block; }
.search-result-item { width: 100%; text-align: left; border: none; border-bottom: 1px solid #f3f4f6; background: #fff; color: #1f2937; cursor: pointer; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #ecfdf5; }
.bill-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.bill-table th, .bill-table td { border: 1px solid #e5e7eb; padding: 0.45rem; text-align: left; font-size: 0.88rem; }
.bill-total-row { margin-top: 0.7rem; display: flex; justify-content: space-between; }
.action-row { margin-top: 0.8rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.stat-card { background: #ecfdf5; padding: 0.75rem; border-radius: 8px; border: 1px solid #bbf7d0; }
.stat-card small { display: block; color: #065f46; }
.stat-card strong { font-size: 1.1rem; }
.sales-history { max-height: 240px; overflow-y: auto; }
.sale-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 0.6rem; margin-bottom: 0.5rem; background: #f9fafb; }
.sale-card p { margin: 0.2rem 0; font-size: 0.9rem; }
.sale-details { margin-top: 0.5rem; }
.sale-details summary { cursor: pointer; color: #14532d; font-weight: 600; margin-bottom: 0.5rem; }
.history-bill-table { margin-top: 0.4rem; }
.print-history-btn { margin-top: 0.6rem; }
.cancel-sale-btn { margin-top: 0.5rem; background: #b91c1c; }
.cancel-sale-btn:hover { background: #991b1b; }
.status-active { color: #166534; font-weight: 700; }
.status-canceled { color: #b91c1c; font-weight: 700; }
.canceled-note { margin-top: 0.5rem !important; color: #b91c1c; font-weight: 600; }
.cancel-line-btn { background: #b91c1c; padding: 0.35rem 0.55rem; font-size: 0.8rem; }
.cancel-line-btn:hover { background: #991b1b; }
@media print {
  .topbar, #menu-form, #menu-list, #bill-item-select, #bill-qty, #add-to-bill-btn, #save-sale-btn, #clear-bill-btn, #print-bill-btn, .sales-history, .stats { display: none !important; }
  .container { display: block; padding: 0; }
  .panel { box-shadow: none; border: none; }
}
