/* ================================================================
   1. STOP BLOCKSY & WORDPRESS GAPS (Force Edge-to-Edge)
   ================================================================ */

.site-main .ct-container-full[data-content="normal"],
.site-main .ct-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    --theme-content-vertical-spacing: 0px !important;
}

.entry-content.is-layout-constrained,
.entry-content.is-layout-constrained > * {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
}

.wp-block-columns,
.wp-block-column {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
}

/* ================================================================
   1D. FULL BLEED BREAKOUT
   ================================================================ */

#gp-page {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    min-height: 100vh !important;
}

/* ================================================================
   2. DESKTOP BASE LAYOUT
   ================================================================ */

#gp-page-sidebar {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    flex: 0 0 250px !important;
    background-color: #1e2d3d !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    z-index: 100 !important;
}

.gp-left-menu-container {
    width: 100% !important;
    min-width: 100% !important;
    flex: 1 !important;
}

#gp-page-right {
    width: calc(100% - 250px) !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f0f4f8;
}

/* ================================================================
   3. HEADER BAR (matches Gripar top bar)
   ================================================================ */

#gp-page-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #ffffff !important;
    padding: 14px 28px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.gp-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.gp-header-left h1 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
    line-height: 1 !important;
    letter-spacing: -0.3px !important;
}

.gp-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

/* User email label */
.gp-header-email {
    font-size: 14px !important;
    color: #64748b !important;
    font-weight: 400 !important;
}

/* Role badge (e.g. "PUBLIC USER") */
.gp-header-role-badge {
    display: inline-flex !important;
    align-items: center !important;
    background: #6c5ce7 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

/* Logout button */
#gp-logout-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    font-family: inherit !important;
}

#gp-logout-btn:hover {
    background: #dc2626 !important;
}

/* Mobile toggle */
.gp-mobile-toggle,
.gp-sidebar-close-btn {
    display: none !important;
}

/* ================================================================
   4. MAIN CONTENT AREA
   ================================================================ */

#gp-page-main {
    flex: 1 !important;
    padding: 32px 28px !important;
    box-sizing: border-box !important;
}

/* ================================================================
   5. DASHBOARD CONTENT (Welcome section + cards)
   ================================================================ */

#gp-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#gp-dashboard-loading {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}

/* Welcome section header */
.gp-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.gp-section-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.gp-section-card-title i {
    color: #6c5ce7;
}

/* Welcome text */
.gp-welcome-text {
    color: #64748b;
    font-size: 14px;
    margin: 0 0 20px;
}

/* Quick tiles grid */
.gp-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.gp-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.gp-tile:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #6c5ce7;
    text-decoration: none;
    color: inherit;
}

.gp-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.gp-tile-icon.purple { background: #f0ecff; color: #6c5ce7; }
.gp-tile-icon.yellow { background: #fff8e1; color: #f59e0b; }
.gp-tile-icon.green  { background: #e8f5e9; color: #22c55e; }
.gp-tile-icon.blue   { background: #e3f2fd; color: #3b82f6; }
.gp-tile-icon.red    { background: #fef2f2; color: #ef4444; }

.gp-tile-body h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
}

.gp-tile-body p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

/* ================================================================
   6. ACCOUNT / MFA SECTION
   ================================================================ */

.gp-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.gp-account-info strong {
    font-size: 14px;
    color: #374151;
}

.gp-account-info span {
    font-size: 14px;
    color: #64748b;
    margin-left: 6px;
}

#gp-setup-mfa-btn {
    background: #6c5ce7;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

#gp-setup-mfa-btn:hover { background: #5b4bd5; }

.gp-mfa-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}

/* ================================================================
   7. MFA MODAL
   ================================================================ */

#gp-mfa-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#gp-mfa-modal.active {
    display: flex;
}

.gp-modal-box {
    background: #fff;
    width: 90%;
    max-width: 380px;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.gp-modal-box h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

#gp-mfa-qr-img {
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 16px;
    width: 160px;
    height: 160px;
}

#gp-mfa-verify-code {
    padding: 10px 14px;
    font-size: 20px;
    text-align: center;
    width: 130px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    letter-spacing: 4px;
    font-family: monospace;
    outline: none;
    transition: border-color 0.15s;
}

#gp-mfa-verify-code:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}

#gp-mfa-confirm-btn {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 14px;
    font-family: inherit;
    transition: background 0.15s;
}

#gp-mfa-confirm-btn:hover { background: #16a34a; }

#gp-mfa-cancel-btn {
    background: none;
    border: none;
    margin-top: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #94a3b8;
    text-decoration: underline;
    font-family: inherit;
}

#gp-mfa-msg {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    min-height: 18px;
}

#gp-dashboard-error {
    color: #ef4444;
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}

/* ================================================================
   8. MOBILE LAYOUT
   ================================================================ */

@media (max-width: 768px) {
    #gp-page {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh !important;
    }

    #gp-page-sidebar {
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        flex: none !important;
        position: relative !important;
        order: 1 !important;
    }

    #gp-page-sidebar.active {
        display: block !important;
    }

    .gp-left-menu-container {
        max-height: none !important;
        overflow: visible !important;
    }

    #gp-page-right {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        position: relative !important;
        order: 2 !important;
        flex: 1 1 auto !important;
    }

    #gp-page-header {
        padding: 12px 16px !important;
        min-height: 60px !important;
    }

    #gp-page-main {
        padding: 20px 16px !important;
    }

    .gp-header-email {
        display: none !important;
    }

    .gp-mobile-toggle {
        display: inline-flex !important;
        background: transparent !important;
        color: #334155 !important;
        border: none !important;
        font-size: 22px !important;
        cursor: pointer !important;
        padding: 4px !important;
    }

    .gp-sidebar-close-btn {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        text-align: left !important;
        padding: 15px 20px !important;
        background: #16212e !important;
        color: #ef4444 !important;
        border: none !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    }

    .gp-tiles-grid {
        grid-template-columns: 1fr !important;
    }
}