/* =========================================
   منصة أخلاقيات البحث العلمي - UST Aden
   Academic Research Ethics Portal Styles
   ========================================= */

:root {
    --primary:        #1a3a5c;
    --primary-light:  #2563eb;
    --primary-dark:   #0f2744;
    --accent:         #b8860b;
    --accent-light:   #f59e0b;
    --success:        #059669;
    --warning:        #d97706;
    --danger:         #dc2626;
    --info:           #0284c7;
    --bg:             #f0f4f8;
    --bg-card:        #ffffff;
    --border:         #d1d5db;
    --border-light:   #e5e7eb;
    --text:           #1f2937;
    --text-muted:     #6b7280;
    --shadow:         0 4px 20px rgba(26,58,92,0.09);
    --shadow-lg:      0 10px 40px rgba(26,58,92,0.15);
    --radius:         14px;
    --radius-sm:      8px;
    --transition:     0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.75;
    font-size: 15px;
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* ── Header ── */
header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #1e4976 100%);
    color: white;
    padding: max(0.9rem, env(safe-area-inset-top, 0px)) 2rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 3px 25px rgba(0,0,0,0.35);
    gap: 1rem;
}

.header-brand { display: flex; align-items: center; gap: 1rem; }

.header-logo {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; flex-shrink: 0;
}

header h1 { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
header .header-sub { font-size: 0.82rem; opacity: 0.75; margin-top: 2px; }

.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 30px;
    transition: all var(--transition);
    border: 1.5px solid transparent;
}
.nav-links a:hover { color: white; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }
.nav-links a.active { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); color: white; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; display: flex; flex-direction: column; gap: 2rem; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(26,58,92,0.06);
}

.card-title {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 1.5rem;
    padding-bottom: 0.9rem;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.title-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.1rem; flex-shrink: 0;
}

/* ── Hero Section ── */
.hero-section {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 50%, #f0fdf4 100%);
    border: 1px solid rgba(37,99,235,0.1);
    text-align: center;
    padding: 3.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent));
}

.hero-section h2 { font-size: 2.2rem; color: var(--primary); font-weight: 800; margin-bottom: 1rem; line-height: 1.35; }
.hero-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 720px; margin: 0 auto 2.5rem; line-height: 1.9; }

/* ── Members Grid ── */
.members-section {
    background: white;
    border-radius: var(--radius-sm);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.members-section h3 {
    text-align: center;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.member-card {
    background: linear-gradient(135deg, #f8faff, #f0f4ff);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.3rem;
    border-right: 4px solid var(--primary-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform var(--transition), box-shadow var(--transition);
}

.member-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(26,58,92,0.12); }
.member-card.is-chair { border-right-color: var(--accent); background: linear-gradient(135deg, #fffcf0, #fef3c7); }
.member-card.is-head { border-right-color: var(--success); background: linear-gradient(135deg, #f0fdf8, #dcfce7); }

.member-card .mc-name { font-weight: 800; color: var(--primary); font-size: 1rem; display: block; margin-bottom: 4px; }
.member-card .mc-role { font-size: 0.85rem; color: var(--text-muted); }

/* ── Tracker Box ── */
.tracker-box {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
}

.tracker-box::after {
    content: '🔍';
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    opacity: 0.06;
}

.tracker-box h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.4rem; }
.tracker-box .tracker-desc { opacity: 0.8; margin-bottom: 1.8rem; font-size: 0.95rem; }

.tracker-tabs { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.tracker-tab {
    padding: 0.45rem 1.3rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    background: transparent;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
}
.tracker-tab.active, .tracker-tab:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.6); color: white; }

.tracker-input-group { display: flex; gap: 1rem; flex-wrap: wrap; }

.tracker-input {
    flex: 1;
    min-width: 200px;
    padding: 0.9rem 1.2rem;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    backdrop-filter: blur(10px);
}
.tracker-input::placeholder { color: rgba(255,255,255,0.55); }
.tracker-input:focus { outline: none; border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.18); }

/* ── Buttons ── */
.btn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97) !important; }

/* لمس سريع على الجوال – بدون JS إضافي */
.btn, .tracker-tab, .filter-btn, .nav-links a, button, select, input, textarea {
    touch-action: manipulation;
}

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; box-shadow: 0 4px 15px rgba(37,99,235,0.3); }
.btn-primary:hover { box-shadow: 0 6px 22px rgba(37,99,235,0.45); transform: translateY(-1px); }

.btn-accent { background: linear-gradient(135deg, var(--accent), #e5a800); color: white; box-shadow: 0 4px 15px rgba(184,134,11,0.3); }
.btn-accent:hover { box-shadow: 0 6px 22px rgba(184,134,11,0.45); transform: translateY(-1px); }

.btn-success { background: linear-gradient(135deg, #047857, var(--success)); color: white; box-shadow: 0 4px 15px rgba(5,150,105,0.3); }
.btn-success:hover { box-shadow: 0 6px 22px rgba(5,150,105,0.45); transform: translateY(-1px); }

.btn-warning { background: linear-gradient(135deg, #b45309, var(--warning)); color: white; box-shadow: 0 4px 15px rgba(217,119,6,0.3); }
.btn-warning:hover { box-shadow: 0 6px 22px rgba(217,119,6,0.45); transform: translateY(-1px); }

.btn-danger { background: linear-gradient(135deg, #991b1b, var(--danger)); color: white; box-shadow: 0 4px 15px rgba(220,38,38,0.3); }
.btn-danger:hover { box-shadow: 0 6px 22px rgba(220,38,38,0.45); transform: translateY(-1px); }

.btn-secondary { background: white; color: var(--primary); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary-light); background: #f0f4ff; }

.btn-white { background: white; color: var(--primary); font-weight: 700; }
.btn-white:hover { background: #f0f4ff; }

.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-full { width: 100%; }

/* ── Forms ── */
.form-section {
    background: #f9fafb;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.step-badge {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.2rem; }

.form-group { display: flex; flex-direction: column; gap: 0.45rem; }

.form-group label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
}

.form-group label .req { color: var(--danger); margin-right: 2px; }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.82rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

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

.form-group textarea { min-height: 90px; resize: vertical; }
.form-group input[type="file"] { padding: 0.6rem; cursor: pointer; }

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.4rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: 400; font-size: 0.9rem; }
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.28rem 0.9rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-submitted        { background: #dbeafe; color: #1e40af; }
.badge-review           { background: #fef3c7; color: #92400e; }
.badge-modifications    { background: #ffedd5; color: #9a3412; }
.badge-mod-submitted    { background: #ede9fe; color: #5b21b6; }
.badge-chair            { background: #f0fdf4; color: #166534; }
.badge-pending-number   { background: #e0f2fe; color: #075985; }
.badge-completed        { background: #d1fae5; color: #065f46; }
.badge-rejected         { background: #fee2e2; color: #991b1b; }

/* ── Timeline ── */
.timeline { list-style: none; position: relative; padding: 0; }

.timeline::before {
    content: '';
    position: absolute;
    top: 0; right: 12px; bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-item { display: flex; align-items: flex-start; gap: 1rem; padding: 0.7rem 0; position: relative; }

.tl-dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: white;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 800;
    position: relative; z-index: 1;
    transition: all var(--transition);
}

.timeline-item.completed .tl-dot { background: var(--success); border-color: var(--success); color: white; }
.timeline-item.active .tl-dot { background: var(--primary-light); border-color: var(--primary-light); color: white; box-shadow: 0 0 0 5px rgba(37,99,235,0.18); }
.timeline-item.rejected .tl-dot { background: var(--danger); border-color: var(--danger); color: white; }

.tl-content { padding-top: 0.15rem; flex: 1; }
.tl-label { font-weight: 700; font-size: 0.92rem; color: var(--text-muted); }
.timeline-item.completed .tl-label { color: var(--success); }
.timeline-item.active .tl-label { color: var(--primary-light); }
.timeline-item.rejected .tl-label { color: var(--danger); }
.tl-date { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ── Loading ── */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(15,39,68,0.75);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
}
.loading-overlay.active { opacity: 1; pointer-events: all; }

.spinner {
    width: 58px; height: 58px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    padding: 1rem;
    backdrop-filter: blur(5px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { transform: translateY(25px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.modal-close {
    position: absolute; top: 1rem; left: 1rem;
    background: #f3f4f6; border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer; font-size: 1.3rem;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.modal-close:hover { background: #e5e7eb; color: var(--text); }

/* ── Dashboard Metrics ── */
.dashboard-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }

.metric-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition);
}
.metric-card:hover { transform: translateY(-3px); }
.metric-card h3 { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 600; }
.metric-number { font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; }

/* ── Table ── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    contain: layout style;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 600px; }

table thead tr { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
table th { color: white; padding: 1rem 1.1rem; text-align: right; font-weight: 700; white-space: nowrap; }
table th:first-child { border-radius: 0 var(--radius-sm) 0 0; }
table th:last-child { border-radius: var(--radius-sm) 0 0 0; }

table td { padding: 0.9rem 1.1rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
table tr:hover td { background: #f8fafc; }
/* لا تستخدم content-visibility بارتفاع تقديري — يسبب تداخل نص الصفوف */
table tr:last-child td { border-bottom: none; }

/* ── Dashboard requests table: clear, non-overlapping rows ── */
#requestsTable {
    table-layout: fixed;
    min-width: 960px;
}
#requestsTable th:nth-child(1),
#requestsTable td.col-id { width: 15%; }
#requestsTable th:nth-child(2),
#requestsTable td.col-researcher { width: 18%; }
#requestsTable th:nth-child(3),
#requestsTable td.col-title { width: 32%; }
#requestsTable th:nth-child(4),
#requestsTable td.col-date { width: 11%; }
#requestsTable th:nth-child(5),
#requestsTable td.col-status { width: 14%; }
#requestsTable th:nth-child(6),
#requestsTable td.col-action { width: 10%; }
#requestsTable td {
    vertical-align: top;
    line-height: 1.55;
    padding: 0.85rem 0.9rem;
}
#requestsTable .req-id {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.88rem;
    word-break: break-word;
}
#requestsTable .req-name {
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}
#requestsTable .req-dept {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}
#requestsTable .req-title {
    font-size: 0.86rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.65em;
}
#requestsTable .col-date { white-space: nowrap; font-size: 0.85rem; }
#requestsTable .col-status { line-height: 1.5; }
#requestsTable .col-action { white-space: nowrap; }

/* ── Notifications ── */
.notif-box {
    border-radius: var(--radius-sm);
    padding: 1.2rem 1.5rem;
    margin: 1rem 0;
    border-right: 5px solid;
    display: flex; align-items: flex-start; gap: 1rem;
}
.notif-box .notif-icon { font-size: 1.5rem; flex-shrink: 0; }
.notif-box.warning { background: #fffbeb; border-right-color: var(--warning); color: #92400e; }
.notif-box.info    { background: #eff6ff; border-right-color: var(--primary-light); color: #1e40af; }
.notif-box.success { background: #ecfdf5; border-right-color: var(--success); color: #065f46; }
.notif-box.danger  { background: #fef2f2; border-right-color: var(--danger); color: #991b1b; }

/* ── Request Details ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.detail-item { background: #f9fafb; padding: 0.8rem 1rem; border-radius: var(--radius-sm); }
.detail-item.full { grid-column: span 2; }
.detail-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-weight: 700; font-size: 0.92rem; color: var(--text); }

/* ── Notes ── */
.note-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    border-right: 3px solid var(--primary-light);
}
.note-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.note-author { font-weight: 800; font-size: 0.85rem; color: var(--primary); }
.note-date { font-size: 0.78rem; color: var(--text-muted); }
.note-text { font-size: 0.92rem; color: var(--text); line-height: 1.65; }

/* ── Ethics Number Display ── */
.ethics-display {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
}
.ethics-display .eth-label { font-size: 0.9rem; color: #065f46; margin-bottom: 0.5rem; font-weight: 600; }
.ethics-display .eth-number { font-size: 2rem; font-weight: 900; color: var(--success); letter-spacing: 2px; }

/* ── Researcher Requests List ── */
.researcher-requests { display: flex; flex-direction: column; gap: 1rem; }
.req-summary-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1.2rem 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all var(--transition);
    flex-wrap: wrap;
    gap: 0.5rem;
}
.req-summary-card:hover { border-color: var(--primary-light); box-shadow: 0 4px 16px rgba(37,99,235,0.15); transform: translateY(-1px); }
.req-summary-info { display: flex; flex-direction: column; gap: 4px; }
.req-summary-id { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.req-summary-title { font-size: 0.9rem; color: var(--text-muted); }

/* ── Section Dividers ── */
.section-divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }
.section-divider span { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

/* ── Head Research Notification ── */
.issue-request-box {
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
    border: 2px solid var(--info);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 1rem 0;
}
.issue-request-box h4 { color: var(--info); font-size: 1rem; margin-bottom: 0.5rem; }
.issue-request-msg { font-size: 1rem; color: var(--primary); font-weight: 600; line-height: 1.6; }
.issue-request-msg .req-num { background: white; padding: 0.2rem 0.8rem; border-radius: 4px; border: 1px solid var(--info); font-weight: 800; }

/* ── Util ── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Form grid span helpers ── */
.form-group[style*="grid-column:span 2"],
.form-group[style*="grid-column: span 2"] {
    grid-column: span 2;
}

/* ── Issue Panel (Head of Research) ── */
.issue-panel {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #0284c7;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
}
.issue-panel h3 { color: #075985; font-size: 1.2rem; margin-bottom: 0.5rem; font-weight: 800; }

/* ── Missing badge ── */
.badge-review { background: #fef3c7; color: #92400e; }

/* ── Modal wide (dashboard review) ── */
.modal-wide { max-width: 850px !important; }

/* ── Dashboard action buttons ── */
#actionArea .btn { min-height: 44px; }

/* ── Print styles for PDF generation ── */
@media print {
    header, .nav-links, .btn, .filter-bar { display: none !important; }
}

/* ── Responsive: tablets & phones ── */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: max(0.75rem, env(safe-area-inset-top, 0px)) 1rem 0.75rem;
    }

    .header-brand { justify-content: center; text-align: center; }
    header h1 { font-size: 1.05rem; }
    header .header-sub { font-size: 0.76rem; }
    .header-logo { width: 44px; height: 44px; font-size: 1.35rem; }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.45rem;
        padding-bottom: 0.15rem;
        scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a {
        flex-shrink: 0;
        font-size: 0.8rem;
        padding: 0.5rem 0.85rem;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .role-pill { font-size: 0.75rem; padding: 0.25rem 0.75rem; flex-shrink: 0; }

    .container { margin: 1rem auto; padding: 0 0.85rem; gap: 1.25rem; }

    .card { padding: 1.25rem; }
    .card-title { font-size: 1.15rem; flex-wrap: wrap; }

    .hero-section { padding: 2rem 1.25rem; }
    .hero-section h2 { font-size: 1.45rem; }
    .hero-subtitle { font-size: 0.95rem; margin-bottom: 1.75rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; white-space: normal; }

    .members-section { padding: 1.25rem; margin: 1rem 0; }
    .members-section h3 { font-size: 1.2rem; }
    .members-grid { grid-template-columns: 1fr; }

    .tracker-box { padding: 1.5rem 1.25rem; margin-top: 1rem; }
    .tracker-box::after { display: none; }
    .tracker-box h3 { font-size: 1.15rem; }
    .tracker-tabs { flex-wrap: wrap; }
    .tracker-tab { flex: 1; text-align: center; min-width: 0; }
    .tracker-input-group { flex-direction: column; }
    .tracker-input { min-width: 0; width: 100%; font-size: 16px; }
    .tracker-input-group .btn { width: 100%; }

    .form-section { padding: 1.25rem; }
    .form-row, .form-row-3, .detail-grid { grid-template-columns: 1fr; }
    .detail-item.full { grid-column: span 1; }
    .form-group[style*="grid-column:span 2"],
    .form-group[style*="grid-column: span 2"] { grid-column: span 1; }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .filter-search { font-size: 16px; }

    .dash-req-id { font-size: 1.35rem; word-break: break-word; }
    .tracking-number-display { font-size: 1.5rem; letter-spacing: 1px; padding: 0.85rem 1rem; word-break: break-all; }

    .req-summary-card { padding: 1rem; }
    .req-summary-card > div:last-child { width: 100%; justify-content: space-between; }

    .dashboard-metrics { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .metric-card { padding: 1rem; }
    .metric-number { font-size: 2.2rem; }

    .filter-bar { gap: 0.5rem; }
    .filter-btn { padding: 0.45rem 0.9rem; font-size: 0.8rem; min-height: 40px; }
    .filter-search { min-width: 100%; flex: 1 1 100%; max-width: none !important; }

    .modal-content { padding: 1.25rem; max-height: 92vh; border-radius: 12px; }
    .modal-wide { max-width: 100% !important; }
    .modal-close { top: 0.65rem; left: 0.65rem; width: 40px; height: 40px; }

    #actionArea { padding: 1rem !important; }
    #actionArea [style*="display:flex"] { flex-direction: column !important; }
    #actionArea .btn { width: 100%; white-space: normal; justify-content: center; }

    .notif-box { padding: 1rem; flex-direction: column; gap: 0.5rem; }

    .ethics-display { padding: 1.25rem; }
    .ethics-display .eth-number { font-size: 1.5rem; word-break: break-all; }

    .preview-row { flex-direction: column; gap: 0.25rem; }
    .preview-label { min-width: 0; }

    .proposal-mod-standalone { padding: 1.25rem 1rem; margin: 1rem 0; }

    /* لوحة التحكم: بطاقات واضحة للأبحاث على الجوال */
    #requestsTable {
        min-width: 0 !important;
        table-layout: auto;
        border-collapse: separate;
        border-spacing: 0 0.7rem;
    }
    #requestsTable thead { display: none; }
    #requestsTable tbody { display: block; }
    #requestsTable tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.35rem 0.65rem;
        background: #fff;
        border: 1px solid var(--border-light, #e5e7eb);
        border-radius: 12px;
        padding: 0.9rem;
        margin: 0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }
    #requestsTable tr:hover td { background: transparent; }
    #requestsTable td {
        width: auto !important;
        padding: 0.15rem 0;
        border: none;
        white-space: normal;
    }
    #requestsTable td.col-id { grid-column: 1; grid-row: 1; }
    #requestsTable td.col-status { grid-column: 2; grid-row: 1; text-align: left; }
    #requestsTable td.col-researcher { grid-column: 1 / -1; grid-row: 2; }
    #requestsTable td.col-title { grid-column: 1 / -1; grid-row: 3; }
    #requestsTable td.col-date { grid-column: 1 / -1; grid-row: 4; color: var(--text-muted); font-size: 0.8rem; }
    #requestsTable td.col-action { grid-column: 1 / -1; grid-row: 5; padding-top: 0.55rem; }
    #requestsTable .req-title {
        -webkit-line-clamp: 4;
        max-height: 6.2em;
        margin: 0.15rem 0;
    }
    #requestsTable td.col-action .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    /* أداء أفضل على الجوال – إزالة blur الثقيل */
    .loading-overlay,
    .modal-overlay,
    .tracker-input { backdrop-filter: none; }
}

/* ── Responsive: small phones ── */
@media (max-width: 480px) {
    body { font-size: 14px; }

    .btn { padding: 0.75rem 1.2rem; font-size: 0.9rem; }
    .btn-lg { padding: 0.9rem 1.25rem; font-size: 1rem; }

    .dashboard-metrics { grid-template-columns: 1fr 1fr; }
    .metric-number { font-size: 1.85rem; }

    table { font-size: 0.82rem; min-width: 520px; }
    table th, table td { padding: 0.65rem 0.55rem; }
    #requestsTable { min-width: 0 !important; font-size: 0.88rem; }
    #requestsTable td { padding: 0.15rem 0; }

    .badge { font-size: 0.72rem; padding: 0.22rem 0.6rem; white-space: normal; text-align: center; }

    .issue-panel { padding: 1.25rem; }
}

/* ── أجهزة اللمس: إلغاء hover المتحرك ── */
@media (hover: none) {
    .member-card:hover,
    .metric-card:hover,
    .req-summary-card:hover { transform: none; box-shadow: inherit; }
}
