/* ── Page wrapper ── */
.dp-page { background: #f5f7fa; min-height: 60vh; padding-bottom: 60px; }

/* ── Hero ── */
.dp-hero {
    background: linear-gradient(120deg, #0b1f3a 0%, #1a3a6b 60%, #0b2d5e 100%);
    padding: 40px 0 30px;
    color: #fff;
}
.dp-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.dp-hero h1 {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 10px;
}
.dp-hero-date {
    margin-bottom: 14px;
}
.dp-hero p {
    color: rgba(255,255,255,.75);
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 0;
}

/* ── Tabs ── */
.dp-tabs-wrap {
    background: #fff;
    border-bottom: 1px solid #e4e8ee;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.dp-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
.dp-tabs::-webkit-scrollbar { display: none; }
.dp-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 14px 22px;
    min-height: 50px;
    font-size: 13.5px;
    font-weight: 600;
    color: #6b7a8d;
    text-decoration: none;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}
.dp-tab:hover {
    color: #1a3a6b;
    background: rgba(26, 58, 107, 0.04);
    text-decoration: none;
}
.dp-tab.active {
    color: #1a3a6b;
    font-weight: 700;
    border-bottom-color: #1a3a6b;
    background: rgba(26, 58, 107, 0.04);
    box-shadow: none;
}
.dp-tab-dot { display: none; }

/* ── Region tabs (body-level segmented control) ── */
.dp-body .dp-tabs-wrap {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
}
#dpRegionTabs {
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    background: #eef2f8;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    width: auto;
}
#dpRegionTabs .dp-tab {
    padding: 7px 18px;
    min-height: 34px;
    font-size: 12.5px;
    border-bottom: none;
    border-radius: 7px;
    color: #5a6a7e;
}
#dpRegionTabs .dp-tab:hover {
    background: rgba(26, 58, 107, 0.1);
    border-bottom-color: transparent;
    color: #1a3a6b;
}
#dpRegionTabs .dp-tab.active {
    background: #1a3a6b;
    color: #fff;
    font-weight: 700;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(26, 58, 107, 0.28);
}

/* ── Body ── */
.dp-body { padding: 24px 0; }

.dp-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #1a3a6b;
    color: #fff;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}
.dp-type-badge {
    background: #eef2f8;
    color: #1a3a6b;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.dp-row-count { font-size: 12px; color: #8a97a8; font-weight: 600; white-space: nowrap; }

/* ── Table card ── */
.dp-table-card {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    overflow: hidden;
}
.dp-table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #f0f3f7;
    gap: 12px;
}
.dp-table-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1a3a6b;
    margin: 0;
}

/* ── Table controls (search + count) ── */
.dp-table-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.dp-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.dp-search-icon {
    position: absolute;
    left: 10px;
    color: #8a97a8;
    font-size: 12px;
    pointer-events: none;
}
.dp-search-input {
    padding: 6px 10px 6px 30px;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    font-size: 12.5px;
    color: #1e293b;
    outline: none;
    width: 200px;
    transition: border-color .2s;
}
.dp-search-input:focus { border-color: #1a3a6b; }

/* ── Sortable headers ── */
.dp-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.dp-sortable:hover { background: #e8edf5; }
.dp-sort-icon { margin-left: 4px; font-size: 9px; color: #a0aab8; }
.dp-sort-asc .dp-sort-icon,
.dp-sort-desc .dp-sort-icon { color: #1a3a6b; }

/* ── No results ── */
.dp-no-results {
    text-align: center;
    padding: 32px 16px;
    color: #8a97a8;
    font-size: 13px;
}

/* ── Table: fit all columns in one screen ── */
.dp-table-scroll { overflow-x: auto; width: 100%; }
.dp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #1e293b;
    table-layout: fixed;
}
.dp-table thead th {
    background: #f1f4f9;
    color: #3d5068;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 10px 10px;
    border-bottom: 1px solid #e4e8ee;
    white-space: normal;
    word-break: break-word;
    position: sticky;
    top: 0;
    z-index: 1;
    line-height: 1.3;
}
.dp-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid #f0f3f7;
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.dp-table tbody tr:last-child td { border-bottom: none; }
.dp-table tbody tr:hover { background: #f8fafc; }

/* First column (Portfolio Name) wider, others auto */
.dp-table th:first-child,
.dp-table td:first-child { width: 13%; }
.dp-table th:nth-child(2),
.dp-table td:nth-child(2) { width: 16%; }
.dp-table th:nth-child(3),
.dp-table td:nth-child(3) { width: 7%; }

/* ── Gain/Loss badges ── */
.dp-gain, .dp-loss, .dp-neutral {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.dp-gain    { background: #dcfce7; color: #166534; }
.dp-loss    { background: #fee2e2; color: #991b1b; }
.dp-neutral { background: #f1f5f9; color: #475569; }
.dp-arrow   { font-size: 9px; }

/* ── Notes ── */
.dp-notes {
    margin-top: 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e4e8ee;
    background: #fff;
}
.dp-notes-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f4f9;
    border-bottom: 1px solid #e4e8ee;
    padding: 10px 16px;
}
.dp-notes-header i { color: #1a3a6b; font-size: 12px; }
.dp-notes-header span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #1a3a6b;
}
.dp-notes-legend {
    background: #f8fafc;
    border-bottom: 1px solid #f0f3f7;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
}
.dp-notes-legend-item {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    font-size: 12px;
    color: #5a6a7e;
    font-style: italic;
    line-height: 1.5;
}
.dp-notes-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    background: #eef2f8;
    border: 1px solid #dde3ec;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    font-style: normal;
    color: #1a3a6b;
    flex-shrink: 0;
    letter-spacing: 0;
    white-space: nowrap;
}
.dp-notes-body {
    background: #fff;
    padding: 14px 16px;
    border-left: 3px solid #1a3a6b;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dp-notes-body p {
    margin: 0;
    font-size: 12px;
    color: #6b7a8d;
    line-height: 1.75;
}

/* ── Disclaimer ── */
.dp-disclaimer {
    margin-top: 16px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.dp-disclaimer-inner { display: contents; }
.dp-disclaimer-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    padding: 10px 16px;
}
.dp-disclaimer-heading i { color: #b45309; font-size: 12px; }
.dp-disclaimer-heading span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #92400e;
}
.dp-disclaimer-body {
    padding: 14px 16px;
    border-left: 3px solid #f59e0b;
}
.dp-disclaimer-body p {
    margin: 0;
    font-size: 12px;
    color: #6b7a8d;
    line-height: 1.75;
}
.dp-disclaimer-body strong { color: #3d5068; font-weight: 700; }

/* ── Empty state ── */
.dp-empty {
    text-align: center;
    padding: 64px 24px;
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
}
.dp-empty-icon { font-size: 2.2rem; color: #c5d0de; margin-bottom: 12px; }
.dp-empty h3   { font-size: 1.15rem; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.dp-empty p    { color: #6b7a8d; font-size: 13.5px; max-width: 400px; margin: 0 auto; line-height: 1.6; }

/* ── Disclaimer ── */
.dp-disclaimer {
    background: #f8fafc;
    border-top: 2px solid #e4e8ee;
    margin-top: 0;
}
.dp-disclaimer-inner {
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    overflow: hidden;
}
.dp-disclaimer-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eef2f8;
    border-bottom: 1px solid #e4e8ee;
    padding: 10px 18px;
}
.dp-disclaimer-heading i {
    color: #1a3a6b;
    font-size: 13px;
}
.dp-disclaimer-heading span {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #1a3a6b;
}
.dp-disclaimer-body {
    background: #fff;
    padding: 16px 18px;
    border-left: 4px solid #e4e8ee;
}
.dp-disclaimer-body p {
    margin: 0;
    font-size: 12px;
    color: #6b7a8d;
    line-height: 1.75;
}
.dp-disclaimer-body strong { color: #3d5068; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 991px) {
    .dp-table { font-size: 11.5px; }
    .dp-table thead th,
    .dp-table tbody td { padding: 8px 8px; }
}

@media (max-width: 767px) {
    .dp-hero { padding: 28px 0 20px; }
    .dp-tabs { padding: 0; gap: 0; border-radius: 0; }
    .dp-tab { padding: 11px 16px; min-height: 44px; font-size: 13px; }
    #dpRegionTabs { padding: 3px; gap: 2px; border-radius: 8px; }
    #dpRegionTabs .dp-tab { padding: 6px 13px; min-height: 32px; font-size: 12px; }

    /* Table card header stacks vertically */
    .dp-table-card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .dp-table-controls { width: 100%; }
    .dp-search-wrap { flex: 1; }
    .dp-search-input { width: 100%; box-sizing: border-box; }

    /* Table: auto layout so columns size to content, scroll container handles overflow */
    .dp-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    .dp-table {
        table-layout: auto;
        font-size: 11px;
        min-width: 600px; /* force scroll rather than squishing */
    }
    .dp-table thead th,
    .dp-table tbody td {
        padding: 7px 8px;
        white-space: nowrap;
    }
    .dp-table th:first-child,
    .dp-table td:first-child,
    .dp-table th:nth-child(2),
    .dp-table td:nth-child(2),
    .dp-table th:nth-child(3),
    .dp-table td:nth-child(3) { width: auto; }

    /* Scroll hint shadow on right edge */
    .dp-table-scroll::after {
        content: '';
        position: absolute;
        top: 0; right: 0; bottom: 0;
        width: 24px;
        background: linear-gradient(to right, transparent, rgba(0,0,0,.06));
        pointer-events: none;
    }

    .dp-notes-legend { flex-direction: column; gap: 4px; }
    .dp-notes-body { padding: 12px 14px; }
}
