*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body.gdhub-portal-body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.gdhub-portal {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: #0f172a;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */

.gdhub-nav {
    width: 220px;
    min-width: 220px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}

.gdhub-nav-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.gdhub-nav-logo span {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.gdhub-nav-list {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.gdhub-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.gdhub-nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: #e2e8f0;
}

.gdhub-nav-item.active {
    background: #1a73e8;
    color: #fff;
}

.gdhub-nav-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.gdhub-nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Nav footer (user + logout) ─────────────────────────────────────────── */

.gdhub-nav-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.gdhub-user-name {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.gdhub-logout {
    color: #64748b;
    font-size: 18px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.15s;
    flex-shrink: 0;
}

.gdhub-logout:hover { color: #f87171; }

/* ── Main content area ──────────────────────────────────────────────────── */

.gdhub-main {
    flex: 1;
    position: relative;
    background: #fff;
    overflow: hidden;
}

.gdhub-iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: none;
    background: #fff;
}

.gdhub-iframe.active {
    display: block;
}

/* ── Loading spinner ────────────────────────────────────────────────────── */

.gdhub-loading {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    z-index: 10;
    transition: opacity 0.3s;
}

.gdhub-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.gdhub-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: gdhub-spin 0.75s linear infinite;
}

@keyframes gdhub-spin {
    to { transform: rotate(360deg); }
}

/* ── External item icon in nav ──────────────────────────────────────────── */

.gdhub-ext-icon {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.5;
}

/* ── External placeholder ───────────────────────────────────────────────── */

.gdhub-external-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.gdhub-ext-message {
    text-align: center;
    color: #64748b;
}

.gdhub-ext-message p {
    margin: 16px 0 20px;
    font-size: 15px;
}

.gdhub-ext-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #1a73e8;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}

.gdhub-ext-btn:hover { background: #1558b0; }
