/* submissions.css — styles specific to the submissions feed and detail modal */

/* ── Page layout ─────────────────────────────────────────────── */
.submissions-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 24px 0;
    height: calc(100dvh - 44px);   /* full height below fixed top-nav */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.submissions-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.submissions-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* ── Submissions header (title + refresh button row) ─────────── */
.submissions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.submissions-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
}

.submissions-refresh-btn {
    background: white;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: #2c3e50;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.submissions-refresh-btn:hover {
    background: #f0f4f8;
    border-color: #3498db;
    color: #3498db;
}

.submissions-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Feed container ──────────────────────────────────────────── */
.submissions-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 24px;
}

.sub-loading, .sub-empty, .sub-error {
    color: #95a5a6;
    font-size: 12px;
    padding: 12px 0;
}

.sub-error { color: #e74c3c; }

/* ── Submission card ─────────────────────────────────────────── */
.submission-card {
    background: white;
    border-radius: 6px;
    border: 1px solid #e8ecf0;
    padding: 7px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.submission-card:hover {
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(52,152,219,0.15);
}

.sub-row {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.sub-name {
    font-weight: 700;
    font-size: 12px;
    color: #2c3e50;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-service-chip {
    background: #eaf4fd;
    color: #2980b9;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-bot-chip {
    font-size: 11px;
    flex-shrink: 0;
}

.sub-details-inline {
    font-size: 11px;
    color: #888;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sub-date {
    font-size: 10px;
    color: #aab;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Submission detail modal ─────────────────────────────────── */
.sub-detail-modal-content {
    max-width: 500px;
    width: 90%;
}

.sub-detail-title-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sub-detail-title-block h2 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.sub-detail-chips {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.sub-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.sub-detail-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.sub-detail-label {
    font-size: 11px;
    font-weight: 700;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: 68px;
    flex-shrink: 0;
}

.sub-detail-value {
    font-size: 13px;
    color: #2c3e50;
    word-break: break-word;
}

.sub-detail-message {
    margin-top: 4px;
}

.sub-detail-message .sub-detail-label {
    display: block;
    margin-bottom: 8px;
    width: auto;
}

.sub-detail-message p {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
}

/* ── Stats bar ───────────────────────────────────────────────────── */
.sub-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    flex-shrink: 0;
    min-height: 0;
}

.sub-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: color-mix(in srgb, var(--stat-color) 12%, white);
    color: var(--stat-color);
    border: 1.5px solid color-mix(in srgb, var(--stat-color) 30%, transparent);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.sub-stat-pill strong {
    font-weight: 800;
}

/* ── Status dot on feed card ─────────────────────────────────────── */
.sub-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Follow-up overdue badge ─────────────────────────────────────── */
.followup-badge {
    font-size: 12px;
    flex-shrink: 0;
}

/* ── Modal editable section ──────────────────────────────────────── */
.sub-detail-editable {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
}

.sub-detail-row--col {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.sub-detail-row--col .sub-detail-label {
    width: auto;
}

.sub-detail-select,
.sub-detail-date-input {
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    color: #2c3e50;
    background: white;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 6px 10px;
    outline: none;
    transition: border-color 0.15s;
}

.sub-detail-select:focus,
.sub-detail-date-input:focus {
    border-color: #3498db;
}

.sub-detail-textarea {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    color: #2c3e50;
    background: white;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 8px 10px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.sub-detail-textarea:focus {
    border-color: #3498db;
}

/* ── Modal footer two-button layout ─────────────────────────────── */
.sub-detail-modal-content .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-secondary {
    background: white;
    color: #555;
    border: 1.5px solid #dde2e8;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background: #f0f4f8;
    border-color: #aab;
}
