/* Cairo — Arabic UI font (self-hosted). */
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400; font-display: swap; src: url('/lib/cairo/cairo-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 600; font-display: swap; src: url('/lib/cairo/cairo-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 700; font-display: swap; src: url('/lib/cairo/cairo-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400; font-display: swap; src: url('/lib/cairo/cairo-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 600; font-display: swap; src: url('/lib/cairo/cairo-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 700; font-display: swap; src: url('/lib/cairo/cairo-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }

/* Use Cairo for the Arabic (RTL) UI. */
[dir="rtl"] body, [dir="rtl"] .btn, [dir="rtl"] .form-control, [dir="rtl"] .form-select, [dir="rtl"] .nav-link, [dir="rtl"] .card-header { font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; }

/* NAUSS official brand theme — teal-green #2e6066 + gold #c6aa76. */
:root {
    --nauss-green: #2e6066;
    --nauss-green-dark: #234b50;
    --nauss-green-light: #3d7d84;
    --nauss-gold: #c6aa76;
    --nauss-gold-dark: #b0925a;
    --nauss-bg: #f4f6f6;
    --nauss-ink: #1e2b2d;
}

body {
    background: var(--nauss-bg);
    color: var(--nauss-ink);
    min-height: 100%;
}

.nauss-navbar {
    background: linear-gradient(90deg, var(--nauss-green-dark), var(--nauss-green));
    border-bottom: 3px solid var(--nauss-gold);
}

.nauss-navbar .navbar-brand { display: inline-flex; align-items: center; }
.nauss-navbar .navbar-brand img { height: 44px; width: auto; }

.nauss-navbar .nav-link { color: #eef3ef !important; font-weight: 500; }
.nauss-navbar { padding-top: .35rem; padding-bottom: .35rem; }
.nauss-navbar .nav-link { border-radius: .45rem; padding: .4rem .7rem; margin: 0 .05rem; transition: background .12s, color .12s; }
.nauss-navbar .nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff !important; }
.nauss-navbar .nav-link.active { background: rgba(198, 170, 118, .22); color: var(--nauss-gold) !important; font-weight: 700; }
.nauss-avatar { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; background: var(--nauss-gold); color: var(--nauss-green-dark); display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
.nauss-navbar .dropdown-menu { min-width: 12rem; }

a { color: var(--nauss-green); }
a:hover { color: var(--nauss-green-dark); }

.card {
    border: none;
    border-radius: .7rem;
    box-shadow: 0 2px 14px rgba(8, 63, 40, .06);
    margin-bottom: 1.1rem;
}

.card-header {
    background: linear-gradient(90deg, #f2f8f6, #ffffff);
    border-bottom: 1px solid #e6ece9;
    border-inline-start: 4px solid var(--nauss-gold);
    border-top-left-radius: .7rem;
    border-top-right-radius: .7rem;
    font-weight: 700;
    color: var(--nauss-green-dark);
    padding: .7rem 1rem;
}
.card-header .bi { color: var(--nauss-gold); margin-inline-end: .35rem; }

.form-label { font-weight: 600; color: var(--nauss-green-dark); font-size: .82rem; margin-bottom: .2rem; }
.form-control:focus, .form-select:focus, .ts-control.focus {
    border-color: var(--nauss-green-light);
    box-shadow: 0 0 0 .2rem rgba(46, 96, 102, .15);
}

/* Modern login fields (icon inside the input, RTL-aware) */
.nauss-input { position: relative; }
.nauss-input > .bi { position: absolute; top: 50%; inset-inline-start: .85rem; transform: translateY(-50%); color: var(--nauss-gold-dark); pointer-events: none; }
.nauss-input .form-control { padding-inline-start: 2.5rem; height: 48px; border-radius: .55rem; }

/* Tom Select (searchable dropdown) tweaks */
.ts-dropdown .active { background: var(--nauss-green); color: #fff; }
.ts-dropdown, .ts-control { border-radius: .375rem; }
[dir="rtl"] .ts-control, [dir="rtl"] .ts-dropdown { text-align: right; }

.btn-nauss {
    background: var(--nauss-green);
    color: #fff;
    border: 1px solid var(--nauss-green);
}
.btn-nauss:hover { background: var(--nauss-green-dark); color: #fff; }

.btn-outline-nauss { color: var(--nauss-green); border: 1px solid var(--nauss-green); }
.btn-outline-nauss:hover { background: var(--nauss-green); color: #fff; }

.btn-outline-primary { color: var(--nauss-green); border-color: var(--nauss-green); }
.btn-outline-primary:hover { background: var(--nauss-green); border-color: var(--nauss-green); color: #fff; }

.nav-pills .nav-link.active { background: var(--nauss-green); }
.nav-pills .nav-link { color: var(--nauss-green-dark); }

.badge.bg-secondary { background: var(--nauss-green) !important; }

.stat-tile { border-radius: .8rem; padding: 1.25rem 1.35rem; color: #fff; position: relative; overflow: hidden; box-shadow: 0 3px 14px rgba(8, 63, 40, .12); }
.stat-tile .stat-value { font-size: 2.1rem; font-weight: 800; line-height: 1; }
.stat-tile .stat-label { font-size: .9rem; opacity: .95; margin-top: .25rem; }
.stat-tile .stat-icon { font-size: 2.7rem; opacity: .3; }
.stat-navy { background: linear-gradient(135deg, var(--nauss-green-dark), #2e6066); }
.stat-teal { background: linear-gradient(135deg, var(--nauss-green-light), #2e6066); }
.stat-gold { background: linear-gradient(135deg, var(--nauss-gold), #d8bf90); color: var(--nauss-green-dark) !important; }
.stat-light { background: #fff; color: var(--nauss-green-dark); border: 1px solid #e2e8e7; }
.stat-light .stat-icon { color: var(--nauss-gold); opacity: .55; }
.stat-tile .stat-sub { font-size: .85rem; font-weight: 600; opacity: .8; }
a.stat-tile { transition: transform .12s, box-shadow .12s; }
a.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(8, 63, 40, .2); }

/* Quick-action cards (dashboard) */
.quick-action { display: block; text-decoration: none; border-radius: .7rem; padding: 1.1rem; background: #fff; box-shadow: 0 2px 10px rgba(8, 63, 40, .06); color: var(--nauss-green-dark); transition: transform .12s, box-shadow .12s; height: 100%; }
.quick-action:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(8, 63, 40, .12); color: var(--nauss-green-dark); }
.quick-action .qa-icon { font-size: 1.9rem; color: var(--nauss-gold); }
.quick-action .qa-title { font-weight: 700; }

/* Table polish */
.table > :not(caption) > * > * { padding: .6rem .8rem; vertical-align: middle; }
.table thead th { color: var(--nauss-green-dark); font-weight: 700; background: #f2f8f6; border-bottom: 2px solid var(--nauss-gold); }

/* Brand pagination: separated pill items (also sidesteps Bootstrap's LTR-only corner rounding in RTL). */
.pagination { gap: .3rem; }
.pagination .page-link {
    border: 1px solid #d3e0de;
    border-radius: .45rem !important;
    color: var(--nauss-green);
    font-weight: 600;
    min-width: 2.2em;
    text-align: center;
    transition: background .12s, color .12s, border-color .12s;
}
.pagination .page-link:hover { background: #e8efee; border-color: var(--nauss-green); color: var(--nauss-green-dark); }
.pagination .page-link:focus { box-shadow: 0 0 0 .2rem rgba(46, 96, 102, .15); }
.pagination .page-item.active .page-link {
    background: var(--nauss-green);
    border-color: var(--nauss-green);
    color: #fff;
    box-shadow: 0 1px 3px rgba(35, 75, 80, .35);
}
.pagination .page-item.disabled .page-link { color: #b6bfbd; background: #fbfcfc; border-color: #e6ecea; }

.report-more { color: var(--nauss-green); font-weight: 600; }
.report-more.collapsed .when-expanded { display: none; }
.report-more:not(.collapsed) .when-collapsed { display: none; }
.report-track { background: #eef3f2; height: .6rem; border-radius: .3rem; overflow: hidden; }
.report-track .report-bar { height: 100%; }
.report-bar { background: var(--nauss-green-light); height: 1.1rem; border-radius: .3rem; }

/* Dashboard mini column chart: registrations per month, single brand hue. */
.mini-chart { display: flex; align-items: flex-end; gap: 6px; }
.mini-col-wrap {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 0;
    cursor: default;
}
.mini-col-area { height: 150px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.mini-col {
    width: 70%;
    max-width: 34px;
    background: var(--nauss-green-light);
    border-radius: 4px 4px 0 0;
    transition: background .12s;
}
.mini-col-wrap:hover .mini-col { background: var(--nauss-green-dark); }
.mini-col-wrap:hover::after {
    content: attr(data-count);
    position: absolute;
    top: -2px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    background: var(--nauss-green-dark);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: .05rem .45rem;
    border-radius: .5rem;
    white-space: nowrap;
}
[dir="rtl"] .mini-col-wrap:hover::after { transform: translateX(50%); }
.mini-col-label { font-size: .68rem; color: #8a8f93; margin-top: .3rem; white-space: nowrap; }

.section-title {
    color: var(--nauss-green-dark);
    border-inline-start: 4px solid var(--nauss-gold);
    padding-inline-start: .6rem;
    margin: 1.25rem 0 .75rem;
}

.login-brand { background: linear-gradient(90deg, var(--nauss-green-dark), var(--nauss-green)); padding: 1.5rem; text-align: center; }
.login-brand img { height: 56px; width: auto; }
.login-lock { width: 56px; height: 56px; border-radius: 50%; background: var(--nauss-gold); color: var(--nauss-green-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: .5rem; box-shadow: 0 2px 6px rgba(8,63,40,.15); }

footer .footer-logo { height: 40px; width: auto; opacity: .9; }

[dir="rtl"] .text-md-start { text-align: right; }

/* Print-friendly layout (hide chrome, keep content). */
@media print {
    header, footer, .no-print, .navbar { display: none !important; }
    .report-collapse { display: block !important; }
    body { background: #fff !important; }
    main.container { max-width: 100% !important; margin: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; break-inside: avoid; }
    .card-header { background: #fff !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .nauss-badge, .nauss-badge-gold { border: 1px solid #999; }
}

/* Required-field asterisk */
.req { color: #dc3545; font-weight: 700; margin-inline-start: .15rem; }

/* RTL: place the checkbox/radio BEFORE the text (on the leading, right-hand edge). */
[dir="rtl"] .form-check { padding-left: 0; padding-right: 1.6em; }
[dir="rtl"] .form-check .form-check-input { float: right; margin-left: 0; margin-right: -1.6em; }

/* NAUSS-colored checkboxes/radios, a touch larger for usability. */
.form-check-input { width: 1.15em; height: 1.15em; cursor: pointer; }
.form-check-label { cursor: pointer; }
.form-check-input:checked { background-color: var(--nauss-green); border-color: var(--nauss-green); }
.form-check-input:focus { border-color: var(--nauss-green-light); box-shadow: 0 0 0 .2rem rgba(46, 96, 102, .15); }

/* Cooperation-area items as selectable highlighted rows. */
.coop-item {
    border: 1px solid #e6ece9;
    border-radius: .45rem;
    padding: .55rem .85rem;
    margin-bottom: .5rem;
    transition: background .12s, border-color .12s;
}
.coop-item:hover { background: #f5faf8; }
.coop-item:has(.form-check-input:checked) { border-color: var(--nauss-green); background: #eef5f2; }
.coop-item .form-check { margin: 0; }

/* Yes/no questions as toggle switches inside the same highlightable tiles. */
.switch-tile { margin-bottom: 0; height: 100%; }
.form-switch .form-check-input { width: 2.1em; height: 1.15em; }
[dir="rtl"] .form-switch { padding-left: 0; padding-right: 2.7em; }
[dir="rtl"] .form-switch .form-check-input { float: right; margin-left: 0; margin-right: -2.7em; }

/* Profile badges + empty states (match the original profile layout) */
.nauss-badge { background: var(--nauss-green); color: #fff; border-radius: 1rem; padding: .25rem .75rem; font-size: .8rem; display: inline-block; margin: .1rem; }
.nauss-badge-gold { background: var(--nauss-gold); color: var(--nauss-green-dark); }
.empty-box { background: #e9f3ee; color: #6c8a7b; border-radius: .3rem; padding: .45rem .85rem; margin-bottom: .45rem; font-size: .85rem; }
.profile-label { color: #6c757d; font-size: .8rem; margin-bottom: .15rem; }
.profile-contact { color: var(--nauss-green-dark); }
.profile-contact .bi { color: var(--nauss-gold); margin-inline-end: .3rem; }
.pub-item { padding: .5rem 0; border-bottom: 1px solid #eee; }
.pub-item .bi { color: var(--nauss-green); }

/* Researchers directory list (match the original list layout) */
/* Researchers admin list: filter card + results table */
.filter-card { border: 1px solid #e2e8e7; box-shadow: 0 2px 8px rgba(30, 43, 45, .04); }
.count-badge { background: var(--nauss-gold); color: #3b3220; font-weight: 700; }
.r-name { font-weight: 700; color: var(--nauss-green-dark); text-decoration: none; }
.r-name:hover { color: var(--nauss-green); text-decoration: underline; }
.r-spec { color: #6c757d; font-size: .82rem; }
.r-contact { font-size: .8rem; color: #6c757d; }
.r-contact .bi { color: var(--nauss-gold-dark); }
[dir="rtl"] .r-contact { text-align: right; }
.res-table thead th {
    background: #f4f7f6;
    color: var(--nauss-green-dark);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    border-bottom: 2px solid #dfe8e6;
}
.res-table tbody tr:hover { background: #f5faf8; }
.res-table td { padding-top: .65rem; padding-bottom: .65rem; }
.lookup-filter { max-width: 240px; }
.parent-badge { background: #eef5f2; color: var(--nauss-green-dark); font-weight: 600; }
.avatar-badge {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nauss-green), var(--nauss-green-light));
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Icon spacing in RTL/LTR */
.nav-link .bi, .btn .bi { vertical-align: -.08em; }

/* Localize (mirror) directional icons for the Arabic RTL layout. Non-directional icons
   (search, download, translate, calendar, ...) are intentionally left unflipped. */
[dir="rtl"] .bi-arrow-left::before,
[dir="rtl"] .bi-arrow-right::before,
[dir="rtl"] .bi-arrow-left-right::before,
[dir="rtl"] .bi-arrow-return-left::before,
[dir="rtl"] .bi-arrow-return-right::before,
[dir="rtl"] .bi-arrow-bar-left::before,
[dir="rtl"] .bi-arrow-bar-right::before,
[dir="rtl"] .bi-box-arrow-in-right::before,
[dir="rtl"] .bi-box-arrow-right::before,
[dir="rtl"] .bi-box-arrow-in-left::before,
[dir="rtl"] .bi-box-arrow-left::before,
[dir="rtl"] .bi-chevron-left::before,
[dir="rtl"] .bi-chevron-right::before,
[dir="rtl"] .bi-chevron-double-left::before,
[dir="rtl"] .bi-chevron-double-right::before,
[dir="rtl"] .bi-caret-left-fill::before,
[dir="rtl"] .bi-caret-right-fill::before,
[dir="rtl"] .bi-reply::before,
[dir="rtl"] .bi-send::before {
    display: inline-block;
    transform: scaleX(-1);
}

/* Hijri / Gregorian calendar toggle — segmented pill next to the field label */
.cal-toggle {
    display: inline-flex;
    padding: 2px;
    background: #e8efee;
    border: 1px solid #d3e0de;
    border-radius: 2rem;
}
.cal-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin: 0;
    padding: .05rem .6rem;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--nauss-green);
    border-radius: 2rem;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease, color .15s ease;
}
.cal-btn:hover { background: #d9e6e4; }
.cal-toggle .btn-check:checked + .cal-btn {
    background: var(--nauss-green);
    color: #fff;
    box-shadow: 0 1px 3px rgba(35, 75, 80, .35);
}
.cal-toggle .btn-check:focus-visible + .cal-btn { outline: 2px solid var(--nauss-green-light); outline-offset: 1px; }
.cal-hijri .hijri-m { flex: 1 1 42%; }
.cal-hijri .hijri-d, .cal-hijri .hijri-y { flex: 1 1 29%; }
.cal-equiv { color: var(--nauss-gold-dark); font-weight: 600; }
.cal-equiv:empty { display: none; }

/* Drag-and-drop upload zone. The native file input stretches invisibly over the whole
   zone so click / drop / required-validation stay native; the preview sits above it. */
.dropzone {
    position: relative;
    border: 2px dashed var(--nauss-gold);
    border-radius: .6rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: #fbfaf6;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.dropzone.dz-hover, .dropzone:hover { background: #f2ede0; border-color: var(--nauss-gold-dark); }
.dropzone.dz-hover { border-style: solid; border-color: var(--nauss-green); box-shadow: 0 0 0 4px rgba(46, 96, 102, .12); }
.dropzone:focus-within { border-color: var(--nauss-green); box-shadow: 0 0 0 3px rgba(46, 96, 102, .18); }
.dz-icon { display: block; font-size: 2.1rem; line-height: 1; color: var(--nauss-gold-dark); margin-bottom: .35rem; transition: transform .15s; }
.dropzone.dz-hover .dz-icon { transform: translateY(-3px); color: var(--nauss-green); }
.dropzone .dz-prompt { color: var(--nauss-green-dark); font-weight: 500; }
.dz-browse { color: var(--nauss-green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.dz-hint { font-size: .8rem; color: #8a8f93; letter-spacing: .06em; margin-top: .15rem; }
.dropzone .dz-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dz-preview { position: relative; z-index: 1; }
.dz-preview:not(:empty) { cursor: default; }
.dz-file { display: flex; justify-content: space-between; gap: 1rem; background: #fff; border: 1px solid #e3e0d5; border-radius: .4rem; padding: .4rem .7rem; margin-top: .8rem; }
.dz-file .dz-name { font-weight: 600; color: var(--nauss-green-dark); }
.dz-file .dz-size { color: #6c757d; }
.dz-pdf { width: 100%; height: 320px; border: 1px solid #e3e0d5; border-radius: .4rem; margin-top: .6rem; }

/* Sticky section navigator on the registration form */
.reg-nav {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    border: 1px solid #e2e8e7;
    border-radius: .6rem;
    box-shadow: 0 2px 10px rgba(30, 43, 45, .06);
    padding: .5rem .75rem;
}
.reg-nav-label { color: #8a8f93; font-weight: 600; align-self: center; }
.reg-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .7rem;
    border: 1px solid #d3e0de;
    border-radius: 2rem;
    background: #fff;
    color: var(--nauss-green);
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.reg-pill:hover { background: #e8efee; border-color: var(--nauss-green); color: var(--nauss-green-dark); }
.reg-pill.active { background: var(--nauss-green); border-color: var(--nauss-green); color: #fff; }
html { scroll-behavior: smooth; }

/* Anchored form sections clear the sticky section-nav when jumped to. */
[id^="sec-"] { scroll-margin-top: 4rem; }
