.admin-shell { display: flex; min-height: 100vh; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px; border-bottom: 1px solid var(--line); background: var(--bg-panel);
}
.admin-topbar .brand { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-size: 18px; color: var(--gold-soft); }
.admin-main { flex: 1; }
.admin-content { padding: 30px; max-width: 1180px; margin: 0 auto; }

.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 26px 0 40px; }
.admin-card {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 8px; transition: transform .15s ease, border-color .15s ease;
}
.admin-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.admin-card .icon-wrap {
  width: 46px; height: 46px; border-radius: 12px; background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center; color: var(--gold); margin-bottom: 6px;
}
.admin-card h3 { font-size: 19px; color: var(--cream); }
.admin-card p { font-size: 13px; color: var(--muted); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat-box { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stat-box b { display: block; font-family: 'Fraunces', serif; font-size: 26px; color: var(--gold-soft); }
.stat-box span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.data-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; background: var(--bg-raised); }
.data-table td { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.data-table tr:hover td { background: rgba(216,171,82,0.04); }

.status-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-Pending { background: rgba(216,171,82,0.15); color: var(--gold-soft); }
.status-Confirmed { background: rgba(111,174,106,0.15); color: var(--success); }
.status-Processing { background: rgba(111,174,106,0.15); color: var(--success); }
.status-Ready { background: rgba(111,174,106,0.2); color: var(--success); }
.status-Completed { background: rgba(111,174,106,0.25); color: var(--success); }
.status-Cancelled { background: rgba(200,73,44,0.18); color: var(--ember-soft); }

.stock-in { color: var(--success); font-weight: 700; font-size: 12px; }
.stock-out { color: var(--ember-soft); font-weight: 700; font-size: 12px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }

.thumb-sm { width: 44px; height: 44px; border-radius: 8px; background: var(--bg-raised); display: flex; align-items: center; justify-content: center; font-size: 18px; overflow: hidden; }

@media (max-width: 760px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { border-top: 1px solid var(--line); padding: 12px 14px; }
  .data-table td { border-top: none; padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
}
/* =========================================
   ADMIN HEADER
========================================= */

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}

.admin-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  color: var(--gold-soft);
  text-decoration: none;
  white-space: nowrap;
}

.admin-user-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.admin-user {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.admin-user b {
  color: var(--cream);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 760px) {

  .admin-topbar {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .admin-topbar .brand {
    font-size: 17px;
    justify-content: center;
  }

  .admin-user-area {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-user {
    text-align: center;
    font-size: 12px;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .admin-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-content {
    padding: 18px 14px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .section-head h1 {
    font-size: 22px !important;
  }

  .section-head .btn {
    width: 100%;
    justify-content: center;
  }
}
/* Order row / detail actions (Download PDF) */
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-title-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Admin: edit order items */
.items-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.items-head .btn { margin-top: 14px; }
.edit-note { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.order-flash { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 700; margin: 0 0 18px; border: 1px solid; }
.order-flash-ok { background: #ecfdf3; border-color: #9fd9b4; color: #15803d; }
.order-flash-info { background: #eef6ff; border-color: #b9d7f5; color: #17497a; }
.order-flash-err { background: #fff1ee; border-color: #f4b8ac; color: #9b1c10; }
.edit-items-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.edit-items { width: 100%; border-collapse: collapse; }
.edit-items th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.edit-items td { padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.edit-items select.input { width: 100%; min-width: 220px; }
.edit-items input.input { width: 90px; }
.edit-items .js-price, .edit-items .js-sub { white-space: nowrap; }
.edit-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 760px) {
  .edit-items thead { display: none; }
  .edit-items, .edit-items tbody, .edit-items tr, .edit-items td { display: block; width: 100%; }
  .edit-items tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .edit-items td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .edit-items td::before { content: attr(data-label); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  .edit-items td[data-label="Product"] { flex-direction: column; align-items: stretch; gap: 6px; }
  .edit-items select.input { min-width: 0; }
  .edit-items td:last-child { justify-content: flex-end; }
  .edit-actions .btn { flex: 1 1 140px; justify-content: center; }
}
