/* Common Transaction Forms Styles (Theme & Desktop Aware) */

.transaction-container {
    font-size: 0.85rem;
    background-color: var(--bg-secondary);
    padding: 6px;
    border-radius: 6px;
}

/* Header Sections */
.erp-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 8px;
}

.erp-card-title {
    font-weight: 600;
    color: var(--primary-color, #0d6efd);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Control density matching desktop app */
.erp-form-group {
    margin-bottom: 6px;
}

/* Total Stats Panel */
.stats-panel {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 180px;
}

.stats-panel-title {
    font-weight: bold;
    color: var(--primary-color) !important;
    margin-bottom: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-weight: normal;
    color: #3c4043;
}

.stat-value {
    width: 90px;
    font-weight: 800;
}

.stat-value input,
.stat-value .e-numeric,
.stat-value .e-input,
.stat-value .e-input-group,
.stat-value .e-disabled input,
.stat-value .e-input-group.e-disabled input,
.stat-value .e-numeric.e-disabled input,
.stat-value input[disabled] {
    font-weight: 800 !important;
    font-size: 0.88rem !important;
    opacity: 1 !important;
}

/* Light Theme Stats Value Text Color */
:root:not([data-theme="dark"]) .stat-value input,
:root:not([data-theme="dark"]) .stat-value .e-numeric,
:root:not([data-theme="dark"]) .stat-value .e-input,
:root:not([data-theme="dark"]) .stat-value .e-disabled input,
:root:not([data-theme="dark"]) .stat-value .e-numeric.e-disabled input,
:root:not([data-theme="dark"]) .stat-value input[disabled],
body:not([data-theme="dark"]) .stat-value input,
body:not([data-theme="dark"]) .stat-value .e-numeric,
body:not([data-theme="dark"]) .stat-value .e-input,
body:not([data-theme="dark"]) .stat-value .e-disabled input,
body:not([data-theme="dark"]) .stat-value .e-numeric.e-disabled input,
body:not([data-theme="dark"]) .stat-value input[disabled] {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

.stat-value .text-success input,
.stat-value .text-success.e-disabled input,
.stat-value .text-success .e-disabled input,
.stat-value.text-success input {
    color: #198754 !important;
    -webkit-text-fill-color: #198754 !important;
    font-weight: 800 !important;
}

/* Mobile View Responsiveness */
@media (max-width: 768px) {
    .stats-panel {
        min-width: 100% !important;
        width: 100% !important;
        padding: 8px 10px !important;
        margin-bottom: 10px !important;
    }

    .stat-row {
        padding: 2px 0 !important;
    }

    .stat-label {
        font-size: 0.8rem !important;
    }

    .stat-value {
        width: auto !important;
        min-width: 80px !important;
        max-width: 130px !important;
    }

    .stat-value input,
    .stat-value .e-numeric,
    .stat-value .e-input {
        font-size: 0.82rem !important;
    }
}



/* Tab/Footer sections */
.erp-section-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.tab-column {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
}

.tab-column-title {
    color: var(--primary-color);
    font-weight: 600;
    padding: 2px 0;
    margin-bottom: 8px;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-color);
}

/* Dark Theme Support */
[data-theme="dark"] .yellow-grid-container {
    background-color: #2b2b1a !important; /* dark yellow-tinted background */
    border-color: #8b7500 !important;
}

[data-theme="dark"] .yellow-grid-container .e-headercell,
[data-theme="dark"] .yellow-grid-container ::deep .e-headercell {
    background-color: #3d341d !important;
    color: #f1f3f4 !important;
    border-color: #5c4e2b !important;
}

[data-theme="dark"] .yellow-grid-container .yellow-grid-cell,
[data-theme="dark"] .yellow-grid-container ::deep .yellow-grid-cell {
    border-color: #4a3e22 !important;
    color: #e8eaed !important;
}

/* Dark Theme Stats Panel & Cards */
[data-theme="dark"] .stats-panel {
    background-color: var(--bg-primary, #1e1e2d) !important;
    border-color: var(--border-color, #2b2b40) !important;
}

[data-theme="dark"] .stats-panel-title {
    color: #f39c12 !important;
}

[data-theme="dark"] .stat-label {
    color: #e8eaed !important;
}

[data-theme="dark"] .stat-value input,
[data-theme="dark"] .stat-value .e-numeric,
[data-theme="dark"] .stat-value .e-input,
[data-theme="dark"] .stat-value .e-input-group,
[data-theme="dark"] .stat-value .e-disabled input,
[data-theme="dark"] .stat-value .e-input-group.e-disabled input,
[data-theme="dark"] .stat-value .e-numeric.e-disabled input,
[data-theme="dark"] .stat-value input[disabled],
[data-theme="dark"] .stat-value .e-control input {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 800 !important;
}

[data-theme="dark"] .stat-value .text-success input,
[data-theme="dark"] .stat-value .text-success.e-disabled input,
[data-theme="dark"] .stat-value .text-success .e-disabled input,
[data-theme="dark"] .stat-value.text-success input {
    color: #2ec4b6 !important;
    -webkit-text-fill-color: #2ec4b6 !important;
    font-weight: 800 !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-primary, #1e1e2d) !important;
    color: var(--text-primary, #ffffff) !important;
    border-color: var(--border-color, #2b2b40) !important;
}

[data-theme="dark"] .bg-light,
[data-theme="dark"] .e-outline.bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .tab-column-title {
    background-color: transparent !important;
    color: var(--primary-color) !important;
}

/* Popup Modal custom styling */
.modal-section-title {
    font-weight: 600;
    color: var(--primary-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 4px;
    margin-bottom: 12px;
    margin-top: 10px;
    font-size: 0.85rem;
}

.enquiry-items-grid-container,
.enquiry-items-grid-container .grid-container {
    margin-bottom: 0 !important;
}

.enquiry-items-grid-container .grid-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
}

.enquiry-items-grid-container .grid-header {
    margin-bottom: 4px !important;
    padding-bottom: 4px !important;
}

.enquiry-items-grid-container .e-grid {
    font-size: 0.8rem !important;
}

.enquiry-items-grid-container .e-headercell {
    padding: 4px 6px !important;
    height: 32px !important;
}

.enquiry-items-grid-container .e-headercell,
.enquiry-items-grid-container .e-headercell .e-headertext {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
}

.enquiry-items-grid-container .e-rowcell {
    padding: 4px 6px !important;
    height: 32px !important;
}

.enquiry-items-grid-container .e-btn {
    font-size: 0.8rem !important;
    padding: 2px 6px !important;
}

/* Enable horizontal scroll in dropdowns when item text is wider than popup */
.e-dropdownbase .e-content {
    overflow-x: auto !important;
}

.e-dropdownbase .e-list-item {
    white-space: nowrap !important;
    text-overflow: clip !important;
    overflow: visible !important;
    width: max-content !important;
    min-width: 100% !important;
}

/* View Action Button Style */
.action-icon-btn.view-btn {
    color: #10b981 !important;
}

.action-icon-btn.view-btn:hover {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] .action-icon-btn.view-btn:hover {
    background: rgba(16, 185, 129, 0.1) !important;
}

/* Custom U-Bend Table styling */
.ubend-table-container {
    height: 160px;
    overflow: auto;
}

.ubend-custom-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ubend-custom-table th {
    background-color: var(--bg-secondary, #f8f9fa);
    color: var(--primary-color, #700f57);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    padding: 6px 4px;
    border: 1px solid var(--border-color, #dee2e6);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ubend-custom-table td {
    padding: 2px 4px;
    border: 1px solid var(--border-color, #dee2e6);
    vertical-align: middle;
}

.ubend-custom-table tr.selected-row {
    background-color: rgba(112, 15, 87, 0.08) !important;
}

[data-theme="dark"] .ubend-custom-table th {
    background-color: #2b2b1a !important;
    color: #e8eaed !important;
    border-color: #5c4e2b !important;
}

[data-theme="dark"] .ubend-custom-table td {
    border-color: #4a3e22 !important;
}

[data-theme="dark"] .ubend-custom-table tr.selected-row {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

