/* ── Variables ───────────────────────────────────────── */
:root {
    --bg:          #f0f0f4;
    --surface:     #ffffff;
    --surface-sel: #1c1c26;
    --surface-2:   #f7f7fa;
    --border:      #e2e2ea;
    --text:        #111118;
    --text-sub:    #55556e;
    --text-muted:  #9090aa;
    --accent:      #f5c518;
    --green:       #15803d;
    --green-bg:    #f0fdf4;
    --green-border:#86efac;
    --red:         #b91c1c;
    --red-bg:      #fef2f2;
    --red-border:  #fca5a5;
    --amber:       #b45309;
    --amber-bg:    #fffbeb;
    --amber-border:#fcd34d;
    --radius:      14px;
    --radius-lg:   20px;
}

/* ── Reset / Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Wrapper ─────────────────────────────────────────── */
.gl-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────── */
.gl-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.gl-logo-link { display: flex; align-items: center; }
.gl-logo      { height: 34px; width: auto; }

.gl-header-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    color: #111;
    background: var(--accent);
    padding: 3px 9px;
    border-radius: 4px;
}

/* ── Tab strip ───────────────────────────────────────── */
.gl-tabnav {
    background: var(--surface);
    padding: 20px 28px 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.gl-tabnav::-webkit-scrollbar { display: none; }

.gl-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
}

/* ── Tab card ────────────────────────────────────────── */
.gl-tab {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 18px;
    min-width: 210px;
    height: 130px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, color .15s, box-shadow .15s;
}

.gl-tab:hover {
    background: #ebebf0;
    color: var(--text-sub);
}
.gl-tab:hover .gl-tab-icon { opacity: .7; }

/* selected: cor mais escura, sem borda amarela */
.gl-tab.active {
    background: var(--surface-sel);
    border-color: var(--surface-sel);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
.gl-tab.active .gl-tab-icon  { opacity: 1; filter: brightness(0) invert(1); }
.gl-tab.active .gl-tab-name  { color: #ffffff; }
.gl-tab.active .gl-tab-quote { color: var(--accent); }

/* ── Tab card content ────────────────────────────────── */
.gl-tab-name {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    transition: color .15s;
}

.gl-tab-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.gl-tab-icon {
    width: 30px;
    height: 30px;
    opacity: .35;
    flex-shrink: 0;
    transition: opacity .15s, filter .15s;
}

.gl-tab-quote {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    transition: color .15s;
}

/* ── Main content ────────────────────────────────────── */
.gl-main {
    flex: 1;
    padding: 28px 24px;
}

.gl-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Panel header ────────────────────────────────────── */
.gl-panel-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.gl-panel-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.gl-panel-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.gl-panel-name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.gl-panel-sym {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.gl-panel-price { text-align: right; }

.gl-price-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.gl-price-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
}

/* ── Stats grid ──────────────────────────────────────── */
.gl-stats {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    width: 100%;
}

@media (max-width: 640px) {
    .gl-stats       { grid-template-columns: 1fr; }
    .gl-panel-head  { flex-wrap: wrap; }
    .gl-panel-price { text-align: left; width: 100%; }
}

/* ── Card ────────────────────────────────────────────── */
.gl-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
}

.gl-card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.gl-card-body {
    display: flex;
    align-items: center;
}

/* ── Trend badge ─────────────────────────────────────── */
.gl-trend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: background .25s, color .25s, border-color .25s;
}

.gl-trend.up   { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.gl-trend.lat  { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.gl-trend.down { background: var(--red-bg);   color: var(--red);   border-color: var(--red-border);   }

/* ── Average row ─────────────────────────────────────── */
.gl-avg-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.gl-avg-sep {
    width: 1px;
    height: 50px;
    background: var(--border);
    flex-shrink: 0;
}

.gl-avg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    padding: 0 16px;
}

.gl-avg-num {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1;
    color: var(--text-muted);
}

.gl-avg-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.gl-avg-up   .gl-avg-num,
.gl-avg-up   .gl-avg-lbl  { color: var(--green); }
.gl-avg-lat  .gl-avg-num,
.gl-avg-lat  .gl-avg-lbl  { color: var(--amber); }
.gl-avg-down .gl-avg-num,
.gl-avg-down .gl-avg-lbl  { color: var(--red);   }