* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background-color: #f0f2f5; margin: 0; padding: 20px; color: #333; }
.container { max-width: 1400px; margin: 0; }
h2 { text-align: left; margin-bottom: 25px; color: #1a252f; }
.layout { display: flex; gap: 20px; flex-wrap: wrap; }
.sidebar { flex: 1; min-width: 300px; max-width: 350px; }
.main-content { flex: 2; min-width: 600px; }
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; }
.card h3 { margin-top: 0; color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 8px; font-size: 16px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: bold; margin-bottom: 5px; color: #666; }
.form-control { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.btn { width: 100%; padding: 10px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 14px; }
.btn-primary { background-color: #3498db; color: white; }
.btn-success { background-color: #2ecc71; color: white; width: auto; padding: 8px 15px; }
.btn-warning { background-color: #f1c40f; color: #2c3e50; text-decoration: none; display: block; text-align: center; padding: 10px; border-radius: 4px; font-weight: bold; }
.btn-secondary { background-color: #7f8c8d; color: white; }
.alert { background-color: #d4edda; color: #155724; padding: 12px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger a { color: #721c24; text-decoration: underline; }
.alert-warning { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-warning a { color: #856404; text-decoration: underline; }
.notebox { margin-top: 8px; padding: 9px 12px; border-radius: 5px; font-size: 13px; line-height: 1.45; }
.notebox.warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.notebox.info { background: #e8f4fd; color: #31708f; border: 1px solid #bce8f1; }
.notebox a { color: inherit; font-weight: bold; }
.list-watchlist { list-style: none; padding: 0; margin: 0; max-height: 150px; overflow-y: auto; border: 1px solid #ddd; border-radius: 4px; }
.list-watchlist li { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #eee; font-size: 14px; }
.btn-delete { background: none; border: none; color: #e74c3c; cursor: pointer; font-weight: bold; }
.flex-tables { display: flex; gap: 20px; flex-wrap: wrap; }
.table-box { flex: 1; background: #fff; padding: 15px; border-radius: 6px; }
.table-buyer { border-top: 4px solid #2ecc71; }
.table-seller { border-top: 4px solid #e74c3c; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid #eee; }
th { background-color: #f8f9fa; color: #555; }
.sort-link { color: #555; text-decoration: none; font-weight: bold; white-space: nowrap; }
.sort-link:hover { color: #2980b9; text-decoration: underline; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: #2980b9; }
th.sortable.sort-asc::after { content: ' ▲'; font-size: 10px; }
th.sortable.sort-desc::after { content: ' ▼'; font-size: 10px; }
.text-right { text-align: right; }
.badge { background: #2ecc71; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; }
.badge-red { background: #e74c3c; }
.badge-tipe { display: inline-block; padding: 2px 9px; border-radius: 10px; color: #fff; font-size: 11px; font-weight: bold; white-space: nowrap; }
.tipe-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.empty-text { text-align: center; color: #999; padding: 20px 0; }
.header-stock { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.header-stock h4 { margin: 0; font-size: 22px; color: #2c3e50; }
.date-badge { background: #7f8c8d; color: white; padding: 4px 10px; border-radius: 4px; font-size: 13px; }
.search-wrap { position: relative; }
.search-results { position: absolute; z-index: 20; left: 0; right: 0; background: #fff; border: 1px solid #ccc; border-radius: 0 0 4px 4px; max-height: 240px; overflow-y: auto; display: none; box-shadow: 0 6px 12px rgba(0,0,0,0.12); }
.search-item { padding: 8px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #eef6ff; }
.search-item small { color: #95a5a6; margin-left: 4px; }
.search-item.empty { color: #999; cursor: default; }

/* Navigasi tombol */
.top-nav { display: flex; justify-content: flex-start; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
.btn-nav { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 14px; color: #fff; background: #3498db; border: none; cursor: pointer; transition: filter .15s; }
.btn-nav:hover { filter: brightness(0.92); }
.btn-nav.active { box-shadow: 0 0 0 3px rgba(52,152,219,0.25); }
.btn-nav.dark { background: #2c3e50; }
.btn-nav.red { background: #e74c3c; }
.btn-nav.green { background: #27ae60; }
.btn-nav.gray { background: #7f8c8d; }
.btn-nav.orange { background: #e67e22; }
.btn-nav.teal { background: #16a085; }
.btn-nav.purple { background: #8e44ad; }
.btn-nav.blue { background: #3498db; }
.btn-nav.maroon { background: #800000; }
.btn-nav.maroon.active { box-shadow: 0 0 0 3px rgba(128,0,0,0.25); }

/* Dropdown menu Bandarmologi */
.nav-dropdown { position: relative; display: inline-flex; }
.nav-drop-toggle { font-family: inherit; }
.nav-caret { font-size: 10px; margin-left: 2px; }
.nav-drop-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.14); padding: 6px; display: none; z-index: 50; }
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu { display: block; }
.nav-drop-menu::before { content: ''; position: absolute; top: -6px; left: 0; right: 0; height: 6px; }
.nav-drop-item { display: block; padding: 9px 12px; border-radius: 4px; text-decoration: none; color: #2c3e50; font-size: 13px; font-weight: 600; white-space: nowrap; }
.nav-drop-item:hover { background: #f0f2f5; }
.nav-drop-item.active { background: #8e44ad; color: #fff; }
.nav-drop-menu-right { left: auto; right: 0; }
.nav-drop-head { padding: 8px 12px; border-bottom: 1px solid #eee; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: #2c3e50; }
.nav-drop-head small { display: block; color: #95a5a6; font-weight: normal; margin-top: 2px; }
.nav-drop-item-danger { color: #c0392b; }
.nav-drop-item-danger:hover { background: #fdecea; }

/* Info user & logout di navigasi */
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-user-info { font-size: 13px; color: #55606a; font-weight: 600; white-space: nowrap; }
.nav-user-info small { color: #95a5a6; font-weight: normal; }
.btn-nav-sm { padding: 7px 13px; font-size: 13px; }

/* Halaman profil */
.profil-card { max-width: 620px; }
.form-divider { border: none; border-top: 1px solid #eee; margin: 24px 0; }
.form-hint { font-size: 13px; color: #95a5a6; margin: 0 0 14px; }
.form-actions { margin-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Halaman login */
.auth-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; padding: 28px 26px; }
.auth-card .btn { margin-top: 4px; }

/* Badge role user */
.role-badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.role-super_admin { background: #f3e5f5; color: #7b1fa2; }
.role-admin { background: #e3f2fd; color: #1565c0; }
.role-userpro { background: #e8f5e9; color: #2e7d32; }
.role-user { background: #eceff1; color: #455a64; }
.sub-active { background: #e8f5e9; color: #2e7d32; }
.sub-expired { background: #ffebee; color: #c62828; }

/* Tabel kelola user */
.table-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #95a5a6 #eef2f6; }
.table-scroll::-webkit-scrollbar { height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #eef2f6; }
.table-scroll::-webkit-scrollbar-thumb { background: #95a5a6; border-radius: 5px; }
.user-table th { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.user-table tbody tr:hover { background: #f9fbfd; }
.user-table td { vertical-align: middle; }
.user-actions { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; }
.user-actions form { display: inline; }
.btn-sm.btn-delete { background: #fff; border: 1px solid #e74c3c; color: #e74c3c; }
.btn-sm.btn-delete:hover { background: #e74c3c; color: #fff; }
.count-badge { background: #eef2f6; color: #55606a; border-radius: 12px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.count-badge-danger { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }

/* Tabel fundamental (master saham) */
.fund-table { min-width: 1700px; }
.fund-table th { white-space: nowrap; }
.fund-table td { white-space: nowrap; }
.fund-table th, .fund-table td { border: 1px solid #dfe4ea; }
.fund-table thead th { background: #eef2f6; }
.fund-table tbody tr:nth-child(even) { background: #fafbfc; }
.user-table th, .user-table td { border: 1px solid #e6eaef; }
.self-tag { background: #e3f2fd; color: #1565c0; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; margin-left: 4px; }
.muted { color: #95a5a6; font-size: 12px; }
.admin-note { font-size: 13px; color: #856404; background: #fff3cd; border: 1px solid #ffeeba; border-radius: 4px; padding: 10px; margin: 16px 0 0; }

/* Tombol aksi kecil di tabel */
.btn-sm { display: inline-block; padding: 5px 12px; border-radius: 5px; font-size: 13px; font-weight: 600; text-decoration: none; color: #fff; border: none; cursor: pointer; }
.btn-edit { background: #3498db; }
.btn-edit:hover { background: #2980b9; }
.btn-hapus { background: #e74c3c; }
.btn-hapus:hover { background: #c0392b; }
.aksi-cell { white-space: nowrap; }
.aksi-cell form { display: inline; }

/* Kartu daftar dengan form & import di dalamnya */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 2px solid #eee; padding-bottom: 8px; margin-bottom: 12px; }
.card-head h3 { margin: 0; padding: 0; border-bottom: none; }
.card-head .btn-sm { flex: 0 0 auto; }
.card-head-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.filter-inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.filter-inline input[name="q"] { width: 180px; }
.filter-inline select { width: auto; min-width: 130px; }
.form-panel { background: #f8f9fa; border: 1px solid #e3e6ea; border-radius: 6px; padding: 14px; margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; margin-bottom: 0; }
.filter-bar .form-row { align-items: flex-end; }
.filter-bar .form-row .form-group.filter-submit { flex: 0 0 auto; min-width: 0; }
.form-actions { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; margin-top: 12px; }
.form-actions .btn { width: auto; }
.btn-auto { width: auto; padding: 9px 18px; }
.toolbar { margin-bottom: 12px; }
.import-panel { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #e3e6ea; }
.import-panel summary { cursor: pointer; font-size: 13px; font-weight: bold; color: #7f8c8d; outline: none; }
.import-panel summary:hover { color: #2980b9; }
.import-panel > form, .import-panel > p { margin-top: 12px; }

/* Paginasi tabel */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pager .page-info { font-size: 13px; color: #666; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* Link emiten ke pantau broker */
.link-emiten { color: #2c3e50; text-decoration: none; }
.link-emiten:hover { color: #2980b9; text-decoration: underline; }
.link-emiten:hover .badge { background: #27ae60; }

/* Link broker ke pantau broker */
.link-broker { color: #2c3e50; text-decoration: none; }
.link-broker:hover { color: #2980b9; text-decoration: underline; }
.link-broker:hover .badge { background: #c0392b; }

/* Akumulasi berjalan broker (matriks broker x tanggal) */
.run-table { min-width: 720px; }
.run-table th, .run-table td { text-align: center; vertical-align: top; }
.run-table th.broker, .run-table td.broker { text-align: left; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; }
.run-table thead th.broker { background: #f8f9fa; }
.run-cell { min-width: 108px; }
.run-cum { font-weight: bold; color: #2c3e50; font-size: 13px; }
.run-cum.pos { color: #27ae60; }
.run-cum.neg { color: #e74c3c; }
.run-cum.muted { color: #c3c9cd; font-weight: normal; }
.run-delta { font-size: 11px; margin-top: 2px; white-space: nowrap; }
.run-delta.up { color: #27ae60; }
.run-delta.down { color: #e74c3c; }
.run-delta.flat { color: #bdc3c7; }

/* Ringkasan statistik */
.stat-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-box { flex: 1; min-width: 200px; background: #f8f9fa; border: 1px solid #e3e6ea; border-radius: 6px; padding: 14px 16px; }
.stat-label { font-size: 12px; font-weight: bold; color: #7f8c8d; text-transform: uppercase; letter-spacing: .4px; }
.dash-meta { font-size: 12px; color: #7f8c8d; margin-top: 8px; line-height: 1.7; }
.dash-meta strong { color: #2c3e50; }
.dash-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Portofolio */
.porto-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.porto-card { background: #f8f9fa; border: 1px solid #e3e6ea; border-radius: 8px; padding: 12px 14px; text-align: center; }
.porto-card .p-label { font-size: 12px; color: #7f8c8d; cursor: pointer; user-select: none; }
.porto-card .p-value { font-size: 20px; font-weight: 700; color: #2c3e50; }
.porto-card .p-sub { font-size: 12px; font-weight: 600; }
.p-bd { margin-top: 6px; padding-top: 6px; border-top: 1px solid #e3e6ea; font-size: 12px; color: #666; text-align: left; display: none; }
.p-bd.show { display: block; }
.p-bd .row { display: flex; justify-content: space-between; gap: 10px; }
.pl-pos { color: #27ae60; }
.pl-neg { color: #e74c3c; }
.porto-toggles { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; margin-bottom: 16px; }
.porto-toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.alloc-list .alloc-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-radius: 5px; }
.alloc-list .alloc-item:hover { background: #f4f6f8; }
.alloc-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.alloc-total { display: flex; justify-content: space-between; padding: 8px; background: #eef4fb; border-radius: 5px; font-weight: 700; }
.chart-wrap { max-width: 260px; margin: 0 auto; }
.porto-2col { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.porto-2col > * { flex: 1; min-width: 280px; }
.porto-wrap { max-width: 1400px; }
.stat-value { font-size: 22px; font-weight: bold; margin: 4px 0 2px; }
.stat-sub { font-size: 12px; color: #95a5a6; }

/* Panel gabungan kelola backend: provider/token + unduh data (1 kartu, 2 kolom) */
.backend-top { display: flex; gap: 28px; flex-wrap: wrap; }
.backend-col { flex: 1; min-width: 300px; }
.backend-col + .backend-col { border-left: 1px solid #eee; padding-left: 28px; }
.backend-col h4 { margin: 0 0 14px; color: #2c3e50; font-size: 14px; }
@media (max-width: 720px) {
    .backend-col + .backend-col { border-left: none; padding-left: 0; border-top: 1px solid #eee; padding-top: 18px; }
    .flex-tables { flex-direction: column; gap: 14px; }
    .table-box { width: 100%; overflow-x: auto; }
    .card-head { flex-wrap: wrap; }
    .card-head-actions { width: 100%; justify-content: flex-start; margin-left: 0; }
    .filter-inline { width: 100%; }
    .filter-inline input[name="q"] { flex: 1 1 160px; width: auto; min-width: 0; }
    .filter-inline select { flex: 1 1 130px; }
}
/* Brand logo NEXUSinvesta */
.brand-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1; color: #0f172a; }
.brand-logo-icon { width: 34px; height: 34px; flex-shrink: 0; vertical-align: middle; }
.brand-logo-text { font-weight: 800; font-size: 20px; letter-spacing: .3px; white-space: nowrap; }
.brand-logo-text em { font-style: normal; color: #0284c7; }
.brand-logo-orbit-1 { animation: nexusOrbit1 10s linear infinite; transform-origin: 32px 32px; }
.brand-logo-orbit-2 { animation: nexusOrbit2 14s linear infinite; transform-origin: 32px 32px; }
@keyframes nexusOrbit1 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes nexusOrbit2 { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
.brand-bar { display: flex; align-items: center; margin: 0 0 14px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 12px; }
.auth-brand .brand-logo { gap: 12px; }
.auth-brand .brand-logo-icon { width: 52px; height: 52px; }
.auth-brand .brand-logo-text { font-size: 27px; }
