:root {
    --green-950: #073b2a;
    --green-900: #0b4d37;
    --green-800: #116347;
    --green-700: #158052;
    --green-100: #e7f5ed;
    --gold-600: #b98520;
    --gold-500: #d7a43b;
    --gold-100: #fff4d7;
    --ink: #17322a;
    --muted: #6b7b75;
    --line: #e2ebe6;
    --surface: #ffffff;
    --soft: #f6faf7;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --success: #087443;
    --success-soft: #e9f8ef;
    --shadow: 0 18px 50px rgba(8, 52, 35, 0.11);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--soft);
    color: var(--ink);
    font-family: "Cairo", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
iframe {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(226, 235, 230, 0.9);
    backdrop-filter: blur(14px);
}

.nav-wrap,
.footer-grid,
.hero-grid,
.contact-grid,
.admin-page-head,
.panel-head,
.reader-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand,
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid rgba(215, 164, 59, 0.42);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, var(--gold-100), var(--green-100));
    color: var(--green-900);
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.brand strong,
.admin-brand strong {
    display: block;
    color: var(--green-950);
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: 1.05rem;
}

.brand small,
.admin-brand small {
    display: block;
    max-width: 230px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-nav,
.admin-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.main-nav a,
.admin-nav a {
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--green-950);
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.admin-nav a:hover,
.admin-nav a.active {
    background: var(--green-100);
    color: var(--green-800);
}

.main-nav .nav-admin,
.admin-nav .logout-link {
    background: var(--green-950);
    color: #fff;
}

.main-nav .nav-admin:hover,
.admin-nav .logout-link:hover {
    background: var(--green-800);
    color: #fff;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--green-950);
    border-radius: 4px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 82px;
    background:
        linear-gradient(135deg, rgba(5, 39, 29, 0.98), rgba(10, 77, 54, 0.94)),
        radial-gradient(circle at 16% 20%, rgba(215, 164, 59, 0.42), transparent 30%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.08) 75%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.08) 75%);
    background-position: 0 0, 0 0, 0 0, 18px 18px;
    background-size: auto, auto, 36px 36px, 36px 36px;
    color: #fff;
}

.hero::before {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 18%, rgba(215, 164, 59, 0.2), transparent 24%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 72px);
    content: "";
    pointer-events: none;
}

.hero::after {
    position: absolute;
    inset-inline-start: 4%;
    bottom: -120px;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    content: "";
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.hero-copy h1,
.page-hero h1 {
    margin: 10px 0 14px;
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.6rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.hero-copy p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.15rem;
}

.hero-subline {
    margin-top: 12px !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 1.02rem !important;
}

.hero-dua {
    display: inline-flex;
    margin-bottom: 14px;
    border: 1px solid rgba(215, 164, 59, 0.45);
    border-radius: 999px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold-100);
    font-family: "Noto Naskh Arabic", "Cairo", serif;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-500);
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
}

.eyebrow::before {
    display: inline-block;
    width: 24px;
    height: 2px;
    background: currentColor;
    content: "";
}

.hero-actions,
.book-actions,
.reader-actions,
.form-actions,
.message-actions,
.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions {
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.2;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(8, 52, 35, 0.13);
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-800), var(--green-700));
    color: #fff;
}

.btn-light {
    border-color: var(--line);
    background: #fff;
    color: var(--green-950);
}

.btn-outline {
    border-color: rgba(21, 128, 82, 0.28);
    background: #fff;
    color: var(--green-800);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 0.9rem;
}

.full-btn {
    width: 100%;
}

.text-link {
    color: var(--green-800);
    font-weight: 800;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--radius);
    padding: 28px;
    background: rgba(255, 255, 255, 0.11);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.16);
}

.hero-panel::before {
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(215, 164, 59, 0.28);
    border-bottom: 0;
    border-radius: 120px 120px var(--radius) var(--radius);
    content: "";
    pointer-events: none;
}

.hero-ornament {
    min-height: 230px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    color: var(--gold-100);
    font-family: "Noto Naskh Arabic", "Cairo", serif;
    font-size: clamp(2.2rem, 6vw, 4.1rem);
    font-weight: 700;
    text-align: center;
}

.hero-ornament span,
.hero-ornament small {
    position: relative;
    z-index: 1;
    display: block;
}

.hero-ornament small {
    margin-top: -52px;
    color: rgba(255, 244, 215, 0.82);
    font-family: "Cairo", Arial, sans-serif;
    font-size: 0.96rem;
    font-weight: 700;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.stats-row div,
.metric-card {
    border: 1px solid rgba(215, 164, 59, 0.24);
    border-radius: var(--radius);
    padding: 16px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--green-950);
}

.stats-row strong,
.metric-card strong {
    display: block;
    font-family: "Noto Kufi Arabic", sans-serif;
    font-size: 2rem;
    line-height: 1;
}

.stats-row span,
.metric-card span {
    color: var(--muted);
    font-weight: 700;
}

.section {
    padding: 68px 0;
}

.home-page .section {
    position: relative;
}

.section-soft {
    background: #fff;
}

.section-head {
    margin-bottom: 26px;
}

.inline-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.section-head h2,
.contact-info h2,
.admin-page-head h1,
.panel-head h2 {
    margin: 4px 0 0;
    color: var(--green-950);
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.18;
}

.class-grid,
.books-grid,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.class-card,
.book-card,
.contact-info,
.form-panel,
.admin-panel,
.message-card,
.login-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.class-card {
    position: relative;
    min-height: 180px;
    padding: 24px;
    overflow: hidden;
    transition: transform 0.2s ease, border 0.2s ease;
}

.class-card::after {
    position: absolute;
    inset-inline-start: -34px;
    bottom: -34px;
    width: 110px;
    height: 110px;
    border: 1px solid rgba(215, 164, 59, 0.22);
    border-radius: 50%;
    content: "";
}

.class-card:hover {
    transform: translateY(-4px);
    border-color: rgba(215, 164, 59, 0.55);
}

.class-card span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-100);
    color: var(--gold-600);
    font-weight: 800;
}

.class-card h3,
.book-card h3 {
    margin: 18px 0 8px;
    color: var(--green-950);
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: 1.25rem;
    line-height: 1.35;
}

.class-card p,
.book-card p,
.site-footer p,
.reader-note,
.muted {
    margin: 0;
    color: var(--muted);
}

.class-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.class-links em {
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--green-100);
    color: var(--green-800);
    font-style: normal;
    font-size: 0.82rem;
    font-weight: 800;
}

.compact-actions {
    margin-top: 16px;
}

.book-card {
    display: flex;
    min-height: 320px;
    flex-direction: column;
    padding: 16px;
}

.book-cover {
    display: grid;
    aspect-ratio: 16 / 10;
    place-items: center;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--green-100), var(--gold-100));
    color: var(--green-900);
    font-family: "Noto Kufi Arabic", sans-serif;
    font-weight: 800;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fallback-cover span {
    border: 1px solid rgba(11, 77, 55, 0.18);
    border-radius: 50%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.64);
}

.book-topline {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.book-topline span,
.status {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 11px;
    background: var(--green-100);
    color: var(--green-800);
    font-size: 0.84rem;
    font-weight: 800;
}

.subject-chip {
    background: var(--gold-100) !important;
    color: var(--gold-600) !important;
}

.book-author {
    color: var(--green-800) !important;
    font-weight: 700;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.book-actions {
    margin-top: auto;
    padding-top: 20px;
}

.btn-icon {
    width: 44px;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    color: var(--gold-600);
    font-size: 1.25rem;
}

.btn-icon.active {
    background: var(--gold-100);
    border-color: rgba(215, 164, 59, 0.45);
}

.page-hero {
    background:
        linear-gradient(135deg, rgba(7, 59, 42, 0.97), rgba(17, 99, 71, 0.92)),
        radial-gradient(circle at 82% 0%, rgba(215, 164, 59, 0.34), transparent 28%);
    color: #fff;
}

.compact-hero {
    padding: 54px 0;
}

.compact-hero h1 {
    margin-bottom: 0;
}

.search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    max-width: 720px;
    margin-top: 24px;
}

.advanced-search {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.45fr) minmax(160px, 0.45fr) auto;
}

.hero-subcopy {
    max-width: 720px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.82);
}

.notice-strip {
    padding: 20px 0;
    background:
        linear-gradient(90deg, rgba(255, 244, 215, 0.55), #fff, rgba(231, 245, 237, 0.8));
}

.notice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.notice-card,
.feature-panel,
.mini-list a {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.notice-card {
    padding: 16px;
}

.notice-card span {
    color: var(--gold-600);
    font-weight: 800;
}

.notice-card h2,
.feature-panel h2 {
    margin: 6px 0 8px;
    color: var(--green-950);
    font-family: "Noto Kufi Arabic", sans-serif;
    font-size: 1.15rem;
}

.notice-card p,
.feature-panel p {
    margin: 0;
    color: var(--muted);
}

.notice-card.pinned {
    border-color: rgba(215, 164, 59, 0.45);
    background: linear-gradient(180deg, #fff, var(--gold-100));
}

.home-intro-section {
    padding-top: 56px;
    padding-bottom: 56px;
    background:
        radial-gradient(circle at 12% 18%, rgba(215, 164, 59, 0.14), transparent 26%),
        linear-gradient(180deg, #fff, var(--soft));
}

.home-intro {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 24px;
    align-items: stretch;
}

.intro-copy,
.intro-values {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.intro-copy {
    position: relative;
    overflow: hidden;
    padding: 30px;
}

.intro-copy::after {
    position: absolute;
    inset-inline-start: -70px;
    bottom: -70px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(215, 164, 59, 0.22);
    border-radius: 50%;
    content: "";
}

.intro-copy h2 {
    margin: 8px 0 12px;
    color: var(--green-950);
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.intro-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.intro-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
}

.intro-values div {
    padding: 26px 20px;
    border-inline-start: 1px solid var(--line);
}

.intro-values div:first-child {
    border-inline-start: 0;
}

.intro-values strong {
    display: block;
    margin-bottom: 8px;
    color: var(--green-900);
    font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
    font-size: 1.2rem;
}

.intro-values span {
    display: block;
    color: var(--muted);
}

.feature-grid,
.home-split {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.home-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-panel {
    position: relative;
    overflow: hidden;
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(215, 164, 59, 0.48);
}

.feature-panel b {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-800);
    font-size: 0.85rem;
}

.feature-panel::after {
    position: absolute;
    inset-inline-start: -48px;
    top: -48px;
    width: 130px;
    height: 130px;
    border: 1px solid rgba(215, 164, 59, 0.22);
    border-radius: 50%;
    content: "";
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list a {
    display: block;
    padding: 14px 16px;
}

.mini-list strong,
.mini-list span {
    display: block;
}

.mini-list span {
    color: var(--muted);
    font-size: 0.92rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 12px 14px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(21, 128, 82, 0.55);
    box-shadow: 0 0 0 4px rgba(21, 128, 82, 0.1);
}

label span {
    display: block;
    margin-bottom: 7px;
    color: var(--green-950);
    font-weight: 800;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
    align-items: start;
}

.contact-info,
.form-panel {
    padding: 26px;
}

.contact-info ul {
    display: grid;
    gap: 12px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.whatsapp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.contact-info li {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.alert {
    width: min(1120px, calc(100% - 32px));
    margin: 18px auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: #fff;
    font-weight: 700;
}

.alert p {
    margin: 0;
}

.alert p + p {
    margin-top: 6px;
}

.alert-success {
    border-color: rgba(8, 116, 67, 0.2);
    background: var(--success-soft);
    color: var(--success);
}

.alert-error {
    border-color: rgba(180, 35, 24, 0.2);
    background: var(--danger-soft);
    color: var(--danger);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 34px;
    text-align: center;
}

.empty-state h1,
.empty-state h2,
.empty-state h3 {
    margin: 0 0 8px;
    color: var(--green-950);
    font-family: "Noto Kufi Arabic", sans-serif;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-weight: 800;
}

.pagination a.active,
.pagination a:hover {
    background: var(--green-800);
    color: #fff;
}

.reader-head {
    padding: 32px 0;
    background: var(--green-950);
    color: #fff;
}

.reader-title h1 {
    margin: 4px 0 0;
    font-family: "Noto Kufi Arabic", sans-serif;
    line-height: 1.25;
}

.reader-frame-wrap {
    padding: 24px 0 54px;
}

.reader-frame {
    width: 100%;
    height: min(78vh, 860px);
    min-height: 560px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.reader-note {
    margin-top: 12px;
}

.reader-note a {
    color: var(--green-800);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer {
    padding: 34px 0;
    background: var(--green-950);
    color: #fff;
}

.site-footer p,
.site-footer a {
    color: rgba(255, 255, 255, 0.76);
}

.site-footer strong {
    display: block;
    font-family: "Noto Kufi Arabic", sans-serif;
    font-size: 1.2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links a {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 8px 12px;
}

.credit {
    text-align: left;
}

.credit a {
    color: var(--gold-100);
    font-weight: 800;
}

.system-error,
.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(7, 59, 42, 0.97), rgba(17, 99, 71, 0.93)),
        radial-gradient(circle at 25% 18%, rgba(215, 164, 59, 0.32), transparent 30%);
}

.system-error > div,
.login-card {
    width: min(460px, 100%);
    padding: 30px;
    text-align: center;
}

.login-card form {
    display: grid;
    gap: 14px;
    margin: 22px 0 16px;
    text-align: right;
}

.login-card .brand-mark {
    margin: 0 auto 16px;
}

.login-card h1 {
    margin: 6px 0 0;
    font-family: "Noto Kufi Arabic", sans-serif;
}

.admin-body {
    min-height: 100vh;
    background: #f3f8f5;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    backdrop-filter: blur(14px);
}

.admin-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 60px;
}

.admin-page-head {
    margin-bottom: 22px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.metric-card {
    background: #fff;
    box-shadow: var(--shadow);
}

.admin-grid-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

.admin-panel {
    padding: 22px;
}

.class-admin-list,
.message-list.compact {
    display: grid;
    gap: 10px;
}

.class-admin-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--soft);
    font-weight: 800;
}

.admin-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.class-admin-list small {
    color: var(--muted);
}

.message-list {
    display: grid;
    gap: 14px;
}

.message-list.compact article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--soft);
}

.message-list.compact strong,
.message-list.compact span {
    display: block;
}

.message-list.compact span {
    color: var(--muted);
    font-size: 0.92rem;
}

.message-card {
    padding: 20px;
}

.message-card.new {
    border-color: rgba(215, 164, 59, 0.48);
}

.message-meta {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.message-meta strong,
.message-meta span {
    display: block;
}

.message-meta span,
.message-meta small {
    color: var(--muted);
}

.admin-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
    align-items: end;
    gap: 14px;
}

.quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-actions h2,
.admin-panel h2 {
    margin-top: 0;
    color: var(--green-950);
    font-family: "Noto Kufi Arabic", sans-serif;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 830px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 12px;
    text-align: right;
    vertical-align: middle;
}

.admin-table th {
    color: var(--green-950);
    font-size: 0.92rem;
}

.admin-table td strong,
.admin-table td small {
    display: block;
}

.admin-table td small {
    color: var(--muted);
}

.empty-cell {
    text-align: center !important;
    color: var(--muted);
}

.status.off {
    background: #f1f3f2;
    color: var(--muted);
}

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

.current-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--soft);
}

.check-line,
.toggle-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.check-line input,
.toggle-line input {
    width: auto;
}

.check-line span,
.toggle-line span {
    margin: 0;
}

.admin-pagination {
    margin-bottom: 0;
}

@media (max-width: 920px) {
    .menu-toggle {
        display: block;
    }

    .nav-wrap {
        min-height: 76px;
    }

    .main-nav,
    .admin-nav {
        position: absolute;
        inset-inline: 16px;
        top: 72px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        padding: 10px;
        box-shadow: var(--shadow);
    }

    .main-nav.open,
    .admin-nav.open {
        display: flex;
    }

    .admin-topbar {
        position: sticky;
        padding-inline: 16px;
    }

    .hero-grid,
    .contact-grid,
    .admin-grid-two,
    .home-intro {
        grid-template-columns: 1fr;
    }

    .class-grid,
    .books-grid,
    .metric-grid,
    .notice-grid,
    .feature-grid,
    .home-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-filters,
    .advanced-search {
        grid-template-columns: 1fr;
    }

    .intro-values {
        grid-template-columns: 1fr;
    }

    .intro-values div,
    .intro-values div:first-child {
        border-inline-start: 0;
        border-top: 1px solid var(--line);
    }

    .intro-values div:first-child {
        border-top: 0;
    }
}

@media (max-width: 640px) {
    .container,
    .admin-main,
    .alert {
        width: min(100% - 24px, 1120px);
    }

    .brand small {
        max-width: 170px;
    }

    .hero {
        padding: 58px 0;
    }

    .hero-copy h1,
    .page-hero h1 {
        font-size: 2.7rem;
    }

    .hero-panel {
        padding: 18px;
    }

    .hero-ornament {
        min-height: 210px;
    }

    .hero-ornament small {
        margin-top: -44px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .class-grid,
    .books-grid,
    .metric-grid,
    .form-grid,
    .notice-grid,
    .feature-grid,
    .home-split {
        grid-template-columns: 1fr;
    }

    .inline-head,
    .footer-grid,
    .admin-page-head,
    .reader-title,
    .message-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .search-bar {
        grid-template-columns: 1fr;
    }

    .book-actions .btn,
    .hero-actions .btn,
    .reader-actions .btn,
    .form-actions .btn {
        width: 100%;
    }

    .reader-frame {
        min-height: 480px;
        height: 72vh;
    }

    .credit {
        text-align: right;
    }
}
