.balance-neutral {
    color: #64748b !important;
}

.overview-value.balance-positive,
.summary-stat-value.balance-positive,
.summary-row strong.balance-positive,
.metric-value.balance-positive,
.operation-account-banner-value.balance-positive,
.transaction-amount.balance-positive {
    color: #16a34a !important;
}

.overview-value.balance-negative,
.summary-stat-value.balance-negative,
.summary-row strong.balance-negative,
.metric-value.balance-negative,
.operation-account-banner-value.balance-negative,
.transaction-amount.balance-negative {
    color: #dc2626 !important;
}

.overview-card .overview-subtext,
.summary-row span,
.metric-label,
.transaction-lock-note,
.archived-meta {
    line-height: 1.5;
}

.main-account .muted-badge {
    color: #fff !important;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.customer-actions .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-settings-section {
    border: 1px solid rgba(102,126,234,0.12);
    background: #f8fafc;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.project-settings-section h4 {
    color: #334155;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-brand-card {
    text-align: center;
    margin-bottom: 20px;
    padding: 18px 18px 14px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(102,126,234,0.14), rgba(118,75,162,0.12));
}

.login-brand-icon {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 34px;
    box-shadow: 0 14px 26px rgba(102,126,234,0.28);
}

.login-brand-name {
    font-size: 30px;
    color: #667eea;
    font-weight: 800;
    line-height: 1.3;
}

.login-brand-subtitle {
    color: #64748b;
    margin-top: 8px;
    font-size: 17px;
    font-weight: 600;
}

.archived-item.archived-customer-item {
    border-inline-start: 4px solid #64748b;
}

.customer-header .customer-actions {
    flex-wrap: wrap;
}

.project-dropdown {
    min-width: 260px;
}

.project-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.project-settings-actions .btn {
    border-radius: 14px;
}

.customer-card.archived-placeholder {
    opacity: .75;
}

.header h1 {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .login-brand-name {
        font-size: 24px;
    }
}

.settings-inline-actions {
    margin: 12px 0 16px;
}

.customer-name-top {
    color: #d97706;
}

.customer-name-top i {
    color: #f59e0b;
}

.customer-summary-white-cards .summary-stat-white,
.summary-stack-white .summary-row-white {
    background: #ffffff !important;
    border: 2px solid rgba(15, 23, 42, 0.18) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

.summary-stat-white .summary-stat-label,
.summary-stat-white .summary-stat-value,
.summary-row-white span,
.summary-row-white strong {
    color: #0f172a !important;
}

.summary-row-white {
    border-top: none !important;
    border-radius: 16px;
    padding: 16px 14px;
}

.summary-stat-white {
    backdrop-filter: none;
}

.operation-note-group textarea,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    resize: vertical;
    background: #fff;
}

.transaction-extra-block {
    margin-top: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 10px 12px;
}

.transaction-extra-label {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.transaction-extra-value {
    color: #0f172a;
    font-weight: 700;
    line-height: 1.6;
}

.profits-header-wrap {
    margin-bottom: 18px;
}

.profits-title-row {
    align-items: center;
}

.profits-top-actions {
    display: flex;
    align-items: center;
}

.profits-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.profits-subtitle,
.profits-toolbar-note {
    color: rgba(255,255,255,0.92);
    line-height: 1.7;
}

.profits-toolbar-card {
    background: rgba(255,255,255,0.14);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.profits-toolbar-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.profits-reset-btn {
    min-width: 250px;
}

.profits-filter-card {
    background: rgba(255,255,255,0.96);
}

.profits-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.profits-records-grid {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.profits-record-card {
    position: relative;
}

.profits-record-time {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 12px;
}

.profits-record-title {
    font-weight: 800;
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 14px;
    line-height: 1.5;
}

.profits-title-buy {
    color: #0f172a;
}

.profits-title-sell {
    color: #0f172a;
}

.profits-title-adjustment {
    color: #334155;
}

.profits-record-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.profits-detail-box {
    background: #ffffff;
    border: 2px solid #dbe2ea;
    border-radius: 16px;
    padding: 14px 16px;
    color: #334155;
    line-height: 1.7;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.profits-detail-box strong {
    color: #0f172a;
}

.profits-note-box {
    background: #f8fafc;
    border-style: dashed;
}

@media (max-width: 768px) {
    .profits-filter-grid {
        grid-template-columns: 1fr;
    }

    .profits-records-grid {
        grid-template-columns: 1fr;
    }

    .profits-reset-btn {
        width: 100%;
        min-width: 0;
    }
}


/* ===== Final layout polish: profits page + desktop grids ===== */
.profits-subtitle {
    color: #667eea;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.8;
    margin-top: 10px;
}

.profits-toolbar-note {
    color: rgba(255,255,255,0.98);
    font-size: 19px;
    font-weight: 600;
}

.profits-filter-card,
.profits-records-panel {
    overflow: hidden;
}

.profits-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.profits-filter-grid > .form-group,
.profits-filter-grid .form-group input,
.profits-filter-grid .form-group select {
    min-width: 0;
    max-width: 100%;
}

.profits-filter-grid .form-group {
    margin-bottom: 0;
}

.profits-filter-grid .form-group input,
.profits-filter-grid .form-group select {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #d7dce5;
    font-size: 18px;
    background: #fff;
}

.profits-filter-grid .form-group label {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.profits-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.profits-panel-header h4 {
    margin: 0;
}

.profits-panel-subtitle {
    color: #64748b;
    line-height: 1.7;
    font-size: 15px;
}

.profits-records-scroll {
    max-height: 1350px;
    overflow-y: auto;
    padding-inline-end: 6px;
}

.profits-records-scroll::-webkit-scrollbar {
    width: 10px;
}

.profits-records-scroll::-webkit-scrollbar-thumb {
    background: rgba(102,126,234,0.45);
    border-radius: 999px;
}

.profits-records-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.profits-record-card {
    margin-bottom: 0;
}

@media (min-width: 1200px) {
    #globalOverview.overview-grid,
    #profitsSummary.overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #customersContainer.customers-grid {
        grid-template-columns: 1fr;
    }

    #customersContainer .customer-card {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .profits-subtitle {
        font-size: 17px;
    }

    .profits-toolbar-note {
        font-size: 16px;
    }

    .profits-filter-grid {
        grid-template-columns: 1fr;
    }

    .profits-panel-header {
        align-items: flex-start;
    }

    .profits-records-scroll {
        max-height: 75vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-inline-end: 0;
    }
}
