/* ==========================================================================
   GoldTrade SaaS — custom design system
   Built on Bootstrap 5 utilities, but deliberately NOT a stock admin theme.
   Palette: obsidian + bullion-gold. Numbers set in a mono face so weights,
   prices and balances stay perfectly aligned in tables.
   ========================================================================== */

:root {
    --gt-obsidian:        #12141c;
    --gt-obsidian-soft:   #1a1d29;
    --gt-obsidian-line:   #262b3a;
    --gt-gold:            #d4a531;
    --gt-gold-soft:       #f0cf7a;
    --gt-gold-dim:        rgba(212, 165, 49, .14);
    --gt-ink:             #171a21;
    --gt-body:            #4a5068;
    --gt-muted:           #8892a6;
    --gt-bg:              #f4f5f8;
    --gt-card:            #ffffff;
    --gt-border:          #e7e9f0;
    --gt-success:         #1c9c72;
    --gt-success-bg:      #e6f6ef;
    --gt-warning:         #c78310;
    --gt-warning-bg:      #fdf1de;
    --gt-danger:          #d8455f;
    --gt-danger-bg:       #fbe8ec;
    --gt-info:            #3266d6;
    --gt-info-bg:         #e9eefb;
    --gt-radius:          14px;
    --gt-radius-sm:       10px;
    --gt-shadow:          0 1px 2px rgba(23, 26, 33, .04), 0 8px 24px -12px rgba(23, 26, 33, .10);
    --gt-shadow-lift:     0 4px 10px rgba(23, 26, 33, .06), 0 16px 40px -16px rgba(23, 26, 33, .16);
    --gt-sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
    background: var(--gt-bg);
    color: var(--gt-body);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--gt-ink); font-weight: 700; letter-spacing: -.01em; }

a { color: var(--gt-gold); text-decoration: none; }
a:hover { color: #b8901f; }

.mono, .num, table td.num, .stat-value { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- shell */
.gt-shell { display: flex; min-height: 100vh; }

.gt-sidebar {
    width: var(--gt-sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(185deg, var(--gt-obsidian) 0%, #191c27 100%);
    color: #c8cddb;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1030;
    transition: transform .25s ease;
}

.gt-brand {
    display: flex; align-items: center; gap: .65rem;
    padding: 1.35rem 1.25rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.gt-brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--gt-gold-soft), var(--gt-gold) 60%, #9c7717);
    display: flex; align-items: center; justify-content: center;
    color: #241d05; font-weight: 800; font-size: 15px;
    box-shadow: 0 4px 14px -4px rgba(212,165,49,.55);
}
.gt-brand-text { line-height: 1.1; }
.gt-brand-text strong { display: block; color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.gt-brand-text span { display: block; font-size: 10.5px; color: #8b93ab; text-transform: uppercase; letter-spacing: .09em; margin-top: 1px; }

.gt-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem 1.25rem; }
.gt-nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #616a83; font-weight: 700; padding: 1rem .6rem .4rem; }
.gt-nav-label:first-child { padding-top: .25rem; }

.gt-nav a.gt-nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .56rem .65rem;
    margin-bottom: 2px;
    border-radius: 10px;
    color: #b7bdd0;
    font-size: 13.6px;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}
.gt-nav a.gt-nav-link i.ti { font-size: 18px; width: 20px; text-align: center; color: #7d8497; transition: color .15s ease; }
.gt-nav a.gt-nav-link:hover { background: rgba(255,255,255,.045); color: #fff; }
.gt-nav a.gt-nav-link:hover i.ti { color: var(--gt-gold-soft); }
.gt-nav a.gt-nav-link.active { background: var(--gt-gold-dim); color: #fff; }
.gt-nav a.gt-nav-link.active i.ti { color: var(--gt-gold); }
.gt-nav a.gt-nav-link .badge-count { margin-left: auto; background: rgba(255,255,255,.08); color: #cfd4e2; font-size: 10.5px; padding: .1rem .42rem; border-radius: 20px; }

.gt-sidebar-foot { padding: .9rem 1.1rem 1.1rem; border-top: 1px solid rgba(255,255,255,.06); }
.gt-plan-chip { display:flex; align-items:center; justify-content:space-between; background: rgba(255,255,255,.045); border-radius: 10px; padding: .55rem .7rem; font-size: 11.5px; color:#9aa1b8; }
.gt-plan-chip strong { color: var(--gt-gold-soft); font-weight: 700; }

/* ---------------------------------------------------------------- main */
.gt-main { margin-left: var(--gt-sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.gt-topbar {
    height: 64px; flex-shrink: 0;
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem;
    background: rgba(244,245,248,.85);
    backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 1020;
    border-bottom: 1px solid var(--gt-border);
}
.gt-topbar .gt-page-title { font-size: 16px; font-weight: 800; color: var(--gt-ink); margin: 0; }
.gt-topbar .gt-page-sub { font-size: 12px; color: var(--gt-muted); margin-top: -2px; }
.gt-topbar-spacer { flex: 1; }
.gt-icon-btn {
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--gt-border);
    background: #fff; display: flex; align-items: center; justify-content: center;
    color: var(--gt-body); position: relative;
}
.gt-icon-btn i.ti { font-size: 18px; }
.gt-icon-btn .dot { position:absolute; top:6px; right:7px; width:7px; height:7px; border-radius:50%; background: var(--gt-danger); border: 2px solid #fff; }
.gt-user-chip { display: flex; align-items: center; gap: .55rem; padding: .3rem .55rem .3rem .3rem; border-radius: 30px; border: 1px solid var(--gt-border); background: #fff; }
.gt-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--gt-gold-soft), var(--gt-gold)); display:flex; align-items:center; justify-content:center; font-weight: 800; color: #2b2205; font-size: 12.5px; }
.gt-user-chip .name { font-size: 12.5px; font-weight: 700; color: var(--gt-ink); line-height: 1.1; }
.gt-user-chip .role { font-size: 10.5px; color: var(--gt-muted); }

.gt-content { padding: 1.5rem; flex: 1; }
.gt-footer { padding: 1rem 1.5rem 1.5rem; font-size: 11.5px; color: var(--gt-muted); }

/* ---------------------------------------------------------------- cards */
.gt-card { background: var(--gt-card); border: 1px solid var(--gt-border); border-radius: var(--gt-radius); box-shadow: var(--gt-shadow); }
.gt-card .gt-card-head { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--gt-border); display: flex; align-items: center; gap: .75rem; }
.gt-card .gt-card-head h5,.gt-card .gt-card-head h6 { margin: 0; font-size: 14.5px; font-weight: 800; }
.gt-card .gt-card-head .sub { font-size: 11.5px; color: var(--gt-muted); font-weight: 500; }
.gt-card .gt-card-body { padding: 1.25rem; }

.gt-stat {
    background: var(--gt-card); border: 1px solid var(--gt-border); border-radius: var(--gt-radius);
    padding: 1.1rem 1.2rem; box-shadow: var(--gt-shadow); position: relative; overflow: hidden;
}
.gt-stat::before { content:''; position:absolute; inset: 0 auto 0 0; width: 4px; background: var(--stat-accent, var(--gt-gold)); }
.gt-stat .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--gt-muted); font-weight: 700; display:flex; align-items:center; gap:.4rem;}
.gt-stat .stat-icon { width: 30px; height: 30px; border-radius: 9px; display:flex; align-items:center; justify-content:center; background: var(--stat-accent-bg, var(--gt-gold-dim)); color: var(--stat-accent, var(--gt-gold)); margin-bottom:.6rem; }
.gt-stat .stat-icon i.ti { font-size: 16px; }
.gt-stat .stat-value { font-size: 22px; font-weight: 800; color: var(--gt-ink); margin-top: .15rem; }
.gt-stat .stat-foot { font-size: 11.5px; color: var(--gt-muted); margin-top: .35rem; }
.gt-stat .stat-foot strong { color: var(--gt-body); }

/* ---------------------------------------------------------------- badges/status pills */
.gt-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .27rem .62rem; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.gt-pill::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; }
.gt-pill.st-open, .gt-pill.st-unpaid       { background: var(--gt-danger-bg); color: var(--gt-danger); }
.gt-pill.st-partial                        { background: var(--gt-warning-bg); color: var(--gt-warning); }
.gt-pill.st-full, .gt-pill.st-paid, .gt-pill.st-active, .gt-pill.st-available { background: var(--gt-success-bg); color: var(--gt-success); }
.gt-pill.st-info                           { background: var(--gt-info-bg); color: var(--gt-info); }
.gt-pill.st-inactive, .gt-pill.st-depleted, .gt-pill.st-suspended { background: #eef0f4; color: #6b7286; }
.gt-pill.st-trial                          { background: var(--gt-info-bg); color: var(--gt-info); }
.gt-pill.st-cancelled                      { background: var(--gt-danger-bg); color: var(--gt-danger); }

/* ---------------------------------------------------------------- tables */
.gt-table-wrap { overflow-x: auto; }
table.gt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.2px; }
table.gt-table thead th {
    text-align: left; font-size: 10.8px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--gt-muted); font-weight: 700; padding: .65rem .9rem; border-bottom: 1px solid var(--gt-border);
    background: #fafafc; white-space: nowrap;
}
table.gt-table thead th:first-child { border-top-left-radius: 10px; }
table.gt-table thead th:last-child { border-top-right-radius: 10px; }
table.gt-table tbody td { padding: .72rem .9rem; border-bottom: 1px solid var(--gt-border); vertical-align: middle; color: var(--gt-body); }
table.gt-table tbody tr:last-child td { border-bottom: none; }
table.gt-table tbody tr:hover { background: #fbfbfd; }
table.gt-table td.num, table.gt-table th.num { text-align: right; }
table.gt-table a.row-link { color: var(--gt-ink); font-weight: 700; }
table.gt-table a.row-link:hover { color: var(--gt-gold); }

/* ---------------------------------------------------------------- forms */
.form-label { font-size: 12.5px; font-weight: 700; color: var(--gt-ink); margin-bottom: .3rem; }
.form-control, .form-select {
    border-radius: var(--gt-radius-sm); border: 1px solid var(--gt-border); font-size: 13.6px;
    padding: .52rem .75rem; color: var(--gt-ink);
}
.form-control:focus, .form-select:focus { border-color: var(--gt-gold); box-shadow: 0 0 0 3px var(--gt-gold-dim); }
.form-text { font-size: 11.5px; }
.input-suffix { position: relative; }
.input-suffix .suffix-label { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--gt-muted); font-weight: 700; pointer-events: none; }

.gt-computed { background: #fbf8ee; border: 1px dashed #e6d497; border-radius: var(--gt-radius-sm); padding: .9rem 1rem; }
.gt-computed .row-line { display:flex; justify-content: space-between; padding: .18rem 0; font-size: 13px; }
.gt-computed .row-line span:first-child { color: var(--gt-muted); }
.gt-computed .row-line span:last-child { font-weight: 700; color: var(--gt-ink); }
.gt-computed .row-line.total { border-top: 1px dashed #e6d497; margin-top: .3rem; padding-top: .5rem; font-size: 14.5px; }
.gt-computed .row-line.total span:last-child { color: #9c7717; }

/* ---------------------------------------------------------------- buttons */
.btn { border-radius: var(--gt-radius-sm); font-weight: 700; font-size: 13px; padding: .5rem 1rem; }
.btn-gold { background: linear-gradient(135deg, var(--gt-gold-soft), var(--gt-gold)); border: none; color: #241d05; box-shadow: 0 6px 16px -6px rgba(212,165,49,.6); }
.btn-gold:hover { color: #241d05; filter: brightness(1.05); }
.btn-outline-soft { background: #fff; border: 1px solid var(--gt-border); color: var(--gt-body); }
.btn-outline-soft:hover { border-color: var(--gt-gold); color: var(--gt-ink); }
.btn-ghost-danger { color: var(--gt-danger); background: transparent; border: none; }
.btn-sm { padding: .34rem .7rem; font-size: 12px; }

/* ---------------------------------------------------------------- misc */
.gt-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.gt-page-head h2 { font-size: 20px; margin: 0; }
.gt-page-head .sub { font-size: 12.8px; color: var(--gt-muted); margin-top: 2px; }
.gt-breadcrumb { font-size: 11.8px; color: var(--gt-muted); margin-bottom: .3rem; }
.gt-breadcrumb a { color: var(--gt-muted); }
.gt-breadcrumb a:hover { color: var(--gt-gold); }

.gt-empty { text-align: center; padding: 3rem 1rem; color: var(--gt-muted); }
.gt-empty i.ti { font-size: 34px; color: #d9dce5; margin-bottom: .6rem; display:block; }
.gt-empty h6 { color: var(--gt-ink); margin-bottom: .25rem; }

.gt-timeline { position: relative; padding-left: 1.5rem; }
.gt-timeline::before { content:''; position:absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--gt-border); }
.gt-timeline .t-item { position: relative; padding-bottom: 1.1rem; }
.gt-timeline .t-item::before { content:''; position:absolute; left: -1.5rem; top: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--gt-card); border: 2.5px solid var(--gt-gold); }
.gt-timeline .t-item .t-title { font-size: 13px; font-weight: 700; color: var(--gt-ink); }
.gt-timeline .t-item .t-meta { font-size: 11.5px; color: var(--gt-muted); }

.gt-progress { height: 7px; border-radius: 20px; background: #eef0f4; overflow: hidden; }
.gt-progress > span { display:block; height:100%; background: linear-gradient(90deg, var(--gt-gold-soft), var(--gt-gold)); border-radius: 20px; }

.gt-sidebar-toggle { display: none; }

@media (max-width: 991.98px) {
    .gt-sidebar { transform: translateX(-100%); }
    .gt-sidebar.open { transform: translateX(0); }
    .gt-main { margin-left: 0; }
    .gt-sidebar-toggle { display: flex; }
}

/* ---------------------------------------------------------------- auth split screen */
.gt-auth-wrap { min-height: 100vh; display: flex; }
.gt-auth-panel {
    flex: 1.05; background: radial-gradient(circle at 20% 20%, #23283a 0%, var(--gt-obsidian) 55%, #0b0c12 100%);
    color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 3rem;
    position: relative; overflow: hidden;
}
.gt-auth-panel::after { content:''; position:absolute; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(212,165,49,.20), transparent 70%); top: -140px; right: -140px; }
.gt-auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.gt-auth-card { width: 100%; max-width: 380px; }
.gt-auth-quote { font-size: 15px; line-height: 1.6; color: #d7dae6; max-width: 380px; position: relative; z-index: 1; }
.gt-auth-metric { display:flex; gap: 1.75rem; margin-top: 1.5rem; position: relative; z-index:1;}
.gt-auth-metric div strong { display:block; font-size: 21px; color: var(--gt-gold-soft); font-family: 'JetBrains Mono', monospace; }
.gt-auth-metric div span { font-size: 10.5px; color: #9aa1b8; text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 860px) { .gt-auth-panel { display: none; } }

/* ---------------------------------------------------------------- login-specific platform accent (super admin) */
.gt-shell.platform .gt-sidebar { background: linear-gradient(185deg, #14172a 0%, #191c34 100%); }
.gt-shell.platform .gt-brand-mark { background: linear-gradient(135deg, #8fa4ff, #4d63d6 60%, #2c3a8f); box-shadow: 0 4px 14px -4px rgba(77,99,214,.55); }
.gt-shell.platform .gt-nav a.gt-nav-link.active { background: rgba(77,99,214,.16); }
.gt-shell.platform .gt-nav a.gt-nav-link.active i.ti { color: #8fa4ff; }
.gt-shell.platform .btn-gold { background: linear-gradient(135deg, #8fa4ff, #4d63d6); box-shadow: 0 6px 16px -6px rgba(77,99,214,.6); color: #fff; }
