/* I/O Fund admin — light theme dashboard accents only */

.app-header .navbar-brand.iof-brand-link {
    color: #1a1a1a;
    opacity: 1;
    padding-top: 0.65rem;
}

.iof-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    opacity: 1;
}

.iof-brand__logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: 200px;
    opacity: 1;
}

.iof-brand__tagline {
    color: #1a1a1a;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-top: 4px;
    opacity: 1;
    text-transform: lowercase;
}

.iof-chart-card .card-body {
    min-height: 280px;
}

.iof-stat-card {
    border: none;
    border-radius: 0.5rem;
}

.iof-stat-card .text-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.iof-stat-card--teal {
    background: linear-gradient(135deg, #e8f8ef 0%, #fff 100%);
    border-left: 4px solid #2ecc71;
}

.iof-stat-card--orange {
    background: linear-gradient(135deg, #fef6e8 0%, #fff 100%);
    border-left: 4px solid #f5a623;
}

.iof-products-table {
    margin-bottom: 0;
}

.iof-products-table thead th {
    border-bottom: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.iof-products-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.iof-products-table tbody td {
    border-top: 1px solid #dee2e6;
    vertical-align: middle;
}

.badge-iof-yes {
    background-color: #d4edda;
    color: #155724;
}

.badge-iof-no {
    background-color: #e9ecef;
    color: #6c757d;
}

.dashboard-intro {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Customer page (admin/customers/show) */

.iof-cust-header {
    padding-top: 0.5rem;
}

.iof-cust-back {
    color: #6c757d;
    display: inline-block;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.iof-cust-header__row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.iof-cust-avatar {
    align-items: center;
    background: #1a1a1a;
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex: 0 0 56px;
    font-size: 1.25rem;
    font-weight: 700;
    height: 56px;
    justify-content: center;
    letter-spacing: 0.02em;
}

.iof-cust-header__main {
    flex: 1 1 240px;
    min-width: 0;
}

.iof-cust-name {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.35rem;
    overflow-wrap: anywhere;
}

.iof-cust-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.iof-cust-header__actions .btn {
    background: #fff;
    border: 1px solid #dee2e6;
    color: #343a40;
    margin-left: 0.25rem;
}

.iof-cust-header__actions .btn:hover {
    background: #f8f9fa;
}

.iof-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.65rem;
    text-transform: capitalize;
}

.iof-pill--good { background: #d4edda; color: #155724; }
.iof-pill--warn { background: #fff3cd; color: #856404; }
.iof-pill--bad { background: #f8d7da; color: #721c24; }
.iof-pill--muted { background: #e9ecef; color: #6c757d; }
.iof-pill--outline { border: 1px solid #ced4da; color: #495057; text-transform: none; }

.iof-cust-stop {
    align-items: flex-start;
    background: #fdf1f2;
    border: 1px solid #f5c2c7;
    border-left: 4px solid #dc3545;
    color: #58151c;
    display: flex;
    gap: 0.75rem;
}

.iof-cust-stop > .la {
    color: #dc3545;
    font-size: 1.4rem;
}

.iof-cust-card {
    border: 1px solid #e4e7ea;
    border-radius: 0.5rem;
    box-shadow: none;
}

.iof-cust-card > .card-header {
    background: transparent;
    border-bottom: 1px solid #eef0f2;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.iof-cust-dl {
    display: grid;
    gap: 0.6rem 1rem;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: 0;
}

.iof-cust-dl dt {
    color: #6c757d;
    font-weight: 400;
}

.iof-cust-dl dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.iof-mono {
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
}

.iof-channels {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1.25rem;
}

.iof-channel {
    align-items: flex-start;
    border-radius: 0.5rem;
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}

.iof-channel--on { background: #e8f8ef; color: #155724; }
.iof-channel--off { background: #f8f9fa; color: #495057; border: 1px dashed #ced4da; }

.iof-channel__icon {
    font-size: 1.6rem;
    line-height: 1;
}

.iof-channel--off .iof-channel__icon { color: #adb5bd; }

.iof-channel__title {
    font-weight: 700;
}

.iof-channel__why {
    color: #b02a37;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.iof-flags {
    display: grid;
    gap: 0.5rem 1rem;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.iof-flag {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.iof-flag .la { font-size: 1.15rem; }
.iof-flag--on .la { color: #2ecc71; }
.iof-flag--bad { color: #b02a37; font-weight: 600; }
.iof-flag--bad .la { color: #dc3545; }
.iof-flag--off { color: #6c757d; }
.iof-flag--off .la { color: #ced4da; }

.iof-alerts-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
}

.iof-alerts-limit {
    font-size: 0.8rem;
    letter-spacing: 0;
    text-transform: none;
}

.iof-alerts-limit a,
.iof-alerts-limit strong {
    margin-left: 0.35rem;
}

.iof-stats {
    background: #eef0f2;
    border-bottom: 1px solid #eef0f2;
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.iof-stat {
    background: #fff;
    padding: 0.9rem 1.25rem;
}

.iof-stat__value {
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.2;
}

.iof-stat__value--date {
    font-size: 1.1rem;
    line-height: 1.6;
}

.iof-stat__label {
    color: #6c757d;
    font-size: 0.8rem;
}

.iof-stat--bad .iof-stat__value { color: #dc3545; }

.iof-alerts thead th {
    border-bottom: 1px solid #dee2e6;
    border-top: 0;
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.iof-alerts tbody td {
    border-top: 1px solid #f1f3f5;
    padding-bottom: 0.6rem;
    padding-top: 0.6rem;
    vertical-align: middle;
}

.iof-alerts tbody tr:hover {
    background: #fafbfc;
}

.iof-alerts__when {
    white-space: nowrap;
}

.iof-alerts__when small,
.iof-stock-name,
.iof-delivery__detail {
    color: #6c757d;
    font-size: 0.8rem;
}

.iof-ticker {
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.iof-alert-type {
    border-radius: 0.25rem;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.iof-alert-type--buy { background: #d4edda; color: #155724; }
.iof-alert-type--sell { background: #f8d7da; color: #721c24; }
.iof-alert-type--hedge { background: #fff3cd; color: #856404; }
.iof-alert-type--cover { background: #d1ecf1; color: #0c5460; }
.iof-alert-type--other { background: #e9ecef; color: #495057; }

.iof-delivery {
    align-items: center;
    color: #343a40;
    display: inline-flex;
    gap: 0.4rem;
    white-space: nowrap;
}

.iof-delivery:hover { color: #1a1a1a; }

.iof-delivery__dot {
    border-radius: 50%;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.iof-delivery--delivered .iof-delivery__dot { background: #2ecc71; }
.iof-delivery--sent .iof-delivery__dot { background: #17a2b8; }
.iof-delivery--accepted .iof-delivery__dot { background: #adb5bd; }
.iof-delivery--failed { color: #b02a37; font-weight: 600; }
.iof-delivery--failed .iof-delivery__dot { background: #dc3545; }

.iof-alerts-foot {
    background: transparent;
    color: #6c757d;
    font-size: 0.8rem;
}

/* One gap size between every card: 1.25rem, the same as under the header. */
.iof-cust-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 1.25rem;
}

.iof-cust-grid > .card,
.iof-cust-grid > .alert {
    margin: 0;
}

@media (min-width: 992px) {
    .iof-cust-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    }

    .iof-cust-grid__full {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .iof-cust-header__row { gap: 0.75rem; }
    .iof-cust-avatar { flex-basis: 44px; font-size: 1rem; height: 44px; }
    .iof-cust-name { font-size: 1.35rem; }
    .iof-cust-header__main { flex-basis: calc(100% - 56px); }
    .iof-cust-header__actions { width: 100%; }
    .iof-cust-header__actions .btn { margin: 0 0.25rem 0 0; }

    .iof-cust-card > .card-body { padding: 1rem; }
    .iof-cust-dl { gap: 0.5rem 0.75rem; }
    .iof-stat { padding: 0.75rem 1rem; }

    /* Alerts table becomes one compact block per alert. */
    .iof-alerts thead { display: none; }
    .iof-alerts,
    .iof-alerts tbody { display: block; }
    .iof-alerts tbody tr {
        border-top: 1px solid #f1f3f5;
        display: grid;
        gap: 0.35rem 0.75rem;
        grid-template-areas:
            "stock type"
            "when price"
            "delivery delivery";
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0.75rem 1rem;
    }
    .iof-alerts tbody tr:first-child { border-top: 0; }
    .iof-alerts tbody td { border: 0; padding: 0; }
    .iof-alerts__stock { grid-area: stock; }
    .iof-alerts__type { grid-area: type; text-align: right; }
    .iof-alerts__when { grid-area: when; }
    .iof-alerts__when div,
    .iof-alerts__when small { display: inline; }
    .iof-alerts__when small::before { content: " · "; }
    .iof-alerts__price { grid-area: price; }
    .iof-alerts__delivery { grid-area: delivery; }
}
