/* =========================================================================
   365 PARTNER PORTAL - MODERN SAAS STYLING
   File: public_html/partner/css/partner.css
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: #f1f5f9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
    font-size: 0.86rem;
    font-feature-settings: "tnum";
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 1. MÀN HÌNH ĐĂNG NHẬP */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2b48 0%, #061524 100%);
    padding: 15px;
}

.login-card {
    background: white;
    padding: 35px 30px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 420px;
}

.brand-badge {
    display: inline-block;
    background-color: #1e3a5f;
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* 2. BỐ CỤC CHÍNH */
.portal-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.portal-sidebar {
    background-color: #0f172a;
    color: #94a3b8;
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid #1e293b;
    transition: margin-left 0.25s ease;
}

.sidebar-brand {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f2b48 100%);
    padding: 16px 20px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #ffffff;
}

.partner-profile-card {
    padding: 12px 16px;
    background-color: #1a273f;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #1e3a8a;
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-nav .nav-item {
    width: 100%;
    padding: 11px 18px;
    color: #94a3b8;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-item.active {
    color: #ffffff;
    background-color: #1e293b;
    border-left-color: #38bdf8;
}

.sidebar-nav .nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid #1e293b;
    background-color: #0b1120;
}

/* 3. MAIN CONTENT */
.portal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    background-color: #f8fafc;
}

.topbar {
    background: white;
    height: 54px;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.btn-toggle-sidebar {
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #1e3a5f;
    cursor: pointer;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 40px 20px;
}

.tab-view {
    display: none;
}
.tab-view.active {
    display: block;
}

/* 4. KPI CARDS */
.kpi-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    border-top-width: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.kpi-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
}

.kpi-value {
    font-weight: 800;
    line-height: 1.2;
}

/* 5. TABLES */
.table-scroll-container {
    max-height: calc(100vh - 230px);
    overflow-y: auto;
}

.table-custom {
    margin-bottom: 0;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table-dark-custom th {
    background-color: #1e3a5f !important;
    color: #ffffff !important;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 10px !important;
    font-size: 0.81rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    border-right: 1px solid rgba(255,255,255,0.15);
}

.table-custom td {
    padding: 7px 10px !important;
    font-size: 0.84rem !important;
    vertical-align: middle !important;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

/* RESPONSIVE MOBILE */
@media (max-width: 991px) {
    .portal-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1050;
        margin-left: -260px;
        box-shadow: 5px 0 20px rgba(0,0,0,0.3);
    }
    .portal-sidebar.show {
        margin-left: 0;
    }
}