/* ============================================================
OurMarket Admin — Design System v2
Fonts: Nunito (Global)
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

:root {
    --sidebar-bg: #0B1120;
    --sidebar-width: 262px;
    --accent: #00C67E;
    --accent-hover: #00A868;
    --accent-glow: rgba(0, 198, 126, 0.22);
    --accent-subtle: rgba(0, 198, 126, 0.09);
    --body-bg: #EDF1F8;
    --card-bg: #FFFFFF;
    --text-primary: #0F1B2D;
    --text-secondary: #334155;
    --text-muted: #7A8EAD;
    --border: #E1E9F5;
    --border-subtle: #F3F6FC;
    --success-bg: #ECFDF5;
    --success-text: #065F46;
    --danger: #E53E3E;
    --danger-bg: #FFF5F5;
    --danger-text: #9B1C1C;
    --warning-bg: #FFFBEB;
    --warning-text: #92400E;
    --purple-bg: #EDE9FE;
    --purple-text: #5B21B6;
    --shadow-xs: 0 1px 2px rgba(15, 27, 45, 0.04);
    --shadow-sm: 0 1px 4px rgba(15, 27, 45, 0.06), 0 1px 2px rgba(15, 27, 45, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 27, 45, 0.08), 0 2px 4px rgba(15, 27, 45, 0.04);
    --shadow-lg: 0 16px 48px rgba(15, 27, 45, 0.14), 0 4px 12px rgba(15, 27, 45, 0.06);
    --shadow-accent: 0 4px 18px rgba(0, 198, 126, 0.32);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--body-bg); color: var(--text-secondary); font-family: 'Nunito', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-family: 'Nunito', sans-serif; color: var(--text-primary); line-height: 1.3; }
a { color: inherit; text-decoration: none; }

.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }

.auth-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: radial-gradient(ellipse at 30% 60%, #132040 0%, #0B1120 60%); }
.auth-card { background: var(--card-bg); padding: 2.5rem; border-radius: var(--radius-xl); width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-card h1 { font-size: 1.55rem; margin-bottom: 0.35rem; }
.auth-card p { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9rem; }
.error-msg { color: var(--danger); margin-top: 1rem; font-size: 0.875rem; display: none; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.45rem; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-secondary); }
.form-control { width: 100%; padding: 0.65rem 0.9rem; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 0.9rem; font-family: 'Nunito', sans-serif; color: var(--text-primary); background: var(--card-bg); transition: var(--transition-fast); }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.6rem 1.2rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.875rem; font-family: 'Nunito', sans-serif; cursor: pointer; border: none; transition: var(--transition); white-space: nowrap; letter-spacing: 0.1px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-accent); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0, 198, 126, 0.42); }
.btn-auto-width { width: auto; }
.btn-secondary { background: var(--border-subtle); color: var(--text-secondary); border: 1.5px solid var(--border); flex: 1; }
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }
.btn-danger-sm { background: var(--danger-bg); color: var(--danger); padding: 0.28rem 0.65rem; font-size: 0.775rem; border-radius: var(--radius-sm); border: 1px solid rgba(229, 62, 62, 0.18); cursor: pointer; font-weight: 600; transition: var(--transition-fast); }
.btn-danger-sm:hover { background: #FED7D7; border-color: rgba(229, 62, 62, 0.35); }

.dashboard-layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; height: 100vh; overflow: hidden; }
.sidebar { background: var(--sidebar-bg); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; position: relative; }
.sidebar::after { content: ''; position: absolute; top: 0; right: 0; width: 1px; height: 100%; background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0.05) 70%, transparent 100%); pointer-events: none; }
.logo { display: flex; align-items: center; gap: 0.75rem; padding: 1.4rem 1.25rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.logo-mark { width: 30px; height: 30px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.7rem; color: #fff; letter-spacing: 0.5px; flex-shrink: 0; box-shadow: 0 3px 10px rgba(0, 198, 126, 0.45); }
.logo-text { font-family: 'Nunito', sans-serif; font-size: 0.95rem; font-weight: 700; color: #fff; letter-spacing: -0.2px; }
.nav-section { padding: 1rem 0.75rem 0.25rem; }
.nav-section-label { display: block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.1px; color: rgba(255,255,255,0.22); padding: 0 0.6rem; margin-bottom: 0.3rem; }
.nav-menu { list-style: none; }
.nav-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.58rem 0.75rem; border-radius: var(--radius-md); margin-bottom: 2px; cursor: pointer; color: rgba(255,255,255,0.42); font-size: 0.855rem; font-weight: 500; transition: var(--transition-fast); position: relative; -webkit-user-select: none; user-select: none; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.82); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 22%; height: 56%; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; box-shadow: 0 0 10px rgba(0,198,126,0.6); }
.nav-icon { display: flex; align-items: center; justify-content: center; width: 16px; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.05); }
.nav-item-danger { color: rgba(229, 62, 62, 0.65) !important; }
.nav-item-danger:hover { background: rgba(229, 62, 62, 0.08) !important; color: #fc8181 !important; }

.main-content { display: flex; flex-direction: column; overflow: hidden; background: var(--body-bg); }
.topbar { background: var(--card-bg); padding: 0 2rem; height: 60px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; box-shadow: var(--shadow-xs); }
.topbar-left { display: flex; align-items: baseline; gap: 0.45rem; }
.topbar-title { font-size: 0.875rem; font-family: 'Nunito', sans-serif; font-weight: 400; color: var(--text-muted); }
.admin-name { font-family: 'Nunito', sans-serif; font-size: 0.975rem; font-weight: 700; color: var(--text-primary); }
.user-profile { display: flex; align-items: center; gap: 0.75rem; }
.avatar { width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), #00A868); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; box-shadow: 0 2px 8px rgba(0, 198, 126, 0.35); cursor: pointer; transition: var(--transition-fast); }
.avatar:hover { transform: scale(1.06); }
.content-area { padding: 1.75rem 2rem; flex: 1; overflow-y: auto; }
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.2rem; }
.page-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header-flex h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.2rem; }

.card { background: var(--card-bg); padding: 1.4rem 1.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 1.5rem; }
.card-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { border-bottom: 1.5px solid var(--border); }
.data-table th { padding: 0.65rem 0.85rem; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.75px; text-align: left; white-space: nowrap; }
.data-table tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background var(--transition-fast); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #FAFBFE; }
.data-table td { padding: 0.8rem 0.85rem; font-size: 0.875rem; color: var(--text-secondary); vertical-align: middle; }
.text-muted-col { color: var(--text-muted); }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(11, 17, 32, 0.58); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(5px); justify-content: center; align-items: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--card-bg); padding: 2rem; border-radius: var(--radius-xl); width: 100%; max-width: 500px; max-height: 87vh; overflow-y: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: modalSlideIn 0.2s cubic-bezier(0.34, 1.26, 0.64, 1); }
@keyframes modalSlideIn { from { transform: translateY(14px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-primary); }
.permissions-label { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 0.75rem; display: block; color: var(--text-secondary); }
.permissions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.permission-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; padding: 0.35rem 0; color: var(--text-secondary); }
.permission-item input[type="checkbox"] { accent-color: var(--accent); }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.75rem; }
.modal-actions .btn { flex: 1; }

select.form-control { appearance: none; background-color: var(--card-bg); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%237A8EAD' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.6rem center; background-repeat: no-repeat; background-size: 1.2em 1.2em; padding-right: 2.5rem; cursor: pointer; }

.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.45px; white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(6, 95, 70, 0.12); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid rgba(155, 28, 28, 0.12); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid rgba(146, 64, 14, 0.12); }
.badge-super { background: var(--purple-bg); color: var(--purple-text); border: 1px solid rgba(91, 33, 182, 0.12); }

.search-bar-container { max-width: 380px; margin-bottom: 1.25rem; }
.seller-section { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: 0.5rem; }
.seller-section-title { margin-bottom: 0.9rem; font-size: 0.875rem; color: var(--text-secondary); }

.product-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border); }
.product-thumb-placeholder { width: 44px; height: 44px; background: var(--border-subtle); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.1rem; }
.product-name { font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.product-business { font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }
.product-sku { font-size: 0.75rem; color: var(--text-muted); font-family: 'Nunito', sans-serif; }
.product-price { font-weight: 600; color: var(--text-primary); font-family: 'Nunito', sans-serif; }
.product-stock { font-size: 0.8rem; color: var(--text-muted); }

.product-modal { max-width: 800px; }
.product-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.product-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.product-main-image { width: 100%; max-height: 280px; object-fit: contain; background: var(--border-subtle); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 0.75rem; }
.product-thumbnails { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.product-thumb-clickable { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; border: 2px solid transparent; transition: var(--transition-fast); }
.product-thumb-clickable:hover { border-color: var(--accent); opacity: 0.88; }
.product-thumb-clickable.active { border-color: var(--accent); }
.product-details-scroll { font-size: 0.875rem; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.product-detail-row { display: flex; flex-direction: column; margin-bottom: 0.7rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--border-subtle); }
.product-detail-row:last-child { border-bottom: none; margin-bottom: 0; }
.product-detail-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.55px; color: var(--text-muted); margin-bottom: 0.18rem; }
.product-detail-value { color: var(--text-primary); font-weight: 500; }
.product-price-box { background: var(--border-subtle); padding: 0.85rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; border: 1px solid var(--border); }
.product-divider { margin: 1rem 0; border: none; border-top: 1px solid var(--border); }
.product-section-title { margin-bottom: 0.75rem; font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }

.modal-close-x { padding: 0.28rem 0.58rem; font-size: 1.05rem; line-height: 1; flex-shrink: 0; width: auto; background: var(--border-subtle); border: 1.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); }
.modal-close-x:hover { background: var(--border); color: var(--text-primary); }

.user-modal-grid { display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; align-items: start; }
.user-image-container { text-align: center; }
.user-profile-image { border-radius: var(--radius-xl); width: 120px; height: 120px; object-fit: cover; background: var(--border-subtle); border: 2px solid var(--border); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card-bg); border-radius: var(--radius-lg); padding: 1.2rem 1.4rem; border: 1px solid var(--border); box-shadow: var(--shadow-xs); display: flex; align-items: center; gap: 1rem; transition: var(--transition); cursor: default; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(0, 198, 126, 0.18); }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-icon.blue { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.stat-icon.green { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.stat-icon.yellow { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.stat-icon.red { background: linear-gradient(135deg, #FEE2E2, #FECACA); }
.stat-icon.purple { background: linear-gradient(135deg, #EDE9FE, #DDD6FE); }
.stat-info h4 { font-family: 'Nunito', sans-serif; font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.65px; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-info .stat-number { font-family: 'Nunito', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1; }

.quick-actions-card { margin-top: 0; }
.quick-actions-desc { margin-bottom: 1rem; font-size: 0.875rem; }
.quick-actions-container { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.quick-actions-container .btn { flex: 0 0 auto; width: auto; padding: 0.58rem 1.2rem; }

.audit-modal { max-width: 620px; }
.audit-target-id { font-family: 'Nunito', sans-serif; font-size: 0.78rem; word-break: break-all; color: var(--text-muted); background: var(--border-subtle); padding: 0.15rem 0.4rem; border-radius: var(--radius-sm); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }

/* ==========================================
   CUSTOM APPENDAGES (Dispute Workspace & Audit)
   ========================================== */
.dispute-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; height: 75vh; }
.dispute-chat-pane { background: var(--border-subtle); border-radius: var(--radius-lg); border: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.dispute-chat-header { padding: 15px; background: var(--card-bg); border-bottom: 1px solid var(--border); font-weight: 600; }
.dispute-chat-messages { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; line-height: 1.4; word-wrap: break-word; }
.chat-bubble.buyer { background: #DBEAFE; color: #1E3A8A; align-self: flex-start; border-bottom-left-radius: 2px; }
.chat-bubble.seller { background: #D1FAE5; color: #065F46; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-bubble.admin { background: #FEF3C7; color: #92400E; align-self: center; border: 1px dashed #D97706; text-align: center; font-style: italic; max-width: 90%; }
.chat-sender { font-size: 0.7rem; font-weight: 600; margin-bottom: 4px; opacity: 0.8; }
.dispute-resolution-pane { background: var(--card-bg); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 20px; overflow-y: auto; display: flex; flex-direction: column; }
.resolution-section { margin-bottom: 20px; }
.resolution-section h4 { margin-bottom: 10px; font-size: 1rem; color: var(--text-primary); border-bottom: 1px solid var(--border-subtle); padding-bottom: 5px; }
.split-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dispute-workspace-padded { padding: 20px; }
.dispute-modal-header { padding: 15px 20px; border-bottom: 1px solid var(--border); }
.dispute-inject-container { display: flex; gap: 10px; }
.dispute-action-container { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.btn-seller-release { background-color: #059669 !important; border-color: #059669 !important; color: #fff !important; }
.btn-buyer-refund { background-color: #2563EB !important; border-color: #2563EB !important; color: #fff !important; }
.btn-split-resolve { background-color: #D97706 !important; border-color: #D97706 !important; color: #fff !important; }
.participants-toggle { padding: 4px 8px; font-size: 0.8rem; background: var(--border-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); }
.participants-bar { margin-top: 10px; font-size: 0.85rem; background: var(--card-bg); padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--border); display: none; }
.participants-bar.active { display: block; }
.participant-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.participant-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--border); }
.participant-role-badge { font-size: 0.7rem; padding: 2px 6px; border-radius: var(--radius-sm); background: #DBEAFE; color: #1E40AF; font-weight: 600; margin-left: auto; }
.chat-header-layout { display: flex; flex-direction: column; gap: 8px; }
.chat-header-row { display: flex; justify-content: space-between; align-items: center; }
.dispute-modal-content { max-width: 1100px; width: 95%; padding: 0; }
.dispute-filter-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.dispute-filter-tabs .btn-secondary.active-filter { background: var(--accent); color: #fff; border-color: var(--accent); }
.dispute-inject-mt { margin-top: 10px; }
.attachment-preview { margin-top: 8px; font-size: 0.85rem; color: var(--accent); font-weight: 500; }
.participant-initiator-badge { font-size: 0.65rem; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger-text); font-weight: 700; margin-left: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.audit-details-scroll { max-height: 60vh; }

/* Login Page Header Layout */
.auth-header-row { display: flex; align-items: center; gap: 12px; margin-bottom: 1.5rem; }
.auth-logo-text { color: var(--text-primary, #111827); font-size: 1.25rem; font-weight: 600; }

/* User Details/Edit Modal Layout */
.user-edit-modal-content { max-width: 900px; }
.user-edit-modal-scroll { max-height: 75vh; }
.user-edit-modal-actions { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.user-edit-actions-col { flex-direction: column; gap: 1rem; }
.user-edit-note-group { margin-bottom: 0; width: 100%; }
.user-edit-note-label { font-size: 0.75rem; margin-bottom: 0.25rem; display: block; text-transform: none; letter-spacing: 0; color: var(--text-secondary); }
.user-edit-save-btn { width: 100%; }

/* ==========================================
   MODAL LAYOUT CLASSES (Replaces Inline Styles)
   ========================================== */
.modal-scroll-lg { 
    max-height: 75vh; 
}
.modal-actions-bordered {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
.modal-width-lg { 
    max-width: 950px; 
}
/* Customer Support Layout */
.support-layout { display: grid; grid-template-columns: 350px 1fr; gap: 1.5rem; height: calc(100vh - 180px); }
.support-sidebar { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.support-convo-list { flex: 1; overflow-y: auto; }
.support-convo-item { padding: 1rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; display: flex; gap: 0.75rem; align-items: center; transition: background 0.2s; }
.support-convo-item:hover { background: var(--border-subtle); }
.support-convo-item.active { background: var(--accent-subtle); border-left: 3px solid var(--accent); }
.support-convo-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--border); flex-shrink: 0; }
.support-convo-details { flex: 1; overflow: hidden; }
.support-convo-name { font-weight: 600; color: var(--text-primary); display: flex; justify-content: space-between; }
.support-convo-preview { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-unread-badge { background: var(--accent); color: white; font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; font-weight: bold; }

.support-chat-area { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.support-chat-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--border-subtle); }
.support-chat-header h3 { margin: 0; font-size: 1.1rem; color: var(--text-primary); }
.support-chat-messages { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; background: #F8FAFC; }
.support-msg { max-width: 70%; padding: 0.75rem 1rem; border-radius: 12px; font-size: 0.95rem; line-height: 1.4; word-wrap: break-word; }
.support-msg.customer { background: #E2E8F0; color: #1E293B; align-self: flex-start; border-bottom-left-radius: 2px; }
.support-msg.admin { background: var(--accent); color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
.support-msg-time { font-size: 0.7rem; opacity: 0.6; margin-top: 4px; display: block; text-align: right; }

.support-chat-input { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; align-items: flex-end; background: var(--card-bg); }
.support-chat-input textarea { flex: 1; resize: none; }
/* ==========================================
   AML & SUPPORT MODAL CLASSES (Replaces Inline Styles)
   ========================================== */
.aml-modal-width { 
    max-width: 700px; 
}
.aml-details-box {
    margin-bottom: 1rem; 
    padding: 1rem; 
    background: var(--border-subtle); 
    border-radius: 8px;
}
.aml-actions-container {
    display: flex; 
    gap: 10px; 
    margin-bottom: 1.5rem; 
    flex-wrap: wrap; 
}
.aml-history-scroll {
    max-height: 300px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    padding: 1rem;
}
.aml-clear-btn {
    background: #059669; 
    border-color: #059669;
}
.aml-review-btn {
    background: #D97706; 
    border-color: #D97706; 
    color: white;
}
.support-loading-msg {
    margin-top: 2rem;
}
.support-empty-msg {
    margin-top: 5rem;
}
/* Customer Support Placeholder Spacing */
.support-loading-msg {
    margin-top: 2rem;
}
.support-empty-msg {
    margin-top: 5rem;
}
/* Support Search & Tabs */
.support-search-box { padding: 1rem; border-bottom: 1px solid var(--border); position: relative; }
.support-search-results { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--border); border-radius: 8px; max-height: 300px; overflow-y: auto; z-index: 10; box-shadow: var(--shadow-md); }
.support-search-item { padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border-subtle); display: flex; gap: 0.75rem; align-items: center; }
.support-search-item:hover { background: var(--border-subtle); }
.support-search-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.support-tabs { display: flex; border-bottom: 1px solid var(--border); }
.support-tab { flex: 1; padding: 0.75rem; background: none; border: none; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.support-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.support-action-btns { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.support-load-more { text-align: center; padding: 0.5rem; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 0.85rem; }
.support-load-more:hover { text-decoration: underline; }
/* Inventory Stats - Handle long numbers */
.stat-card .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
}

/* Responsive font size for stat numbers */
@media (max-width: 768px) {
    .stat-card .stat-number {
        font-size: 1.1rem;
    }
}

/* For very long numbers like ₦123,456,789.00 */
.stat-card {
    min-width: 0;
    overflow: hidden;
}

.stat-card .stat-info {
    min-width: 0;
    overflow: hidden;
}

.stat-card .stat-info h4 {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Inventory Stats Grid - Exactly 3 columns */
#view-inventory .stats-grid,
.stats-grid.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    #view-inventory .stats-grid,
    .stats-grid.inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    #view-inventory .stats-grid,
    .stats-grid.inventory-grid {
        grid-template-columns: 1fr;
    }
}
/* ==========================================
   UTILITY CLASSES (Replaces Inline Styles)
   ========================================== */
.mb-20 { margin-bottom: 20px; }
.mb-15 { margin-bottom: 15px; }
.mb-16 { margin-bottom: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-10 { margin-bottom: 10px; }

/* Specificity override for smaller stat numbers */
.stat-card .stat-number-sm { 
    font-size: 1.2rem; 
    word-break: break-all; 
}
.text-muted.text-muted-xs { 
    font-size: 0.7rem; 
}

/* Custom Stat Icon Colors */
.stat-icon.orange { background: #F59E0B; color: white; }
.stat-icon.purple-custom { background: #8B5CF6; color: white; }
.stat-icon.blue-custom { background: #3B82F6; color: white; }
.stat-icon.red-custom { background: #EF4444; color: white; }
.stat-icon.pink { background: #EC4899; color: white; }
.stat-icon.emerald { background: #10B981; color: white; }

/* Layout & Form Utilities */
.flex-filter-bar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.form-group-inline { margin-bottom: 0; min-width: 150px; }
.label-sm { font-size: 0.8rem; }
.form-control-sm { padding: 8px 12px; }
.btn-height-38 { height: 38px; }
.btn-height-42 { height: 42px; }
.search-bar-inline { flex: 1; min-width: 200px; margin-bottom: 0; }
.flex-1 { flex: 1; }

/* Dispute & Escrow Utilities */
.dispute-controls-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.dispute-filter-tabs-compact { display: flex; gap: 8px; }
.dispute-filter-tabs-wrap { margin-bottom: 15px; flex-wrap: wrap; gap: 8px; }
.sort-select { margin-left: auto; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-primary); font-size: 0.85rem; cursor: pointer; }

/* Support Chat Utilities */
.btn-respond { width: 100%; margin-bottom: 10px; background: #2563EB; border-color: #2563EB; color: #fff; }
.btn-respond:hover { background: #1D4ED8; border-color: #1D4ED8; }
.input-row { display: flex; gap: 10px; align-items: flex-end; }
.btn-end-chat { background: #DC2626; color: white; border: none; white-space: nowrap; }
.btn-end-chat:hover { background: #B91C1C; color: white; }

/* Analytics Utilities */
.analytics-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.btn-sort-toggle { margin-left: auto; font-size: 0.85rem; }
.analytics-search-bar { margin-bottom: 15px; display: flex; gap: 10px; align-items: flex-end; }
/* ==========================================
   LOGO STYLES
   ========================================== */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.4rem 1.25rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

/* If you want a larger logo */
.logo-image-lg {
    width: 40px;
    height: 40px;
}

/* For dark sidebar, if logo is dark, add this */
.logo-image-white {
    filter: brightness(0) invert(1);
}

.logo-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
}
/* ==========================================
   PROFILE DROPDOWN MENU
   ========================================== */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), #00A868);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 198, 126, 0.35);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative; 
    -webkit-user-select: none;    /* ✅ Safari support */
    user-select: none;  
}

.avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(0, 198, 126, 0.5);
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 280px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 1001;
    animation: dropdownSlideIn 0.2s cubic-bezier(0.34, 1.26, 0.64, 1);
    overflow: hidden;
}

.profile-dropdown.hidden {
    display: none !important;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Click outside overlay */
.profile-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: transparent;
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--border-subtle);
}

.profile-dropdown-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), #00A868);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-dropdown-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.profile-dropdown-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.profile-dropdown-menu {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.profile-dropdown-menu li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.profile-dropdown-menu li:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.profile-dropdown-danger:hover {
    background: var(--danger-bg) !important;
    color: var(--danger) !important;
}

.dropdown-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* ==========================================
   PASSWORD CHANGE MODAL
   ========================================== */
.password-change-modal {
    max-width: 480px;
    padding: 2rem;
}

.password-change-modal .logo-mark {
    width: 40px;
    height: 40px;
    background: #F59E0B;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.password-change-modal .auth-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.password-strength {
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.password-strength-text {
    font-size: 0.75rem;
    display: block;
    margin-top: 4px;
}

.password-change-modal .error-msg {
    color: var(--danger);
    margin-top: 0.5rem;
    font-size: 0.875rem;
    display: none;
    padding: 0.5rem;
    background: var(--danger-bg);
    border-radius: 6px;
    border: 1px solid rgba(229, 62, 62, 0.2);
}

.password-change-modal .error-msg.error-danger {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger-text);
}

.password-change-modal .error-msg.error-success {
    background: var(--success-bg);
    border-color: var(--success-text);
    color: var(--success-text);
}

/* Prevent modal from being closed */
#passwordChangeModal .modal-overlay {
    -webkit-backdrop-filter: blur(8px);  /* Safari 9+ */
    backdrop-filter: blur(8px);     
}

#passwordChangeModal .modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.26, 0.64, 1);
}

/* Requirement check styles */
.password-change-modal .req-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.password-change-modal .req-valid {
    color: var(--success-text);
}

.password-change-modal .req-valid .req-icon {
    opacity: 1;
    color: var(--accent);
}
/* ==========================================
   PERMISSIONS DISPLAY
   ========================================== */
.permissions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.permission-category-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    margin-top: 0.5rem;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--border-subtle);
    border-radius: var(--radius-sm);
}

.permission-category-icon {
    font-size: 1rem;
}

.permission-category-name {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permission-category-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.permission-item:hover {
    background: var(--border-subtle);
    border-color: var(--border);
}

.permission-item input[type="checkbox"] {
    margin-top: 0.15rem;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.permission-item span {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.permission-item .permission-desc {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.permission-item strong {
    font-weight: 600;
    color: var(--text-primary);
}
/* In style.css */
.nav-item {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.nav-item[style*="display: none"] {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
}