/* assets/css/app.css - RishtaShure Master UI Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #881337;
    --primary-hover: #9f1239;
    --primary-light: #ffe4e6;
    --secondary: #fb7185;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Impersonation Floating Bar */
.impersonation-bar {
    background: linear-gradient(90deg, #b91c1c, #dc2626);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.impersonation-bar a.exit-btn {
    background: #fff;
    color: #b91c1c;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 700;
}

/* Header & Navigation */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-brand .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.navbar-brand .brand-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.navbar-brand .brand-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
}

.nav-link {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff !important;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(136, 19, 55, 0.25);
}

.btn-secondary {
    background: #e2e8f0;
    color: #334155 !important;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary) !important;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff !important;
}

.btn-success {
    background: var(--success);
    color: #fff !important;
}

.btn-danger {
    background: var(--danger);
    color: #fff !important;
}

.btn-warning {
    background: var(--warning);
    color: #fff !important;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 13px 28px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* Layout Containers */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.container-fluid {
    width: 100%;
    padding: 0 24px;
}

.page-content {
    flex: 1;
    padding: 30px 0;
}

/* Dashboard App Layout (Sidebar + Content) */
.app-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.app-sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.app-sidebar-header {
    padding: 0 12px 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.sidebar-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-item:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.sidebar-item.active {
    color: #fff;
    background: var(--primary);
}

.sidebar-item .badge-pill {
    margin-left: auto;
}

.app-main {
    flex: 1;
    padding: 28px 36px;
    background: var(--bg-light);
    overflow-x: hidden;
}

/* Cards & Panels */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Metric / Stat Card */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: #d1fae5; color: var(--success); }
.stat-icon.warning { background: #fef3c7; color: var(--warning); }
.stat-icon.info { background: #dbeafe; color: var(--info); }

.stat-info .stat-val {
    font-size: 1.65rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #0f172a;
    line-height: 1.2;
}

.stat-info .stat-label {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.badge-verified { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-rejected { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-platinum { background: linear-gradient(135deg, #475569, #0f172a); color: #fff; }
.badge-gold { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }
.badge-silver { background: #e2e8f0; color: #334155; }
.badge-free { background: #f1f5f9; color: #64748b; }
.badge-ai { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }

/* Forms & Inputs */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

.form-label .req {
    color: var(--danger);
}

.form-control, .form-select, textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text-main);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Stepper Wizard for 6-Step Registration */
.wizard-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.wizard-stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    text-decoration: none;
}

.step-bubble {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step-item.active .step-bubble {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 5px var(--primary-light);
}

.step-item.completed .step-bubble {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.step-item.active .step-name {
    color: var(--primary);
}

/* Profile Card in Search / Catalog */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.profile-card-img {
    position: relative;
    height: 220px;
    background: #e2e8f0;
    overflow: hidden;
}

.profile-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-img .ai-score-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-card-img .ai-score-badge i {
    color: #a855f7;
}

.profile-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-card-sub {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.profile-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.profile-card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background: #f8fafc;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1.5px solid var(--border);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.table tr:hover td {
    background: #fdf2f4;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-backdrop.show {
    display: flex;
}

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Footer */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 40px 0 20px 0;
    margin-top: auto;
    font-size: 0.88rem;
}

.footer h5 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer a {
    color: #cbd5e1;
}

.footer a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
}

/* =====================================================
   MOBILE HAMBURGER NAVIGATION DRAWER
   ===================================================== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1.3rem;
    transition: background 0.2s;
    line-height: 1;
}
.hamburger-btn:hover { background: var(--primary-light); }

.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.mobile-nav-overlay.open { display: block; }

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    padding: 0;
}
.mobile-nav-drawer.open { right: 0; }

.mobile-drawer-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-drawer-header .brand { font-size: 1.2rem; font-weight: 800; }
.mobile-drawer-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-drawer-links {
    padding: 12px 0;
    flex: 1;
}
.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.mobile-drawer-link:hover, .mobile-drawer-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
.mobile-drawer-link i { width: 20px; color: var(--primary); font-size: 0.95rem; }

.mobile-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =====================================================
   PHOTO LIGHTBOX MODAL
   ===================================================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }

.lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
    object-fit: contain;
    cursor: default;
    animation: lightboxIn 0.2s ease-out;
}

@keyframes lightboxIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10000;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

.profile-photo-clickable {
    cursor: zoom-in;
    transition: transform 0.2s;
}
.profile-photo-clickable:hover { transform: scale(1.03); }

/* =====================================================
   AI SCORE BREAKDOWN MODAL
   ===================================================== */
#aiScoreModal .modal-card {
    max-width: 480px;
    width: 94%;
}
.ai-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.ai-score-row:last-child { border-bottom: none; }
.ai-score-bar-wrap {
    width: 120px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
}
.ai-score-bar {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #7e22ce, #a855f7);
}
.ai-score-clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ai-score-clickable:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 3px rgba(168,85,247,0.3);
}

/* =====================================================
   TOAST NOTIFICATION SYSTEM
   ===================================================== */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-msg {
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    max-width: 340px;
    pointer-events: all;
    animation: toastIn 0.3s ease-out;
    border-left: 4px solid var(--primary);
}
.toast-msg.success { border-color: var(--success); }
.toast-msg.error { border-color: var(--danger); }
.toast-msg.info { border-color: var(--info); }

@keyframes toastIn {
    from { transform: translateX(120px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =====================================================
   SHORTLIST BUTTON ACTIVE STATE
   ===================================================== */
.btn-shortlist.active {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
}
.btn-shortlist.active i { color: #fff; }

/* =====================================================
   GLOBAL RESPONSIVE & GRID UTILITIES
   ===================================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.profile-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.info-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    font-size: 0.9rem;
}

.search-page-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

.search-filter-card { flex-shrink: 0; }

.card-header-responsive {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

/* =====================================================
   RESPONSIVE MOBILE RULES
   ===================================================== */
@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .app-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: none; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 10px 12px; }
    .app-sidebar .sidebar-item { padding: 8px 12px; font-size: 0.82rem; }
    .app-sidebar .app-sidebar-header { display: none; }
    .wizard-stepper { flex-wrap: wrap; gap: 12px; }
    .wizard-stepper::before { display: none; }
    .search-page-layout { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 768px) {
    /* Hide desktop nav items, show hamburger */
    .navbar { padding: 10px 14px; gap: 8px; }
    .navbar .nav-links { display: none !important; }
    .hamburger-btn { display: flex !important; }
    .navbar-brand .brand-title { font-size: 1.05rem; }
    .navbar-brand .brand-sub { display: none; }
    .navbar-brand .logo-icon { width: 34px; height: 34px; font-size: 1rem; }

    /* Navbar action buttons: compact on mobile */
    .navbar > div:last-child {
        gap: 6px;
    }
    .navbar > div:last-child .btn { font-size: 0.8rem; padding: 7px 10px; }

    .app-main { padding: 14px 10px; }
    .container-fluid { padding: 0 8px; }
    .container { padding: 0 10px; }
    .page-content { padding: 16px 0; }
    
    .profile-detail-grid { grid-template-columns: 1fr; gap: 14px; }
    .info-grid-2col { grid-template-columns: 1fr; gap: 10px; }
    .card-header-responsive { flex-direction: column; align-items: flex-start; }
    .card-header-responsive .btn { width: 100%; }
    
    /* Profile hero — stack on mobile */
    .profile-hero-flex { flex-direction: column !important; gap: 18px !important; }
    .profile-hero-actions { flex-wrap: wrap; gap: 8px !important; }
    .profile-hero-actions .btn { flex: 1; min-width: 120px; text-align: center; justify-content: center; }
    
    /* Table Responsive Mobile Cards */
    .table-responsive-cards table,
    .table-responsive-cards thead,
    .table-responsive-cards tbody,
    .table-responsive-cards th,
    .table-responsive-cards td,
    .table-responsive-cards tr {
        display: block;
    }
    .table-responsive-cards thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    .table-responsive-cards tr {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        margin-bottom: 14px;
        padding: 14px;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }
    .table-responsive-cards td {
        border: none;
        padding: 6px 0;
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .table-responsive-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Plans grid on mobile */
    .plans-grid { grid-template-columns: 1fr !important; }

    /* AI score mobile badge */
    .ai-score-badge { font-size: 0.78rem; }

    /* Hero quick-search form */
    .hero-search-form { grid-template-columns: 1fr !important; }

    /* AI breakdown modal width */
    #aiScoreModal .modal-card { width: 96%; }

    /* Lightbox full-width on small screens */
    .lightbox-img { max-width: 96vw; }
}

@media (max-width: 600px) {
    .profile-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-icon { width: 40px; height: 40px; font-size: 1rem; }
    .stat-info .stat-val { font-size: 1.3rem; }
    .btn { min-height: 44px; }
    
    /* Toast on mobile — bottom center */
    #toastContainer { right: 10px; left: 10px; bottom: 16px; }
    .toast-msg { min-width: 0; max-width: 100%; }
    
    /* Sidebar compact horizontal scroll on very small phones */
    .app-sidebar { overflow-x: auto; flex-wrap: nowrap; }
    .app-sidebar .sidebar-item { white-space: nowrap; }

    .mobile-filter-toggle { display: block !important; }
}

@media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr; }
    .navbar-brand .brand-title { font-size: 0.95rem; }
}
