/* ═══════════════════════════════════════════════════════════
   Proposal Modification Tracking Form – Postgraduate Students
   ═══════════════════════════════════════════════════════════ */

.proposal-mod-section {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-top: 1.5rem;
}

.proposal-mod-header {
    text-align: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary);
}

.proposal-mod-header h3 {
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    line-height: 1.6;
}

.proposal-mod-header .pm-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.proposal-mod-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.85rem;
    border-radius: 20px;
    margin-top: 0.75rem;
}

.proposal-mod-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .proposal-mod-meta { grid-template-columns: 1fr; }
    .pm-table-actions { flex-direction: column; }
    .pm-table-actions .btn { width: 100%; }
    .pm-form-actions { flex-direction: column; }
    .pm-form-actions .btn { width: 100%; }
}

.pm-meta-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.pm-meta-label {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    min-width: 120px;
}

.pm-meta-label .en { font-weight: 500; color: var(--text-muted); font-size: 0.82rem; }

.pm-meta-input {
    flex: 1;
    min-width: 140px;
    border: none;
    border-bottom: 1.5px dashed var(--border);
    background: transparent;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem;
    color: var(--text);
}

.pm-meta-input:focus {
    outline: none;
    border-bottom-color: var(--primary-light);
    background: rgba(255,255,255,0.6);
}

.pm-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 1.5rem 0 1rem;
    padding: 0.6rem 1rem;
    background: rgba(26,58,92,0.07);
    border-right: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pm-section-title .en {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

/* ── Modification Table ── */
.pm-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 780px;
}

.pm-table thead th {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 0.75rem 0.6rem;
    text-align: center;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.15);
    line-height: 1.4;
}

.pm-table thead th .en {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}

.pm-table tbody td {
    border: 1px solid var(--border-light);
    padding: 0.5rem;
    vertical-align: top;
}

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

.pm-table tbody tr:hover { background: #f0f7ff; }

.pm-row-num {
    text-align: center;
    font-weight: 800;
    color: var(--primary);
    width: 36px;
}

.pm-table textarea,
.pm-table input[type="text"] {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.84rem;
    resize: vertical;
    min-height: 60px;
    background: white;
    transition: border-color var(--transition);
}

.pm-table input[type="text"].pm-page-input {
    min-height: auto;
    text-align: center;
    width: 60px;
}

.pm-table textarea:focus,
.pm-table input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

.pm-supervisor-check {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
    padding: 0.25rem;
}

.pm-supervisor-check label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
}

.pm-supervisor-check input[type="radio"] {
    accent-color: var(--primary);
}

.pm-table-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

/* ── Signatures Section ── */
.pm-signatures {
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: white;
}

.pm-signatures table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pm-signatures thead th {
    background: #f1f5f9;
    padding: 0.65rem 1rem;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
}

.pm-signatures tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.pm-signatures tbody tr:last-child td { border-bottom: none; }

.pm-sign-input {
    width: 100%;
    border: none;
    border-bottom: 1.5px dashed var(--border);
    background: transparent;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    padding: 0.3rem;
    text-align: center;
}

.pm-date-inputs {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    align-items: center;
}

.pm-date-inputs input {
    width: 42px;
    text-align: center;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.3rem;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
}

.pm-date-inputs input.pm-date-year { width: 58px; }

/* ── Confirmations ── */
.pm-confirm-box {
    background: #fffbeb;
    border: 1.5px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.pm-confirm-box label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.7;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.pm-confirm-box label:last-child { margin-bottom: 0; }

.pm-confirm-box input[type="checkbox"] {
    margin-top: 0.35rem;
    accent-color: var(--warning);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* ── Instructions callout ── */
.pm-instructions {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: var(--radius-sm);
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.85;
}

.pm-instructions strong { color: var(--primary-dark); }

.pm-instructions ol {
    margin: 0.75rem 1.25rem 0;
    padding: 0;
}

.pm-instructions ol li { margin-bottom: 0.35rem; }

/* ── Read-only / Preview mode ── */
.pm-readonly .pm-meta-input,
.pm-readonly .pm-sign-input,
.pm-readonly .pm-table textarea,
.pm-readonly .pm-table input {
    border: none;
    background: transparent;
    pointer-events: none;
}

.pm-readonly .pm-table-actions,
.pm-readonly .pm-confirm-box input { display: none; }

.pm-status-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.pm-status-banner.pending {
    background: #fffbeb;
    border: 1px solid var(--warning);
    color: #92400e;
}

.pm-status-banner.submitted {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.pm-status-banner.verified {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* ── Preview modal specific ── */
#proposalModPreviewModal .modal-content {
    max-width: 920px;
    max-height: 92vh;
    overflow-y: auto;
}
