/* ============================================================
   Planning — Info Board   css/info_board.css
   ============================================================ */

.pl-info-page {
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 13px;
}

/* ── KPI cards ───────────────────────────────────────────── */
.pl-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.pl-kpi-card {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.pl-kpi-card .pl-kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: #1e3a5f;
}

.pl-kpi-card .pl-kpi-label {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pl-kpi-card.pl-kpi-late   .pl-kpi-value { color: #c0392b; }
.pl-kpi-card.pl-kpi-done   .pl-kpi-value { color: #27ae60; }
.pl-kpi-card.pl-kpi-hours  .pl-kpi-value { color: #2980b9; }
.pl-kpi-card.pl-kpi-scrap  .pl-kpi-value { color: #c0392b; }
.pl-kpi-card.pl-kpi-dt     .pl-kpi-value { color: #7f8c8d; }
.pl-kpi-card.pl-kpi-dt.pl-kpi-warn .pl-kpi-value { color: #e67e22; }
.pl-kpi-card.pl-kpi-warn   .pl-kpi-value { color: #e67e22; }

/* ── Scrap badge in section title ────────────────────────── */
.pl-scrap-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 6px;
}
.pl-scrap-badge-warn {
    background: #e67e22;
    color: #fff;
}

/* ── Pending scrap row highlight ─────────────────────────── */
.pl-scrap-pending-row td {
    background: #fff8f0;
}
.pl-scrap-pending-row:hover td {
    background: #fdebd0;
}

/* ── Confirm link ────────────────────────────────────────── */
.pl-scrap-confirm-link {
    font-size: 11px;
    font-weight: 600;
    color: #e67e22;
    text-decoration: none;
    white-space: nowrap;
}
.pl-scrap-confirm-link:hover {
    color: #d35400;
    text-decoration: underline;
}

/* ── Total footer row ────────────────────────────────────── */
.pl-scrap-total-row td {
    background: #f0f4f8;
    border-top: 2px solid #2c3e6b;
    padding: 6px 8px;
}

/* ── Section header ──────────────────────────────────────── */
.pl-info-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a5f;
    padding: 6px 0 6px 4px;
    border-bottom: 2px solid #2c3e6b;
    margin-bottom: 8px;
    margin-top: 18px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── Filters bar ─────────────────────────────────────────── */
.pl-info-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 8px;
    background: rgba(0,0,0,.02);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 6px;
}

.pl-info-filters label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.pl-info-filters input[type=text],
.pl-info-filters input[type=date],
.pl-info-filters select {
    height: 28px;
    padding: 0 7px;
    border: 1px solid rgba(0,0,0,.18);
    border-radius: 5px;
    font-size: 11px;
    background: #fff;
}

.pl-info-filters button {
    height: 28px;
    padding: 0 12px;
    border: none;
    border-radius: 5px;
    background: #2c3e6b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.pl-info-filters button:hover {
    background: #1e2e55;
}

.pl-info-filters a.pl-info-reset {
    font-size: 11px;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

/* ── Optracking table ────────────────────────────────────── */
.pl-optrack-wrap {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #d0d0d0;
}

.pl-optrack-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
}

.pl-optrack-table thead th {
    background: #2c3e6b;
    color: #fff;
    padding: 7px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid #1f2e52;
    position: sticky;
    top: 0;
    z-index: 2;
}

.pl-optrack-table thead th.pl-ot-r { text-align: right; }

.pl-optrack-table tbody tr:nth-child(even) td {
    background: #f8f8f8;
}

.pl-optrack-table tbody tr:hover td {
    background: #eef4ff;
}

.pl-optrack-table td {
    border: 1px solid #e4e4e4;
    padding: 5px 8px;
    vertical-align: middle;
    white-space: nowrap;
    color: #333;
}

.pl-ot-pos { color: #27ae60; font-weight: 700; }
.pl-ot-neg { color: #c0392b; font-weight: 700; }

.pl-ot-cumul {
    font-weight: 600;
    color: #1e3a5f;
}

.pl-ot-note {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #666;
    font-style: italic;
    font-size: 11px;
}

/* ── Pagination bar ──────────────────────────────────────── */
.pl-info-pager {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #555;
}

.pl-info-pager a {
    padding: 2px 9px;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 11px;
}

.pl-info-pager a:hover {
    background: #eee;
}

.pl-info-pager .pl-pager-cur {
    font-weight: 700;
    color: #1e3a5f;
}

/* ── Empty state ─────────────────────────────────────────── */
.pl-info-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* ── WS Overview table (Option A) ───────────────────────── */
.pl-ws-overview-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #d0d0d0;
}
.pl-ws-overview-table {
    border-collapse: collapse;
    font-size: 13px;
    min-width: 380px;
    width: 100%;
}
.pl-ws-overview-table thead th {
    background: #2c3e6b;
    color: #fff;
    padding: 7px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.pl-ws-hdr-r { text-align: right !important; }
.pl-ws-overview-table tbody td {
    padding: 6px 12px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
.pl-ws-overview-table tbody tr:last-child td { border-bottom: none; }
.pl-ws-overview-table tbody tr:nth-child(even) td { background: #f8f9fa; }
.pl-ws-overview-table tbody tr:hover td { background: #eef4ff; }
.pl-ws-cell-num {
    text-align: right;
    font-weight: 600;
    font-size: 13px;
    color: #1e3a5f;
}
.pl-ws-cell-late { color: #c0392b !important; font-weight: 700 !important; }
.pl-ws-link { color: #1e3a5f; font-weight: 600; text-decoration: none; }
.pl-ws-link:hover { color: #2d7cbc; text-decoration: underline; }

/* ── Capacity mini-grid (Option C) ──────────────────────── */
.pl-cap-grid-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: 6px;
    border: 1px solid #d0d0d0;
}
.pl-cap-grid-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
}
.pl-cap-ws-hdr {
    background: #2c3e6b;
    color: #fff;
    padding: 7px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    min-width: 130px;
    position: sticky;
    left: 0;
    z-index: 2;
}
.pl-cap-day-hdr {
    background: #2c3e6b;
    color: #fff;
    padding: 6px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    min-width: 54px;
    line-height: 1.3;
}
.pl-cap-day-hdr.pl-cap-today-hdr { background: #2980b9; }
.pl-cap-day-sub { font-size: 10px; font-weight: 400; opacity: 0.85; }
.pl-cap-ws-cell {
    padding: 5px 12px;
    font-size: 12px;
    white-space: nowrap;
    border-bottom: 1px solid #e8e8e8;
    background: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 1;
}
.pl-cap-cell {
    text-align: center;
    padding: 5px 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e4e4e4;
    min-width: 54px;
}
.pl-cap-cell.pl-cap-today-col {
    border-left: 2px solid #2980b9;
    border-right: 2px solid #2980b9;
}
.pl-cap-empty { background: #f5f5f5; color: #ccc; }
.pl-cap-low   { background: #fff9c4; color: #7d5a00; }
.pl-cap-mid   { background: #c8e6c9; color: #1b5e20; }
.pl-cap-full  { background: #43a047; color: #fff; }
.pl-cap-over  { background: #ffcdd2; color: #b71c1c; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .pl-kpi-card { max-width: 100%; }
    .pl-info-filters { flex-direction: column; align-items: flex-start; }
}

/* ── Section D: Daily Performance table ─────────────────── */
.pl-perf-grid-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
}
.pl-perf-grid-table {
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
    min-width: 100%;
}
.pl-perf-grid-table thead th {
    background: #1a3a5c;
    color: #fff;
    padding: 2px 4px;
    text-align: center;
    border: 1px solid #2d5986;
}
.pl-perf-ws-hdr {
    text-align: left !important;
    min-width: 100px;
    position: sticky;
    left: 0;
    z-index: 2;
    background: #1a3a5c !important;
}
.pl-perf-date-hdr  { border-left: 2px solid #4a7ab5 !important; }
.pl-perf-today-hdr { background: #1565c0 !important; border-left: 2px solid #90caf9 !important; }
.pl-perf-sub-hdr   { font-size: 9px; font-weight: 400; opacity: 0.85; padding: 1px 2px; }
.pl-perf-ws-cell {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    background: #f4f6f9;
    border: 1px solid #ddd;
    position: sticky;
    left: 0;
    z-index: 1;
    white-space: nowrap;
}
.pl-perf-cell {
    padding: 2px 2px;
    text-align: center;
    border: 1px solid #e5e5e5;
    background: #fff;
    min-width: 22px;
    font-size: 11px;
}
.pl-perf-today-col { border-left: 2px solid #90caf9 !important; }
.pl-perf-grid-table tbody tr:hover .pl-perf-cell,
.pl-perf-grid-table tbody tr:hover .pl-perf-ws-cell { background: #f0f4ff; }

/* Performance / Quality colour bands */
.pl-perf-green { background: #c8e6c9 !important; color: #1b5e20; font-weight: 600; }
.pl-perf-amber { background: #fff9c4 !important; color: #7d5a00; font-weight: 600; }
.pl-perf-red   { background: #ffcdd2 !important; color: #b71c1c; font-weight: 600; }
.pl-perf-pending { font-size: 0.78em; opacity: 0.7; margin-left: 2px; }
