.qimah-portal { color: #14364b; max-width: 1200px; margin: 0 auto; padding: 16px; }
.qimah-portal * { box-sizing: border-box; letter-spacing: 0; }
.qimah-portal .qp-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-block: 12px 24px; }
.qimah-portal .qp-actions .btn { white-space: normal; }
.qimah-portal .qp-search { display: flex; align-items: center; gap: 12px; max-width: 600px; margin-bottom: 24px; }
.qimah-portal .qp-search input { min-width: 0; flex: 1; }
.qimah-portal .qp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.qimah-portal .qp-item { padding: 20px; border: 1px solid #d9e1e6; border-radius: 8px; background: #fff; min-width: 0; }
.qimah-portal h2, .qimah-portal h3 { font-size: 20px; line-height: 1.6; margin: 8px 0 12px; }
.qimah-portal p, .qimah-portal h2, .qimah-portal h3, .qimah-portal a { overflow-wrap: anywhere; }
.qimah-portal .qp-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.qimah-portal .qp-status { display: inline-block; background: #edf0f3; color: #394b58; padding: 4px 10px; font-size: 14px; border-radius: 4px; }
.qimah-portal .qp-status-success { background: #e7f3ed; color: #176247; }
.qimah-portal .qp-status-pending { background: #fff4d6; color: #765200; }
.qimah-portal .qp-status-danger { background: #fcebed; color: #a02335; }
.qimah-portal time { display: inline-block; font-variant-numeric: tabular-nums; }
.qimah-portal .qp-profile { display: flex; gap: 24px; align-items: flex-start; padding-block: 12px 28px; }
.qimah-portal .qp-profile > div { min-width: 0; }
.qimah-portal .qp-summary { border-block: 1px solid #d9e1e6; padding-block: 16px; margin-bottom: 24px; }
.qimah-portal .qp-empty { padding-block: 32px; color: #526574; }
.qimah-portal .qp-form { max-width: 760px; }
.qimah-portal .qp-field { margin-block: 0 20px; }
.qimah-portal .qp-field label { display: block; margin-bottom: 8px; font-weight: 600; }
.qimah-portal .qp-field .form-control { width: 100%; min-width: 0; height: auto; min-height: 42px; }
.qimah-portal .qp-field textarea { min-height: 112px; }
.qimah-portal .qp-field input[type="file"] { white-space: normal; overflow: hidden; }
@media (max-width: 600px) {
    .qimah-portal { padding: 8px; }
    .qimah-portal .qp-profile { flex-direction: column; }
    .qimah-portal .qp-actions { gap: 8px; }
}
.qimah-portal .qp-center-nav{display:flex;flex-wrap:wrap;gap:10px 18px;margin:12px 0 24px;padding:14px 0;border-block:1px solid #d9e3eb}
.qimah-portal .qp-center-nav a{padding:6px 0;overflow-wrap:anywhere}
.qimah-portal .qp-center-nav [aria-current=page]{font-weight:700;border-bottom:2px solid currentColor}
.qimah-portal .qp-referrals a{direction:ltr;display:inline-block;max-width:100%;overflow-wrap:anywhere}
.qimah-portal .qp-filters{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin-bottom:24px}
.qimah-portal .qp-filters .qp-field{flex:1 1 160px;margin-bottom:0;min-width:0}
.qimah-portal .qp-filters button{min-height:42px;margin-bottom:0}
.qp-directory { --qp-accent:#087f79; --qp-ink:#20343c; color:var(--qp-ink); }
.qimah-portal .qp-directory-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid #dce3e5; margin-bottom:24px; }
.qimah-portal .qp-tabs { display:flex; gap:24px; align-self:stretch; }
.qimah-portal .qp-tab { display:flex; align-items:center; padding:14px 0; border-bottom:3px solid transparent; color:#4d6068; font-weight:600; }
.qimah-portal .qp-tab[aria-current="page"] { color:#076963; border-color:var(--qp-accent); }
.qimah-portal .qp-create { margin-bottom:10px; }
.qimah-portal .qp-directory .btn-primary { background:#087f79; border-color:#087f79; color:#fff; box-shadow:none; border-radius:6px; }
.qimah-portal .qp-directory .btn-primary:hover { background:#06645f; border-color:#06645f; }
.qimah-portal .qp-directory .btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:8px; white-space:normal; }
.qimah-portal .qp-directory-filters { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding-bottom:22px; border-bottom:1px solid #dce3e5; }
.qimah-portal .qp-filter { flex:1 1 155px; min-width:0; }
.qimah-portal .qp-filter-query { flex:2 1 240px; }
.qimah-portal .qp-filter label { display:block; margin-bottom:8px; font-size:14px; font-weight:600; }
.qimah-portal .qp-filter .form-control { width:100%; height:46px; min-width:0; border:1px solid #a9bbc1; border-radius:6px; background-color:#fff; color:#20343c; text-overflow:ellipsis; }
.qimah-portal .qp-filter select.form-control { appearance:auto; background-image:none; }
.qimah-portal .qp-directory :is(a,button,input,select):focus-visible { outline:3px solid #c48112; outline-offset:3px; }
.qimah-portal .qp-results-bar { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:18px 0; font-size:14px; color:#52656c; }
.qimah-portal .qp-results-bar p { margin:0; }
.qimah-portal .qp-results-bar strong { font-size:20px; color:#20343c; margin-inline-end:5px; font-variant-numeric:tabular-nums; }
.qimah-portal .qp-reset { color:#076963; text-decoration:underline; }
.qimah-portal .qp-directory-grid { gap:20px; }
.qimah-portal .qimah-request-card__link { height:100%; text-decoration:none; }
.qimah-portal .qimah-request-card__meta span { min-width:0; overflow-wrap:anywhere; }
.qimah-portal .qp-directory-item { display:flex; flex-direction:column; padding:22px; border-color:#d3dfe1; transition:border-color .15s; }
.qimah-portal .qp-directory-item:hover { border-color:#76a9a4; }
.qimah-portal .qp-directory-item h2 { font-size:19px; margin:12px 0; line-height:1.6; }
.qimah-portal .qp-directory-item h2 a { color:#20343c; }
.qimah-portal .qp-request-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.qimah-portal .qp-reference { font-size:13px; color:#63767d; font-variant-numeric:tabular-nums; }
.qimah-portal .qp-university { display:flex; align-items:baseline; gap:8px; color:#49646d; font-size:14px; line-height:1.7; margin:0 0 12px; }
.qimah-portal .qp-university i { color:#087f79; flex-shrink:0; }
.qimah-portal .qp-description { color:#5c6a71; line-height:1.9; font-size:14px; margin-bottom:18px; }
.qimah-portal .qp-request-meta { display:flex; flex-wrap:wrap; gap:12px 22px; margin:0 0 18px; font-size:13px; }
.qimah-portal .qp-request-meta dt { font-weight:400; color:#5c6a71; }
.qimah-portal .qp-request-meta dd { margin:4px 0 0; color:#253e44; font-weight:600; }
.qimah-portal .qp-card-footer { margin-top:auto; border-top:1px solid #e7edef; padding-top:16px; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.qimah-portal .qp-date { font-size:12px; color:#63767d; }
.qimah-portal .qp-card-link { color:#076963; font-size:14px; font-weight:600; display:inline-flex; align-items:center; gap:8px; min-height:36px; }
/* Teacher cards share the homepage's surfaces, accent line and elevation. */
.qimah-portal .qp-teacher-card {
    position:relative;
    padding:24px;
    border:1px solid var(--qimah-border, #d8e0e8);
    border-radius:1.15rem;
    background:var(--qimah-surface, #fff);
    box-shadow:var(--qimah-home-shadow-sm, 0 .55rem 1.75rem rgba(0,44,87,.06));
    transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.qimah-portal .qp-teacher-card::before {
    position:absolute;
    inset-block-start:-1px;
    inset-inline:18px;
    height:3px;
    border-radius:0 0 4px 4px;
    background:linear-gradient(90deg, var(--qimah-primary, #0159ae), var(--qimah-secondary, #25a18e));
    content:"";
}
.qimah-portal .qp-teacher-card:focus-within {
    border-color:#99c7ef;
    box-shadow:var(--qimah-home-shadow-md, 0 1rem 2.6rem rgba(0,44,87,.11));
}
.qimah-portal .qp-teacher-head { display:flex; align-items:center; gap:16px; min-width:0; min-height:96px; }
.qimah-portal .qp-teacher-head > div { min-width:0; flex:1; }
.qimah-portal .qp-teacher-head h2 { margin:0 0 8px; font-size:18px; font-weight:800; line-height:1.6; }
.qimah-portal .qp-teacher-head h2 a { color:var(--qimah-text, #17202a); text-decoration:none; }
.qimah-portal .qp-teacher-head h2 a:hover { color:var(--qimah-primary, #0159ae); }
.qimah-portal .qp-teacher-head .qp-avatar {
    width:96px;
    height:96px;
    aspect-ratio:1;
    flex-shrink:0;
    border-radius:1rem;
    border:1px solid var(--qimah-border, #d8e0e8);
    background:var(--qimah-surface-subtle, #f7f9fc);
}
.qimah-portal .qp-teacher-card .qp-degree {
    display:inline-flex;
    align-items:baseline;
    gap:6px;
    max-width:100%;
    margin:0;
    padding:3px 8px;
    border-radius:6px;
    color:#835214;
    background:#fff6e9;
    font-size:12px;
    font-weight:600;
    line-height:1.7;
}
.qimah-portal .qp-teacher-card .qp-degree bdi { min-width:0; overflow-wrap:anywhere; }
.qimah-portal .qp-teacher-card .qp-description {
    margin:18px 0;
    min-height:3.6em;
    color:var(--qimah-text-muted, #4a5968);
    font-size:14px;
    line-height:1.8;
}
.qimah-portal .qp-teacher-details { display:grid; gap:16px; margin:0 0 20px; min-width:0; }
.qimah-portal .qp-teacher-details > div { min-width:0; }
.qimah-portal .qp-teacher-details dt {
    display:flex;
    align-items:center;
    gap:7px;
    margin:0 0 5px;
    color:var(--qimah-text-muted, #4a5968);
    font-size:12px;
    font-weight:600;
    line-height:1.7;
}
.qimah-portal .qp-teacher-details dt i { color:#166458; font-size:16px; }
.qimah-portal .qp-teacher-details dd {
    margin:0;
    color:var(--qimah-text, #17202a);
    font-size:14px;
    line-height:1.8;
    overflow-wrap:anywhere;
}
.qimah-portal .qp-teacher-details .qp-specialism { font-weight:600; min-height:3.6em; }
.qimah-portal .qp-teacher-card :is(.qp-description, .qp-specialism, .qp-teacher-university dd) {
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
}
.qimah-portal .qp-teacher-card .qp-card-footer { border-color:var(--qimah-surface-muted, #eef2f6); padding-top:16px; }
.qimah-portal .qp-teacher-card .qp-card-link {
    justify-content:space-between;
    gap:12px;
    width:100%;
    min-height:46px;
    padding:10px 14px;
    border:1px solid #c9e0f5;
    border-radius:8px;
    color:var(--qimah-primary, #0159ae);
    background:#e6f1fb;
    font-size:14px;
    font-weight:800;
    line-height:1.6;
    text-decoration:none;
    transition:color .18s ease, background-color .18s ease, border-color .18s ease;
}
.qimah-portal .qp-teacher-card .qp-card-link i { flex-shrink:0; font-size:18px; }
.qimah-portal .qp-teacher-card .qp-card-link:hover,
.qimah-portal .qp-teacher-card .qp-card-link:focus-visible {
    color:#fff;
    background:var(--qimah-primary, #0159ae);
    border-color:var(--qimah-primary, #0159ae);
}
@media (hover:hover) {
    .qimah-portal .qp-teacher-card:hover {
        border-color:#99c7ef;
        box-shadow:var(--qimah-home-shadow-md, 0 1rem 2.6rem rgba(0,44,87,.11));
        transform:translateY(-4px);
    }
}
@media (prefers-reduced-motion:reduce) {
    .qimah-portal .qp-teacher-card,
    .qimah-portal .qp-teacher-card .qp-card-link { transition:none; }
    .qimah-portal .qp-teacher-card:hover { transform:none; }
}
@media (forced-colors:active) {
    .qimah-portal .qp-teacher-card,
    .qimah-portal .qp-teacher-card .qp-card-link { border-color:CanvasText; box-shadow:none; }
}
.qimah-portal .qp-no-results { text-align:center; padding:48px 16px; border-block:1px solid #dce3e5; }
.qimah-portal .qp-pagination { display:flex; align-items:center; justify-content:center; gap:20px; margin:28px 0 12px; }
@media (max-width:600px) {
    .qimah-portal .qp-directory-bar { gap:12px; }
    .qimah-portal .qp-tabs { gap:20px; width:100%; }
    .qimah-portal .qp-directory-filters .qp-filter { flex-basis:calc(50% - 6px); }
    .qimah-portal .qp-directory-filters .qp-filter-query { flex-basis:100%; }
    .qimah-portal .qp-directory-filters > button { flex:1 1 100%; }
    .qimah-portal .qp-directory-item { padding:18px; }
    .qimah-portal .qp-teacher-head { gap:12px; min-height:80px; }
    .qimah-portal .qp-teacher-head .qp-avatar { width:80px; height:80px; }
    .qimah-portal .qp-pagination { gap:12px; }
}
