/* ============================================================
   MG Delivery App — CSS
   Exact same design as Laravel delivery system
   ============================================================ */

:root {
    --primary:       #6366f1;
    --primary-light: #e0e7ff;
    --success:       #22c55e;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --dark:          #1e293b;
    --muted:         #94a3b8;
    --bg:            #f1f5f9;
    --card:          #ffffff;
    --bottom-nav-h:  68px;
    --indigo:        #4338ca;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: var(--bottom-nav-h);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Top Header ──────────────────────────────────────────── */
.deli-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
}
.deli-header h6 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    flex: 1;
}
.back-btn {
    color: #fff;
    font-size: 18px;
    text-decoration: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.deli-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.4);
}

/* Availability Toggle */
.availability-toggle {
    width: 48px;
    height: 26px;
    border-radius: 13px;
    border: none;
    position: relative;
    cursor: pointer;
    transition: background .3s;
    flex-shrink: 0;
}
.availability-toggle.online  { background: var(--success); }
.availability-toggle.offline { background: #94a3b8; }
.availability-toggle span {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    transition: left .3s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.availability-toggle.online  span { left: 25px; }
.availability-toggle.offline span { left: 3px; }

/* ── Bottom Navigation ───────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    z-index: 200;
    height: var(--bottom-nav-h);
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    padding: 8px 0;
    transition: color .2s;
}
.bottom-nav a.active,
.bottom-nav a:hover { color: var(--primary); }
.bottom-nav a i { font-size: 20px; }
.badge-dot-red {
    position: absolute;
    top: -3px;
    right: -5px;
    width: 9px;
    height: 9px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* ── Cards ───────────────────────────────────────────────── */
.deli-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    margin: 12px 16px;
    overflow: hidden;
}
.deli-card-body { padding: 16px; }

/* ── Status Pills ────────────────────────────────────────── */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.status-1 { background: #dbeafe; color: #1d4ed8; }
.status-2 { background: #e0e7ff; color: #4338ca; }
.status-3 { background: #fee2e2; color: #dc2626; }
.status-4 { background: #fef3c7; color: #d97706; }
.status-5 { background: #fef3c7; color: #d97706; }
.status-6 { background: #dcfce7; color: #15803d; }
.status-7 { background: #fee2e2; color: #dc2626; }
.status-8 { background: #f1f5f9; color: #64748b; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-deli {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 15px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: opacity .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-deli:hover { opacity: .9; color: #fff; text-decoration: none; }
.btn-deli:disabled { opacity: .5; cursor: not-allowed; }
.btn-deli.mb-3 { margin-bottom: 12px; }

.btn-deli-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 13px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-deli-outline:hover { background: var(--primary-light); }

.btn-deli-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 15px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Toast ───────────────────────────────────────────────── */
.deli-toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    display: none;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.deli-toast.show {
    display: block;
    animation: deliToastAnim 3.2s forwards;
}
@keyframes deliToastAnim {
    0%   { opacity:0; transform:translateX(-50%) translateY(-10px); }
    12%  { opacity:1; transform:translateX(-50%) translateY(0); }
    75%  { opacity:1; }
    100% { opacity:0; }
}

/* ── Stats Row ───────────────────────────────────────────── */
.deli-stats-row {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
    padding: 16px;
}
.deli-stat-card {
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 14px;
}
.deli-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 18px;
}
.deli-stat-val   { font-size: 20px; font-weight: 800; color: var(--dark); }
.deli-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }

/* ── Tabs ────────────────────────────────────────────────── */
.deli-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 56px;
    z-index: 50;
}
.deli-tab {
    flex: 1;
    text-align: center;
    padding: 13px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all .2s;
}
.deli-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ── Timeline ────────────────────────────────────────────── */
.deli-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
}
.deli-timeline-line {
    position: absolute;
    top: 17px;
    left: 8%;
    right: 8%;
    height: 3px;
    background: #e2e8f0;
    z-index: 0;
}
.deli-timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}
.deli-timeline-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    font-size: 14px;
    transition: all .3s;
}
.deli-timeline-dot.done { background: var(--primary); color: #fff; }
.deli-timeline-label { font-size: 10px; font-weight: 600; color: var(--muted); }
.deli-timeline-label.done { color: var(--primary); }

/* ── Navigate Button ─────────────────────────────────────── */
.navigate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--indigo);
    padding: 13px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

/* ── Info Rows ───────────────────────────────────────────── */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.info-row span:first-child { color: var(--muted); }
.info-row:last-child { border-bottom: none; }

/* ── Form Fields (small) ─────────────────────────────────── */
.mg-field-sm { margin-bottom: 12px; }
.mg-field-sm label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--dark);
}
.mg-field-sm .form-control,
.mg-field-sm .form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    font-size: 14px;
}

/* ── Page Content ────────────────────────────────────────── */
.page-content { padding-bottom: 8px; }

/* ── Login Shortcode ─────────────────────────────────────── */
.mg-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
}
.mg-login-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(99,102,241,.12);
    padding: 36px 28px;
    width: 100%;
    max-width: 420px;
}
.mg-login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg,#6366f1,#8b5cf6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: #fff;
}
.mg-login-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    text-align: center;
    margin: 0 0 4px;
}
.mg-login-sub {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 24px;
}
.mg-alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.mg-alert-error { background: #fee2e2; color: #dc2626; }
.mg-alert-success { background: #dcfce7; color: #15803d; }
.mg-login-form .mg-field { margin-bottom: 14px; }
.mg-login-form .mg-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--dark);
}
.mg-login-form .mg-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border .2s;
    box-sizing: border-box;
}
.mg-login-form .mg-field input:focus { border-color: var(--primary); }
.mg-pwd-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.mg-pwd-wrap input { flex: 1; padding-right: 44px; }
.mg-pwd-wrap button {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
}
.mg-btn-primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .2s;
}
.mg-btn-primary:hover { opacity: .9; }

/* ── Utilities ───────────────────────────────────────────── */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-primary-deli { color: var(--primary); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .deli-stats-row { grid-template-columns: repeat(2,1fr); gap: 10px; padding: 12px; }
    .deli-stat-val  { font-size: 18px; }
}
