/* =============================================
   RIKOPEDIA STOCK RECOMMENDATION APP
   assets/css/style.css
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --bg-dark:       #0A0F1E;
    --bg-card:       #0D1425;
    --bg-surface:    #111827;
    --border:        #1E2D45;
    --border-light:  #253348;
    --primary:       #1A56E8;
    --primary-glow:  rgba(26, 86, 232, 0.25);
    --primary-light: #3B74F5;
    --accent:        #00D4AA;
    --accent-glow:   rgba(0, 212, 170, 0.2);
    --profit:        #10D67A;
    --profit-bg:     rgba(16, 214, 122, 0.1);
    --loss:          #FF4560;
    --loss-bg:       rgba(255, 69, 96, 0.1);
    --warning:       #F5A623;
    --warning-bg:    rgba(245, 166, 35, 0.1);
    --text:          #E8EDF5;
    --text-muted:    #8B9EC7;
    --text-dim:      #4A5980;
    --white:         #FFFFFF;
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:     0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg:     0 8px 40px rgba(0,0,0,0.5);
    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     16px;
    --radius-xl:     24px;
    --transition:    all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ====== TYPOGRAPHY ====== */
h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; }
h4, h5, h6 { font-family: 'DM Sans', sans-serif; font-weight: 600; }
.mono { font-family: 'DM Mono', monospace; }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ====== LOGIN PAGE ====== */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.login-bg::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(26,86,232,0.15) 0%, transparent 70%);
    top: -200px; left: -100px;
    pointer-events: none;
}
.login-bg::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(0,212,170,0.08) 0%, transparent 70%);
    bottom: -150px; right: -100px;
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .brand-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.login-logo h1 {
    font-size: 22px;
    color: var(--white);
    letter-spacing: -0.3px;
}
.login-logo span { color: var(--accent); }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ====== FORMS ====== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
}
.btn-success {
    background: var(--profit);
    color: #000;
}
.btn-success:hover { background: #0ab868; transform: translateY(-1px); }
.btn-danger {
    background: transparent;
    border: 1px solid var(--loss);
    color: var(--loss);
}
.btn-danger:hover { background: var(--loss-bg); }
.btn-warning {
    background: transparent;
    border: 1px solid var(--warning);
    color: var(--warning);
}
.btn-warning:hover { background: var(--warning-bg); }
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}
.btn-accent:hover { background: #00bfa0; transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; width: 100%; justify-content: center; }

/* ====== ALERTS ====== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-danger { background: var(--loss-bg); border: 1px solid rgba(255,69,96,0.3); color: var(--loss); }
.alert-success { background: var(--profit-bg); border: 1px solid rgba(16,214,122,0.3); color: var(--profit); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(245,166,35,0.3); color: var(--warning); }
.alert-info { background: var(--primary-glow); border: 1px solid rgba(26,86,232,0.3); color: var(--primary-light); }

/* ====== LAYOUT: SIDEBAR + MAIN ====== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-logo .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}
.sidebar-logo .logo-sub {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 10px 8px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}
.nav-item:hover { background: rgba(26,86,232,0.1); color: var(--text); }
.nav-item.active { background: var(--primary-glow); color: var(--primary-light); }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    margin-bottom: 8px;
}
.sidebar-user .user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-user .user-info .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
.sidebar-user .user-info .user-role {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
}

/* ====== MAIN CONTENT ====== */
.main-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-dark);
}

.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}
.topbar-title span { color: var(--text-muted); font-weight: 400; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.content-wrap {
    padding: 28px;
    flex: 1;
}

/* ====== CARDS ====== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title .title-icon {
    font-size: 18px;
}

/* ====== STAT CARDS ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--profit); }
.stat-card.red::before { background: var(--loss); }
.stat-card.yellow::before { background: var(--warning); }

.stat-icon {
    font-size: 28px;
    margin-bottom: 12px;
    opacity: 0.9;
}
.stat-value {
    font-family: 'DM Mono', monospace;
    font-size: 32px;
    font-weight: 500;
    color: var(--white);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ====== TABLE ====== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead th {
    background: var(--bg-surface);
    padding: 12px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 13.5px;
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

.td-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stock-code {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 3px 8px;
    border-radius: 4px;
}

/* ====== BADGES ====== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.badge-active { background: var(--profit-bg); color: var(--profit); border: 1px solid rgba(16,214,122,0.3); }
.badge-inactive { background: rgba(255,69,96,0.1); color: var(--loss); border: 1px solid rgba(255,69,96,0.3); }
.badge-hold { background: rgba(26,86,232,0.15); color: var(--primary-light); border: 1px solid rgba(26,86,232,0.3); }
.badge-buy { background: var(--profit-bg); color: var(--profit); border: 1px solid rgba(16,214,122,0.3); }
.badge-watchlist { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,166,35,0.3); }
.badge-tp { background: rgba(0,212,170,0.1); color: var(--accent); border: 1px solid rgba(0,212,170,0.3); }
.badge-profit { background: var(--profit-bg); color: var(--profit); }
.badge-loss { background: var(--loss-bg); color: var(--loss); }
.badge-impas { background: var(--warning-bg); color: var(--warning); }
.badge-rendah { background: var(--profit-bg); color: var(--profit); }
.badge-sedang { background: var(--warning-bg); color: var(--warning); }
.badge-tinggi { background: var(--loss-bg); color: var(--loss); }
.badge-admin { background: rgba(26,86,232,0.15); color: var(--primary-light); border: 1px solid rgba(26,86,232,0.3); }
.badge-member { background: rgba(0,212,170,0.1); color: var(--accent); border: 1px solid rgba(0,212,170,0.3); }

/* ====== SEARCH/FILTER BAR ====== */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { padding: 9px 12px; font-size: 13px; min-width: 130px; }
.filter-bar .btn { padding: 9px 16px; }

/* ====== DISCLAIMER ====== */
.disclaimer {
    background: rgba(26,86,232,0.07);
    border: 1px solid rgba(26,86,232,0.2);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.7;
}
.disclaimer strong { color: var(--primary-light); }

/* ====== MEMBERSHIP INFO ====== */
.membership-card {
    background: linear-gradient(135deg, rgba(26,86,232,0.15), rgba(0,212,170,0.1));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.membership-card .mem-icon { font-size: 36px; }
.membership-card .mem-info .mem-title { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.membership-card .mem-info .mem-date {
    font-family: 'DM Mono', monospace;
    font-size: 20px;
    font-weight: 500;
    color: var(--accent);
}
.membership-card .mem-days { margin-left: auto; text-align: right; }
.membership-card .mem-days .days-num {
    font-family: 'DM Mono', monospace;
    font-size: 28px;
    font-weight: 500;
    color: var(--profit);
}
.membership-card .mem-days .days-label { font-size: 11px; color: var(--text-muted); }

/* ====== MODAL ====== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--white); }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--text); }

/* ====== PAGE HEADER ====== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header h2 {
    font-size: 22px;
    color: var(--white);
}
.page-header p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ====== EMPTY STATE ====== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h4 { color: var(--text); margin-bottom: 8px; font-family: 'DM Sans', sans-serif; }
.empty-state p { font-size: 13px; }

/* ====== HAMBURGER (mobile) ====== */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-content { margin-left: 0; }
    .hamburger { display: block; }
    .content-wrap { padding: 16px; }
    .topbar { padding: 0 16px; }
    .login-card { padding: 32px 24px; }
    .card { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ====== RETURN % COLORS ====== */
.positive { color: var(--profit); font-weight: 600; }
.negative { color: var(--loss); font-weight: 600; }
.neutral  { color: var(--text-muted); }

/* ====== LOADING SPINNER ====== */
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== TOOLTIP ====== */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-text {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1E2D45;
    color: var(--text);
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 6px;
    border: 1px solid var(--border);
}
.tooltip-wrap:hover .tooltip-text { display: block; }

/* ====== OVERLAY for sidebar close ====== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }


/* =============================================
   RIKOPEDIA - MOBILE RESPONSIVE FIX
   assets/css/mobile_fix.css
   Load setelah style.css untuk override
   ============================================= */

/* === ANTI HORIZONTAL OVERFLOW === */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    max-width: 100%;
}

.main-content {
    max-width: 100%;
    overflow-x: hidden;
}

.content-wrap {
    max-width: 100%;
    overflow-x: hidden;
}

/* === TABEL: BUAT BISA DI-SCROLL HORIZONTAL DI HP === */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* === STATS GRID - MOBILE === */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .stat-card {
        padding: 14px !important;
    }
    .stat-icon {
        font-size: 22px !important;
        margin-bottom: 8px !important;
    }
    .stat-value {
        font-size: 22px !important;
    }
    .stat-label {
        font-size: 11px !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .stat-card {
        padding: 12px !important;
    }
    .stat-icon {
        font-size: 18px !important;
        margin-bottom: 4px !important;
    }
    .stat-value {
        font-size: 18px !important;
        line-height: 1.1;
    }
    .stat-label {
        font-size: 10px !important;
    }
}

/* === JURNAL STATS GRID === */
@media (max-width: 768px) {
    .stats-jurnal {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}
@media (max-width: 480px) {
    .stats-jurnal {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

/* === CARD - MOBILE === */
@media (max-width: 768px) {
    .card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 10px;
    }
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-title {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 14px 12px;
    }
}

/* === PAGE HEADER === */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .page-header h2 {
        font-size: 18px;
    }
    .page-header p {
        font-size: 12px;
    }
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
}

/* === FILTER BAR === */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .form-group {
        width: 100%;
    }
    .filter-bar .form-control {
        min-width: unset !important;
        width: 100%;
    }
    .filter-bar .btn {
        width: 100%;
        justify-content: center;
    }
}

/* === MEMBERSHIP CARD === */
@media (max-width: 768px) {
    .membership-card {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .membership-card .mem-days {
        margin-left: 0;
        text-align: center;
    }
}

/* === DISCLAIMER === */
@media (max-width: 480px) {
    .disclaimer {
        font-size: 11px;
        padding: 12px 14px;
    }
}

/* === FORM ROW === */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* === BUTTON - MOBILE === */
@media (max-width: 480px) {
    .btn {
        font-size: 13px;
        padding: 9px 14px;
    }
    .btn-sm {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* === TABLE FONT SIZE - MOBILE === */
@media (max-width: 768px) {
    thead th {
        font-size: 10px !important;
        padding: 10px 8px !important;
    }
    tbody td {
        font-size: 12px !important;
        padding: 10px 8px !important;
    }
    .stock-code {
        font-size: 11px;
        padding: 2px 6px;
    }
    .td-actions {
        gap: 4px;
    }
    .td-actions .btn-sm {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* === TOPBAR === */
@media (max-width: 480px) {
    .topbar {
        padding: 0 12px;
        height: 54px;
    }
    .topbar-title {
        font-size: 14px;
    }
    .topbar-title span {
        font-size: 12px;
    }
    .topbar-actions {
        gap: 6px;
    }
    .topbar-actions span {
        display: none;
    }
}

/* === IMAGE WRAPPER - PASTIKAN TIDAK OVERFLOW === */
img {
    max-width: 100%;
    height: auto;
}

/* === SIDEBAR USER FOOTER === */
@media (max-width: 768px) {
    .sidebar-user .user-info .user-name {
        max-width: 110px;
    }
}

/* === CHART CONTAINER - JANGAN OVERFLOW === */
.chart-canvas-wrap {
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr !important;
    }
    .chart-canvas-wrap {
        height: 240px !important;
    }
    .chart-box {
        padding: 14px;
    }
}

/* === FIX TEXT OVERFLOW === */
.analisa-title,
.analisa-caption,
.card-title {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* === GAMBAR DI ANALISA - PASTIKAN RESPONSIVE === */
@media (max-width: 768px) {
    .analisa-images {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    .img-wrapper {
        width: 100%;
    }
    .img-wrapper img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }
}