/* ============================================================================
   Table Styles
   Shared table styling for reports and data displays
   ============================================================================ */

/* Market table styling */
.market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 6px;
}

.market-table th,
.market-table td {
    padding: 4px 6px;
    text-align: left;
    border-bottom: 1px solid #3a3a5a;
}

.market-table th {
    background: #2a2a4e;
    color: #aac;
    font-weight: bold;
}

.market-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Info table styling */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 10px 0;
}

.info-table th,
.info-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #3a3a5a;
}

.info-table th {
    background: #2a2a4e;
    color: #aac;
    font-weight: bold;
}

.info-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Companies Table */
.companies-table {
    width: auto;
    max-width: 800px;
    border-collapse: collapse;
    margin: 20px 0;
}

.companies-table thead {
    background-color: #4CAF50;
    color: white;
}

.companies-table th,
.companies-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.companies-table th {
    font-weight: bold;
}

/* Kolom breedtes */
.companies-table th:nth-child(1),
.companies-table td:nth-child(1) {
    width: 150px;
    white-space: nowrap;
}

.companies-table th:nth-child(2),
.companies-table td:nth-child(2) {
    width: 300px;
}

.companies-table th:nth-child(3),
.companies-table td:nth-child(3) {
    width: 120px;
    text-align: center;
}

.companies-table th:nth-child(4),
.companies-table td:nth-child(4) {
    width: 80px;
    text-align: center;
}

.companies-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Users Table */
.users-table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.users-table thead {
    background-color: #4CAF50;
    color: white;
}

.users-table th,
.users-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.users-table th {
    font-weight: bold;
    font-size: 13px;
}

/* User table column widths */
.users-table th:nth-child(1),
.users-table td:nth-child(1) {
    width: 100px;
    white-space: nowrap;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
    width: 120px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
    width: 200px;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
    width: 60px;
    text-align: center;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
    width: 220px;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
    width: 70px;
    text-align: center;
}

.users-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Customer Report Table */
.customer-report {
    color: #ddd;
}

.customer-report-intro {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #ccc;
}

.customer-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background-color: #2a2a4e;
}

.customer-report-table thead th {
    background-color: #3a3a6e;
    color: #fff;
    padding: 8px 6px;
    text-align: left;
    border-bottom: 2px solid #5a5a8e;
    font-weight: bold;
    vertical-align: bottom;
    line-height: 1.3;
}

.customer-report-table tbody td {
    padding: 6px;
    border-bottom: 1px solid #4a4a6a;
    color: #ddd;
}

.customer-report-table tbody tr:hover {
    background-color: #3a3a5e;
}

.customer-report-table td.number,
.customer-report-table th.number {
    text-align: right;
}

/* Right-align numeric column headers (columns 3-7) */
.customer-report-table th:nth-child(n+3) {
    text-align: right;
}

.customer-report-table tfoot td {
    padding: 8px 6px;
    background-color: #3a3a6e;
    border-top: 2px solid #5a5a8e;
    color: #fff;
}

.customer-report-table .totals-row td {
    font-weight: bold;
}

/* Customer report column widths */
.customer-report-table th:nth-child(1),
.customer-report-table td:nth-child(1) {
    width: 100px;  /* Customer */
}

.customer-report-table th:nth-child(2),
.customer-report-table td:nth-child(2) {
    width: 70px;  /* Level - wide enough for "Very Large" */
    white-space: nowrap;
}

.customer-report-table th:nth-child(7),
.customer-report-table td:nth-child(7) {
    width: 80px;  /* Weighted delivery reliability */
}

/* Forecast Table */
.forecast-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.forecast-table thead th {
    background-color: #3a3a6e;
    color: #fff;
    padding: 6px 4px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #4a4a8e;
    white-space: nowrap;
}

.forecast-table tbody td {
    padding: 4px;
    border: 1px solid #4a4a8e;
    background-color: #2a2a4e;
    color: #ccc;
}

.forecast-table tbody tr:hover {
    background-color: #3a3a5e;
}

.forecast-table td.number {
    text-align: right;
    font-family: monospace;
}

/* Orders Table */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.orders-table thead th {
    background-color: #3a3a6e;
    color: #fff;
    padding: 6px 4px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #4a4a8e;
    white-space: nowrap;
}

.orders-table tbody td {
    padding: 4px;
    border: 1px solid #4a4a8e;
    background-color: #2a2a4e;
    color: #ccc;
}

.orders-table tbody tr:hover {
    background-color: #3a3a5e;
}

.orders-table td.number {
    text-align: right;
    font-family: monospace;
}

.orders-table td.on-time {
    color: #6f6;
    text-align: center;
}

.orders-table td.late {
    color: #f66;
    text-align: center;
}

/* Order Promiser Report Table */
.orderpromiser-report .report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.orderpromiser-report .report-table tr td {
    padding: 6px 10px;
    border-bottom: 1px solid #3a3a5a;
}

.orderpromiser-report .report-table tr td:first-child {
    color: #ccc;
}

.orderpromiser-report .report-table tr td.number {
    text-align: right;
    font-family: monospace;
    color: #fff;
}
