/* ============================================================
   ADMIN — DETAIL ASOSIATOR
   MASTER DASHBOARD STYLE
   ============================================================ */


/* ============================================================
   BASE
   ============================================================ */

.assoc-detail-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    color: #172033;
    box-sizing: border-box;
}

.assoc-detail-page *,
.assoc-detail-page *::before,
.assoc-detail-page *::after {
    box-sizing: border-box;
}


/* ============================================================
   BREADCRUMB
   POSISI DI LUAR CARD
   ============================================================ */

.assoc-detail-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;

    margin: 0 0 16px 2px;
    padding: 0;

    color: #94a3b8;

    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.assoc-detail-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color .18s ease;
}

.assoc-detail-breadcrumb a:hover {
    color: #2563eb;
}

.assoc-detail-breadcrumb span {
    color: #cbd5e1;
    font-size: 14px;
}

.assoc-detail-breadcrumb strong {
    color: #334155;
    font-weight: 700;
}


/* ============================================================
   HERO / HEADER
   SAMA KONSEP DENGAN "DAFTAR ASOSIATOR"
   ============================================================ */

.assoc-detail-hero {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    min-height: 174px;

    margin: 0 0 22px;
    padding: 30px 32px;

    overflow: hidden;

    border: 1px solid rgba(30, 64, 175, .25);
    border-radius: 16px;

    background:
        radial-gradient(
            circle at 90% 15%,
            rgba(37, 99, 235, .24),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #020617 0%,
            #0b1224 48%,
            #172554 100%
        );

    box-shadow:
        0 10px 28px rgba(15, 23, 42, .13);
}


/* dekorasi hero */

.assoc-detail-hero::before {
    content: "";

    position: absolute;

    top: -90px;
    right: 130px;

    width: 220px;
    height: 220px;

    border: 1px solid rgba(96, 165, 250, .08);
    border-radius: 50%;

    pointer-events: none;
}

.assoc-detail-hero::after {
    content: "";

    position: absolute;

    right: -80px;
    bottom: -110px;

    width: 280px;
    height: 280px;

    border: 1px solid rgba(96, 165, 250, .09);
    border-radius: 50%;

    pointer-events: none;
}


/* ============================================================
   HERO CONTENT
   ============================================================ */

.assoc-detail-hero-content {
    position: relative;
    z-index: 2;

    min-width: 0;
}

.assoc-detail-label {
    display: inline-flex;
    align-items: center;

    width: fit-content;

    margin-bottom: 9px;
    padding: 5px 11px;

    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: 6px;

    background: rgba(37, 99, 235, .18);

    color: #60a5fa;

    font-size: 10px;
    font-weight: 800;

    line-height: 1;

    letter-spacing: .1em;
}

.assoc-detail-hero h2 {
    margin: 0;

    color: #ffffff;

    font-size: 29px;
    font-weight: 800;
    line-height: 1.15;

    letter-spacing: -.025em;
}

.assoc-detail-hero p {
    margin: 8px 0 0;

    color: #cbd5e1;

    font-size: 13px;
    line-height: 1.5;
}


/* ============================================================
   HERO BUTTON
   ============================================================ */

.assoc-detail-hero-action {
    position: relative;
    z-index: 3;

    flex-shrink: 0;

    margin-left: 25px;
}

.assoc-detail-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 145px;
    height: 44px;

    padding: 0 19px;

    border: 0;
    border-radius: 9px;

    background: #ffffff;
    color: #172554;

    font-size: 12px;
    font-weight: 800;

    text-decoration: none;

    white-space: nowrap;

    box-shadow:
        0 7px 18px rgba(0, 0, 0, .18);

    transition:
        background .18s ease,
        color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}

.assoc-detail-edit:hover {
    background: #eff6ff;
    color: #1d4ed8;

    transform: translateY(-1px);

    box-shadow:
        0 9px 22px rgba(0, 0, 0, .22);
}


/* ============================================================
   MAIN PROFILE + STATISTICS
   ============================================================ */

.assoc-detail-page .detail-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        255px;

    gap: 18px;

    width: 100%;
    margin: 0 0 18px;
}


/* ============================================================
   ALL DETAIL CARDS
   ============================================================ */

.assoc-detail-page .detail-card {
    position: relative;

    width: 100%;
    min-width: 0;

    padding: 22px;

    border: 1px solid #e1e7ef;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 4px 16px rgba(15, 23, 42, .035);

    overflow: hidden;
}


/*
   GARIS BIRU HARUS HORIZONTAL DI ATAS
   BUKAN DI SAMPING
*/

.assoc-detail-page .detail-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: #2563eb;

    opacity: 1;
}


/* khusus card di dalam grid */
.assoc-detail-page .detail-grid > .detail-card {
    min-height: 100%;
}


/* ============================================================
   PROFILE CARD HEADER
   ============================================================ */

.assoc-detail-page .card-heading {
    display: flex;
    align-items: center;

    gap: 13px;

    margin: 0 0 19px;
    padding: 0;
}

.assoc-detail-page .avatar.large {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 54px;

    width: 54px;
    height: 54px;

    border: 1px solid #c7ddfa;
    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #e0efff,
            #f1f7ff
        );

    color: #2563eb;

    font-size: 20px;
    font-weight: 800;
}

.assoc-detail-page .card-heading h3 {
    margin: 0;

    color: #172033;

    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
}

.assoc-detail-page .card-heading p {
    margin: 4px 0 0;

    color: #94a3b8;

    font-size: 11px;
    font-weight: 600;
}


/* ============================================================
   PROFILE INFORMATION
   ============================================================ */

.assoc-detail-page .info-list {
    display: flex;
    flex-direction: column;

    width: 100%;
    margin: 0;
    padding: 0;
}

.assoc-detail-page .info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;

    min-height: 50px;

    padding: 10px 0;

    border-top: 1px solid #edf1f5;
}

.assoc-detail-page .info-row > span:first-child {
    flex-shrink: 0;

    color: #64748b;

    font-size: 12px;
    font-weight: 600;
}

.assoc-detail-page .info-row strong {
    min-width: 0;
    max-width: 70%;

    color: #1e293b;

    font-size: 12px;
    font-weight: 700;

    line-height: 1.4;

    text-align: right;
    overflow-wrap: anywhere;
}

.assoc-detail-page .info-row strong.code {
    display: inline-flex;
    align-items: center;

    max-width: none;

    padding: 6px 10px;

    border: 1px solid #cfe0f7;
    border-radius: 7px;

    background: #f1f7ff;

    color: #2563eb;

    font-family: monospace;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .02em;
}


/* ============================================================
   STATUS BADGE
   ============================================================ */

.assoc-detail-page .status {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    flex-shrink: 0;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;

    line-height: 1;
    white-space: nowrap;
}

.assoc-detail-page .status::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;
}

.assoc-detail-page .status.active {
    background: #ecfdf3;
    color: #15803d;
}

.assoc-detail-page .status.active::before {
    background: #22c55e;
}

.assoc-detail-page .status.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.assoc-detail-page .status.inactive::before {
    background: #94a3b8;
}


/* ============================================================
   STATISTICS COLUMN
   ============================================================ */

.assoc-detail-page .stats-column {
    display: flex;
    flex-direction: column;

    gap: 18px;

    width: 100%;
}


/* ============================================================
   STAT CARD
   ============================================================ */

.assoc-detail-page .stat-card {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 132px;

    padding: 21px;

    overflow: hidden;

    border: 1px solid #dfe6ef;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 4px 16px rgba(15, 23, 42, .035);
}


/* garis atas */

.assoc-detail-page .stat-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: #2563eb;
}


/* dekorasi */

.assoc-detail-page .stat-card::after {
    content: "";

    position: absolute;

    right: -35px;
    bottom: -42px;

    width: 120px;
    height: 120px;

    border-radius: 50%;

    background: #f1f6ff;

    pointer-events: none;
}

.assoc-detail-page .stat-card span {
    position: relative;
    z-index: 2;

    display: block;

    margin: 0;

    color: #64748b;

    font-size: 9px;
    font-weight: 800;

    line-height: 1.4;

    letter-spacing: .1em;
}

.assoc-detail-page .stat-card strong {
    position: relative;
    z-index: 2;

    display: block;

    margin-top: 9px;

    color: #172554;

    font-size: 34px;
    font-weight: 800;

    line-height: 1;
}


/* ============================================================
   GENERIC BUTTON INSIDE DETAIL
   ============================================================ */

.assoc-detail-page .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 41px;

    padding: 0 16px;

    border: 0;
    border-radius: 8px;

    background: #1d4ed8;
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;

    text-decoration: none;

    cursor: pointer;

    transition: .18s ease;
}

.assoc-detail-page .btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
}


/* ============================================================
   REFERRAL CARD
   ============================================================ */

.assoc-detail-page .referral-card {
    margin-bottom: 18px;
}

.assoc-detail-page .referral-card .card-heading {
    margin-bottom: 17px;
}


/* ============================================================
   REFERRAL INPUT
   ============================================================ */

.assoc-detail-page .referral-box {
    display: flex;
    align-items: stretch;

    width: 100%;

    gap: 9px;
}

.assoc-detail-page .referral-box input {
    flex: 1;

    width: 100%;
    min-width: 0;
    height: 42px;

    padding: 0 12px;

    border: 1px solid #dce4ed;
    border-radius: 8px;

    outline: none;

    background: #f8fafc;

    color: #475569;

    font-family: monospace;
    font-size: 11px;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.assoc-detail-page .referral-box input:focus {
    border-color: #93c5fd;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, .07);
}

.assoc-detail-page .referral-box button {
    flex-shrink: 0;

    height: 42px;
}

.assoc-detail-page #copyMessage {
    display: block;

    min-height: 15px;

    margin-top: 7px;

    color: #15803d;

    font-size: 11px;
    font-weight: 600;
}


/* ============================================================
   COMPANY NETWORK CARD
   ============================================================ */

.assoc-detail-page > .detail-card:last-child {
    margin-bottom: 0;
}


/* ============================================================
   TABLE WRAPPER
   ============================================================ */

.assoc-detail-page .table-wrapper {
    width: 100%;

    overflow-x: auto;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #ffffff;
}


/* ============================================================
   TABLE
   ============================================================ */

.assoc-detail-page .table-wrapper table {
    width: 100%;
    min-width: 650px;

    border-collapse: collapse;
    border-spacing: 0;
}

.assoc-detail-page .table-wrapper thead {
    background: #f7f9fc;
}

.assoc-detail-page .table-wrapper th {
    padding: 12px 14px;

    border-bottom: 1px solid #e5eaf0;

    color: #64748b;

    font-size: 9px;
    font-weight: 800;

    line-height: 1.4;

    letter-spacing: .09em;

    text-align: left;

    white-space: nowrap;
}

.assoc-detail-page .table-wrapper td {
    padding: 13px 14px;

    border-bottom: 1px solid #eef2f6;

    color: #475569;

    font-size: 12px;

    vertical-align: middle;
}

.assoc-detail-page .table-wrapper tbody tr {
    transition: background .15s ease;
}

.assoc-detail-page .table-wrapper tbody tr:hover {
    background: #f8fbff;
}

.assoc-detail-page .table-wrapper tbody tr:last-child td {
    border-bottom: 0;
}

.assoc-detail-page .table-wrapper td strong {
    display: block;

    margin-bottom: 3px;

    color: #1e293b;

    font-size: 12px;
    font-weight: 700;
}

.assoc-detail-page .table-wrapper td small {
    display: block;

    color: #94a3b8;

    font-size: 10px;
    line-height: 1.4;
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.assoc-detail-page .empty-state {
    width: 100%;

    padding: 32px 20px;

    border: 1px dashed #d8e1eb;
    border-radius: 10px;

    background: #f8fafc;

    text-align: center;
}

.assoc-detail-page .empty-state.compact {
    margin: 0;
}

.assoc-detail-page .empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    margin: 0 auto 11px;

    border-radius: 10px;

    background: #eff6ff;

    color: #2563eb;

    font-size: 20px;
}

.assoc-detail-page .empty-state h3 {
    margin: 0;

    color: #334155;

    font-size: 14px;
    font-weight: 800;
}

.assoc-detail-page .empty-state p {
    margin: 6px 0 0;

    color: #94a3b8;

    font-size: 11px;
    line-height: 1.5;
}


/* ============================================================
   INVALID / NOT FOUND STATE
   ============================================================ */

.assoc-detail-page > .empty-state {
    margin-top: 5px;
}


/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */

@media (max-width: 1000px) {

    .assoc-detail-page .detail-grid {
        grid-template-columns:
            minmax(0, 1fr)
            220px;
    }

    .assoc-detail-hero {
        padding: 27px;
    }

}


/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media (max-width: 760px) {

    .assoc-detail-page .detail-grid {
        grid-template-columns: 1fr;
    }

    .assoc-detail-page .stats-column {
        display: grid;

        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 14px;
    }

    .assoc-detail-hero {
        align-items: flex-start;

        flex-direction: column;

        gap: 22px;

        min-height: auto;

        padding: 25px;
    }

    .assoc-detail-hero-action {
        width: 100%;

        margin-left: 0;
    }

    .assoc-detail-edit {
        width: 100%;
    }

}


/* ============================================================
   RESPONSIVE — SMALL MOBILE
   ============================================================ */

@media (max-width: 520px) {

    .assoc-detail-breadcrumb {
        margin-left: 0;

        font-size: 11px;
    }

    .assoc-detail-hero {
        padding: 22px;
        border-radius: 13px;
    }

    .assoc-detail-hero h2 {
        font-size: 24px;
    }

    .assoc-detail-hero p {
        font-size: 12px;
    }

    .assoc-detail-page .detail-card {
        padding: 18px;
        border-radius: 12px;
    }

    .assoc-detail-page .stats-column {
        grid-template-columns: 1fr;
    }

    .assoc-detail-page .info-row {
        align-items: flex-start;

        flex-direction: column;

        gap: 6px;
    }

    .assoc-detail-page .info-row strong {
        max-width: 100%;

        text-align: left;
    }

    .assoc-detail-page .referral-box {
        flex-direction: column;
    }

    .assoc-detail-page .referral-box button {
        width: 100%;
    }

}


/* ============================================================
   FORCE REMOVE OLD SIDE-BORDER STYLES
   Kalau admin.css lama masih memberikan garis kiri
   ============================================================ */

.assoc-detail-page .page-header,
.assoc-detail-page .detail-card,
.assoc-detail-page .stat-card,
.assoc-detail-page .referral-card {
    border-left: 1px solid #e1e7ef !important;
}

.assoc-detail-page .page-header::before,
.assoc-detail-page .page-header::after {
    display: none !important;
}

.assoc-detail-page .detail-card::before {
    display: block !important;

    top: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: 3px !important;

    border-radius: 0 !important;

    background: #2563eb !important;
}

.assoc-detail-page .stat-card::before {
    display: block !important;

    top: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: 3px !important;

    background: #2563eb !important;
}


/* ============================================================
   DARK MODE OVERRIDES FOR ASSOCIATOR DETAIL PAGE
   ============================================================ */

html.theme-dark .assoc-detail-page {
    color: #cbd5e1;
}

html.theme-dark .assoc-detail-breadcrumb {
    color: #64748b;
}

html.theme-dark .assoc-detail-breadcrumb a {
    color: #94a3b8;
}

html.theme-dark .assoc-detail-breadcrumb a:hover {
    color: #60a5fa;
}

html.theme-dark .assoc-detail-breadcrumb strong {
    color: #f1f5f9;
}

html.theme-dark .assoc-detail-hero {
    background: radial-gradient(circle at 90% 15%, rgba(37, 99, 235, 0.28), transparent 40%), linear-gradient(135deg, #0b1329 0%, #151d38 50%, #1c284e 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4) !important;
}

html.theme-dark .assoc-detail-edit {
    background: #182854 !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
}

html.theme-dark .assoc-detail-edit:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
}

html.theme-dark .assoc-detail-page .detail-card,
html.theme-dark .assoc-detail-page .stat-card {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
    color: #cbd5e1 !important;
}

html.theme-dark .assoc-detail-page .card-heading h3 {
    color: #ffffff !important;
}

html.theme-dark .assoc-detail-page .card-heading p {
    color: #94a3b8 !important;
}

html.theme-dark .assoc-detail-page .avatar.large {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

html.theme-dark .assoc-detail-page .info-row {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}

html.theme-dark .assoc-detail-page .info-row > span:first-child {
    color: #94a3b8 !important;
}

html.theme-dark .assoc-detail-page .info-row strong {
    color: #f1f5f9 !important;
}

html.theme-dark .assoc-detail-page .info-row strong.code {
    background: rgba(168, 85, 247, 0.2) !important;
    color: #c084fc !important;
    border: 1px solid rgba(192, 132, 252, 0.4) !important;
}

html.theme-dark .assoc-detail-page .status.active {
    background: rgba(34, 197, 94, 0.18) !important;
    color: #4ade80 !important;
}

html.theme-dark .assoc-detail-page .status.inactive {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #f87171 !important;
}

html.theme-dark .assoc-detail-page .stat-card span {
    color: #818cf8 !important;
}

html.theme-dark .assoc-detail-page .stat-card strong {
    color: #ffffff !important;
}

html.theme-dark .assoc-detail-page .referral-box input {
    background: #182854 !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #cbd5e1 !important;
}

html.theme-dark .assoc-detail-page .table-wrapper {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.theme-dark .assoc-detail-page .table-wrapper thead {
    background: #182854 !important;
}

html.theme-dark .assoc-detail-page .table-wrapper th {
    color: #818cf8 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html.theme-dark .assoc-detail-page .table-wrapper td {
    color: #cbd5e1 !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

html.theme-dark .assoc-detail-page .table-wrapper tbody tr:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

html.theme-dark .assoc-detail-page .table-wrapper td strong {
    color: #f1f5f9 !important;
}

html.theme-dark .assoc-detail-page .empty-state {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.theme-dark .assoc-detail-page .empty-state h3 {
    color: #ffffff !important;
}

html.theme-dark .assoc-detail-page .empty-state p {
    color: #94a3b8 !important;
}