/* ============ Jhatpat Go Now Admin — dark sidebar panel ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, 'Segoe UI', Roboto, sans-serif; background: #f4f6f4; color: #1d2418; }

.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #123018; color: #cfe6d3; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 18px 0;
}
.a-logo { font-size: 18px; font-weight: 800; color: #fff; padding: 0 18px 18px; letter-spacing: .3px; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar a {
  color: #cfe6d3; text-decoration: none; padding: 11px 18px; font-size: 14.5px; font-weight: 600;
}
.sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar a.active { background: #0c831f; color: #fff; border-radius: 0; }
.sidebar a.logout { color: #ffb4a8; margin-top: 14px; }

.admin-main { flex: 1; padding: 26px 30px; max-width: 1100px; }
.admin-main h1 { font-size: 22px; margin-bottom: 18px; }
.admin-main h2 { font-size: 17px; margin: 26px 0 12px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat { background: #fff; border: 1px solid #e2e6e0; border-radius: 14px; padding: 18px; }
.s-num { font-size: 26px; font-weight: 800; color: #0c831f; }
.s-label { font-size: 13px; color: #6d7767; margin-top: 4px; }

/* Tables */
.table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e2e6e0; border-radius: 12px; overflow: hidden; font-size: 14px;
}
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f2ee; }
.table th { background: #eef3ee; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: #55604f; }
.table tr:last-child td { border-bottom: none; }
.table tr.hl { background: #fdf6e0; }
.table td.big { font-size: 22px; }
.dim { color: #8a9384; }
td.actions { white-space: nowrap; }

/* Links & buttons */
.link { color: #0c831f; font-weight: 700; text-decoration: none; font-size: 13.5px; }
.link:hover { text-decoration: underline; }
.link.danger { color: #c0392b; margin-left: 10px; }
.cta {
  display: inline-block; background: #0c831f; color: #fff; border: none; font-weight: 800;
  padding: 11px 20px; border-radius: 9px; font-size: 14.5px; cursor: pointer; text-decoration: none;
}
.cta:hover { background: #0a6f1a; }
.cta.small { padding: 7px 14px; font-size: 13px; margin-left: auto; }
.btn-plain { display: inline-block; margin-left: 12px; color: #667061; text-decoration: none; font-weight: 600; font-size: 14px; }

/* Filter chips */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.cat-add { background: #fff; border: 1px solid #e2e6e0; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.cat-form { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-form input { padding: 9px 12px; border: 1.5px solid #d3d9d0; border-radius: 9px; font-size: 14px; }
.cat-form input[name="emoji"] { width: 64px; text-align: center; font-size: 18px; }
.cat-form input[name="name"] { flex: 1; min-width: 240px; }
.cat-edit-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat-edit-input { padding: 7px 10px; border: 1.5px solid #d3d9d0; border-radius: 8px; font-size: 13.5px; min-width: 180px; }
.cur-photos { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cur-photos img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1.5px solid #e2e6e0; }
.a-form input[type="file"] { padding: 9px; font-size: 13.5px; }
.chip { background: #e9ede8; color: #3a4534; text-decoration: none; border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; }
.chip.active { background: #0c831f; color: #fff; }

/* Status pills */
.status {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.status.placed { background: #fdf1d0; color: #8a6d00; }
.status.packed { background: #e0ecff; color: #1a56b0; }
.status.out-for-delivery { background: #ffe8d0; color: #a34d00; }
.status.delivered { background: #ddf4e0; color: #0c831f; }
.status.cancelled { background: #fde0dc; color: #b3261e; }

/* Status dropdown */
.status-form { display: inline-block; margin-right: 6px; }
.coupon-pill { background: #fdf1d0; color: #8a6d00; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; white-space: nowrap; }
.status-form select {
  padding: 4px 8px; border-radius: 7px; border: 1.5px solid #cdd4cc; font-size: 12.5px; background: #fff;
}

/* Forms */
.a-form { background: #fff; border: 1px solid #e2e6e0; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.a-form.narrow { max-width: 420px; }
.a-form label { font-size: 13px; font-weight: 700; color: #4d5647; display: flex; flex-direction: column; gap: 6px; }
.a-form input, .a-form select, .a-form textarea {
  padding: 10px 12px; border: 1.5px solid #d3d9d0; border-radius: 9px; font-size: 15px; font-family: inherit;
}
.a-form input:focus, .a-form select:focus { outline: 3px solid #f4cb30; border-color: #0c831f; }
.a-form .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.a-form label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14.5px; }
.a-form label.check input { width: auto; }

/* Detail card */
.detail-card { background: #fff; border: 1px solid #e2e6e0; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; font-size: 14.5px; }
.detail-card p { margin: 4px 0; }

/* Messages */
.ok { background: #ddf4e0; color: #0c6b18; border: 1px solid #b9e6c1; padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 14px; }
.err { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c2; padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 14px; }

/* Login page */
.login-bg { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #123018; }
.login-card {
  background: #fff; border-radius: 18px; padding: 34px 30px; width: 360px; max-width: 92vw;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.login-logo { font-size: 20px; font-weight: 800; text-align: center; color: #0c831f; }
.login-card label { font-size: 13px; font-weight: 700; color: #4d5647; display: flex; flex-direction: column; gap: 6px; }
.login-card input { padding: 11px 13px; border: 1.5px solid #d3d9d0; border-radius: 9px; font-size: 15px; }
.login-card input:focus { outline: 3px solid #f4cb30; border-color: #0c831f; }
.login-card .cta { width: 100%; }
.login-card .err { margin-bottom: 0; }
.hint { text-align: center; font-size: 12.5px; color: #8a9384; }
.hint a { color: #0c831f; }

@media (max-width: 700px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px; }
  .a-logo { padding: 0 10px 0 4px; font-size: 15px; }
  .sidebar nav { flex-direction: row; }
  .sidebar a { padding: 8px 10px; white-space: nowrap; font-size: 13px; }
  .admin-main { padding: 16px 12px; }
  .table { font-size: 12.5px; display: block; overflow-x: auto; }
}

/* ============ Admin mobile ============ */
@media (max-width: 700px) {
  .admin-shell { flex-direction: column; }
  .sidebar { position: static; width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; }
  .sidebar nav { flex-direction: row; }
  .sidebar a { white-space: nowrap; padding: 8px 12px; }
  .sidebar .panel-title { display: none; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .panel { padding: 12px; }
  .two-col, .two-col-inline, .cat-form, .cat-edit-form, .filter-row { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px !important; }
}

/* Delivery OTP + driver alert */
.cust-otp { background: #fff3e0; border: 2px dashed #f57c00; border-radius: 12px; padding: 14px 16px; font-size: 15px; margin: 10px 0; }
.cust-otp b { font-size: 22px; letter-spacing: 6px; color: #e65100; }
.otp-notify { background: #e8f5e9; border: 2px dashed #0c831f; border-radius: 12px; padding: 12px 16px; font-size: 16px; margin: 10px 0; }
.drv-alert { position: sticky; top: 0; background: #b3261e; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; z-index: 40; animation: pulse-red 1.2s infinite; }
.drv-alert.hidden { display: none; }
.drv-alert .da-link { color: #fff; font-weight: 800; text-decoration: underline; }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 6px rgba(179,38,30,.25); } }

/* ============ Vendor naya-order ALERT (voice + blink) ============ */
.vendor-alert { background: #b3261e; color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; animation: va-pulse 1.2s infinite; }
.vendor-alert.va-muted { background: #4d5647; animation: none; }
@keyframes va-pulse { 50% { box-shadow: 0 0 0 8px rgba(179,38,30,.22); } }
.va-head { font-size: 15.5px; margin-bottom: 8px; }
.va-row { font-size: 13.5px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.25); }
.va-call, .va-pack { color: #fff; font-weight: 800; text-decoration: underline; }
.va-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.va-btn { background: #fff; color: #b3261e; border: none; padding: 8px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.va-mute { background: rgba(255,255,255,.2); color: #fff; }

/* ============ Evening settlement — stat cards ============ */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: #fff; border: 1px solid #e9ebe7; border-radius: 14px; padding: 14px 16px; }
.stat-num { font-size: 22px; font-weight: 900; color: #0a6b19; }
.stat-lbl { font-size: 12.5px; color: #6d7767; margin-top: 3px; }

/* WhatsApp reminder banner */
.wa-remind { background: #7c3aed; color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.wa-remind.hidden { display: none; }
.wa-remind a { color: #fff; font-weight: 800; }
.warn { background: #fff8e1; border: 1.5px solid #f2c200; color: #7a5b00; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }

/* settings preview pills */
.pill { display:inline-block; background:#eef7ef; color:#136a1a; border:1px solid #bfe0c4; font-size:12px; font-weight:700; padding:2px 10px; border-radius:20px; margin:2px 3px; }

.va-timer { display:inline-block; font-weight:800; font-size:12.5px; background:rgba(255,255,255,.18); border-radius:20px; padding:1px 9px; }

/* approval / health badges */
.h-badge { display:inline-block; font-size:11.5px; font-weight:800; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.h-green { background:#e7f6e9; color:#136a1a; }
.h-yellow { background:#fff6e0; color:#8a5b00; }
.h-red { background:#fdecea; color:#b3261e; }
.alert-red { background:#fdecea; border:2px solid #e57373; color:#b3261e; border-radius:12px; padding:12px 16px; font-size:14px; }

/* ============ Admin/Vendor/Driver mobile pass v2 ============ */
@media (max-width: 820px) {
  .admin-shell { flex-direction: column; min-height: auto; }
  .sidebar { width: 100% !important; flex-direction: column !important; padding: 10px 12px !important; }
  .a-logo { padding: 0 0 8px !important; font-size: 16.5px; }
  .sidebar nav { flex-direction: row !important; overflow-x: auto; gap: 6px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .sidebar a { white-space: nowrap; padding: 9px 13px !important; font-size: 13.5px !important; border-radius: 10px; }
  .sidebar a.active { border-radius: 10px; }
  .sidebar a.logout { margin-top: 0; }
  .admin-main { padding: 16px 12px !important; max-width: 100% !important; }
  .admin-main h1 { font-size: 19px; margin-bottom: 12px; }
  .admin-main h2 { font-size: 16px; margin: 18px 0 10px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important; gap: 10px; }
  .stat { padding: 13px !important; }
  .s-num { font-size: 21px; }
  .s-label { font-size: 12px; }
  .two-col, .two-col-inline, .a-form .two-col { grid-template-columns: 1fr !important; }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .table th, .table td { padding: 9px 10px; font-size: 13px; }
  .detail-card, .cat-add, .panel { padding: 14px !important; }
  input, select, textarea { font-size: 16px !important; }
  .cta, button, .btn-plain, .cta.small { min-height: 42px; }
  .filter-row { gap: 6px; flex-wrap: wrap; }
  .cat-form, .cat-edit-form { flex-wrap: wrap; }
  .cat-edit-input { flex: 1 1 100% !important; min-width: 0 !important; }
  .a-form label { font-size: 13px; }
  .mini-thumb { width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr !important; }
  .sidebar a { font-size: 12.5px !important; padding: 8px 10px !important; }
  .admin-main h1 { font-size: 17.5px; }
}

/* Tables: swipe hint on mobile + compact */
@media (max-width: 700px) {
  .table::before, table.tbl::before { content: "👉 Swipe the table sideways to see the full data"; display: block; font-size: 11px; font-weight: 700; color: #8a9384; padding: 2px 2px 8px; white-space: normal; }
  .table th, .table td { padding: 8px 9px !important; font-size: 12.5px !important; }
  .table td.big { font-size: 18px !important; }
  .stats { gap: 8px !important; }
}
