/* ============================================
   MMCrow — Professional Dark UI v3.0
   Clean, sharp, trustworthy design system
   ============================================ */

:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #111219;
    --bg-tertiary: #16171f;
    --bg-card: #14151e;
    --bg-card-hover: #1a1b27;
    --bg-input: #111219;
    --bg-glass: rgba(20, 21, 30, 0.85);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(124, 58, 237, 0.6);
    --text-primary: #eeeef2;
    --text-secondary: #9395a5;
    --text-muted: #565870;
    --accent: #7c3aed;
    --accent-2: #2dd4bf;
    --accent-hover: #8b5cf6;
    --accent-glow: rgba(124, 58, 237, 0.2);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);
    --gradient-1: linear-gradient(135deg, #7c3aed, #2dd4bf);
    --gradient-2: linear-gradient(135deg, #7c3aed, #ec4899);
    --gradient-3: linear-gradient(135deg, #2dd4bf, #10b981);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --radius-xl: 20px;
    --transition: all 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    font-size: 14px;
}

::selection { background: rgba(124, 58, 237, 0.35); color: #fff; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ===== SUBTLE GRID BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: rgba(10, 11, 16, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.nav-brand:hover { color: var(--text-primary); }
.nav-brand-icon {
    width: 32px; height: 32px;
    background: var(--gradient-1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; color: white;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-link i { font-size: 0.9rem; }
.nav-icon-only span { display: none; }
.nav-admin { color: var(--danger); }
.nav-admin:hover { color: #f87171; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.nav-balance {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-2);
    background: rgba(45, 212, 191, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.nav-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.nav-avatar-default {
    background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.75rem;
}
.nav-avatar-link { display: flex; }

.mobile-nav-toggle {
    display: none;
    background: none; border: none;
    color: var(--text-primary); font-size: 1.2rem; cursor: pointer;
}

/* Notification Dropdown */
.notif-dropdown { position: relative; }
.notification-toggle {
    position: relative;
}
.notif-count {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: -50px;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
    overflow: hidden;
}
.notif-panel.open { display: block; }

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
}
.notif-mark-read {
    background: none; border: none;
    color: var(--accent); cursor: pointer;
    font-size: 0.75rem; font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}
.notif-mark-read:hover { background: var(--accent-glow); }

.notif-panel-body {
    max-height: 360px;
    overflow-y: auto;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    transition: var(--transition);
    text-decoration: none;
}
.notif-item:hover { background: rgba(255,255,255,0.03); color: var(--text-primary); }
.notif-dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}
.notif-content { flex: 1; min-width: 0; }
.notif-msg { font-size: 0.82rem; line-height: 1.4; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.notif-empty {
    padding: 2rem; text-align: center;
    color: var(--text-muted); font-size: 0.85rem;
}
.notif-empty i { font-size: 1.5rem; margin-bottom: 0.5rem; display: block; opacity: 0.4; }

/* ===== MAIN LAYOUT ===== */
main {
    padding-top: 72px;
    min-height: calc(100vh - 56px);
    position: relative;
    z-index: 1;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.container-md { max-width: 800px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.container-sm { max-width: 520px; margin: 0 auto; padding: 0 1.5rem 3rem; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-title i { color: var(--accent); font-size: 1.2rem; }
.page-title-admin i { color: var(--danger); }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}
.card-header i { color: var(--accent); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: white; }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #059669; border-color: #059669; color: white; }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: white; }

.btn-warning { background: var(--warning); color: #000; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #000; }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--border-hover); color: var(--text-primary); background: rgba(255,255,255,0.03); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: none; padding: 0.4rem 0.6rem; }
.btn-ghost:hover { color: var(--text-primary); }

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-lg { padding: 0.65rem 1.4rem; font-size: 0.9rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    padding: 0.3rem; font-size: 0.8rem;
    border-radius: 4px; transition: var(--transition);
}
.btn-icon:hover { color: var(--danger); }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-group-sm { display: flex; gap: 0.25rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { cursor: pointer; }
.form-hint { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-row { display: flex; align-items: center; justify-content: space-between; }

.char-counter { font-size: 0.72rem; color: var(--text-muted); }
.char-counter.warn { color: var(--danger); }

.file-upload-btn { cursor: pointer; }
.file-upload-btn input[type="file"] { display: none; }

.fee-preview {
    font-size: 0.75rem;
    color: var(--accent-2);
    margin-top: 0.3rem;
    min-height: 1.2em;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.alert i { flex-shrink: 0; }
.alert-error { background: var(--danger-bg); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: var(--success-bg); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }
.alert-warning { background: var(--warning-bg); color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.alert-info { background: var(--info-bg); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.stat-card-lg { padding: 1.25rem 1.5rem; }

.stat-icon {
    width: 40px; height: 40px;
    background: var(--accent-glow);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 1rem;
    flex-shrink: 0;
}
.stat-info { flex: 1; }
.stat-value { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== GRID LAYOUTS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}
.section-title i { color: var(--accent); font-size: 0.9rem; }

.section-heading {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
}

/* ===== BADGES ===== */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.badge-sm { padding: 0.1rem 0.4rem; font-size: 0.6rem; }

.badge-Moderator { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.badge-Pro\ Trader { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.badge-Beginner { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }

.badges-display {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-pending { background: rgba(245,158,11,0.15); color: #fcd34d; }
.status-accepted { background: rgba(59,130,246,0.15); color: #93c5fd; }
.status-completed, .status-resolved, .status-approved { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.status-disputed { background: rgba(239,68,68,0.15); color: #fca5a5; }
.status-cancelled, .status-rejected { background: rgba(107,114,128,0.15); color: #9ca3af; }
.status-cancel_pending { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-transfer { background: rgba(59,130,246,0.15); color: #93c5fd; }
.status-withdrawal { background: rgba(239,68,68,0.15); color: #fca5a5; }
.status-escrow_create { background: rgba(124,58,237,0.15); color: #c4b5fd; }
.status-escrow_release { background: rgba(16,185,129,0.15); color: #6ee7b7; }

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.tab {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
}
.tab-badge-danger { background: var(--danger); color: white; }
.tab-badge-warning { background: var(--warning); color: black; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
thead { background: var(--bg-secondary); }
th {
    padding: 0.6rem 0.85rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

.cell-amount { font-weight: 700; color: var(--text-primary); }
.cell-fee { color: var(--text-muted); font-size: 0.78rem; }
.cell-desc { font-size: 0.78rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-date { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.cell-address { font-family: monospace; font-size: 0.72rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.cell-user { font-weight: 600; }

/* ===== ESCROW CARDS ===== */
.escrow-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.escrow-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); color: inherit; }

.escrow-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.escrow-amount { font-size: 1.15rem; font-weight: 800; color: var(--accent-2); }
.escrow-desc { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.4rem; }
.escrow-parties { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.escrow-card-bottom { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); }
.escrow-link { font-weight: 800; font-size: 1rem; }

/* ===== ESCROW VIEW ===== */
.escrow-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.escrow-details-card { position: sticky; top: 72px; }
.escrow-details-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.escrow-title { font-size: 1.05rem; font-weight: 800; }
.escrow-date { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

.escrow-amount-display {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-2);
    margin: 1rem 0;
}
.escrow-fee-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
}

.escrow-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ===== DETAIL ROWS ===== */
.detail-list { display: flex; flex-direction: column; gap: 0; }
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }
.detail-label i { width: 14px; text-align: center; }
.detail-value { font-weight: 600; color: var(--text-primary); text-align: right; }
.detail-value-wrap { max-width: 200px; text-align: right; word-wrap: break-word; }

/* ===== UID DISPLAY ===== */
.uid-display {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.uid-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; display: block; }
.uid-row { display: flex; align-items: center; gap: 0.5rem; }
.uid-code {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-input);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ===== POST CARDS ===== */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
}
.post-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.post-avatar-default {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.8rem;
    flex-shrink: 0;
}
.post-meta { flex: 1; min-width: 0; }
.post-author-row { display: flex; align-items: center; gap: 0.4rem; }
.post-author { font-weight: 700; font-size: 0.85rem; color: var(--text-primary); }
.post-author:hover { color: var(--accent); }
.post-username { font-size: 0.75rem; color: var(--text-muted); }
.post-time { font-size: 0.7rem; color: var(--text-muted); }
.post-delete { margin-left: auto; }
.post-body { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; }
.post-body strong { color: var(--text-primary); }
.post-body code { background: var(--bg-input); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.8rem; }
.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    border: 1px solid var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 2rem; margin-bottom: 0.75rem; display: block; opacity: 0.3; }
.empty-state p { font-size: 0.85rem; }

/* ===== AUTH PAGES ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}
.auth-brand {
    text-align: center;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.auth-title { text-align: center; font-size: 1.4rem; font-weight: 800; margin-bottom: 0.25rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-footer a { margin-left: 0.3rem; }

/* ===== HERO ===== */
.hero {
    position: relative;
    text-align: center;
    padding: 4rem 1.5rem 3rem;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.15) 0%, transparent 60%);
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.25);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #c4b5fd;
    margin-bottom: 1.25rem;
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}
.hero-gradient {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}
.hero-stat {
    text-align: center;
}
.hero-stat strong {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
}
.hero-stat span {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== FEATURES ===== */
.features-section {
    padding: 3rem 0;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.feature-icon {
    width: 48px; height: 48px;
    margin: 0 auto 0.75rem;
    background: var(--accent-glow);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 1.2rem;
}
.feature-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* ===== FEES SECTION ===== */
.fees-section {
    padding: 2rem 0 3rem;
}
.fees-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.fee-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.fee-amount { font-size: 1.5rem; font-weight: 800; color: var(--accent-2); }
.fee-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ===== PROFILE ===== */
.profile-card { padding: 0; overflow: hidden; }
.profile-banner {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.profile-banner-default {
    width: 100%;
    height: 180px;
    background: var(--gradient-1);
    opacity: 0.4;
}
.profile-header {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 0 2rem;
    margin-top: -40px;
}
.profile-avatar {
    width: 88px; height: 88px;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
    object-fit: cover;
    flex-shrink: 0;
}
.profile-avatar-default {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2rem; font-weight: 800;
    border: 4px solid var(--bg-card);
    flex-shrink: 0;
}
.profile-info { padding-bottom: 1rem; }
.profile-name-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.profile-name-row h1 { font-size: 1.3rem; font-weight: 800; }
.profile-username { color: var(--text-muted); font-size: 0.85rem; }
.profile-stats { display: flex; gap: 1.5rem; margin-top: 0.5rem; }
.profile-stat { font-size: 0.82rem; color: var(--text-secondary); }
.profile-stat strong { color: var(--text-primary); font-weight: 700; }
.profile-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem 1.5rem;
    flex-wrap: wrap;
}

/* ===== SETTINGS ===== */
.avatar-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.settings-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.settings-avatar-default {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.6rem; font-weight: 800;
}
.avatar-hint { font-size: 0.78rem; color: var(--text-muted); }
.settings-banner { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.settings-banner-default { width: 100%; height: 140px; background: var(--gradient-1); opacity: 0.3; border-radius: var(--radius-sm); margin-bottom: 1rem; }

/* ===== SEARCH ===== */
.search-form { margin-bottom: 1.5rem; }
.search-bar { display: flex; gap: 0.5rem; }
.search-input { flex: 1; }

.user-list { display: flex; flex-direction: column; gap: 0.5rem; }
.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.user-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); color: inherit; }
.user-card-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-card-avatar-default {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.user-card-username { font-size: 0.78rem; color: var(--text-muted); }
.user-card-uid { font-size: 0.72rem; color: var(--text-muted); font-family: monospace; }

/* ===== DEPOSIT ===== */
.deposit-info { text-align: center; padding: 1.5rem; }
.deposit-icon { font-size: 2.5rem; color: var(--accent); margin-bottom: 1rem; }
.deposit-info h2 { margin-bottom: 0.5rem; }
.deposit-info p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.6; }

/* ===== CHAT SYSTEM ===== */
.chat-card {
    display: flex;
    flex-direction: column;
    min-height: 600px;
    padding: 0 !important;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.88rem;
}
.chat-header-left i { color: var(--accent); }
.chat-online {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.chat-dot {
    width: 6px; height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: chatDotPulse 2s infinite;
}
@keyframes chatDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}
.chat-empty i { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.3; }
.chat-empty p { font-size: 0.88rem; }
.chat-empty span { font-size: 0.75rem; }

.chat-msg {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.chat-msg-system {
    justify-content: center;
    padding: 0.3rem;
}
.chat-system-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.chat-msg-admin { background: rgba(239,68,68,0.05); border-radius: 8px; padding: 0.4rem; }
.chat-msg-avatar { flex-shrink: 0; }
.chat-avatar-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.chat-avatar-default {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.7rem; font-weight: 700;
}
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-meta { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.15rem; }
.chat-msg-name { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.chat-msg-name:hover { color: var(--accent); }
.chat-admin-name { color: #fca5a5 !important; }
.chat-msg-time { font-size: 0.65rem; color: var(--text-muted); }
.chat-msg-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; word-break: break-word; }

.chat-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}
.chat-locked {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.chat-input-form { display: flex; }
.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.35rem 0.35rem 0.75rem;
}
.chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font);
    resize: none;
    outline: none;
    max-height: 100px;
    line-height: 1.5;
}
.chat-send-btn {
    width: 34px; height: 34px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--accent-hover); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== ADMIN CHAT LIST ===== */
.chat-list { display: flex; flex-direction: column; gap: 0.5rem; }
.chat-list-item {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.chat-list-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); color: inherit; }
.chat-list-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.chat-list-escrow { font-weight: 800; }
.chat-list-parties { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.3rem; }
.chat-list-bottom { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); }

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    position: relative;
    z-index: 1;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-brand { font-weight: 800; font-size: 1rem; color: var(--text-primary); margin-bottom: 0.3rem; }
.footer-links { margin-top: 0.5rem; font-size: 0.72rem; }

/* ===== DIVIDER ===== */
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ===== FADE ANIMATION ===== */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.fade-in-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mobile-nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px; left: 0; right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.25rem;
    }
    .nav-links.open { display: flex; }
    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .fees-grid { grid-template-columns: repeat(2, 1fr); }
    .escrow-layout { grid-template-columns: 1fr; }
    .escrow-details-card { position: static; }

    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }

    .profile-header { flex-direction: column; align-items: flex-start; padding: 0 1.25rem; }
    .profile-actions { padding: 0 1.25rem 1.25rem; }

    .notif-panel { right: -20px; width: 300px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.6rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .fees-grid { grid-template-columns: 1fr 1fr; }
}
