@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   FLIXO – Premium Modern SaaS Theme (Vercel/Linear Inspired)
   ========================================================================== */

:root {
    /* Backgrounds */
    --bg:          #F8FAFC; /* Slate 50 */
    --surface:     #FFFFFF;
    --surface-2:   #F1F5F9; /* Slate 100 */
    --surface-3:   #E2E8F0; /* Slate 200 */

    /* Borders */
    --border:      #E2E8F0;
    --border-soft: #F1F5F9;
    --border-focus:#94A3B8;

    /* Text */
    --text-main:   #0F172A; /* Slate 900 */
    --text-muted:  #64748B; /* Slate 500 */
    --text-light:  #94A3B8; /* Slate 400 */

    /* Accent Colors (Brand) */
    --accent:      #0F172A; /* Deep Navy Black */
    --accent-dark: #020617;
    --accent-glow: rgba(15, 23, 42, 0.15);
    
    /* Functional Accents */
    --primary:     #2563EB; /* Blue 600 */
    --primary-bg:  rgba(37, 99, 235, 0.1);
    --success:     #10B981; /* Emerald 500 */
    --success-bg:  rgba(16, 185, 129, 0.1);
    --warning:     #F59E0B; /* Amber 500 */
    --warning-bg:  rgba(245, 158, 11, 0.1);
    --danger:      #EF4444; /* Red 500 */
    --danger-bg:   rgba(239, 68, 68, 0.1);

    /* Layout & Typography */
    --font-heading: 'Noto Sans Thai', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body:    'Noto Sans Thai', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --radius-sm:    10px;
    --radius-md:    16px;
    --radius-lg:    24px;
    --radius-xl:    32px;
    
    /* Modern layered shadows */
    --shadow-sm:    0 2px 4px rgba(15, 23, 42, 0.02), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-md:    0 4px 8px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
    --shadow-lg:    0 8px 16px rgba(15, 23, 42, 0.06), 0 24px 64px rgba(15, 23, 42, 0.08);
    
    --glass-bg:     rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    
    --transition:   all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Mode Theme */
body.dark-mode {
    --bg:          #020617; /* Slate 950 */
    --surface:     #0F172A; /* Slate 900 */
    --surface-2:   #1E293B; /* Slate 800 */
    --surface-3:   #334155; /* Slate 700 */
    --border:      #334155;
    --border-soft: #1E293B;
    --border-focus:#64748B;
    --text-main:   #F8FAFC;
    --text-muted:  #94A3B8;
    --text-light:  #64748B;
    --accent:      #F8FAFC;
    --accent-dark: #E2E8F0;
    --accent-glow: rgba(255,255,255,0.15);
    --glass-bg:    rgba(15, 23, 42, 0.75);
    --glass-border:rgba(255, 255, 255, 0.1);
}

/* ===== RESET & BASE ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    background: var(--bg);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.03em;
}
input, select, textarea, button { font-family: var(--font-body); }
[hidden] { display: none !important; }
.kyc-modal { max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.kyc-modal .modal-body { overflow-y: auto; min-height: 0; }
.kyc-modal .modal-header, .kyc-modal .modal-footer { flex-shrink: 0; }
.kyc-modal h2 { font-size: 22px; }
.kyc-eyebrow { font-size: 11px; letter-spacing: .12em; color: var(--primary); }
.kyc-progress { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.kyc-progress li { text-align: center; padding: 10px 4px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--text-muted); }
.kyc-progress .current { background: var(--primary-bg); color: var(--primary); font-weight: 700; }
.kyc-notice, .kyc-status { padding: 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 20px; font-size: 13px; }
.kyc-status { border: 1px solid var(--primary); }
.kyc-modal .kyc-upload-box { min-width: 0; justify-content: flex-start; }
.kyc-upload-box p, .kyc-upload-box span { font-size: 12px; overflow-wrap: anywhere; }
.kyc-upload-box input { max-width: 100%; font-size: 12px; }
.kyc-upload-box img { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; }
.kyc-review-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.kyc-review-images img { width: 100%; max-height: 340px; object-fit: contain; background: var(--surface-2); border-radius: 12px; }
.kyc-summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin-top: 16px; overflow-wrap: anywhere; }
.kyc-summary dt { color: var(--text-muted); font-size: 13px; }
.kyc-consent { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0; font-size: 13px; }
.kyc-consent input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px; }
.kyc-error { color: var(--danger); font-size: 13px; margin-top: 12px; }
@media (max-width: 600px) {
    .kyc-modal input[type="text"], .kyc-modal textarea { font-size: 16px; }
    .kyc-modal .modal-footer button { flex: 1 1 auto; min-height: 44px; }
    .kyc-review-images { grid-template-columns: 1fr; }
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== TOAST ===== */
#toast-container {
    position: fixed; bottom: 32px; right: 32px;
    display: flex; flex-direction: column; gap: 12px; z-index: 9999;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 360px;
    color: var(--text-main);
    display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
@keyframes slideIn { 
    from { transform: translateX(120%) scale(0.9); opacity:0; } 
    to { transform: translateX(0) scale(1); opacity:1; } 
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.font-10 { font-size: 10px; }
.font-11 { font-size: 11px; }
.font-12 { font-size: 12px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.ml-10 { margin-left: 10px; }
.bold  { font-weight: 600; }
.cursor-pointer { cursor: pointer; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 12px; border-radius: 100px; font-size: 12px; font-weight: 600;
    background: var(--surface-3); color: var(--text-main);
}
.badge-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== BUTTONS ===== */
button { cursor: pointer; border: none; transition: var(--transition); font-family: var(--font-body); }
.btn-primary {
    background: var(--accent);
    color: var(--bg);
    padding: 12px 20px; border-radius: 100px; /* Pill buttons for modern look */
    font-weight: 600; font-size: 14px;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--accent-glow); opacity: 0.95; }
.btn-primary:active { transform: translateY(0); }

.btn-success {
    background: var(--success); color: #fff;
    padding: 12px 20px; border-radius: 100px;
    font-weight: 600; font-size: 14px;
}
.btn-success:hover { background: #059669; transform: translateY(-2px); }

.btn-danger {
    background: var(--danger); color: #fff;
    padding: 12px 20px; border-radius: 100px;
    font-weight: 600; font-size: 14px;
}
.btn-danger:hover { background: #DC2626; transform: translateY(-2px); }

.btn-outline-danger {
    background: transparent; color: var(--danger);
    border: 1px solid var(--danger);
    padding: 8px 14px; border-radius: 100px;
    font-weight: 500; font-size: 13px;
    transition: var(--transition); cursor: pointer;
}
.btn-outline-danger:hover { background: var(--danger-bg); border-color: var(--danger); transform: translateY(-1px); }

.btn-secondary {
    background: var(--surface); color: var(--text-main);
    border: 1px solid var(--border);
    padding: 11px 20px; border-radius: 100px;
    font-weight: 600; font-size: 14px;
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-focus); transform: translateY(-1px); }

.btn-accent {
    background: var(--primary); color: #fff;
    padding: 12px 20px; border-radius: 100px;
    font-weight: 600; font-size: 14px;
    box-shadow: 0 4px 14px var(--primary-bg);
}
.btn-accent:hover { background: #1D4ED8; transform: translateY(-2px); }

.btn-block { width: 100%; display: block; text-align: center; }
.btn-large { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-icon {
    background: transparent; border: none;
    width: 36px; height: 36px; border-radius: 50%; /* Circle icons */
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 16px; transition: var(--transition);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text-main); }

/* ===== MINIMAL CONTROLS (LOGIN PAGE) ===== */
.theme-circle-btn, .lang-circle-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.theme-circle-btn:hover, .lang-circle-btn:hover {
    transform: scale(1.08);
}

/* Light mode override for login page controls */
body:not(.dark-mode) .theme-circle-btn,
body:not(.dark-mode) .lang-circle-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12) !important;
}

body:not(.dark-mode) .theme-circle-btn #login-theme-icon {
    color: #0f172a !important;
}

body:not(.dark-mode) .lang-circle-btn #lang-circle-label {
    color: #0f172a !important;
}

/* ===== FORMS & INPUTS ===== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.req { color: var(--danger); }
input[type="text"], input[type="tel"], input[type="number"], select, textarea {
    width: 100%; padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-main);
    font-size: 14px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
input::placeholder, textarea::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row .col-6 { flex: 1; }
.form-help { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ===== ALERT BOXES ===== */
.alert-box {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 16px 20px; border-radius: var(--radius-sm);
    font-size: 14px; line-height: 1.5;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}
.alert-info    { background: var(--primary-bg); border-color: rgba(37, 99, 235, 0.2); color: var(--text-main); }
.alert-info i  { color: var(--primary); }
.alert-success { background: var(--success-bg); border-color: rgba(16, 185, 129, 0.2); color: var(--text-main); }
.alert-success i { color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: rgba(245, 158, 11, 0.2); color: var(--text-main); }
.alert-warning i { color: var(--warning); }
.alert-danger  { background: var(--danger-bg);  border-color: rgba(239, 68, 68, 0.2); color: var(--text-main); }
.alert-danger i { color: var(--danger); }
.alert-box strong { font-weight: 600; display: block; margin-bottom: 2px; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    display: flex; min-height: 100vh;
    background: var(--bg);
}
.login-left {
    flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 60px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--surface-3) 100%);
    position: relative; overflow: hidden;
}
/* Abstract Stripe-like background elements for login-left */
.login-left::before {
    content: ''; position: absolute; top: -10%; left: -10%; width: 120%; height: 120%;
    background: radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    z-index: 0;
}
.login-brand { position: relative; z-index: 1; margin-bottom: 40px; }
.login-logo {
    width: 64px; height: 64px; border-radius: 16px;
    background: var(--accent); color: var(--bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}
.login-brand h1 { font-size: 40px; font-weight: 800; color: var(--text-main); margin-bottom: 12px; letter-spacing: -0.04em; }
.login-brand p { font-size: 18px; color: var(--text-muted); line-height: 1.6; max-width: 400px; }

.login-art { position: relative; z-index: 1; }
.login-features { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.feat-item {
    display: flex; align-items: center; gap: 16px; font-size: 16px; font-weight: 500; color: var(--text-main);
    background: var(--glass-bg); padding: 16px 24px; border-radius: var(--radius-md);
    border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    max-width: 380px;
}
.feat-item i { color: var(--primary); font-size: 20px; }

.login-right {
    flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px;
    background: var(--surface); box-shadow: -20px 0 40px rgba(0,0,0,0.02); z-index: 2;
}
.login-card { 
    width: 100%; max-width: 440px; 
    background: var(--surface); 
    padding: 48px; 
    border-radius: var(--radius-lg); 
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 40px; }
.login-header h2 { font-size: 28px; margin-bottom: 12px; font-weight: 700; letter-spacing: -0.03em; }
.login-header p  { color: var(--text-muted); font-size: 15px; }
.login-step-panel { display: none; }
.login-step-panel.active { display: block; animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Phone input */
.phone-input-row {
    display: flex; align-items: center;
    border: 1px solid var(--border); border-radius: 100px; overflow: hidden;
    background: var(--surface); transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.phone-input-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.phone-prefix {
    padding: 14px 20px; background: var(--surface-2);
    border-right: 1px solid var(--border); font-size: 14px;
    color: var(--text-muted); font-weight: 600;
}
.phone-input-row input { border: none !important; box-shadow: none !important; border-radius: 0; padding-left: 16px; }
.phone-input-row input { min-width: 0; flex: 1; }

/* SMS Notification (Mock) */
.sms-notification-wrapper {
    position: fixed; top: 32px; right: 32px; z-index: 9999;
    animation: slideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.sms-card {
    display: flex; align-items: flex-start; gap: 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px;
    box-shadow: var(--shadow-lg); max-width: 360px;
}
.sms-icon { font-size: 24px; color: var(--primary); margin-top: 2px; }
.sms-content { flex: 1; }
.sms-sender { font-size: 13px; font-weight: 700; color: var(--text-main); display: block; margin-bottom: 6px; }
.sms-body { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.text-accent2 { color: var(--primary); font-weight: 600; }

/* ===== APP HEADER / NAVBAR ===== */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    height: 72px; position: sticky; top: 0; z-index: 100;
}
body.dark-mode .app-header { background: rgba(15, 23, 42, 0.75); }
.logo-area { display: flex; align-items: center; gap: 16px; }
.logo-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent); color: var(--bg);
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    box-shadow: var(--shadow-sm);
}
.logo-text h1 { font-size: 20px; font-weight: 800; color: var(--text-main); letter-spacing: -0.04em; }

.role-nav { display: flex; gap: 8px; background: var(--surface-2); padding: 6px; border-radius: 100px; border: 1px solid var(--border); }
.nav-tab {
    background: transparent; color: var(--text-muted);
    font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    border: none; transition: var(--transition); cursor: pointer;
    padding: 8px 16px; border-radius: 100px;
}
.nav-tab:hover { color: var(--text-main); }
.nav-tab.active { background: var(--surface); color: var(--text-main); box-shadow: var(--shadow-sm); }
.nav-tab .badge { background: var(--border); color: var(--text-main); }

.header-profile { display: flex; align-items: center; gap: 20px; }
.profile-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); box-shadow: var(--shadow-sm); }
.profile-info { display: flex; flex-direction: column; }
.profile-id { font-size: 14px; font-weight: 600; color: var(--text-main); }
.logout-btn { color: var(--text-muted); font-size: 20px; cursor: pointer; transition: color 0.2s; }
.logout-btn:hover { color: var(--danger); transform: scale(1.1); }

/* ===== SIMULATOR BAR ===== */
.simulator-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 32px; background: var(--surface-2);
    border-bottom: 1px solid var(--border); font-size: 12px;
}
.sim-info { display: flex; align-items: center; gap: 12px; color: var(--text-muted); }

/* ===== MAIN PANELS ===== */
.app-main { flex: 1; padding: 24px 40px; max-width: 1600px; margin: 0 auto; width: 100%; }
.role-panel { display: none; animation: fadeIn 0.4s ease; }
.role-panel.active { display: block; }

/* ===== DASHBOARD (Redesigned 2-Column) ===== */
.dashboard-welcome-layout {
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px;
}
.welcome-card, .welcome-kyc-card {
    background: var(--surface); border-radius: var(--radius-xl);
    border: 1px solid var(--border); padding: 40px;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
.welcome-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--success));
}
.welcome-header { margin-bottom: 32px; text-align: left; }
.welcome-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; letter-spacing: -0.02em; }
.welcome-header p { color: var(--text-muted); font-size: 15px; }

/* Search Box */
.deal-search-box { background: var(--surface-2); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.search-input-wrapper {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 100px; padding: 6px 6px 6px 20px;
    transition: var(--transition); box-shadow: var(--shadow-sm);
}
.search-input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.search-input-wrapper input { flex: 1; border: none; background: transparent; font-size: 15px; color: var(--text-main); padding: 10px 0; font-weight: 500; }
.search-input-wrapper input:focus { outline: none; }
.search-input-wrapper .btn-primary { padding: 12px 24px; border-radius: 100px; }
.search-icon { color: var(--text-muted); }

/* Quick Fill Chips */
.quick-fill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn-chip {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 100px; padding: 6px 12px; font-size: 12px;
    font-weight: 600; color: var(--text-muted); cursor: pointer;
    transition: var(--transition);
}
.btn-chip:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

/* Instructions list inside Dashboard */
.instruction-list { margin-top: 32px; font-size: 14px; color: var(--text-muted); display: grid; gap: 12px; }
.instruction-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-md); }
.instruction-list li i { color: var(--primary); font-size: 16px; margin-top: 2px; }

/* Personal Info Card (Right) */
.profile-details-card { display: flex; flex-direction: column; align-items: center; }
.profile-kyc-box {
    background: var(--surface-2); border-radius: var(--radius-lg); padding: 24px;
    margin: 24px 0; width: 100%; text-align: center; border: 1px dashed var(--border-focus);
}
.profile-kyc-title { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; display: block; text-transform: uppercase; letter-spacing: 0.05em; }
.profile-kyc-status-text { font-size: 16px; font-weight: 700; }

.bank-info-box {
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
    border-radius: var(--radius-lg); padding: 24px;
    text-align: left; position: relative; width: 100%;
    border: 1px solid var(--border); box-shadow: inset 0 2px 0 rgba(255,255,255,0.5);
}
.bank-info-box .btn-secondary { position: absolute; right: 20px; top: 20px; background: var(--surface); border-radius: 100px; padding: 6px 16px; }
.bank-info-detail { font-size: 14px; color: var(--text-main); display: flex; flex-direction: column; gap: 8px; font-weight: 500; }
.bank-info-detail span { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 2px; }

/* Search Results Card */
.search-result-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 32px; margin-top: 32px;
    box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.search-result-card::after {
    content: ''; position: absolute; top: -50%; right: -50%; width: 200px; height: 200px;
    background: radial-gradient(circle, var(--primary-bg) 0%, transparent 70%); z-index: 0;
}
.result-user-info { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; position: relative; z-index: 1; }
.result-avatar img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: var(--shadow-md); }
.role-button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; position: relative; z-index: 1; }
.role-btn {
    display: flex; align-items: center; gap: 16px;
    padding: 20px; border-radius: var(--radius-lg);
    text-align: left; border: 1px solid var(--border);
    background: var(--surface); cursor: pointer; transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.role-btn:hover { border-color: var(--primary); box-shadow: 0 8px 24px var(--primary-bg); transform: translateY(-4px); }
.btn-role-icon { font-size: 28px; color: var(--primary); }
.btn-role-text strong { display: block; font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
.btn-role-text span { color: var(--text-muted); font-size: 13px; }

/* ==========================================================================
   2. PANELS (DASHBOARD / DEALS / ADMIN)
   ========================================================================== */
.role-panel { display: none; height: calc(100vh - 120px); }
.role-panel.active { display: block; animation: fadeIn 0.3s ease; }
/* Dashboard/Admin don't need fixed height */
#panel-dashboard, #panel-admin { height: auto; min-height: calc(100vh - 120px); }

.panel-layout { 
    display: grid; grid-template-columns: 320px 1fr 360px; gap: 24px; 
    height: 100%;
}
.panel-sidebar { 
    background: var(--surface); border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    overflow-y: auto; padding: 20px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.panel-content { 
    display: flex; flex-direction: column; overflow: hidden; 
    gap: 16px; 
}
.panel-details { 
    background: var(--surface); border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    overflow-y: auto; padding: 24px;
}

/* Sidebar */
.sidebar-section { padding: 0; }
.sidebar-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 0 4px; }
.sidebar-header-row h4 { font-size: 15px; font-weight: 600; }

/* ===== MINIMAL ARCHIVE VAULT SWITCHER BUTTON ===== */
.btn-show-archived {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    outline: none;
}

.btn-show-archived:hover {
    background: var(--surface-3);
    color: var(--text-main);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.btn-show-archived.active {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.4);
    color: #f97316;
}

body:not(.dark-mode) .btn-show-archived {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

body:not(.dark-mode) .btn-show-archived:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.chat-list { display: flex; flex-direction: column; gap: 12px; }
.chat-item {
    background: var(--surface); border-radius: var(--radius-md);
    padding: 16px; cursor: pointer; border: 1px solid var(--border);
    transition: var(--transition); box-shadow: var(--shadow-sm);
    position: relative;
}
.chat-item:hover { border-color: var(--border-focus); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.chat-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.chat-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.chat-item-title { font-weight: 600; font-size: 15px; color: var(--text-main); display: flex; align-items: center; gap: 6px; }
.chat-item-subnote { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.chat-item-preview { font-size: 13px; color: var(--text-muted); }

/* Custom iOS Deals Context Menu */
.btn-deal-menu { background: none; border: none; color: var(--text-light); cursor: pointer; padding: 4px; border-radius: 4px; }
.btn-deal-menu:hover { color: var(--text-main); background: var(--surface-2); }
.deal-context-menu {
    position: absolute; right: -10px; top: 40px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 100;
    width: 160px; display: flex; flex-direction: column; padding: 8px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    background: var(--glass-bg);
}
.deal-menu-item { padding: 10px 12px; font-size: 13px; cursor: pointer; border-radius: 6px; display: flex; align-items: center; gap: 10px; color: var(--text-main); font-weight: 500; }
.deal-menu-item:hover { background: var(--surface-2); }
.deal-menu-item i { color: var(--text-muted); width: 14px; text-align: center; }
.deal-menu-item.deal-menu-archive { color: var(--warning); }
.deal-menu-item.deal-menu-archive i { color: var(--warning); }
.deal-menu-item.deal-menu-close { color: var(--success); }
.deal-menu-item.deal-menu-close i { color: var(--success); }
.deal-menu-item.deal-menu-disabled { opacity: 0.4; cursor: not-allowed; }
.deal-menu-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* Chat Container Blocks */
.chat-container { background: transparent !important; height: 100%; display: flex; flex-direction: column; }
.chat-header {
    background: var(--surface); padding: 24px;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: var(--shadow-sm); flex-shrink: 0;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.chat-title h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.chat-title p { font-size: 14px; color: var(--text-muted); }
.mobile-chat-back, .mobile-chat-details { display: none; }

.chat-messages {
    flex: 1; padding: 24px 16px; overflow-y: auto;
    background: transparent;
    display: flex; flex-direction: column; gap: 16px;
}

/* Messages */
.msg-bubble {
    max-width: 70%; padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; line-height: 1.5;
}
.msg-row { display: flex; width: 100%; margin-bottom: 8px; }
.msg-row.buyer { justify-content: flex-end; }
.msg-row.seller { justify-content: flex-start; }
.msg-row.buyer  .msg-bubble { background: var(--text-main); color: var(--bg); }
.msg-row.seller .msg-bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-main); }
.msg-meta { font-size: 11px; opacity: 0.5; margin-top: 6px; display: block; }

/* System Messages */
.msg-system { display: flex; justify-content: center; margin: 12px 0; }
.system-alert {
    background: var(--glass-bg); padding: 14px 24px; border-radius: 100px;
    font-size: 13px; color: var(--text-main); text-align: center;
    border: 1px solid var(--glass-border);
    display: flex; align-items: center; gap: 8px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-weight: 500;
}
.system-alert.held { border-color: var(--warning); color: var(--warning); background: var(--warning-bg); }
.system-alert.released { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.system-alert.suspended { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* Input Area */
.chat-input-area {
    padding: 16px 24px; background: var(--surface); border: 1px solid var(--border);
    display: flex; gap: 12px; align-items: center; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.chat-input-area input {
    flex: 1; border: 1px solid var(--border);
    background: var(--surface-2); border-radius: var(--radius-sm);
    padding: 12px 16px; font-size: 14px;
}
.btn-bell {
    background: var(--surface-2); border: 1px solid var(--border);
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    font-size: 18px; color: var(--text-muted); cursor: pointer; flex-shrink: 0;
    transition: var(--transition);
}
.btn-bell:hover { background: var(--surface-3); color: var(--text-main); }
.btn-chat-img {
    background: var(--surface-2); border: 1px solid var(--border);
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    font-size: 18px; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); flex-shrink: 0;
}
.btn-chat-img:hover { background: var(--surface-3); color: var(--primary); }
.chat-input-area .btn-primary { padding: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.chat-msg-img-wrap {
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.chat-msg-img {
    max-width: 240px;
    max-height: 240px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    display: block;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.2s ease;
}
.chat-msg-img:hover {
    transform: scale(1.02);
}

/* Proposal Cards in Chat */
.cart-proposal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden; width: 320px;
    box-shadow: var(--shadow-sm);
}
.proposal-banner {
    background: var(--text-main); color: var(--bg);
    padding: 10px 16px; font-size: 12px; font-weight: 600;
}
.proposal-item-box { padding: 16px; display: flex; gap: 16px; }
.proposal-img img { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; }
.proposal-footer { padding: 16px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Right Panel (Escrow details) */
.section-title { margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.escrow-card { background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.escrow-status-bar { padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.escrow-status-text { font-size: 14px; font-weight: 600; margin-top: 2px; }
.escrow-details-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.escrow-actions { padding: 12px 16px; border-top: 1px solid var(--border); }

/* Ultra-compact Escrow & Tracking Cards */
.escrow-compact-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}
.escrow-compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.escrow-compact-label {
    color: var(--text-muted);
    font-weight: 500;
}
.escrow-compact-val {
    color: var(--text-main);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
}
.escrow-compact-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.tracking-form-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.tracking-form-card h4 {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}
.tracking-form-card .form-group {
    margin-bottom: 8px;
}
.tracking-form-card .form-group label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}
.tracking-form-card select,
.tracking-form-card input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
}

/* Cart builder */
.product-image-upload-area {
    border: 1px dashed var(--border-focus); border-radius: var(--radius-sm);
    background: var(--surface-2); padding: 32px; text-align: center;
    cursor: pointer; transition: var(--transition);
}
.product-image-upload-area:hover { background: var(--surface-3); }

/* ===== MODALS ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
    background: var(--surface); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
    border: 1px solid var(--border);
    animation: modalIn 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.modal-header {
    padding: 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header .close-btn {
    background: transparent; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; transition: 0.2s;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.modal-header .close-btn:hover { color: var(--text-main); background: var(--surface-2); }

/* Image Preview */
.product-img-preview-img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    display: block;
    margin: 0 auto;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 24px; border-top: 1px solid var(--border); background: var(--surface-2);
    display: flex; justify-content: flex-end; gap: 12px; border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Modal Sizes */
.modal-card.modal-sm { max-width: 400px; }
.modal-card.modal-md { max-width: 540px; }
.modal-card.modal-lg { max-width: 680px; }
.modal-card.modal-qr { max-width: 440px; border-radius: var(--radius-lg); overflow: hidden; }

/* QR Payment Modal Styles */
.qr-code-box {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    width: 100%;
    max-width: 320px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 0 auto;
}
body.dark-mode .qr-code-box {
    background: #1E293B;
    border-color: #334155;
}
.promptpay-header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.pp-logo {
    max-width: 140px;
    max-height: 42px;
    height: auto;
    object-fit: contain;
    display: block;
}
.qr-canvas-sim {
    background: #FFFFFF;
    border: 2px solid var(--text-main);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}
.qr-mock-lines {
    color: #0F172A;
    font-size: 100px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-amount-label {
    text-align: center;
}
.qr-amount-label span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.qr-amount-label h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 2px;
}
.qr-details {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    width: 100%;
    font-size: 12px;
    color: var(--text-main);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.qr-details p {
    margin: 0;
    display: flex;
    justify-content: space-between;
}

/* e-KYC Modal Custom Styles */
.modal-desc {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.kyc-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
@media (max-width: 576px) {
    .kyc-upload-grid {
        grid-template-columns: 1fr;
    }
}
.kyc-upload-box {
    background: var(--surface-2);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.kyc-upload-box:hover {
    border-color: var(--primary);
    background: var(--surface-3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}
.kyc-upload-box:hover .upload-icon {
    transform: scale(1.1);
}
.kyc-upload-box span {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
}
.sim-file-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.sim-file-input .btn-secondary {
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
}
.file-name-text {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preview-img-container {
    width: 100%;
    height: 110px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-top: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: fadeIn 0.3s ease;
}
.e-kyc-options {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 20px;
    transition: var(--transition);
}
.e-kyc-options:hover {
    border-color: var(--border-focus);
}
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
    user-select: none;
}
.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border);
    accent-color: var(--primary);
    cursor: pointer;
}

/* ===== ADMIN PANEL ===== */
/* ===== ADMIN PANEL REDESIGN ===== */
.admin-dashboard { width: 100%; }
.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.summary-card:hover {
    border-color: var(--border-focus);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.summary-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--primary); border-radius: 4px 0 0 4px;
}
.summary-card.card-blue::before { background: #3b82f6; }
.summary-card.card-green::before { background: #22c55e; }
.summary-card.card-amber::before { background: #f59e0b; }
.summary-card.card-red::before { background: #ef4444; }

.card-icon {
    width: 48px; height: 48px; border-radius: 14px;
    background: var(--surface-2); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    flex-shrink: 0;
}
.card-icon.blue { color: #3b82f6; background: rgba(59, 130, 246, 0.12); }
.card-icon.green { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.card-icon.yellow { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.card-icon.red { color: #ef4444; background: rgba(239, 68, 68, 0.12); }

.card-data { overflow: hidden; }
.card-data h3 { font-size: 22px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; line-height: 1.2; }
.card-data p { font-size: 12px; color: var(--text-muted); font-weight: 500; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

.admin-main-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.admin-panel-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.admin-panel-card .card-header {
    padding: 14px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-panel-card .card-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}
.admin-panel-card .card-body {
    padding: 0;
}

.admin-table-container { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
    text-align: left; padding: 12px 18px; color: var(--text-muted); font-weight: 600; 
    border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; 
    text-transform: uppercase; letter-spacing: 0.04em; 
}
.admin-table td {
    padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; 
    color: var(--text-main); font-weight: 500; 
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); }
.admin-table tr.selected-dispute-row td {
    background: rgba(74, 144, 184, 0.12);
}
.admin-table tr.selected-dispute-row td:first-child {
    border-left: 3px solid var(--primary);
}

/* AI Investigator Right Panel Styling */
#admin-investigator-card {
    min-height: 480px;
}
.ai-empty-state-wrap {
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ai-empty-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(74, 144, 184, 0.1);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin-bottom: 16px;
}
.ai-empty-state-wrap p {
    font-size: 13.5px; color: var(--text-muted); line-height: 1.6; max-width: 280px; margin: 0 auto;
}

/* AI Details Layout */
.ai-details-wrapper {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ai-header-card {
    background: rgba(74, 144, 184, 0.08);
    border: 1px solid rgba(74, 144, 184, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-main);
}
.ai-header-card i {
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.ai-card-section {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.ai-card-section-title {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-classification-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.ai-badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ai-badge i { font-size: 11px; color: var(--accent); }

.ai-quote-box {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent);
    padding: 10px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-chat-excerpt-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ai-chat-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-main);
}
.ai-chat-bubble.highlighted {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.06);
}
.ai-chat-bubble .sender-name {
    font-weight: 600;
    font-size: 11.5px;
    margin-right: 4px;
}
.ai-chat-bubble .sender-buyer { color: #3b82f6; }
.ai-chat-bubble .sender-seller { color: #22c55e; }

.ai-verdict-card {
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--border);
}
.ai-verdict-card.verdict-refund {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}
.ai-verdict-card.verdict-release {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
}
.ai-verdict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.ai-verdict-main {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
}
.ai-verdict-card.verdict-refund .ai-verdict-main { color: #ef4444; }
.ai-verdict-card.verdict-release .ai-verdict-main { color: #22c55e; }

.ai-evidence-img-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.ai-evidence-img-container:hover {
    border-color: var(--primary);
}
.ai-evidence-img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .dashboard-welcome-layout { grid-template-columns: 1fr; }
    .panel-layout { display: flex; flex-direction: column; height: auto; }
    .panel-sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: 400px; }
    .panel-content { min-height: 600px; }
    .admin-main-grid { grid-template-columns: 1fr; }
    .admin-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

/* The portal and workspace adapt independently: the desktop layout stays intact. */
@media (max-width: 900px) {
    .login-wrapper { flex-direction: column; }
    .login-left { flex: none; padding: 30px 24px 24px; }
    .login-brand { margin: 0; display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; }
    .login-logo { width: 44px; height: 44px; margin: 0; border-radius: 12px; font-size: 22px; grid-row: span 2; }
    .login-brand h1 { font-size: 25px; margin: 0; line-height: 1.2; }
    .login-brand p { font-size: 13px; max-width: none; line-height: 1.4; }
    .login-brand p br { display: none; }
    .login-art { display: none; }
    .login-right { flex: 1; min-width: 0; padding: 80px 24px 32px; align-items: flex-start; }
    .login-card { max-width: 480px; padding: 32px; margin-inline: auto; }
    .app-header { padding: 12px 20px; height: auto; flex-wrap: wrap; gap: 12px; }
    .role-nav { order: 3; width: 100%; justify-content: center; }
    .header-profile { margin-left: auto; gap: 10px; }
    .app-main { padding: 20px; }
    .panel-layout { min-width: 0; }
    .panel-content { min-width: 0; }
}

@media (max-width: 600px) {
    .login-wrapper, .login-left, .login-right { width: 100%; min-width: 0; }
    .login-left { padding: 18px; }
    .login-right { padding: 62px 16px 28px; }
    .login-controls { top: 12px !important; right: 16px !important; }
    .login-card { padding: 26px 20px; border-radius: 20px; max-width: 440px; }
    .login-brand { min-width: 0; }
    .login-brand p { overflow-wrap: anywhere; }
    .login-header { margin-bottom: 26px; }
    .login-header h2 { font-size: 24px; }
    .login-header p { font-size: 14px; }
    .login-card .btn-large { padding: 12px 16px; min-height: 50px; font-size: 14px; }
    .login-card .btn-large span { min-width: 0; }
    .login-card .form-group { margin-bottom: 14px; }
    #otp-single-input { font-size: 26px !important; letter-spacing: 7px !important; }
    .phone-prefix { padding: 13px 14px; }
    .phone-input-row input { padding: 12px !important; font-size: 16px; }
    .sms-notification-wrapper { left: 12px; right: 12px; top: 12px; }
    .sms-card { max-width: none; padding: 14px; }
    #toast-container { left: 12px; right: 12px; bottom: 16px; }
    .toast { max-width: none; }

    .app-header { padding: 10px 14px; gap: 10px; }
    .logo-area { gap: 8px; }
    .logo-text h1 { font-size: 17px; }
    .logo-icon { width: 32px; height: 32px; }
    .header-profile { gap: 4px; }
    .header-profile .profile-info, .header-profile .profile-avatar { display: none; }
    .role-nav { padding: 4px; gap: 2px; overflow-x: auto; justify-content: flex-start; }
    .nav-tab { flex: 1 0 auto; justify-content: center; font-size: 12px; padding: 8px 10px; gap: 5px; }
    .nav-tab .badge { padding: 2px 5px; font-size: 10px; }
    .simulator-bar { padding: 10px 14px; }
    .sim-info { flex-wrap: wrap; gap: 5px; }
    .app-main { padding: 14px; min-width: 0; }
    .dashboard-welcome-layout { gap: 14px; }
    .welcome-card, .welcome-kyc-card, .search-result-card { padding: 20px !important; border-radius: 20px; }
    .welcome-header h2 { font-size: 19px; flex-wrap: wrap; }
    .deal-search-box { padding: 14px; }
    .search-input-wrapper { min-width: 0; padding-left: 12px; gap: 6px; }
    .search-input-wrapper input { min-width: 0; font-size: 16px; }
    .search-input-wrapper .btn-primary { padding: 10px 12px; }
    .role-button-grid { grid-template-columns: 1fr; gap: 10px; }
    .result-user-info { gap: 12px; margin-bottom: 20px; min-width: 0; }
    .result-details { min-width: 0; overflow-wrap: anywhere; }
    .bank-info-box .btn-secondary { position: static; margin-top: 14px; }
    .profile-header-compact { gap: 12px !important; }
    .profile-avatar-large img { width: 54px !important; height: 54px !important; }
    .profile-info-compact { min-width: 0; overflow-wrap: anywhere; }

    #panel-deals { height: auto; min-height: calc(100dvh - 160px); }
    #panel-deals .panel-layout { gap: 12px; }
    #panel-deals .panel-sidebar { max-height: none; padding: 14px; }
    #panel-deals .panel-content { min-height: 0; height: min(72dvh, 700px); }
    #panel-deals .panel-details { padding: 18px; }
    #panel-deals:not(.mobile-room-open) .panel-content,
    #panel-deals:not(.mobile-room-open) .panel-details { display: none !important; }
    #panel-deals.mobile-room-open .panel-sidebar { display: none; }
    .chat-header { padding: 12px; flex-wrap: wrap; gap: 8px; }
    .chat-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
    .chat-title h3 { font-size: 15px; line-height: 1.4; }
    .chat-title p { font-size: 11px; overflow-wrap: anywhere; }
    .chat-escrow-status { order: 4; width: 100%; }
    .mobile-chat-back { display: inline-flex; flex-shrink: 0; }
    .mobile-chat-details { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 11px; padding: 8px; }
    .chat-messages { padding: 14px 8px; min-height: 0; }
    .msg-bubble { max-width: 88%; overflow-wrap: anywhere; }
    .system-alert { border-radius: 16px; padding: 10px; max-width: 100%; overflow-wrap: anywhere; }
    .proposal-item-box { flex-wrap: wrap; }
    .escrow-compact-row { gap: 8px; align-items: flex-start; }
    .escrow-compact-val { min-width: 0; text-align: right; overflow-wrap: anywhere; }
    .chat-input-area { padding: 10px; }
    .chat-input-area > div { gap: 6px !important; min-width: 0; }
    .chat-input-area input[type="text"] { min-width: 0; padding: 10px; font-size: 16px; }
    .chat-input-area .btn-primary, .btn-chat-img, .btn-bell { width: 38px; height: 42px; flex-shrink: 0; }

    .modal-overlay { padding: 12px; }
    .modal-card { max-height: calc(100dvh - 24px); overflow-y: auto; }
    .modal-header, .modal-body, .modal-footer { padding: 16px; }
    .modal-footer { flex-wrap: wrap; }
    .form-row { flex-wrap: wrap; }
    .form-row .col-6 { flex: 1 1 100%; }
    .guide-tabs { overflow-x: auto; }
    .guide-tab-btn { white-space: nowrap; }
    .admin-summary-grid { grid-template-columns: 1fr; }
    .admin-panel-card .card-header { gap: 8px; flex-wrap: wrap; }
    .admin-table { min-width: 560px; }
}

@media (max-width: 360px) {
    .login-right { padding-inline: 12px; }
    .login-card { padding-inline: 16px; }
    .login-card .btn-large { padding-inline: 10px; }
    .login-card .btn-large span { overflow-wrap: anywhere; }
    .search-input-wrapper { flex-wrap: wrap; border-radius: 16px !important; }
    .search-input-wrapper .btn-primary { width: 100%; }
    .chat-input-area .btn-primary, .btn-chat-img, .btn-bell { width: 34px; }
}

/* Compact Profile */
.profile-header-compact { display: flex; align-items: center; gap: 20px; }
.profile-avatar-large img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }
.profile-info-compact { flex: 1; text-align: left; }
.profile-actions-compact { margin-top: 24px; width: 100%; }

/* Link Button style */
.btn-link {
    background: none; border: none; padding: 0; color: var(--primary);
    font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex;
    align-items: center; gap: 6px; transition: var(--transition);
    text-decoration: none;
}
.btn-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* User Guide Modal CSS */
.guide-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    margin-bottom: 20px;
}
.guide-tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.guide-tab-btn:hover {
    color: var(--text-main);
}
.guide-tab-btn.active {
    color: var(--primary);
}
.guide-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}
.guide-tab-content {
    animation: fadeIn 0.3s ease;
}
.guide-step-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 15px;
}
.guide-step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.guide-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.guide-step-text {
    flex-grow: 1;
}
.guide-step-text strong {
    display: block;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 3px;
}
.guide-step-text p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}
