/* ============================================================
   ⭐ GLOBAL
============================================================ */
html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, sans-serif;
    background: #f5f6fa;
}

.saas-body {
    background: #f5f6fa;
}

.saas-shell {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   ⭐ SIDEBAR
============================================================ */
.saas-sidebar {
    width: 260px;
    background: #1e1e2f;
    color: #fff;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
}

.saas-logo {
    margin-bottom: 35px;
}

.logo-main {
    font-size: 22px;
    font-weight: 700;
    color: #a29bfe;
}

.logo-sub {
    font-size: 14px;
    opacity: 0.7;
}

/* ============================================================
   ⭐ NAVIGATION
============================================================ */
.saas-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saas-nav-item {
    color: #cfcfe8;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 15px;
    transition: 0.2s;
}

.saas-nav-item:hover {
    background: #2d2d44;
    color: #fff;
}

.saas-nav-item.active {
    background: #6c5ce7;
    color: #fff;
}

/* ============================================================
   ⭐ MAIN CONTENT
============================================================ */
.saas-main {
    flex: 1;
    padding: 35px;
}

/* ============================================================
   ⭐ HEADER
============================================================ */
.saas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    color: #2d3436;
}

.user-name {
    margin-right: 15px;
    font-weight: 500;
}

.logout-btn {
    background: #d63031;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.logout-btn:hover {
    background: #e84343;
}

/* ============================================================
   ⭐ CONTENT BOX
============================================================ */
.saas-content,
.saas-card,
.metric-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ============================================================
   ⭐ GRID SYSTEM
============================================================ */
.saas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.saas-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; }
.saas-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.super-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }

/* ============================================================
   ⭐ MODULES
============================================================ */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.module-toggle-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 6px solid #dfe6e9;
    transition: 0.2s;
}

.module-toggle-card.on { border-left-color: #6c5ce7; }
.module-toggle-card.off { border-left-color: #b2bec3; }

.module-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-toggle-header input[type="checkbox"] {
    transform: scale(1.3);
}

.module-desc {
    margin-top: 10px;
    font-size: 14px;
    color: #636e72;
}

/* ============================================================
   ⭐ TABLE
============================================================ */
.saas-table {
    width: 100%;
    border-collapse: collapse;
}

.saas-table th {
    text-align: left;
    padding: 12px;
    background: #f1f2f6;
    font-weight: 600;
}

.saas-table td {
    padding: 12px;
    border-bottom: 1px solid #ececec;
}

/* ============================================================
   ⭐ TAGS
============================================================ */
.tag { padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.tag-on { background: #6c5ce7; color: #fff; }
.tag-off { background: #dfe6e9; color: #636e72; }
.tag-purple { background: #a29bfe; color: #fff; }
.tag-danger { background: #d63031; color: #fff; }
.tag-info { background:#6c5ce7; color:#fff; }
.tag-warning { background:#fdcb6e; color:#000; }
.tag-debug { background:#00cec9; color:#fff; }

/* ============================================================
   ⭐ BUTTONS
============================================================ */
.saas-btn {
    background: #6c5ce7;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.saas-btn:hover { background: #5a4bd6; }

.saas-btn-danger {
    background: #d63031;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
}

/* ============================================================
   ⭐ DASHBOARD CHARTS PREMIUM
============================================================ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.chart-card {
    padding: 20px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: 0.2s;
}

.chart-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #4b4b4b;
}

.chart-card canvas {
    width: 100% !important;
    height: 260px !important;
}

/* ============================================================
   ⭐ HEATMAP FLAVE
============================================================ */
#chart-heatmap {
    width: 100% !important;
    height: 260px !important;
}

/* ============================================================
   ⭐ TOAST
============================================================ */
#flave-toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 12px 20px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    opacity: 0;
    display: none;
    transition: opacity 0.3s;
    z-index: 9999;
}
