/* ========================================================
   BASE STYLES, LAYOUT WRAPPER, HEADER, KPI BAR
   ======================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

input, textarea, [contenteditable="true"] {
    user-select: text;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-base);
    font-family: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.45;
}

/* AMBIENT CURSOR CANVAS */
#ambientCursorCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* FULLSCREEN RESPONSIVE LAYOUT */
.app-layout-wrapper {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

/* HEADER */
header {
    flex: 0 0 auto;
    height: 52px;
    background: rgba(20, 13, 11, 0.94);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-svg-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #2a1c19, #150d0c);
    border: 1px solid rgba(206, 160, 90, 0.35);
    box-shadow: 0 0 14px rgba(206, 160, 90, 0.22);
    transition: all 0.25s ease;
    flex-shrink: 0;
    cursor: pointer;
}
.brand-logo-svg-wrap:hover {
    transform: scale(1.06);
    border-color: #CEA05A;
    box-shadow: 0 0 20px rgba(206, 160, 90, 0.45);
}

.brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    box-shadow: 0 0 12px var(--cyan-glow);
    object-fit: contain;
}

.brand-title {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    background: linear-gradient(135deg, #ffffff 40%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.save-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--emerald);
    background: rgba(126, 163, 106, 0.12);
    border: 1px solid rgba(126, 163, 106, 0.3);
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* TOP CLEAN KPI BAR */
.kpi-bar {
    flex: 0 0 auto;
    padding: 6px 18px 8px 18px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
}

.kpi-card {
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 9px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 56px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}


.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.kpi-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.kpi-body {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.kpi-progress {
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 3px;
}

.kpi-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.bar-amber { background: linear-gradient(90deg, #CEA05A, #B26B2F); }
.bar-cyan { background: linear-gradient(90deg, #B26B2F, #943636); }
.badge-flame {
    color: #ffffff !important;
    background: rgba(148, 54, 54, 0.25) !important;
    border: 1px solid rgba(148, 54, 54, 0.45);
}

/* MASTER GRAPHS BUTTON */
.btn-master-graphs {
    background: linear-gradient(135deg, rgba(206, 160, 90, 0.22), rgba(178, 107, 47, 0.22));
    border: 1.5px solid rgba(206, 160, 90, 0.5);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 0.90rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    height: 56px;
}
.btn-master-graphs:hover {
    background: linear-gradient(135deg, rgba(206, 160, 90, 0.38), rgba(178, 107, 47, 0.38));
    box-shadow: 0 0 24px rgba(206, 160, 90, 0.45);
    transform: translateY(-2px);
}
