@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url("fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Noto Sans Arabic";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/noto-sans-arabic-arabic-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Noto Sans Arabic";
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url("fonts/noto-sans-arabic-arabic-600-normal.woff2") format("woff2");
}

:root {
    --teal: #1a4a3a;
    --teal-dark: #103024;
    --gold: #c9a84c;
    --gold-light: #e8c96a;
    --ivory: #f7f1e1;
    --ivory-deep: #ede3cb;
    --ink: #2a2a2a;
    --muted: #7a7061;
    --error: #9b2c2c;
    --success: #2f7a4d;
    --border: rgba(26, 74, 58, 0.18);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--ivory);
    color: var(--ink);
    min-height: 100vh;
}

input,
select,
textarea {
    font-size: max(16px, 1em);
}

.auth-gate {
    --night: #0b1a2e;
    --night-soft: rgba(11, 26, 46, 0.72);
    --line: rgba(247, 241, 225, 0.22);
    --line-strong: rgba(247, 241, 225, 0.55);
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--night);
    color: var(--ivory);
    padding:
        max(32px, env(safe-area-inset-top))
        max(24px, env(safe-area-inset-right))
        max(32px, env(safe-area-inset-bottom))
        max(24px, env(safe-area-inset-left));
}

.auth-gate[hidden] {
    display: none;
}

.auth-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(90deg, rgba(8, 19, 35, 0.92) 0%, rgba(8, 19, 35, 0.74) 34%, rgba(8, 19, 35, 0.18) 62%, rgba(8, 19, 35, 0) 100%),
        linear-gradient(0deg, rgba(8, 19, 35, 0.55) 0%, rgba(8, 19, 35, 0) 40%),
        url("images/mosquee-touba-1536.webp");
    background-size: cover;
    background-position: 30% 50%;
    background-repeat: no-repeat;
    animation: auth-backdrop-in 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.auth-shell {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin-block: auto;
    margin-inline-start: clamp(0px, 7vw, 120px);
    display: grid;
    gap: 40px;
    animation: auth-rise 0.9s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.auth-eyebrow {
    margin: 0 0 18px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold-light);
}

.auth-title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 500;
    font-size: clamp(40px, 5.4vw, 60px);
    line-height: 1.02;
    letter-spacing: -0.005em;
    color: #fbf6ea;
    text-wrap: balance;
}

.auth-lead {
    margin: 20px 0 0;
    max-width: 36ch;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(247, 241, 225, 0.76);
}

.auth-form {
    display: grid;
    gap: 22px;
}

.auth-field {
    display: grid;
    gap: 10px;
}

.auth-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(247, 241, 225, 0.64);
}

.auth-field input {
    width: 100%;
    font-family: inherit;
    font-size: 18px;
    letter-spacing: 0.04em;
    color: #fbf6ea;
    caret-color: var(--gold-light);
    background: rgba(11, 26, 46, 0.42);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    min-height: 56px;
    transition: border-color 180ms, background-color 180ms, box-shadow 180ms;
    -webkit-appearance: none;
    appearance: none;
}

.auth-field input::placeholder {
    color: rgba(247, 241, 225, 0.38);
    letter-spacing: 0.01em;
}

.auth-field input:hover {
    border-color: var(--line-strong);
}

.auth-field input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(11, 26, 46, 0.6);
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.18);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #14110a;
    background: linear-gradient(180deg, #e8c96a 0%, #c9a84c 100%);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px -12px rgba(201, 168, 76, 0.7);
    transition: transform 160ms, box-shadow 160ms, filter 160ms;
}

.auth-submit:hover:not(:disabled) {
    background: linear-gradient(180deg, #edd07a 0%, #cfae52 100%);
    box-shadow: 0 14px 34px -12px rgba(201, 168, 76, 0.85);
}

.auth-submit:focus-visible {
    outline: 2px solid #fbf6ea;
    outline-offset: 3px;
}

.auth-submit svg {
    transition: transform 200ms;
}

.auth-submit:hover:not(:disabled) svg {
    transform: translateX(3px);
}

.auth-submit.is-loading {
    opacity: 1;
    cursor: progress;
    filter: saturate(0.7);
}

.auth-submit.is-loading svg {
    animation: auth-pulse 0.9s ease-in-out infinite alternate;
}

.auth-form .feedback.error {
    background: rgba(155, 44, 44, 0.28);
    color: #ffd9d2;
    border: 1px solid rgba(255, 150, 135, 0.35);
    border-radius: 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.auth-note {
    margin: 0;
    max-width: 40ch;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(247, 241, 225, 0.5);
}

@keyframes auth-backdrop-in {
    from { opacity: 0; transform: scale(1.04); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-pulse {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(4px); opacity: 0.4; }
}

@media (max-width: 700px) and (orientation: portrait) {
    .auth-gate {
        padding-top: max(36vh, env(safe-area-inset-top));
    }

    .auth-backdrop {
        background-image:
            linear-gradient(180deg, rgba(8, 19, 35, 0) 0%, rgba(8, 19, 35, 0) 38%, rgba(8, 19, 35, 0.72) 50%, #081323 62%),
            url("images/mosquee-touba-900.webp");
        background-position: 74% 0%;
        background-size: auto 64%;
        background-color: #081323;
    }

    .auth-shell {
        margin: auto auto 0;
        gap: 28px;
    }

    .auth-eyebrow {
        margin-bottom: 12px;
        font-size: 11px;
    }

    .auth-title {
        font-size: clamp(32px, 9vw, 44px);
    }

    .auth-lead {
        margin-top: 12px;
        font-size: 15px;
        line-height: 1.55;
    }

    .auth-form {
        gap: 16px;
    }
}

@media (max-width: 700px) and (orientation: portrait) and (max-height: 700px) {
    .auth-gate {
        padding-top: max(30vh, env(safe-area-inset-top));
    }

    .auth-lead {
        display: none;
    }
}

@media (min-width: 701px) and (max-width: 1100px) and (orientation: portrait) {
    .auth-backdrop {
        background-image:
            linear-gradient(0deg, rgba(8, 19, 35, 0.96) 0%, rgba(8, 19, 35, 0.82) 42%, rgba(8, 19, 35, 0.2) 70%, rgba(8, 19, 35, 0) 100%),
            url("images/mosquee-touba-1536.webp");
        background-position: 70% 50%;
    }

    .auth-shell {
        margin: auto auto 6vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-backdrop,
    .auth-shell,
    .auth-submit.is-loading svg {
        animation: none;
    }
}

.app-content[hidden] {
    display: none;
}

.site-header {
    background: var(--teal);
    color: var(--ivory);
    padding: 24px 32px;
    border-bottom: 3px solid var(--gold);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 960px;
    margin: 0 auto;
}

.seal {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    display: grid;
    place-items: center;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--gold-light);
    letter-spacing: 0.04em;
}

.brand-text h1 {
    font-family: "Cormorant Garamond", serif;
    margin: 0;
    font-size: 26px;
    letter-spacing: 0.05em;
}

.brand-text p {
    margin: 2px 0 0;
    color: var(--gold-light);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.container {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 24px;
    display: grid;
    gap: 24px;
}

.card {
    background: #fffaf0;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px 32px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 24px;
    margin: 0 0 20px;
    color: var(--teal);
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.upload-form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--teal-dark);
    letter-spacing: 0.02em;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="file"] {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--ivory);
    color: var(--ink);
    transition: border-color 150ms, box-shadow 150ms;
}

.field input[type="text"]:focus,
.field input[type="password"]:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 74, 58, 0.12);
}

.field input.arabic {
    font-family: "Noto Sans Arabic", "Inter", sans-serif;
    font-size: 16px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

button {
    font: inherit;
    cursor: pointer;
    background: var(--teal);
    color: var(--ivory);
    border: 1px solid var(--teal-dark);
    padding: 10px 24px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: background 150ms, transform 80ms;
}

button:hover:not(:disabled) {
    background: var(--teal-dark);
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.progress {
    height: 6px;
    background: var(--ivory-deep);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--gold);
    transition: width 120ms linear;
}

.feedback {
    padding: 10px 14px;
    border-radius: 3px;
    font-size: 14px;
}

.feedback.success {
    background: rgba(47, 122, 77, 0.12);
    color: var(--success);
    border: 1px solid rgba(47, 122, 77, 0.35);
}

.feedback.error {
    background: rgba(155, 44, 44, 0.1);
    color: var(--error);
    border: 1px solid rgba(155, 44, 44, 0.35);
}

.pdf-list {
    display: grid;
    gap: 10px;
    max-height: calc(7 * 100px + 6 * 10px);
    overflow-y: auto;
    padding-right: 6px;
}

.pdf-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 10px;
    background: var(--ivory);
    border: 1px solid var(--border);
    border-radius: 3px;
}

.pdf-row img {
    width: 56px;
    height: 78px;
    object-fit: cover;
    border-radius: 2px;
    background: var(--ivory-deep);
}

.pdf-row .name {
    font-weight: 600;
    color: var(--teal-dark);
}

.pdf-row .meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.pdf-row .name.arabic {
    font-family: "Noto Sans Arabic", "Inter", sans-serif;
    direction: rtl;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.metrics-header h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 24px;
    margin: 0;
    color: var(--teal);
    letter-spacing: 0.03em;
    border: 0;
    padding: 0;
}

.metrics-card h2 {
    border: 0;
    padding: 0;
    margin: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.metric {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px; 
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(26, 74, 58, 0.04); 
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 74, 58, 0.08);
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.metric-value {
    font-family: "Cormorant Garamond", serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--teal);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.metric-hint {
    font-size: 12px;
    color: var(--muted);
}

.popularity-section {
    margin-top: 32px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.popularity-section h3 {
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--teal-dark);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popularity-list {
    display: grid;
    gap: 12px;
    max-height: calc(7 * 73px + 6 * 12px);
    overflow-y: auto;
    padding-right: 6px;
}

.popularity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--ivory);
    border: 1px solid var(--border);
    border-radius: 6px;
    gap: 16px;
}

.popularity-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.popularity-item-name-fr {
    font-weight: 600;
    color: var(--teal-dark);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popularity-item-name-ar {
    font-family: "Noto Sans Arabic", "Inter", sans-serif;
    font-size: 13px;
    color: var(--muted);
    direction: rtl;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popularity-item-count {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    color: var(--teal);
    font-size: 16px;
    background: rgba(26, 74, 58, 0.08);
    padding: 6px 14px;
    border-radius: 20px;
}

.popularity-item-count span {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--teal-dark);
}

button.ghost {
    background: transparent;
    color: var(--teal);
    border: 1px solid var(--teal);
    padding: 6px 14px;
    font-size: 13px;
}

button.ghost:hover:not(:disabled) {
    background: rgba(26, 74, 58, 0.08);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.notes-header h2 {
    margin: 0;
    border: 0;
    padding: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: 24px;
    color: var(--teal);
    letter-spacing: 0.03em;
}

.notes-toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    align-items: flex-end;
}

.notes-filter-field {
    flex: 1;
    max-width: 360px;
}

.dropdown {
    position: relative;
    width: 100%;
}

.dropdown-trigger {
    width: 100%;
    background: var(--ivory);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 500;
    text-align: left;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: border-color 150ms, box-shadow 150ms;
}

.dropdown-trigger:hover:not(:disabled) {
    background: var(--ivory);
    border-color: var(--teal);
}

.dropdown.is-open .dropdown-trigger {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 74, 58, 0.12);
}

.dropdown-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-caret {
    color: var(--teal);
    font-size: 12px;
    transition: transform 150ms;
}

.dropdown.is-open .dropdown-caret {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: 2px solid var(--gold);
    border-radius: 3px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 30;
    padding: 4px 0;
}

.dropdown-menu[hidden] {
    display: none;
}

.dropdown-option {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
}

.dropdown-option:hover,
.dropdown-option.is-active {
    background: rgba(26, 74, 58, 0.06);
    border-left-color: var(--gold);
}

.dropdown-option.is-selected {
    color: var(--teal-dark);
    font-weight: 600;
}

.dropdown-option .option-ar {
    font-family: "Noto Sans Arabic", "Inter", sans-serif;
    color: var(--muted);
    font-size: 13px;
    direction: rtl;
    margin-left: 12px;
}

.author-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 20px;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--ivory-deep);
    border-radius: 4px;
}

.author-bar[hidden] {
    display: none;
}

.author-bar-text {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 14px;
}

.author-bar-text strong {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    color: var(--teal-dark);
    letter-spacing: 0.04em;
}

.author-bar-actions {
    display: flex;
    gap: 8px;
}

.author-bar-actions button {
    padding: 6px 14px;
    font-size: 12px;
}

.author-bar button.danger {
    background: var(--error);
    border-color: #6b1f1f;
}

.author-bar button.danger:hover:not(:disabled) {
    background: #6b1f1f;
}

.note-row .author-chip {
    font: inherit;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 1px 8px;
    color: var(--teal-dark);
    background: var(--ivory-deep);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.note-row .author-chip:hover {
    background: rgba(26, 74, 58, 0.14);
}

.note-row .report-count {
    color: var(--error);
    font-weight: 600;
}

.notes-list {
    display: grid;
    gap: 12px;
    max-height: calc(7 * 110px + 6 * 12px);
    overflow-y: auto;
    padding-right: 6px;
}

.note-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px 16px;
    background: var(--ivory);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.note-row .note-main {
    min-width: 0;
}

.note-row .note-title {
    font-weight: 700;
    color: var(--teal-dark);
    margin: 0 0 4px;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.note-row .note-body {
    color: var(--ink);
    font-size: 14px;
    margin: 0 0 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.note-row .note-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.note-row .note-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.note-row .note-actions button {
    padding: 6px 14px;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.note-row button.danger {
    background: var(--error);
    border-color: #6b1f1f;
}

.note-row button.danger:hover:not(:disabled) {
    background: #6b1f1f;
}

.note-row.is-editing {
    background: #fffaf0;
    border-color: var(--gold);
}

.note-row .note-edit {
    display: grid;
    gap: 8px;
}

.note-row .note-edit input,
.note-row .note-edit textarea {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #ffffff;
    color: var(--ink);
    width: 100%;
}

.note-row .note-edit textarea {
    min-height: 90px;
    resize: vertical;
}

.note-row .note-edit-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.note-row .note-edit-row label {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-row .note-edit-row input[type="number"] {
    width: 80px;
}

.note-row.arabic .note-title,
.note-row.arabic .note-body {
    font-family: "Noto Sans Arabic", "Inter", sans-serif;
    direction: rtl;
    text-align: right;
}

@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 36px;
    }

    .metrics-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card {
        padding: 20px 18px;
    }

    .card h2 {
        font-size: 20px;
        margin: 0 0 16px;
    }

    .popularity-section {
        margin-top: 24px;
        padding-top: 18px;
    }

    .popularity-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .popularity-item-count {
        padding: 4px 10px;
        font-size: 14px;
    }

    .popularity-list {
        max-height: calc(7 * 70px + 6 * 12px);
    }

    .pdf-row {
        grid-template-columns: 44px 1fr auto;
        gap: 10px;
        padding: 8px;
    }

    .pdf-row img {
        width: 44px;
        height: 62px;
    }

    .pdf-list {
        max-height: calc(7 * 80px + 6 * 10px);
    }
}
