/* ============================================================
   IG Theme  — Professional Trading Platform
   Colour palette: #ff4931 (red)  |  #ffffff (white)  |  #000000 (black)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --ig-red:        #ff4931;
    --ig-red-dark:   #e03d28;
    --ig-red-dim:    rgba(255,73,49,.12);
    --ig-black:      #000000;
    --ig-white:      #ffffff;
    --bg-body:       #0c0c0c;
    --bg-secondary:  #111111;
    --bg-card:       #181818;
    --bg-hover:      #202020;
    --border:        #2a2a2a;
    --text-primary:  #f0f0f0;
    --text-secondary:#999999;
    --text-muted:    #555555;
    --green:         #22c55e;
    --red-loss:      #ef4444;
    --yellow:        #f59e0b;
    --blue:          #3b82f6;
    --sidebar-w:     240px;
    --header-h:      60px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background: var(--bg-body) !important;
    color: var(--text-primary) !important;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    margin: 0;
}

/* Override Bootstrap defaults for dark theme */
h1,h2,h3,h4,h5,h6 { color: var(--text-primary); }
p { color: var(--text-secondary); }
hr { border-color: var(--border); }
label { color: var(--text-secondary); }
.form-control, .form-select {
    background: var(--bg-hover) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--ig-red) !important;
    box-shadow: none !important;
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}
.card { background: var(--bg-card) !important; border-color: var(--border) !important; color: var(--text-primary) !important; }
.badge { font-size: 11px; }

a { color: var(--ig-red); text-decoration: none; }
a:hover { color: var(--ig-red-dark); }

/* ── Top Header ───────────────────────────────────────────── */
.ig-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: #000;
    border-bottom: 2px solid var(--ig-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    gap: 12px;
}

.ig-logo {
    display: flex; align-items: center; gap: 10px;
    color: var(--ig-white); font-weight: 800; font-size: 17px;
    letter-spacing: .5px; text-decoration: none; flex-shrink: 0;
}
.ig-logo-mark {
    width: 34px; height: 34px; border-radius: 4px;
    background: var(--ig-red); display: flex; align-items: center;
    justify-content: center; font-weight: 900; font-size: 15px; color: #fff;
}
.ig-logo-text { letter-spacing: 1px; }

.ig-header-center { flex: 1; display: flex; justify-content: center; }

.ig-header-right {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.ig-balance-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 14px;
    display: flex; flex-direction: column; align-items: flex-end;
}
.ig-balance-pill .bp-label {
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
.ig-balance-pill .bp-value {
    font-size: 14px; font-weight: 700; color: var(--ig-white);
    font-variant-numeric: tabular-nums;
}

.ig-icon-btn {
    width: 34px; height: 34px; border-radius: 6px;
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary); display: flex; align-items: center;
    justify-content: center; cursor: pointer; font-size: 16px;
    transition: all .2s; position: relative;
}
.ig-icon-btn:hover { border-color: var(--ig-red); color: var(--ig-red); }

.ig-avatar-btn {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--ig-red); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff;
    position: relative; flex-shrink: 0;
}

/* Dropdown */
.ig-dropdown { position: relative; }
.ig-dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; min-width: 200px; padding: 6px 0;
    display: none; z-index: 1200; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.ig-dropdown.show .ig-dropdown-menu { display: block; }

.ig-dropdown-header {
    padding: 10px 16px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.ig-dropdown-header .dh-name {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.ig-dropdown-header .dh-user {
    font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.ig-dropdown-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 16px; color: var(--text-secondary);
    font-size: 13px; cursor: pointer; transition: background .15s;
    border: none; background: none; width: 100%; text-align: left;
    text-decoration: none;
}
.ig-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.ig-dropdown-item.danger:hover { color: var(--red-loss); }
.ig-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Mobile menu toggle */
.ig-menu-toggle {
    display: none; background: none; border: none;
    color: var(--text-primary); font-size: 20px; cursor: pointer; padding: 4px;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.ig-sidebar {
    position: fixed;
    top: var(--header-h); left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    z-index: 900;
    transition: transform .25s ease;
}
.ig-sidebar::-webkit-scrollbar { width: 3px; }
.ig-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ig-sidebar-user {
    padding: 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.ig-sidebar-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--ig-red); display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 14px;
    color: #fff; flex-shrink: 0;
}
.ig-sidebar-info .si-name {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.ig-sidebar-info .si-username {
    font-size: 11px; color: var(--text-muted); margin-top: 1px;
}

.ig-nav-section { padding: 16px 0 4px; }
.ig-nav-label {
    padding: 0 16px 6px;
    font-size: 10px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--text-muted);
}
.ig-nav-list { list-style: none; margin: 0; padding: 0; }
.ig-nav-list li a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; color: var(--text-secondary);
    text-decoration: none; font-size: 13px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .2s;
}
.ig-nav-list li a i { width: 18px; text-align: center; font-size: 15px; }
.ig-nav-list li a:hover {
    color: var(--text-primary); background: var(--bg-hover);
    border-left-color: var(--ig-red);
}
.ig-nav-list li a.active {
    color: var(--ig-white);
    background: var(--ig-red-dim);
    border-left-color: var(--ig-red);
}

.ig-sidebar-bottom {
    margin-top: auto; padding: 12px 0;
    border-top: 1px solid var(--border); flex-shrink: 0;
}

.ig-sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.7); z-index: 890;
}
.ig-sidebar-overlay.show { display: block; }

/* ── Main Content Area ────────────────────────────────────── */
.ig-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    display: flex; flex-direction: column;
}

.ig-ticker-bar { background: #000; border-bottom: 1px solid var(--border); }

.ig-content { flex: 1; padding: 24px; }

.ig-page-header { margin-bottom: 22px; }
.ig-page-title { font-size: 20px; font-weight: 700; margin: 0; }
.ig-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    margin-top: 4px; font-size: 11px; color: var(--text-muted);
}
.ig-breadcrumb a { color: var(--ig-red); }
.ig-breadcrumb .sep { color: var(--border); }

/* ── Cards ────────────────────────────────────────────────── */
.ig-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
    margin-bottom: 20px;
}
.ig-card-header {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.ig-card-title {
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-secondary); margin: 0;
}
.ig-card-body { padding: 20px; }

/* Stat Card */
.ig-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    position: relative; overflow: hidden;
    transition: border-color .2s, transform .2s;
    margin-bottom: 0;
}
.ig-stat:hover { border-color: var(--ig-red); transform: translateY(-1px); }
.ig-stat::after {
    content: ''; position: absolute;
    top: 0; left: 0; width: 3px; height: 100%;
    background: var(--ig-red);
}
.ig-stat-icon {
    width: 38px; height: 38px; border-radius: 8px;
    background: var(--ig-red-dim); display: flex; align-items: center;
    justify-content: center; color: var(--ig-red); font-size: 17px;
    margin-bottom: 12px;
}
.ig-stat-label {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .8px;
}
.ig-stat-value {
    font-size: 21px; font-weight: 700; color: var(--text-primary);
    margin: 5px 0 4px; font-variant-numeric: tabular-nums;
    letter-spacing: -.3px;
}
.ig-stat-value.positive { color: var(--green); }
.ig-stat-value.negative { color: var(--red-loss); }
.ig-stat-sub { font-size: 11px; color: var(--text-muted); }
.ig-stat-link { font-size: 11px; color: var(--ig-red); margin-top: 8px; display: inline-block; }
.ig-stat-link:hover { color: var(--ig-red-dark); }

/* ── Tables ───────────────────────────────────────────────── */
.ig-table-wrap { overflow-x: auto; }

.ig-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.ig-table thead th {
    background: #111; color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; font-size: 10px;
    letter-spacing: .8px; padding: 11px 16px;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ig-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.ig-table tbody tr:last-child { border-bottom: none; }
.ig-table tbody tr:hover { background: var(--bg-hover); }
.ig-table td { padding: 11px 16px; vertical-align: middle; }
.ig-table td.mono { font-variant-numeric: tabular-nums; font-size: 12px; }

/* DataTables dark overrides */
table.dataTable { color: var(--text-primary) !important; border-collapse: collapse !important; }
table.dataTable thead th {
    background: #111 !important; color: var(--text-muted) !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 10px !important; font-weight: 600 !important;
    text-transform: uppercase !important; letter-spacing: .8px !important;
    padding: 11px 16px !important;
}
table.dataTable tbody tr { background: var(--bg-card) !important; border-bottom: 1px solid var(--border) !important; }
table.dataTable tbody tr:hover { background: var(--bg-hover) !important; }
table.dataTable tbody td { color: var(--text-primary) !important; padding: 11px 16px !important; }
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info { color: var(--text-secondary) !important; font-size: 12px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--bg-hover) !important; border: 1px solid var(--border) !important;
    color: var(--text-primary) !important; border-radius: 4px !important;
    padding: 4px 8px !important; outline: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important; border-radius: 4px !important; border: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--ig-red) !important; color: #fff !important; border: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-hover) !important; color: var(--text-primary) !important; border: none !important;
}

/* ── Forms ────────────────────────────────────────────────── */
.ig-form-group { margin-bottom: 18px; }
.ig-label {
    display: block; font-size: 11px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .5px;
}
.ig-input, .ig-select {
    width: 100%; background: var(--bg-hover);
    border: 1px solid var(--border); color: var(--text-primary);
    border-radius: 6px; padding: 10px 14px; font-size: 14px;
    outline: none; transition: border-color .2s;
    font-family: inherit;
}
.ig-input:focus, .ig-select:focus { border-color: var(--ig-red); background: var(--bg-hover); }
.ig-input::placeholder { color: var(--text-muted); }
.ig-input:disabled, .ig-input[readonly] {
    background: #111; color: var(--text-muted); cursor: not-allowed;
}
.ig-select { cursor: pointer; }
.ig-input-group { display: flex; }
.ig-input-addon {
    background: #111; border: 1px solid var(--border); border-right: none;
    border-radius: 6px 0 0 6px; padding: 10px 14px;
    color: var(--text-muted); font-size: 13px; white-space: nowrap;
    display: flex; align-items: center;
}
.ig-input-group .ig-input { border-radius: 0 6px 6px 0; }

/* ── Buttons ──────────────────────────────────────────────── */
.ig-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; border-radius: 6px; font-size: 13px;
    font-weight: 600; cursor: pointer; border: none; outline: none;
    transition: all .2s; text-decoration: none; font-family: inherit;
    justify-content: center;
}
.ig-btn-primary { background: var(--ig-red); color: #fff; }
.ig-btn-primary:hover { background: var(--ig-red-dark); color: #fff; }
.ig-btn-outline { background: transparent; border: 1px solid var(--ig-red); color: var(--ig-red); }
.ig-btn-outline:hover { background: var(--ig-red); color: #fff; }
.ig-btn-ghost { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.ig-btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }
.ig-btn-sm { padding: 6px 14px; font-size: 12px; }
.ig-btn-block { width: 100%; }
.ig-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badges ───────────────────────────────────────────────── */
.ig-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.ig-badge-success { background: rgba(34,197,94,.15); color: #22c55e; }
.ig-badge-danger  { background: rgba(239,68,68,.15);  color: #ef4444; }
.ig-badge-warning { background: rgba(245,158,11,.15); color: #f59e0b; }
.ig-badge-info    { background: rgba(59,130,246,.15); color: #60a5fa; }
.ig-badge-primary { background: var(--ig-red-dim); color: var(--ig-red); }

/* ── Alert / Notice ───────────────────────────────────────── */
.ig-alert {
    border-radius: 6px; padding: 12px 16px; font-size: 13px;
    display: flex; align-items: flex-start; gap: 10px;
}
.ig-alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25); color: #93c5fd; }
.ig-alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: #fcd34d; }
.ig-alert-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25);  color: #86efac; }

/* ── Live dot / pulse ─────────────────────────────────────── */
.ig-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--green); }
.ig-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green); animation: igPulse 1.6s infinite;
}
@keyframes igPulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Profit row animation ─────────────────────────────────── */
@keyframes igSlideIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }
.ig-row-new { animation: igSlideIn .3s ease-out; }

/* ── Divider ──────────────────────────────────────────────── */
.ig-divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Footer ───────────────────────────────────────────────── */
.ig-footer {
    padding: 14px 24px; border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 11px;
    background: var(--bg-secondary);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
    .ig-sidebar { transform: translateX(-100%); }
    .ig-sidebar.open { transform: translateX(0); }
    .ig-main { margin-left: 0; }
    .ig-menu-toggle { display: flex !important; }
    .ig-balance-pill { display: none; }
}
@media (max-width: 768px) {
    .ig-content { padding: 16px; }
}

/* ── Login Page ───────────────────────────────────────────── */
.ig-login-page {
    min-height: 100vh; background: var(--ig-black);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.ig-login-wrap {
    display: flex; width: 100%; max-width: 940px;
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border); min-height: 560px;
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.ig-login-left {
    flex: 1; background: var(--ig-red);
    padding: 48px 40px; display: flex; flex-direction: column;
    justify-content: space-between; position: relative; overflow: hidden;
}
.ig-login-left::before {
    content: ''; position: absolute; bottom: -80px; right: -80px;
    width: 240px; height: 240px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.ig-login-left::after {
    content: ''; position: absolute; top: -40px; left: 60px;
    width: 140px; height: 140px; border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.ig-login-brand { font-size: 26px; font-weight: 900; color: #fff; letter-spacing: 2px; position: relative; z-index:1; }
.ig-login-tagline { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 4px; position: relative; z-index:1; }
.ig-login-left-body { position: relative; z-index: 1; }
.ig-login-left-body h2 { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.ig-login-left-body p  { color: rgba(255,255,255,.8); font-size: 13px; line-height: 1.7; }
.ig-login-feat { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.9); font-size: 13px; margin-top: 14px; }
.ig-login-feat i { font-size: 15px; }
.ig-login-right {
    flex: 1; background: var(--bg-secondary);
    padding: 48px 44px; display: flex; flex-direction: column; justify-content: center;
}
.ig-login-right h1  { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.ig-login-right > p { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
@media (max-width: 640px) {
    .ig-login-left { display: none; }
    .ig-login-right { padding: 32px 24px; }
    .ig-login-wrap { max-width: 440px; }
}

/* ── Utility ──────────────────────────────────────────────── */
.text-success-ig { color: var(--green); }
.text-danger-ig  { color: var(--red-loss); }
.text-muted-ig   { color: var(--text-muted); }
.text-red        { color: var(--ig-red); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-mono { font-variant-numeric: tabular-nums; font-family: 'Courier New', monospace; }
.gap-2 { gap: 8px; }
.mb-0  { margin-bottom: 0 !important; }
.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }

/* Override Bootstrap default link in buttons */
.ig-nav-list li a { text-decoration: none; }
