/* ═══════════════════════════════════════════════════════════
   operator.css — Operator panel styles
   ═══════════════════════════════════════════════════════════ */

/* ── Section headers with accent bar ── */
.op-section {
    margin-bottom: 1.5rem;
}

.op-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    font-size: 0.95rem;
    margin: -1.25rem -1.25rem 1rem -1.25rem;
}

.op-section-header .op-count {
    background: rgba(255,255,255,0.85);
    padding: 0.1rem 0.65rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 1.8rem;
    text-align: center;
}

.op-section-pending .op-section-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-bottom: 2px solid #f59e0b;
}

.op-section-pending .op-section-header .op-count {
    color: #92400e;
    background: rgba(255,255,255,0.7);
}

.op-section-processed .op-section-header {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-bottom: 2px solid #86efac;
}

.op-section-processed .op-section-header .op-count {
    color: #166534;
}

.op-section-modifications .op-section-header {
    background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
    color: #854d0e;
    border-bottom: 2px solid #facc15;
}

/* ── Card section overrides ── */
.card.op-section-pending,
.card.op-section-processed,
.card.op-section-modifications,
.card.op-section-info {
    padding: 1.25rem;
    overflow: hidden;
}

.op-section-info .op-section-header {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border-bottom: 2px solid #93c5fd;
}

/* ── Improved tables ── */
.op-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.op-table thead th {
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.op-table thead th:not(.no-sort) {
    cursor: pointer;
    user-select: none;
}

.op-table thead th:not(.no-sort):hover {
    color: #1e293b;
    background: #f1f5f9;
}

/* ── Sortable header indicators ── */
.op-table thead th .sort-indicator {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-left: 0.2rem;
}

.op-table thead th:hover .sort-indicator {
    opacity: 1;
}

.op-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.op-table tbody tr {
    transition: background 0.1s;
}

.op-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.op-table tbody tr:hover {
    background: #f0f4ff;
}

/* Status-colored row left border */
.op-table tbody tr.op-row-pending {
    border-left: 3px solid var(--status-pending-fill);
}

.op-table tbody tr.op-row-accepted {
    border-left: 3px solid var(--status-available-fill);
}

.op-table tbody tr.op-row-declined {
    border-left: 3px solid var(--status-reserved-fill);
}

.op-table tbody tr.op-row-cancelled {
    border-left: 3px solid var(--status-unavailable-fill);
}

.op-table tbody tr.op-row-completed {
    border-left: 3px solid var(--status-completed-fill);
}

/* Row conflict highlight */
.op-table tbody tr.row-has-conflict {
    background: #fffbeb;
}

.op-table tbody tr.row-has-conflict:hover {
    background: #fef3c7;
}

/* ── Improved ID cells ── */
.op-id-link {
    font-weight: 700;
    font-size: 0.9rem;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.op-id-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ── Date display improvements ── */
.op-date-primary {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    white-space: nowrap;
}

.op-date-secondary {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 1px;
}

.op-date-arrow {
    color: #94a3b8;
    padding: 0 0.15rem;
}

/* ── Improved filter bar ── */
.op-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.op-filter-bar .form-group {
    margin: 0;
    min-width: 130px;
}

.op-filter-bar label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
}

.op-filter-bar .form-control {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
}

.op-filter-bar .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

/* ── Summary stats strip ── */
.op-stats-strip {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.op-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.op-stat-pending {
    background: var(--status-pending-bg);
    color: var(--status-pending-text);
    border-color: #fde68a;
}

.op-stat-accepted {
    background: var(--status-available-bg);
    color: var(--status-available-text);
    border-color: #bbf7d0;
}

.op-stat-declined {
    background: var(--status-declined-bg);
    color: var(--status-declined-text);
    border-color: #fecaca;
}

.op-stat-cancelled {
    background: var(--status-cancelled-bg);
    color: var(--status-cancelled-text);
    border-color: #e5e7eb;
}

.op-stat-total {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.op-stat .op-stat-num {
    font-size: 0.95rem;
    font-weight: 800;
}

/* ── Action buttons ── */
.op-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    white-space: nowrap;
}

.op-actions .btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.15s;
}

.op-actions .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ── Better pagination ── */
.op-pagination {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem 0 0.5rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 0.5rem;
}

.op-pagination .btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 6px;
    min-width: 2rem;
    text-align: center;
    font-weight: 500;
}

.op-pagination .op-page-current {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    padding: 0.3rem 0.85rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.op-pagination .op-page-info {
    padding: 0.25rem 0.75rem;
    color: #64748b;
    font-size: 0.82rem;
}

/* ── Improved empty state ── */
.op-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #94a3b8;
}

.op-empty-state .op-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.op-empty-state .op-empty-text {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ── Page header improvements ── */
.op-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.op-page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.op-page-header .op-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Requester cell styling ── */
.op-requester {
    font-weight: 600;
    color: #1e293b;
}

.op-requester-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 400;
}

/* ── Entity type pill ── */
.op-entity-pill {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

/* ── Responsive table wrapper for operator ── */
.op-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1.25rem -1.25rem;
    padding: 0 1.25rem 1.25rem;
}

/* ── Parent/child entity rows ── */
.op-parent-row {
    background: #f1f5f9 !important;
    border-bottom: none;
}

.op-parent-row td {
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    padding-bottom: 0.4rem;
}

.op-child-row {
    background: #fff !important;
}

.op-child-row:nth-child(even) {
    background: #fafbfd !important;
}

.op-child-row td {
    border-bottom: 1px solid #f1f5f9;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.op-child-entity-name {
    display: inline-block;
    padding-left: 1.5rem;
    color: #475569;
    font-size: 0.85rem;
}

/* Colored left accent connecting children to parent */
.op-child-row > td:first-child {
    border-left: 3px solid #3b82f6;
}

/* Space before next parent group */
.op-child-row + .op-parent-row > td {
    border-top: 2px solid #e2e8f0;
}

/* ── Bulk action bar ────────────────────────────────────────── */
.bulk-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: #1e293b;
    border-top: 2px solid #3b82f6;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}
.bulk-action-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.bulk-action-count {
    color: #f1f5f9;
    font-size: 0.9rem;
    white-space: nowrap;
}
.bulk-action-count strong {
    color: #60a5fa;
    font-size: 1.1rem;
}
.bulk-action-bar .form-control {
    height: 32px;
    font-size: 0.85rem;
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}
.bulk-action-bar .form-control::placeholder {
    color: #94a3b8;
}
.bulk-action-bar .btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.bulk-action-bar .btn-danger:hover {
    background: #b91c1c;
}

/* Checkbox styling in tables */
.bulk-select-all,
.bulk-select-item {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}
