/* =========================================================
   BRAVO CRM — BASE: CSS Variables, Reset, Global Foundation
   ========================================================= */

html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.content-wrapper {
    flex: 1 0 auto;
}

.site-footer {
    margin-top: auto;
}


/* -------------------------------------------------------
   COLOR TOKENS (light theme)
-------------------------------------------------------- */

:root {
    /* Background layers */
    --bg: #f6f8fb;
    --bg-soft: #fbfcff;

    /* Surfaces */
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;

    /* Borders */
    --border: rgba(15,23,42,.12);
    --border-soft: rgba(15,23,42,.06);

    /* Text */
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;

    /* Brand */
    --brand-1: #f0b90b;
    --brand-2: #fcd535;

    /* Link */
    --link: #2563eb;

    /* Status */
    --success-bg: rgba(34,197,94,.10);
    --success-text: #15803d;

    --danger-bg: rgba(239,68,68,.10);
    --danger-text: #b91c1c;

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(15,23,42,.05);
    --shadow-md: 0 4px 20px rgba(15,23,42,.07);
    --shadow-lg: 0 20px 50px rgba(15,23,42,.14);
}


/* -------------------------------------------------------
   DARK THEME TOKEN OVERRIDES
-------------------------------------------------------- */

:root.theme-dark {
    --bg: #0b0e11;
    --bg-grid-dot: rgba(240, 185, 11, 0.04);
    --bg-glow-1: rgba(240,185,11,.07);
    --bg-glow-2: rgba(240,185,11,.05);

    --surface: #1b2026;
    --surface-2: #222830;
    --surface-3: rgba(255,255,255,.04);

    --border: rgba(255,255,255,.12);
    --border-soft: rgba(255,255,255,.08);

    --text: #eaecef;
    --text-2: rgba(234,236,239,.85);
    --muted: rgba(234,236,239,.55);
    --muted-2: rgba(234,236,239,.38);

    --brand-1: #f0b90b;
    --brand-2: #f0b90b;
    --brand-accent: #fcd535;

    --link: #f0b90b;

    --success-bg: rgba(14,203,129,.12);
    --success-text: #0ecb81;

    --danger-bg: rgba(246,70,93,.12);
    --danger-text: #f6465d;

    --shadow-sm: 0 1px 6px rgba(0,0,0,.55);
    --shadow-md: 0 10px 30px rgba(0,0,0,.60);
    --shadow-lg: 0 22px 70px rgba(0,0,0,.75);

    --glow-gold: 0 0 20px rgba(240,185,11,.15);
    --glow-gold-strong: 0 0 30px rgba(240,185,11,.25);
}

:root.theme-dark { color-scheme: dark; }


/* -------------------------------------------------------
   GLOBAL FOUNDATION
-------------------------------------------------------- */

body {
    background: var(--bg);
    color: var(--text);
    transition: background .25s ease, color .25s ease;
}

/* Subtle dot grid background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--border-soft) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: -1;
}

:root.theme-dark body::before {
    background-image: radial-gradient(rgba(240,185,11,.04) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* Ambient gradient overlay */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(600px 300px at 20% 20%, rgba(99,102,241,.05), transparent 60%),
        radial-gradient(500px 250px at 80% 30%, rgba(237,192,22,.06), transparent 60%);
    pointer-events: none;
    z-index: -1;
    animation: bgFloat 18s ease-in-out infinite alternate;
}

@keyframes bgFloat {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}


/* -------------------------------------------------------
   SURFACE SYSTEM (shared card defaults)
-------------------------------------------------------- */

.card,
.info-card,
.orders-list,
.order-detail__card,
.settings-card,
.balance-card,
.pf__tableCard {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
    border-radius: 18px;
}

.card,
.assets .card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.06);
    box-shadow: 0 6px 20px rgba(15,23,42,.04);
}


/* -------------------------------------------------------
   GLOBAL LINKS & TEXT
-------------------------------------------------------- */

a { color: var(--link); }

.balance-card__sub,
.asset-row__name,
.order-row__date,
.activity-row__date {
    color: var(--muted);
}


/* -------------------------------------------------------
   INPUT SYSTEM (global defaults)
-------------------------------------------------------- */

input,
select,
textarea,
.sf-input,
.orders-filter__input,
.orders-filter__select {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input:focus,
select:focus,
textarea:focus {
    background: var(--surface);
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px rgba(242,135,57,.18);
}


/* -------------------------------------------------------
   SMOOTH TRANSITIONS (global)
-------------------------------------------------------- */

* {
    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease;
}

/* Suppress ALL transitions during theme switch */
.no-transition *,
.no-transition *::before,
.no-transition *::after {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}


/* -------------------------------------------------------
   FONT SCOPE (Inter inside new namespaces)
-------------------------------------------------------- */

.bravo-auth,
.bravo-auth *,
.pf,
.pf *,
.txd,
.txd *,
.assets,
.assets *,
.payment,
.payment *,
.orders-page,
.orders-page *,
.order-detail,
.order-detail *,
.settings-page,
.settings-page *,
.dashboard,
.dashboard * {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}


/* -------------------------------------------------------
   LAYOUT
-------------------------------------------------------- */

.wrapper,
.content-wrapper {
    background: transparent;
}

.content-wrapper {
    padding-top: 140px;
}

.content-wrapper > .container {
    max-width: 1240px;
    padding-left: 24px;
    padding-right: 24px;
}

/* AdminLTE sidebar fix */
body.layout-top-nav .content-wrapper,
body.layout-top-nav .main-footer,
body.layout-top-nav .main-header {
    margin-left: 0 !important;
}

.assets--wide {
    max-width: 1400px;
    margin: 0 auto;
}

