:root {
    --primary: #FF3A00;  /* Neo-bank orange */
    --bg-color: #F4F7FE;
    --text-main: #1F2933;
    --text-gray: #A3AED0;
    --green: #05CD99;
    --red: #EE5D50;
    --orange: #FFB547;
    --purple: #A020F0;
    --indigo: #E0E7FF;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    color: var(--text-main);
}

/* ---------- HEADER (NEO-BANK STYLE) ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 4px 0 10px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.crm-logo {
    height: 96px;
    width: 96px;
    object-fit: contain;
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-product {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}

.title-group h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
}

.title-group p {
    margin: 0;
    color: var(--text-gray);
    font-size: 14px;
}

.refresh-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    box-shadow: none;
}

.refresh-btn:hover { transform: translateY(-1px); opacity: 0.95; }
.refresh-btn:disabled { opacity: 0.7; cursor: default; box-shadow: none; }
.logout-btn {
    background: var(--red);
}


/* ---------- LAYOUT GRIDS ---------- */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
}

/* ---------- CARDS & KPI WIDGETS ---------- */
.card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0px 18px 40px rgba(112, 144, 176, 0.12);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 22px 45px rgba(112, 144, 176, 0.18);
}

.kpi-widget { display: flex; align-items: center; }

.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.kpi-content h4 {
    margin: 0;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}
.kpi-content h2 {
    margin: 5px 0 0 0;
    font-size: 24px;
    font-weight: 700;
}
.sub-text {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 3px;
    display: block;
}

/* KPI COLOR BLOCKS (TUNED TO BRAND) */
.bg-blue   { background: #FFE1D6; color: var(--primary); }
.bg-green  { background: #E6FAF5; color: var(--green); }
.bg-orange { background: #FFF1DA; color: var(--orange); }
.bg-red    { background: #FEEEEE; color: var(--red); }
.bg-purple { background: #F3E5F5; color: var(--purple); }
.bg-indigo { background: #E0E7FF; color: #4318FF; }

.txt-orange { background: #FFB547; color: var(--orange); }
.txt-red    { background: #EE5D50; color: var(--red); }


/* Inputs */
.chart-select {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    outline: none;
    cursor: pointer;
    background: #fff;
}

/* ---------- MODALS & TABLES ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-gray);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.data-table th {
    text-align: left;
    color: var(--text-gray);
    font-weight: 500;
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f4f7fe;
    font-size: 14px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-success { background: #E6FAF5; color: var(--green); }
.badge-warning { background: #FFF7E8; color: var(--orange); }
.badge-danger  { background: #FEEEEE; color: var(--red); }

.tag-virtual {
    background: #E0E7FF;
    color: #4318FF;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

.btn-view {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.btn-view:hover { opacity: 0.92; }

.account-section-title {
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

/* --- CHART TABS --- */
.chart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--text-gray);
    cursor: pointer;
    border-radius: 999px;
    transition: 0.2s;
}
.tab-btn:hover { background: #f0f0f0; }
.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 58, 0, 0.25);
}

@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---------------------------------------------------- */
/* NEW STYLES FOR DEVICES WIDGET & PIE CHART BREAKDOWN */
/* ---------------------------------------------------- */
.device-widget-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.device-chart-wrapper {
    width: 75px; 
    height: 75px; 
    position: relative;
}

.breakdown-icons i { margin: 0 5px; color: #555; }
.breakdown-icons .fa-apple { color: #555; }     /* Grey */
.breakdown-icons .fa-android { color: #3ddc84; } /* Android Green */
.breakdown-icons .fa-globe { color: #3b82f6; }   /* Blue */