/* ==================================================================
   Kabab Jees - admin panel styles (loaded after style.css)
   Modern, clean, professional restaurant admin UI
   ================================================================== */

.admin { background: var(--bg); }
.admin-main { padding-bottom: 60px; }
.admin-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar + navigation ---------------------------------- */
.admin-top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
          backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.admin-top-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
}
.admin-user {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
  font-size: .85rem; color: var(--muted); font-weight: 600;
}
.admin-user svg { opacity: .6; }
.admin-logout {
  padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; font-size: .82rem;
  transition: all .2s var(--ease);
}
.admin-logout:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }

.admin-nav {
  max-width: 1080px; margin: 0 auto; padding: 0 10px 12px;
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav-link {
  flex: 0 0 auto; padding: 9px 18px; border-radius: 999px;
  font-size: .86rem; font-weight: 600; color: var(--muted);
  transition: all .2s var(--ease); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.admin-nav-link svg { width: 16px; height: 16px; opacity: .6; }
.admin-nav-link:hover { background: var(--brand-soft); color: var(--brand); }
.admin-nav-link.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 4px 14px rgba(226, 87, 30, .28);
}
.admin-nav-link.is-active svg { opacity: 1; }

/* ---------- page furniture ---------------------------------------- */
.stats-row {
  display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr);
  margin: 22px 0 18px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; text-align: center;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: 0; transition: opacity .25s var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card:hover::before { opacity: 1; }
.stat-card-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; margin-bottom: 10px;
}
.stat-card-icon svg { width: 22px; height: 22px; }
.sci-orders { background: #eff6ff; color: #2563eb; }
.sci-revenue { background: #f0fdf4; color: #16a34a; }
.sci-active { background: #fef3c7; color: #d97706; }

.stat-card-accent {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent;
}
.stat-card-accent::before { background: rgba(255,255,255,.3); opacity: 1; }
.stat-card-accent .stat-label { color: rgba(255,255,255,.8); }
.stat-card-accent .stat-card-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.stat-label { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 26px 0 16px;
}
.page-head h1 { font-size: 1.6rem; margin: 0 0 2px; letter-spacing: -.02em; }
.page-head p { margin: 0; font-size: .88rem; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: 22px; margin: 0 0 20px;
  animation: fadeUp .5s var(--ease) both;
}
.panel-narrow { max-width: 520px; }
.panel-title {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 0 0 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); font-weight: 700;
}

.flash {
  max-width: 1080px; margin: 16px auto 0;
  padding: 13px 18px; border-radius: 12px;
  font-size: .9rem; font-weight: 500;
  background: #dcfce7; color: #14532d; border: 1px solid #86efac;
  animation: fadeUp .4s var(--ease) both;
  display: flex; align-items: center; gap: 10px;
}
.flash::before { content: "\2713"; font-weight: 800; font-size: 1.1rem; }
.flash-error { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.flash-error::before { content: "\2717"; }
.flash a { text-decoration: underline; font-weight: 700; }

/* ---------- forms -------------------------------------------------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.field > span small { font-weight: 400; color: var(--muted); }
.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%; padding: 12px 14px; font: inherit; font-size: .94rem;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: var(--card);
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(226, 87, 30, .12);
}
.field input[type="file"] { font-size: .86rem; padding: 10px 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.current-image { flex-direction: row; align-items: center; gap: 14px; }
.current-image img { border-radius: 12px; object-fit: cover; border: 2px solid var(--line); }
.two-forms { display: grid; gap: 20px; }

/* ---------- tables ------------------------------------------------- */
.table-scroll { overflow-x: auto; margin: 0 -4px; border-radius: 12px; }
.grid {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: .9rem; min-width: 620px;
}
.grid th {
  text-align: left; padding: 11px 14px; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  border-bottom: 2px solid var(--line); white-space: nowrap;
  background: var(--bg); font-weight: 700;
}
.grid th:first-child { border-radius: 10px 0 0 0; }
.grid th:last-child { border-radius: 0 10px 0 0; }
.grid td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle; transition: background .15s var(--ease);
}
.grid tr:last-child td { border-bottom: 0; }
.grid tr { transition: background .2s var(--ease); }
.grid tbody tr:hover { background: var(--brand-soft); }
.grid .right { text-align: right; }
.nowrap { white-space: nowrap; }
.cell-sub { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; line-height: 1.3; }
.thumb {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover;
  border: 2px solid var(--line); transition: border-color .2s var(--ease);
}
.grid tbody tr:hover .thumb { border-color: var(--brand); }
.inline { display: inline; }

/* ---------- buttons ------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: .88rem;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; transition: all .2s var(--ease); white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(226, 87, 30, .25);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(226, 87, 30, .35); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--brand); background: var(--brand-soft); }
.btn-mini { padding: 7px 14px; font-size: .8rem; border-radius: 10px; }
.btn-danger { border-color: rgba(220, 38, 38, .25); color: var(--danger); background: var(--card); }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }

/* ---------- pills / toggles ---------------------------------------- */
.pill {
  border: 0; cursor: pointer; padding: 5px 14px; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  transition: transform .18s var(--ease), filter .18s var(--ease);
}
.pill:active { transform: scale(.94); }
.pill-on { background: #dcfce7; color: #15803d; }
.pill-off { background: #e7e5e4; color: #78716c; }
.pill:hover { filter: brightness(.96); }

/* ---------- dashboard --------------------------------------------- */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); font-weight: 600; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); font-size: .84rem; font-weight: 600; color: var(--muted);
  transition: all .2s var(--ease);
}
.tab:hover { color: var(--ink); border-color: rgba(226, 87, 30, .3); background: var(--brand-soft); }
.tab.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(226, 87, 30, .24);
}
.tab-count {
  min-width: 24px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg); color: var(--ink); font-size: .72rem; font-weight: 700;
}
.tab.is-active .tab-count { background: rgba(255, 255, 255, .25); color: #fff; }

.orders { display: grid; gap: 16px; }
@media (min-width: 760px) { .orders { grid-template-columns: 1fr 1fr; } }

.order-card {
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: 18px 20px; animation: fadeUp .45s var(--ease) both;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
  position: relative;
}
.order-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.oc-new { border-left-color: #2563eb; }
.oc-preparing { border-left-color: #d97706; }
.oc-ready { border-left-color: #16a34a; }
.oc-completed { border-left-color: #a8a29e; }
.oc-cancelled { border-left-color: #dc2626; }

.oc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.oc-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.oc-id h2 { font-size: 1.1rem; margin: 0; }
.oc-time { font-size: .78rem; color: var(--muted); }
.oc-table {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 66px; padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 4px 14px rgba(226, 87, 30, .25);
}
.oc-table small { font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; opacity: .85; }
.oc-table b { font-size: 1.5rem; line-height: 1.1; }

.oc-items { list-style: none; margin: 14px 0 0; padding: 0; }
.oc-items li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .92rem;
}
.oc-items li:last-child { border-bottom: 0; }
.oci-name b { color: var(--brand); }
.oci-name small { display: block; color: var(--muted); font-size: .74rem; margin-top: 1px; }
.oci-price { font-weight: 700; white-space: nowrap; }

.oc-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0 4px; font-size: .94rem; color: var(--muted); font-weight: 600;
  border-top: 2px solid var(--line); margin-top: 4px;
}
.oc-total b { font-size: 1.25rem; color: var(--ink); }

.oc-foot { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; margin-bottom: 10px;
}
.status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
}
.status-new { background: #eff6ff; color: #2563eb; }
.status-new::before { background: #2563eb; }
.status-preparing { background: #fef3c7; color: #92400e; }
.status-preparing::before { background: #d97706; }
.status-ready { background: #f0fdf4; color: #166534; }
.status-ready::before { background: #16a34a; }
.status-completed { background: #f5f5f4; color: #57534e; }
.status-completed::before { background: #a8a29e; }
.status-cancelled { background: #fef2f2; color: #991b1b; }
.status-cancelled::before { background: #dc2626; }

.status-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.sbtn {
  border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
  padding: 8px 16px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  cursor: pointer; transition: all .18s var(--ease);
}
.sbtn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.sbtn:disabled { cursor: default; }
.sbtn.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.sbtn-cancelled:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

/* ---------- QR management ------------------------------------------ */
.qr-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.qr-tile {
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); padding: 18px; text-align: center;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .45s var(--ease) both;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.qr-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.qr-tile.is-off { opacity: .55; }
.qr-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.qr-tile-head b { font-size: 1.05rem; display: block; }
.qr-tile-head small { color: var(--muted); font-size: .74rem; }
.qr-box { margin: 14px auto 10px; width: 100%; max-width: 180px; }
.qr-box svg { width: 100%; height: auto; display: block; border-radius: 10px; }
.qr-url { font-size: .68rem; color: var(--muted); word-break: break-all; margin: 0 0 12px; line-height: 1.4; }
.qr-actions { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.qr-manage {
  display: flex; gap: 7px; justify-content: center; align-items: center; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.qr-orders { font-size: .72rem; color: var(--muted); font-weight: 600; }

/* ---------- login --------------------------------------------------- */
.admin-bare { display: block; background: #faf7f4; }
.login-page {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-left {
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #1c1917, #292524);
  color: #fff; padding: 48px 40px;
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(226, 87, 30, .15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, .1) 0%, transparent 50%);
}
.login-left-content { position: relative; z-index: 1; }
.login-logo { width: 80px; height: 80px; margin-bottom: 24px; filter: brightness(0) invert(1); }
.login-left h2 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 2rem; font-style: italic; margin: 0 0 6px; letter-spacing: -.01em;
}
.login-left > .login-left-content > p {
  font-size: .9rem; color: #a8a29e; margin: 0 0 40px;
}
.login-features { display: flex; flex-direction: column; gap: 16px; }
.login-feat {
  display: flex; align-items: center; gap: 12px;
  font-size: .9rem; color: #d6d3d1;
}
.login-feat svg { color: #e2571e; flex-shrink: 0; }
.login-left-footer {
  position: relative; z-index: 1;
  font-size: .78rem; color: #57534e; margin-top: 40px;
}

.login-right {
  display: grid; place-items: center; padding: 40px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 1px 3px rgba(28,25,23,.06), 0 20px 50px rgba(28,25,23,.08);
  border: 1px solid rgba(236,230,225,.6);
}
.login-card-header { text-align: center; margin-bottom: 32px; }
.login-mark {
  display: inline-grid; place-items: center; width: 56px; height: 56px;
  border-radius: 16px; color: #fff; margin-bottom: 16px;
  background: linear-gradient(135deg, #e2571e, #f59e0b);
  box-shadow: 0 10px 24px rgba(226, 87, 30, .3);
}
.login-card h1 { font-size: 1.4rem; margin: 0 0 6px; color: #1c1917; }
.login-card-header p { font-size: .9rem; color: #a8a29e; margin: 0; }

.login-card .flash { margin: 0 0 20px; text-align: left; }
.login-fields { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.login-card .field { text-align: left; }
.login-card .field > span { font-size: .82rem; font-weight: 600; color: #57534e; margin-bottom: 6px; display: block; }
.field-icon-wrap {
  position: relative; display: flex; align-items: center;
}
.field-icon {
  position: absolute; left: 14px; color: #a8a29e;
  pointer-events: none; transition: color .2s;
}
.field-icon-wrap input {
  width: 100%; padding: 13px 14px 13px 44px;
  font-size: .95rem; border: 1.5px solid #ece6e1; border-radius: 12px;
  background: #faf7f4; color: #1c1917;
  transition: all .2s;
}
.field-icon-wrap input:focus {
  outline: none; border-color: #e2571e;
  background: #fff; box-shadow: 0 0 0 3px rgba(226, 87, 30, .1);
}
.field-icon-wrap input:focus + .field-icon,
.field-icon-wrap:focus-within .field-icon { color: #e2571e; }
.field-icon-wrap input::placeholder { color: #c4bfb9; }

.btn-login-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 24px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #e2571e, #f59e0b);
  color: #fff; font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: all .25s;
  box-shadow: 0 6px 20px rgba(226, 87, 30, .3);
}
.btn-login-submit:hover {
  box-shadow: 0 10px 28px rgba(226, 87, 30, .4);
  transform: translateY(-1px);
}
.btn-login-submit:active { transform: translateY(0); }

.login-back {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 20px; font-size: .84rem; color: #a8a29e; text-decoration: none;
  transition: color .2s;
}
.login-back:hover { color: #e2571e; }

@media (max-width: 768px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 24px 16px; }
  .login-card { padding: 32px 24px; }
}

/* ---------- printable QR sheet -------------------------------------- */
.print-page { background: #f4f1ee; }
.print-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  font-size: .88rem; color: var(--muted);
}
.print-sheet { display: grid; gap: 18px; padding: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); max-width: 1000px; margin: 0 auto; }
.qr-card-print {
  background: #fff; border: 2px dashed #d6cec8; border-radius: 18px;
  padding: 26px 20px; text-align: center; break-inside: avoid; page-break-inside: avoid;
}
.qr-card-print h1 { font-size: 1.5rem; margin: 0 0 2px; }
.qcp-sub { color: #78716c; font-size: .85rem; margin: 0 0 14px; }
.qcp-code { margin: 0 auto; width: 100%; max-width: 260px; }
.qcp-code svg { width: 100%; height: auto; display: block; }
.qcp-table { font-size: 1.7rem; font-weight: 800; margin: 12px 0 2px; letter-spacing: -.02em; }
.qcp-url { font-size: .66rem; color: #a8a29e; word-break: break-all; margin: 0; }

/* ---------- empty state -------------------------------------------- */
.empty-state {
  text-align: center; padding: 40px 20px;
}
.empty-state p { color: var(--muted); font-size: .92rem; }

/* ---------- responsive ---------------------------------------------- */
@media (max-width: 639px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 1.25rem; }
  .oc-right { flex-direction: column; gap: 6px; align-items: flex-end; }
  .qr-grid { grid-template-columns: 1fr 1fr; }
  .oc-table b { font-size: 1.2rem; }
  .admin-nav-link { padding: 7px 12px; font-size: .82rem; }
  .order-card { padding: 14px 16px; }
  .sbtn { padding: 6px 12px; font-size: .76rem; }
}

@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: 1 / -1; }
  .two-forms { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}
