/* Gold Account - Bootstrap compatible trading UI
   Keeps your current MVC shell names and sidebar toggle behaviour.
*/

@font-face { font-family: "Ubuntu Mono"; src: url('/fonts/UbuntuMono-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Ubuntu Mono"; src: url('/fonts/UbuntuMono-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
    --ga-sidebar-expanded: 252px;
    --ga-sidebar-collapsed: 78px;
    --ga-header-height: 70px;
    --ga-footer-height: 44px;
    --ga-navy: #0b1a2a;
    --ga-navy-2: #0f2740;
    --ga-navy-3: #143553;
    --ga-text: #142236;
    --ga-muted: #748196;
    --ga-bg: #f3f6f9;
    --ga-surface: rgba(255,255,255,.93);
    --ga-border: rgba(20,34,54,.10);
    --ga-gold: #d2aa43;
    --ga-gold-2: #b98422;
    --ga-gold-soft: #fbf5e7;
    --ga-green: #159060;
    --ga-green-soft: #e8f7f0;
    --ga-red: #cf4c52;
    --ga-red-soft: #fcebed;
    --ga-blue: #176bb0;
    --ga-radius: 14px;
    --ga-shadow: 0 8px 28px rgba(13,29,48,.08);
    --ga-shadow-soft: 0 4px 16px rgba(13,29,48,.05);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--ga-bg); color: var(--ga-text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--ga-blue); text-decoration: none; }
a:hover { color: #0c5795; }

/* Sidebar + brand */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1045; width: var(--ga-sidebar-expanded); overflow-x: hidden; overflow-y: auto; background: linear-gradient(180deg, #0d2237 0%, #081523 100%); border-right: 1px solid rgba(255,255,255,.06); box-shadow: 8px 0 30px rgba(7,18,30,.08); transition: width .22s ease, transform .22s ease; }
.sidebar.collapsed { width: var(--ga-sidebar-collapsed); }
.sidebar-brand { height: var(--ga-header-height); display: flex; align-items: center; padding: 10px 18px; border-bottom: 1px solid rgba(255,255,255,.07); overflow: hidden; }
.sidebar-brand .brand-logo-full { display: block; width: 194px; min-width: 194px; height: auto; }
.sidebar-brand .brand-logo-mark { display: none; width: 42px; height: 42px; min-width: 42px; }
.sidebar.collapsed .brand-logo-full { display: none; }
.sidebar.collapsed .brand-logo-mark { display: block; margin: 0 auto; }
.sidebar-nav { padding: 17px 12px 24px; }
.sidebar-section-label { margin: 16px 12px 7px; color: #63758a; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.sidebar .nav { gap: 4px; }
.sidebar .nav-link { position: relative; min-height: 47px; display: flex; align-items: center; padding: 11px 12px; border-radius: 10px; color: #aebccc; font-size: 15px; white-space: nowrap; transition: color .15s ease, background .15s ease; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.055); }
.sidebar .nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(210,170,67,.20), rgba(210,170,67,.05)); }
.sidebar .nav-link.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 999px; background: var(--ga-gold); }
.sidebar .nav-link i { flex: 0 0 36px; width: 36px; text-align: center; color: #7f93aa; font-size: 18px; }
.sidebar .nav-link.active i { color: #e6c35b; }
.sidebar .nav-link span { overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .nav-link { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .nav-link i { flex-basis: auto; width: auto; }
.sidebar.collapsed .nav-link span, .sidebar.collapsed .sidebar-section-label, .sidebar.collapsed .sidebar-account { display: none; }
.sidebar-account { margin: 18px 4px 0; padding: 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(255,255,255,.035); }
.sidebar-account-label { color: #74869a; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-account-value { margin-top: 5px; color: #f7f9fb; font: 700 19px/1.2 "Ubuntu Mono", monospace; }
.sidebar-account-sub { margin-top: 4px; color: #8fa1b4; font-size: 12px; line-height: 1.35; }

/* Header */
.navbar-custom { position: fixed; top: 0; right: 0; left: var(--ga-sidebar-expanded); z-index: 1040; height: var(--ga-header-height); display: flex; align-items: center; gap: 14px; padding: 0 20px; color: #fff; background: linear-gradient(90deg, #0d3555 0%, #07528a 58%, #0b4168 100%); border-bottom: 1px solid rgba(255,255,255,.10); box-shadow: 0 4px 18px rgba(8,28,46,.13); transition: left .22s ease; }
.sidebar.collapsed ~ .navbar-custom { left: var(--ga-sidebar-collapsed); }
#sidebarToggle { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.10); border-radius: 10px; color: #fff; background: rgba(255,255,255,.06); font-size: 18px; cursor: pointer; }
#sidebarToggle:hover { background: rgba(255,255,255,.12); }
#sidebarToggle:focus { outline: none; box-shadow: 0 0 0 3px rgba(210,170,67,.20); }
.navbar-title { min-width: 140px; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.market-ticker { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 7px; }
.ticker-item { min-width: 126px; display: grid; grid-template-columns: auto auto; grid-template-areas: "name price" "name change"; align-items: center; column-gap: 9px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.06); }
.ticker-name { grid-area: name; color: #dfe9f2; font-size: 12px; font-weight: 700; }
.ticker-price { grid-area: price; color: #fff; font: 700 15px/1.1 "Ubuntu Mono", monospace; text-align: right; }
.ticker-change { grid-area: change; font: 700 11px/1.1 "Ubuntu Mono", monospace; text-align: right; }
.ticker-change.up { color: #54d89c; }
.ticker-change.down { color: #ff8585; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-icon { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.10); border-radius: 10px; color: #fff; background: rgba(255,255,255,.055); }
.header-icon:hover { color: #fff; background: rgba(255,255,255,.11); }
.header-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; color: #241b06; background: var(--ga-gold); font-size: 9px; font-weight: 800; }
.user-menu-btn { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px 4px 5px; border: 1px solid rgba(255,255,255,.10); border-radius: 10px; color: #fff !important; background: rgba(255,255,255,.055) !important; box-shadow: none !important; }
.user-menu-btn:hover, .user-menu-btn.show { background: rgba(255,255,255,.11) !important; }
.user-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #251c06; background: linear-gradient(145deg, #f1d26f, #c8952d); font-size: 12px; font-weight: 900; }
.user-menu-label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
.navbar-custom .dropdown-menu { margin-top: 10px !important; padding: 7px; border: 1px solid var(--ga-border); border-radius: 12px; box-shadow: var(--ga-shadow); }
.navbar-custom .dropdown-item { padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.navbar-custom .dropdown-item:hover { background: #f3f6f9; }

/* Page shell/background */
.content-wrapper { position: relative; isolation: isolate; min-height: 100vh; margin-left: var(--ga-sidebar-expanded); padding: calc(var(--ga-header-height) + 10px) 24px calc(var(--ga-footer-height) + 18px); overflow: hidden; background: #f4f7fa; transition: margin-left .22s ease; }
/* Artwork layer. Absolute /images path matches the logo path used by the layout. */
.content-wrapper::before { content: ""; position: fixed; z-index: 0; inset: var(--ga-header-height) 0 0 var(--ga-sidebar-expanded); pointer-events: none; background-image: url('/images/background.png?v=3'); background-repeat: no-repeat; background-position: right center; background-size: cover; transition: left .22s ease; }
/* Fade the artwork underneath the working area but leave the far right clearly visible. */
.content-wrapper::after { content: ""; position: fixed; z-index: 1; inset: var(--ga-header-height) 0 0 var(--ga-sidebar-expanded); pointer-events: none; background: linear-gradient(90deg, #f4f7fa 0%, rgba(244,247,250,.98) 55%, rgba(244,247,250,.78) 67%, rgba(244,247,250,.28) 80%, rgba(244,247,250,0) 100%); transition: left .22s ease; }
.content-wrapper.collapsed { margin-left: var(--ga-sidebar-collapsed); }
.content-wrapper.collapsed::before, .content-wrapper.collapsed::after { left: var(--ga-sidebar-collapsed); }
.content { position: relative; z-index: 2; }
.top-space { padding: 0; }
.dashboard-shell { width: 100%; max-width: none; margin: 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.page-heading h1 { margin: 0; color: #102038; font-size: clamp(32px, 2.2vw, 40px); line-height: 1.1; font-weight: 800; letter-spacing: -.035em; }
.page-subtitle { margin: 5px 0 0; color: var(--ga-muted); font-size: 15px; }
.market-meta { text-align: right; color: #69768a; font-size: 13px; }
.market-open { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--ga-green); font-weight: 700; }
.market-open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #24a66f; box-shadow: 0 0 0 4px rgba(36,166,111,.10); }

/* Cards */
.box, .ga-card { background: var(--ga-surface); border: 1px solid var(--ga-border); border-radius: var(--ga-radius); box-shadow: var(--ga-shadow-soft); backdrop-filter: blur(7px); }
.box-header.with-border, .ga-card-header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; color: var(--ga-text); background: rgba(255,255,255,.72); border-bottom: 1px solid var(--ga-border); border-radius: var(--ga-radius) var(--ga-radius) 0 0; }
.box-title, .ga-card-title { margin: 0; color: var(--ga-text); font-size: 17px; font-weight: 800; }
.box-body, .ga-card-body { padding: 16px; }
.card-link { color: #396f9f; font-size: 13px; font-weight: 700; }

/* Summary KPI */
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.summary-card { min-height: 118px; display: flex; align-items: center; gap: 15px; padding: 18px; background: rgba(255,255,255,.92); border: 1px solid var(--ga-border); border-radius: var(--ga-radius); box-shadow: var(--ga-shadow-soft); }
.summary-icon { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; border-radius: 13px; color: #8b6715; background: linear-gradient(145deg, #fff8df, #f4e6b6); font-size: 23px; }
.summary-label { color: #637086; font-size: 13px; font-weight: 700; }
.summary-value { margin-top: 5px; color: #13233b; font: 700 clamp(24px, 1.65vw, 30px)/1.05 "Ubuntu Mono", monospace; letter-spacing: -.02em; }
.summary-sub { margin-top: 8px; font: 700 13px/1.15 "Ubuntu Mono", monospace; }
.summary-sub.up { color: var(--ga-green); }
.summary-sub.down { color: var(--ga-red); }
.summary-sub.muted { color: var(--ga-muted); }

/* Metal quotes */
.market-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.market-card { position: relative; overflow: hidden; min-height: 142px; padding: 17px; background: rgba(255,255,255,.92); border: 1px solid var(--ga-border); border-radius: var(--ga-radius); box-shadow: var(--ga-shadow-soft); }
.market-card::after { content: ""; position: absolute; top: -34px; right: -34px; width: 115px; height: 115px; border-radius: 50%; background: var(--metal-glow); }
.market-card-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; }
.metal-disc { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(20,30,40,.10); background: var(--metal-fill); box-shadow: inset 0 1px 1px rgba(255,255,255,.65); font: 700 12px/1 "Ubuntu Mono", monospace; color: var(--metal-text); }
.market-name { font-size: 15px; font-weight: 800; }
.market-symbol { margin-top: 2px; color: var(--ga-muted); font-size: 12px; }
.market-price { position: relative; z-index: 1; margin-top: 13px; font: 700 28px/1 "Ubuntu Mono", monospace; letter-spacing: -.03em; }
.market-change { position: relative; z-index: 1; margin-top: 8px; font: 700 13px/1 "Ubuntu Mono", monospace; }
.market-change.up { color: var(--ga-green); }
.market-change.down { color: var(--ga-red); }
.sparkline { position: absolute; right: 12px; bottom: 12px; width: 72px; height: 30px; opacity: .80; }
.sparkline polyline { fill: none; stroke: var(--spark-color); stroke-width: 2; vector-effect: non-scaling-stroke; }
.market-card.gold { --metal-fill: linear-gradient(145deg,#f8dc79,#b8841f); --metal-text:#5a4009; --metal-glow:rgba(210,170,67,.18); --spark-color:#c79529; }
.market-card.silver { --metal-fill: linear-gradient(145deg,#f4f6f8,#a8b0ba); --metal-text:#4b5563; --metal-glow:rgba(152,162,179,.16); --spark-color:#8d98a5; }
.market-card.platinum { --metal-fill: linear-gradient(145deg,#e7edf1,#8493a2); --metal-text:#394958; --metal-glow:rgba(100,116,139,.14); --spark-color:#667c91; }
.market-card.palladium { --metal-fill: linear-gradient(145deg,#ded7cf,#9b8d7d); --metal-text:#544b41; --metal-glow:rgba(127,111,96,.14); --spark-color:#8b7560; }

/* Main dashboard blocks */
.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(360px, 1fr); gap: 12px; margin-bottom: 12px; }
.holdings-table .metal-disc { width: 29px; height: 29px; flex-basis: 29px; font-size: 10px; }
.holding-name { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 750; }
.trade-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: #edf1f4; }
.trade-switch .btn { border: 0; border-radius: 8px; color: #6c7889; background: transparent; font-weight: 750; }
.trade-switch .btn.active.buy { color: #fff; background: var(--ga-green); box-shadow: 0 3px 10px rgba(21,144,96,.18); }
.trade-switch .btn.sell:hover { color: var(--ga-red); background: #fff; }
.quick-trade-form { margin-top: 14px; }
.quick-trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quote-panel { margin-top: 12px; padding: 12px; border-radius: 11px; background: #f6f8fa; border: 1px solid #e6ebef; }
.quote-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: #6d7a8d; font-size: 13px; }
.quote-row strong { color: var(--ga-text); font: 700 14px/1.2 "Ubuntu Mono", monospace; }
.quote-row.total { margin-top: 5px; padding-top: 9px; border-top: 1px solid #dde4ea; color: var(--ga-text); font-weight: 800; }
.quote-row.total strong { font-size: 17px; }
.btn-quote { width: 100%; margin-top: 10px; color: #251b04; background: linear-gradient(180deg,#e5c35c,#ce9f31); border: 1px solid #c29127; font-weight: 800; box-shadow: 0 5px 16px rgba(201,151,39,.17); }
.btn-quote:hover { color: #201803; background: linear-gradient(180deg,#d9b64d,#bd8b25); border-color: #ad7f20; }

/* Bootstrap forms/buttons */
label, .form-label { margin-bottom: 6px; color: #59677b; font-size: 13px; font-weight: 750; }
.form-control, .form-select { min-height: 46px; border: 1px solid #d7dee6; border-radius: 9px; color: var(--ga-text); background-color: rgba(255,255,255,.96); box-shadow: none; font-size: 15px; }
.form-control:focus, .form-select:focus { border-color: #8cb3d4; box-shadow: 0 0 0 3px rgba(23,107,176,.10); }
.input-group-text { border-color: #d7dee6; background: #f4f6f8; color: #778396; font-size: 13px; }
.btn { border-radius: 9px; font-size: 14px; font-weight: 750; }
.btn-primary, .btn.bg-blue.btn-flat { background: var(--ga-blue); border-color: var(--ga-blue); }
.btn-warning, .btn-warning.btn-block.btn-flat { color: #241b06; background: var(--ga-gold); border-color: #bd8d27; }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { margin-bottom: 0; color: var(--ga-text); font-size: 14px; }
.table > :not(caption) > * > * { padding: 11px 13px; border-bottom-color: #e9edf1; vertical-align: middle; }
.table thead th { color: #66758a; background: rgba(247,249,251,.92); border-bottom-width: 1px; font-size: 11px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:hover { background: rgba(247,249,251,.72); }
.mono, .numeric, .amount, .price { font-family: "Ubuntu Mono", monospace; font-variant-numeric: tabular-nums; }
.change-up { color: var(--ga-green); font-weight: 750; }
.change-down { color: var(--ga-red); font-weight: 750; }
.type-badge, .status-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 7px; font-size: 12px; font-weight: 800; }
.type-badge.buy, .status-badge.completed { color: #0e7950; background: #dff4ea; }
.type-badge.sell { color: #b33e45; background: #fbe3e5; }
.status-badge.pending { color: #946e14; background: #fbf1d4; }

/* Footer */
.footer { position: fixed; z-index: 1030; left: var(--ga-sidebar-expanded); right: 0; bottom: 0; height: var(--ga-footer-height); display: flex; align-items: center; justify-content: center; padding: 0 24px; color: #7c899a; background: rgba(244,247,250,.94); border-top: 1px solid rgba(20,34,54,.08); backdrop-filter: blur(8px); font-size: 12px; text-align: center; transition: left .22s ease; }
.footer.collapsed { left: var(--ga-sidebar-collapsed); }

/* Modal/spinner compatibility */
.modal-content { border: 1px solid var(--ga-border); border-radius: 14px; box-shadow: var(--ga-shadow); }
.modal-header { border-bottom-color: var(--ga-border); }
.modal-footer { border-top-color: var(--ga-border); }
.wrapper_spinner { position: fixed; inset: 0; z-index: 1090; display: grid; place-items: center; background: rgba(7,18,30,.28); backdrop-filter: blur(2px); }
.wrapper_spinner .spinner { padding: 16px; border-radius: 14px; background: #fff; box-shadow: var(--ga-shadow); }

@media (max-width: 1199.98px) {
    .market-ticker .ticker-item:nth-child(n+4) { display: none; }
    .summary-grid, .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
    .market-ticker .ticker-item:nth-child(n+3) { display: none; }
    .navbar-title { display: none; }
    .user-menu-label { display: none; }
}

@media (max-width: 767.98px) {
    .sidebar, .sidebar.collapsed { width: min(86vw, 300px); transform: translateX(-104%); box-shadow: 18px 0 44px rgba(7,18,30,.28); }
    .sidebar.active { transform: translateX(0); }
    .sidebar.collapsed .brand-logo-full { display: block; }
    .sidebar.collapsed .brand-logo-mark { display: none; }
    .sidebar.collapsed .nav-link { justify-content: flex-start; padding: 10px 12px; }
    .sidebar.collapsed .nav-link i { flex: 0 0 34px; width: 34px; }
    .sidebar.collapsed .nav-link span, .sidebar.collapsed .sidebar-section-label, .sidebar.collapsed .sidebar-account { display: block; }
    .navbar-custom, .sidebar.collapsed ~ .navbar-custom { left: 0; padding-inline: 12px; }
    .market-ticker { display: none; }
    .navbar-title { display: block; flex: 1; }
    .content-wrapper, .content-wrapper.collapsed { margin-left: 0 !important; padding: calc(var(--ga-header-height) + 10px) 12px calc(var(--ga-footer-height) + 14px); }
    .content-wrapper::before, .content-wrapper::after, .content-wrapper.collapsed::before, .content-wrapper.collapsed::after { left: 0; }
    .content-wrapper::before { background-position: 72% center; }
    .content-wrapper::after { background: linear-gradient(90deg, rgba(244,247,250,.97), rgba(244,247,250,.78)); }
    .content-wrapper.drawer-scrim::after { z-index: 1035; background: rgba(7,18,30,.44); backdrop-filter: blur(1px); }
    .footer, .footer.collapsed { left: 0; padding-inline: 12px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .market-meta { text-align: left; }
}

@media (max-width: 575.98px) {
    .summary-grid, .market-grid { grid-template-columns: 1fr; }
    .summary-card { min-height: 98px; }
    .quick-trade-grid { grid-template-columns: 1fr; }
    .box-body, .ga-card-body { padding: 13px; }
    .box-header.with-border, .ga-card-header { padding: 12px 13px; }
    .content-wrapper, .content-wrapper.collapsed { padding-inline: 9px; }
    .header-icon { display: none; }
}
