/* Work Requests page */

.req-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.req-header {
    padding: 20px 24px 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
    flex-shrink: 0;
}

.req-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.req-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }

.req-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.req-filters select, .req-filters input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: inherit;
    outline: none;
}

.req-filters input { width: 220px; }

.req-scope {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.req-scope-btn {
    padding: 6px 12px;
    border: none;
    border-right: 1px solid var(--border);
    background: var(--bg-white);
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
}

.req-scope-btn:last-child { border-right: none; }
.req-scope-btn.active { background: var(--accent); color: #fff; }

.req-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
}

.req-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.85em;
}

.req-table th {
    text-align: left;
    padding: 8px 7px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-main);
    z-index: 1;
}

.req-table td {
    padding: 8px 7px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.req-row { cursor: pointer; }
.req-row:hover { background: #f9fafb; }
.req-id { color: var(--text-secondary); }
.req-overdue { color: #b91c1c; font-weight: 600; }

.req-subtext {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.req-badge {
    display: inline-block;
    font-size: 0.72em;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.req-status-new { background: #e0e7ff; color: #3730a3; }
.req-status-in_progress { background: #fef3c7; color: #92400e; }
.req-status-on_hold { background: #fee2e2; color: #991b1b; }
.req-status-done { background: #d1fae5; color: #065f46; }
.req-status-cancelled { background: #f3f4f6; color: #6b7280; }

.req-approved-yes { background: #d1fae5; color: #065f46; }
.req-approved-no { background: #fee2e2; color: #991b1b; }

.req-priority-critical { background: #dc2626; color: #fff; }
.req-priority-high { background: #ffedd5; color: #9a3412; }
.req-priority-medium { background: #e0f2fe; color: #075985; }
.req-priority-low { background: #f1f5f9; color: #64748b; }
.req-priority-deferred { background: #f3f4f6; color: #9ca3af; }

.req-history {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.req-event {
    padding: 8px 10px;
    border-left: 3px solid var(--border);
    background: #f9fafb;
    border-radius: 4px;
    font-size: 0.85em;
}

.req-event-comment { border-left-color: var(--accent); background: #fff; }

.req-event-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.req-event-body { white-space: pre-wrap; }

.req-comment-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.req-comment-row textarea { flex: 1; }

#request-modal .modal-card { max-width: 620px; }
#request-modal .form-input { width: 100%; }
#request-modal .form-row .form-group { min-width: 0; }  /* long client/job names must not push the row wider */

.req-choice { display: flex; gap: 6px; flex-wrap: wrap; }

.req-choice-btn {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-white);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
}

.req-choice-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.req-tag {
    display: inline-block;
    margin: 3px 4px 0 0;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72em;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.req-tracking {
    padding: 12px 12px 0;
    margin-bottom: 14px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Requests-only accounts (Jodi users): just the Requests page, no triage controls */
body.requests-only .nav-item:not(.nav-requests),
body.requests-only .server-restart { display: none !important; }
body.requests-only .req-triage-only { display: none !important; }
