:root {
  --primary: #1a56db;
  --primary-dark: #1342b0;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1a56db;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --so-green: #059669;
  --so-green-light: #d1fae5;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter','Noto Sans Bengali',sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* Navbar */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--primary); }
.nav-brand i { font-size: 22px; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.badge-role { background: var(--primary); color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.btn-logout { color: var(--danger); font-size: 18px; text-decoration: none; }

/* Layout */
.layout { display: flex; min-height: calc(100vh - 60px); }

/* Sidebar */
.sidebar { width: 220px; background: var(--sidebar-bg); min-height: 100%; padding: 20px 0; flex-shrink: 0; }
.sidebar ul { list-style: none; }
.sidebar ul li a { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; transition: all 0.2s; }
.sidebar ul li a:hover, .sidebar ul li a.active { background: rgba(26,86,219,0.15); color: #fff; border-left: 3px solid var(--sidebar-active); }
.sidebar ul li a i { width: 18px; text-align: center; }

/* Main */
.main-content { flex: 1; padding: 28px; overflow-x: auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 22px; font-weight: 700; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 10px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0; }
.stat-icon.blue { background: var(--primary); }
.stat-icon.green { background: var(--success); }
.stat-icon.orange { background: var(--warning); }
.stat-icon.red { background: var(--danger); }
.stat-icon.purple { background: #7c3aed; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-value { font-size: 24px; font-weight: 700; }

/* Progress */
.progress-wrap { background: var(--border); border-radius: 50px; height: 10px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 50px; background: var(--primary); transition: width 0.5s; }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #f8fafc; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
tbody tr:hover { background: #f8fafc; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 7px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form-control { padding: 9px 12px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; outline: none; transition: border 0.2s; width: 100%; }
.form-control:focus { border-color: var(--primary); }
.form-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-received  { background: #dcfce7; color: #166534; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-partial   { background: #fef3c7; color: #92400e; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-approved  { background: #dcfce7; color: #166534; }
.badge-rejected  { background: #fee2e2; color: #991b1b; }
.badge-verified  { background: #dbeafe; color: #1e40af; }
.badge-active    { background: #dcfce7; color: #166534; }
.badge-inactive  { background: #f1f5f9; color: #64748b; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--primary); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1a56db 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 42px; color: var(--primary); }
.login-logo h1 { font-size: 22px; font-weight: 700; margin-top: 8px; }
.login-logo p { color: var(--text-muted); font-size: 13px; }

/* Live tracking dot */
.live-dot { display: inline-block; width: 8px; height: 8px; background: var(--success); border-radius: 50%; margin-right: 5px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.3)} }

/* Map container */
#liveMap { width: 100%; height: 450px; border-radius: var(--radius); border: 1px solid var(--border); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SO MOBILE-FIRST STYLES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.so-body { background: #f0fdf4; min-height: 100vh; padding-bottom: 80px; font-family: 'Inter','Noto Sans Bengali',sans-serif; }

/* SO Top Navbar */
.so-navbar { background: var(--so-green); color: #fff; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.so-navbar .so-nav-title { font-size: 17px; font-weight: 700; }
.so-navbar .so-nav-right { display: flex; align-items: center; gap: 12px; }
.so-nav-icon { color: #fff; font-size: 20px; text-decoration: none; }

/* SO Bottom Nav */
.so-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); display: flex; z-index: 200; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); }
.so-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px; text-decoration: none; color: var(--text-muted); font-size: 10px; gap: 4px; transition: color 0.2s; }
.so-nav-item i { font-size: 20px; }
.so-nav-item.active { color: var(--so-green); }
.so-nav-item.active i { transform: scale(1.1); }

/* SO Dashboard Stat Cards */
.so-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.so-stat { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.so-stat-icon { font-size: 22px; margin-bottom: 8px; }
.so-stat-val { font-size: 26px; font-weight: 700; color: var(--text); }
.so-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* SO Target Card */
.so-target-card { margin: 0 16px 16px; background: linear-gradient(135deg, var(--so-green), #047857); border-radius: 16px; padding: 20px; color: #fff; }
.so-target-title { font-size: 13px; opacity: 0.85; margin-bottom: 4px; }
.so-target-pct { font-size: 38px; font-weight: 700; }
.so-target-bar-bg { background: rgba(255,255,255,0.3); border-radius: 50px; height: 8px; margin: 12px 0 8px; }
.so-target-bar { background: #fff; height: 8px; border-radius: 50px; transition: width 0.5s; }
.so-target-detail { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.9; }

/* SO Section Header */
.so-section { padding: 0 16px; margin-bottom: 16px; }
.so-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }

/* SO Quick Actions */
.so-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.so-action-btn { background: #fff; border-radius: 14px; padding: 16px 12px; text-align: center; text-decoration: none; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform 0.15s; }
.so-action-btn:active { transform: scale(0.97); }
.so-action-btn i { font-size: 26px; }
.so-action-btn span { font-size: 12px; font-weight: 600; }

/* SO Order Card */
.so-order-card { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.so-order-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.so-order-no { font-size: 13px; font-weight: 700; color: var(--primary); }
.so-order-shop { font-size: 13px; color: var(--text); }
.so-order-meta { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; }
.so-order-amount { font-size: 15px; font-weight: 700; color: var(--so-green); }

/* SO Place Order Form */
.so-form { padding: 0 16px; }
.so-form-card { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.so-form-card-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.so-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; display: block; }
.so-input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; outline: none; background: #fff; }
.so-input:focus { border-color: var(--so-green); }
.so-select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; outline: none; background: #fff; appearance: none; }
.so-select:focus { border-color: var(--so-green); }
.so-product-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.so-product-name { flex: 1; font-size: 14px; font-weight: 500; }
.so-product-price { font-size: 12px; color: var(--text-muted); }
.so-qty-btn { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--so-green); background: #fff; color: var(--so-green); font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; flex-shrink: 0; }
.so-qty-val { width: 40px; text-align: center; font-size: 16px; font-weight: 700; border: none; outline: none; }
.so-total-bar { position: fixed; bottom: 65px; left: 0; right: 0; background: var(--so-green); color: #fff; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; z-index: 150; }
.so-total-label { font-size: 13px; opacity: 0.85; }
.so-total-amount { font-size: 20px; font-weight: 700; }
.so-submit-btn { width: calc(100% - 32px); margin: 0 16px 16px; background: var(--so-green); color: #fff; border: none; border-radius: 12px; padding: 16px; font-size: 16px; font-weight: 700; cursor: pointer; }
.so-submit-btn:active { background: #047857; }

/* SO Shop List */
.so-shop-card { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 14px; }
.so-shop-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--so-green-light); display: flex; align-items: center; justify-content: center; color: var(--so-green); font-size: 18px; flex-shrink: 0; }
.so-shop-name { font-size: 14px; font-weight: 600; }
.so-shop-area { font-size: 12px; color: var(--text-muted); }

/* SO Check-in Button */
.so-checkin-btn { background: var(--so-green); color: #fff; border: none; border-radius: 12px; padding: 14px 24px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 12px; }
.so-checkout-btn { background: var(--warning); color: #fff; border: none; border-radius: 12px; padding: 14px 24px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 8px; }

/* Location Status */
.loc-status { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 10px 16px; background: var(--so-green-light); border-radius: 10px; margin: 0 16px 14px; }
.loc-status.off { background: #fee2e2; color: #991b1b; }
.loc-status.on { color: var(--so-green); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 18px; }
}
