@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:       #0f0e0c;
  --surface:  #1a1814;
  --surface2: #242118;
  --border:   #2e2b24;
  --accent:   #e8b84b;
  --accent2:  #c9813a;
  --green:    #4caf7d;
  --red:      #e05252;
  --text:     #f0ead8;
  --muted:    #7a7465;
  --radius:   14px;
  --shadow:   0 8px 32px rgba(0,0,0,.5);
}

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

body {
  font-family: 'Be Vietnam Pro', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100; padding: 24px 0;
}
.logo { padding: 0 24px 24px; border-bottom: 1px solid var(--border); }
.logo-text { font-size: 22px; font-weight: 800; color: var(--accent); }
.logo-sub  { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-top: 3px; }

.nav { padding: 12px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .18s; user-select: none;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(232,184,75,.07); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer { padding: 16px 24px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ===== MAIN ===== */
.main { margin-left: 220px; min-height: 100vh; padding: 32px; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 26px; font-weight: 700; }
.page-title span { color: var(--accent); }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  position: relative; overflow: hidden; transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::after {
  content:''; position: absolute; top:0; right:0;
  width:50px; height:50px; border-radius: 0 var(--radius) 0 100%; opacity:.15;
}
.stat-card.gold::after { background: var(--accent); }
.stat-card.green::after { background: var(--green); }
.stat-card.red::after { background: var(--red); }
.stat-card.blue::after { background: #5b8def; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-value.gold  { color: var(--accent); }
.stat-value.green { color: var(--green); }
.stat-value.red   { color: var(--red); }
.stat-value.blue  { color: #5b8def; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ===== BÀN GRID ===== */
.ban-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 14px; }
.ban-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 20px 14px;
  text-align: center; cursor: pointer;
  transition: all .2s; position: relative;
}
.ban-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ban-card.trong    { border-color: var(--green); }
.ban-card.co_khach { border-color: var(--accent); background: rgba(232,184,75,.05); }
.ban-icon  { font-size: 28px; margin-bottom: 8px; }
.ban-name  { font-size: 14px; font-weight: 600; }
.ban-status { font-size: 11px; margin-top: 3px; }
.ban-card.trong    .ban-status { color: var(--green); }
.ban-card.co_khach .ban-status { color: var(--accent); }
.ban-tien  { font-size: 12px; color: var(--accent); margin-top: 5px; font-weight: 600; }
.ban-badge {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
}
.ban-badge.trong    { background: var(--green); }
.ban-badge.co_khach { background: var(--accent); animation: pulse 2s infinite; }

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.section-title::after { content:''; flex:1; height:1px; background: var(--border); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; width: 100%; max-width: 680px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.7); overflow: hidden;
}
.modal-header {
  padding: 20px 26px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { color: var(--text); background: var(--border); }
.modal-body   { padding: 22px 26px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== ORDER LAYOUT (inside modal) ===== */
.order-layout { display: grid; grid-template-columns: 1fr 290px; gap: 18px; }
.menu-grid    { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.menu-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px; cursor: pointer;
  transition: all .18s; display: flex; flex-direction: column; gap: 3px;
}
.menu-item:hover { border-color: var(--accent); background: rgba(232,184,75,.07); }
.menu-item-emoji { font-size: 20px; }
.menu-item-name  { font-size: 13px; font-weight: 600; }
.menu-item-price { font-size: 12px; color: var(--accent); }
.menu-item-cat   { font-size: 11px; color: var(--muted); }

.order-panel {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 15px;
  display: flex; flex-direction: column; gap: 12px;
}
.order-items { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.order-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.order-item-name { flex: 1; font-weight: 500; font-size: 12px; }
.qty-control { display: flex; align-items: center; gap: 5px; }
.qty-btn {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--border); border: none; color: var(--text);
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.qty-btn:hover { background: var(--accent); color: #000; }
.qty-num { font-weight: 700; min-width: 18px; text-align: center; font-size: 13px; }
.order-item-price { font-size: 12px; color: var(--accent); min-width: 65px; text-align: right; }

.order-total {
  border-top: 1px solid var(--border); padding-top: 11px;
  display: flex; justify-content: space-between; align-items: center;
}
.total-label { font-size: 13px; color: var(--muted); }
.total-value { font-size: 20px; font-weight: 700; color: var(--accent); }

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 20px; border-radius: 9px; border: none;
  cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600;
  transition: all .18s; display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary { background: var(--accent); color: #0f0e0c; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-danger  { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-ghost   { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-green   { background: var(--green); color: #fff; }
.btn-green:hover { opacity: .85; }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ===== MENU LIST (quản lý thực đơn) ===== */
.menu-list { display: flex; flex-direction: column; gap: 9px; }
.menu-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 17px;
  display: flex; align-items: center; gap: 14px;
}
.menu-row-emoji { font-size: 24px; }
.menu-row-info  { flex: 1; }
.menu-row-name  { font-size: 14px; font-weight: 600; }
.menu-row-meta  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.menu-row-price { font-size: 16px; font-weight: 700; color: var(--accent); min-width: 90px; text-align: right; }
.menu-row-actions { display: flex; gap: 7px; }

/* ===== FORM ===== */
.form-group { margin-bottom: 15px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: .5px; }
.form-input {
  width: 100%; padding: 10px 13px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .18s;
}
.form-input:focus { border-color: var(--accent); }
select.form-input option { background: var(--surface2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* ===== ORDERS TABLE ===== */
.orders-list { display: flex; flex-direction: column; gap: 9px; }
.order-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all .18s;
}
.order-row:hover { border-color: var(--accent); }
.order-row-id     { font-size: 12px; color: var(--muted); min-width: 44px; }
.order-row-table  { font-weight: 600; min-width: 58px; }
.order-row-items  { flex: 1; font-size: 13px; color: var(--muted); }
.order-row-total  { font-size: 15px; font-weight: 700; color: var(--accent); min-width: 95px; text-align: right; }
.order-row-time   { font-size: 12px; color: var(--muted); min-width: 60px; text-align: right; }

.badge { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.badge-open { background: rgba(232,184,75,.15); color: var(--accent); }
.badge-done { background: rgba(76,175,125,.15); color: var(--green); }

/* ===== SEARCH BAR ===== */
.search-bar { position: relative; margin-bottom: 16px; }
.search-bar input {
  width: 100%; padding: 10px 13px 10px 38px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .18s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar::before { content:'🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; }

/* ===== TOAST ===== */
#toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 11px 17px;
  font-size: 14px; box-shadow: var(--shadow);
  animation: slideIn .25s ease; max-width: 280px;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
@keyframes slideIn { from{transform:translateX(20px);opacity:0} to{transform:translateX(0);opacity:1} }

/* ===== EMPTY STATE ===== */
.empty { text-align: center; padding: 36px; color: var(--muted); }
.empty-icon { font-size: 36px; margin-bottom: 9px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== LEGEND ===== */
.legend { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
