/* InvestPortal custom styles */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header h1 {
    margin-bottom: .25rem;
}

.actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: .375rem;
    padding: .5rem .875rem;
    background: var(--bs-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.button:hover {
    background: var(--bs-primary);
    color: #fff;
    opacity: .9;
}

.button.secondary {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

.button.secondary:hover {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.button.danger,
button.danger {
    background: var(--bs-danger);
    color: #fff;
}

.muted {
    color: var(--bs-secondary-color);
}

.dropdown-form {
    margin: 0;
}

.dropdown-form .dropdown-item {
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}

form.stack {
    display: grid;
    gap: 1rem;
}

.detail-list {
    display: grid;
    gap: .75rem;
}

.detail-label {
    display: block;
    color: var(--bs-secondary-color);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.inline-form {
    display: inline;
}

/* Card hover effect */
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease-in-out;
}

.card-hover {
    transition: all 0.2s ease-in-out;
}

/* Stat cards */
.stat-card {
    border-left: 4px solid;
    border-radius: 0.375rem;
}

.stat-card.primary { border-left-color: #0d6efd; }
.stat-card.success { border-left-color: #198754; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.info    { border-left-color: #0dcaf0; }

/* Table styles */
.table-hover tbody tr {
    cursor: pointer;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Badge styles for roles */
.badge-admin  { background-color: #dc3545; }
.badge-member { background-color: #0d6efd; }
.badge-viewer { background-color: #6c757d; }

/* Impersonation banner */
.impersonation-banner {
    background-color: #fff3cd;
    border-bottom: 2px solid #ffc107;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 500;
}

/* Home / portfolio dashboard */
.portfolio-card .card-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.portal-section {
    padding: 1rem 0;
}

.portal-section + .portal-section {
    border-top: 1px solid var(--bs-border-color);
}

/* Portfolio-level content grouped in a tinted panel (parallels the investor panel) */
.portfolio-group {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: .25rem 1.125rem .75rem;
    margin-bottom: 1rem;
}

.portfolio-group .portal-section {
    padding: .875rem 0;
}

.portfolio-group .portal-section + .portal-section {
    border-top: none;
}

.section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: .75rem;
}

.sub-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

/* Reporting period blocks */
.period-block.period-latest {
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--bs-primary);
    border-radius: .5rem;
    padding: .875rem 1rem;
    background: transparent;
}

.period-head {
    display: flex;
    align-items: center;
    margin-bottom: .75rem;
}

.period-date {
    font-weight: 600;
}

.period-history {
    margin-top: .25rem;
}

.period-history .accordion-button {
    padding: .5rem .25rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background: transparent;
    box-shadow: none;
}

.period-history .accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background: transparent;
}

.period-history .list-group-item {
    padding: .75rem .25rem;
}

/* Investor area — visually distinct from portfolio-level content */
.investor-section {
    margin-top: .25rem;
}

.investor-section.portal-section + .investor-section {
    border-top: none;
}

.investor-block {
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    overflow: hidden;
    background: var(--bs-tertiary-bg);
}

.investor-block + .investor-block {
    margin-top: 0;
}

.investor-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.125rem;
    background: var(--bs-info-bg-subtle);
    border-bottom: 1px solid var(--bs-border-color);
}

.investor-icon {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--bs-info-text-emphasis);
    background: var(--bs-body-bg);
}

.investor-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.investor-body {
    padding: 1rem 1.125rem 1.125rem;
}

.portfolio-group .period-block.period-latest,
.investor-body .period-block.period-latest {
    background: var(--bs-body-bg);
}

/* Document list — styled to read as files */
.doc-list .doc-item {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .75rem 1rem;
}

.doc-icon {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.doc-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.doc-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.doc-title {
    font-weight: 600;
    color: var(--bs-body-color);
}

.doc-desc {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
}

.doc-sub {
    font-size: .75rem;
    color: var(--bs-secondary-color);
    margin-top: .125rem;
}

.doc-action {
    flex: 0 0 auto;
    color: var(--bs-secondary-color);
}

.doc-action svg {
    width: 1.125rem;
    height: 1.125rem;
}

.doc-item:hover .doc-action {
    color: var(--bs-primary);
}

.portal-closed-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bs-body-bg);
}

.portal-closed-panel {
    width: min(100%, 640px);
    text-align: center;
    padding: 2rem;
}

.portal-closed-brand {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--bs-body-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.portal-closed-brand span {
    color: var(--bs-primary);
}

.portal-closed-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.portal-closed-icon svg {
    width: 2rem;
    height: 2rem;
}

.portal-closed-panel h1 {
    margin-bottom: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.portal-closed-panel p {
    margin: 0 auto 1.5rem;
    max-width: 560px;
    color: var(--bs-secondary-color);
    font-size: 1rem;
    line-height: 1.6;
}

.sidebar .sidebar-header .sidebar-brand {
    font-size: 21px;
    white-space: nowrap;
}
