/**
 * Coslife DistributorHub - Compact App Dashboard Sheet Rules
 */

.hub-navbar {
    background: var(--surface-dark);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-branding {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.2px;
}

.btn-logout {
    background: transparent;
    color: var(--error-red);
    border: 1px solid var(--error-red);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(230, 57, 70, 0.1);
}

/* Structural Dashboard Grid */
.dashboard-core-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

.dashboard-metrics-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    background: var(--surface-dark);
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.03);
}

.metric-card.highlight {
    border-left: 4px solid var(--accent-gold);
}

.metric-card .label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.metric-card .value {
    font-size: 18px;
    font-weight: 700;
}

/* Compact Table Layouts */
.hub-data-card {
    background: var(--surface-dark);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.btn-refresh {
    background: var(--primary-hub-color);
    color: #fff;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
}

.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
}

.hub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.hub-table th {
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.08);
}

.hub-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hub-table tr:last-child td {
    border-bottom: none;
}

.placeholder-text {
    text-align: center;
    color: var(--text-muted);
    padding: 20px !important;
}

/* ==========================================================================
   Mobile Adaptive Engine Overrides & Landscape Rotation Overlay
   ========================================================================== */
@media screen and (max-width: 768px) {
    .hub-table {
        font-size: 12px;
    }
    .hub-table td {
        padding: 8px 6px;
    }
}

@media screen and (max-width: 896px) and (orientation: portrait) {
    /* If an active session is running, require landscape rotation to map dense layout data cleanly */
    #view-dashboard:not(.hidden)::before {
        content: "🔄 Please rotate your device to landscape for the full Distributor Suite layout.";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: var(--primary-hub-color);
        color: #fff;
        z-index: 999999;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 30px;
        box-sizing: border-box;
        font-weight: bold;
        font-size: 16px;
    }
    
    #view-dashboard:not(.hidden) .dashboard-core-container,
    #view-dashboard:not(.hidden) .hub-navbar {
        display: none !important;
    }
}