/* Rifqa Aljanub identity: one palette, readable Arabic and responsive lockups. */
:root {
    --rifqa-ink: #153E43;
    --rifqa-teal: #2E7B73;
    --rifqa-sand: #B89461;
    --rifqa-ivory: #F7F5F0;
}
html { scroll-padding-top: 7rem; }
body { line-height: 1.7; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--rifqa-teal);
    outline-offset: 4px;
}
.skip-link {
    position: fixed;
    inset-block-start: .75rem;
    inset-inline-start: .75rem;
    z-index: 100;
    padding: .65rem 1rem;
    border-radius: .75rem;
    background: var(--rifqa-ink);
    color: #fff;
    font-weight: 700;
    transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }
.brand-link { display: inline-flex; align-items: center; min-width: 0; text-decoration: none; border-radius: .5rem; }
.brand-lockup { display: inline-flex; align-items: center; gap: .7rem; max-width: 100%; text-align: right; line-height: 1.35; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; flex: 0 0 auto; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: block; min-width: 0; }
.brand-name { display: block; color: var(--rifqa-ink); font-size: 1.45rem; font-weight: 800; white-space: nowrap; line-height: 1.4; }
.brand-descriptor { display: block; color: #25665F; font-size: .75rem; font-weight: 600; line-height: 1.6; }
.brand-subtitle { display: block; margin-top: .2rem; color: #BFDAD2; font-size: .65rem; line-height: 1.5; }
.brand-lockup--dark .brand-name { color: #fff; }
.brand-lockup--dark .brand-descriptor { color: #DFEEEA; }
.brand-lockup--dark .brand-mark { background: var(--rifqa-ivory); padding: .35rem; border-radius: .8rem; }
.brand-lockup--compact { gap: .6rem; }
.brand-lockup--compact .brand-mark { width: 2.8rem; height: 2.8rem; }
.brand-lockup--compact .brand-name { font-size: 1.15rem; }
.brand-lockup--compact .brand-descriptor { font-size: .66rem; }
.brand-lockup--large { gap: 1rem; }
.brand-lockup--large .brand-mark { width: 4.5rem; height: 4.5rem; }
.brand-lockup--large .brand-name { font-size: 2rem; }
.brand-lockup--large .brand-descriptor { font-size: .95rem; }
.public-header-row { min-height: 5.25rem; }
.public-header nav a { white-space: nowrap; }
.public-header #mobile-menu a { white-space: normal; }
.hero-title { line-height: 1.35; text-wrap: balance; }
.login-page { background: var(--rifqa-ivory); }
.admin-topbar { gap: 1rem; flex-wrap: wrap; }
.admin-topbar h1 { overflow-wrap: anywhere; }
.print-document { background: var(--rifqa-ivory); color: var(--rifqa-ink); }
.print-document .brand-lockup { break-inside: avoid; }
.receipt-sheet { width: 100%; max-width: 50rem; margin: 0 auto; background: white; border: 1px solid #d8e4e0; border-radius: 1.3rem; padding: 2.25rem; }
.receipt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--rifqa-ink); }
.receipt-meta { font-size: .78rem; color: #475569; }
.receipt-title { margin: 1.75rem 0 .4rem; font-size: 1.4rem; font-weight: 800; }
.receipt-description { color: #475569; font-size: .9rem; }
.receipt-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.receipt-detail { padding: .85rem; border: 1px solid #d8e4e0; border-radius: .65rem; overflow-wrap: anywhere; }
.receipt-detail dt { color: #64748b; font-size: .75rem; }
.receipt-detail dd { font-weight: 700; font-size: .9rem; margin: .2rem 0 0; }
.receipt-amounts { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
.receipt-amounts th, .receipt-amounts td { padding: .85rem; border-bottom: 1px solid #d8e4e0; text-align: right; }
.receipt-amounts th { background: #F0F7F5; }
.receipt-note { margin-top: 1.25rem; color: #475569; font-size: .78rem; line-height: 1.8; }
.receipt-signature { margin-top: 3rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; color: #475569; font-size: .8rem; }
.receipt-signature span { display: block; border-top: 1px dashed #64748b; padding-top: .65rem; }
@media (max-width: 1023px) {
    .admin-sidebar nav { max-height: 17rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: .3rem; }
    .admin-sidebar nav > div { grid-column: 1 / -1; }
    .admin-sidebar nav > a { min-width: 0; }
    .admin-sidebar nav > a span { overflow-wrap: anywhere; }
}
@media (max-width: 479px) {
    .brand-lockup { gap: .55rem; }
    .brand-mark { width: 2.8rem; height: 2.8rem; }
    .brand-name { font-size: 1.2rem; }
    .brand-descriptor { font-size: .66rem; }
    .brand-lockup--large .brand-name { font-size: 1.7rem; }
    .brand-lockup--large .brand-descriptor { font-size: .85rem; }
    .public-header-row { gap: .6rem; }
    .receipt-sheet { padding: 1.1rem; }
    .receipt-header { flex-direction: column; gap: 1rem; }
    .receipt-details { grid-template-columns: 1fr; }
    .admin-topbar { padding-inline: 1rem; }
    .admin-topbar > div { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
    .skip-link, .no-print { display: none !important; }
    .print-document { background: #fff !important; color: #111 !important; padding: 0 !important; }
    .print-document .brand-name, .print-document .brand-descriptor { color: #111 !important; }
    .brand-mark { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .receipt-sheet { border: 0; border-radius: 0; padding: 0; box-shadow: none; max-width: none; }
    .receipt-header, .receipt-details, .receipt-amounts, .receipt-signature { break-inside: avoid; }
    .print-document .brand-lockup--compact .brand-name { font-size: 15pt; }
    @page { size: A4; margin: 15mm; }
}

/* Common layouts for the coordination desk. */
.ops-stack { display: grid; gap: 1rem; }
.ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 25rem), 1fr)); gap: 1rem; }
.ops-panel { background: #fff; border: 1px solid #dbe5e2; border-radius: 1rem; padding: clamp(1rem, 2.5vw, 1.6rem); min-width: 0; }
.ops-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .85rem; }
.ops-heading h2, .ops-panel h3 { color: var(--rifqa-ink); font-size: 1.05rem; font-weight: 800; }
.ops-heading time, .ops-muted, .ops-list p { color: #475569; font-size: .85rem; }
.ops-link { color: #25665f; text-decoration: underline; text-underline-offset: .2em; font-weight: 700; font-size: .86rem; }
.ops-list li { border-top: 1px solid #e2e8f0; padding: .65rem 0; display: flex; justify-content: space-between; align-items: baseline; gap: .35rem 1rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.ops-list li:first-child { border-top: 0; }
.ops-metrics { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem),1fr)); }
.ops-metrics > div { padding: .75rem; border-radius: .6rem; background: #f0f7f5; }
.ops-metrics dt { font-size: .84rem; color: #475569; }
.ops-metrics dd { font-size: 1.2rem; font-weight: 800; color: var(--rifqa-ink); }
.ops-form { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); align-items: end; margin-block: .75rem; }
.ops-form label { display: grid; gap: .24rem; color: #334155; font-size: .86rem; font-weight: 600; min-width: 0; }
.ops-form :is(input, select, textarea) { min-width: 0; width: 100%; padding: .4rem .55rem; background: #fff; border: 1px solid #94a3b8; border-radius: .5rem; color: #0f172a; }
.ops-button { display: inline-flex; justify-content: center; padding: .45rem .8rem; border: 1px solid #25665f; border-radius: .55rem; background: #25665f; color: white; font-size: .88rem; font-weight: 700; }
.ops-button:hover { background: var(--rifqa-ink); }
.ops-table { width: 100%; border-collapse: collapse; }
.ops-table :is(td,th) { padding: .6rem; border-bottom: 1px solid #dbe5e2; text-align: start; vertical-align: top; }
.ops-table thead th { background: #f0f7f5; color: var(--rifqa-ink); }
.ops-print-body { font-family: 'Tajawal', system-ui, sans-serif; margin: 0; padding: 1rem; }
.ops-print-body .receipt-sheet { box-sizing: border-box; }
.ops-print-body .no-print { margin: 0 auto 1rem; max-width: 50rem; }
.ops-print-text { overflow-wrap: anywhere; white-space: pre-wrap; }
@media print {
    .ops-print-body .ops-table tr, .ops-print-body .receipt-header { break-inside: avoid; }
    .ops-print-body .ops-table thead { display: table-header-group; }
}

.admin-menu-toggle { display: none; }
@media (max-width: 1023px) {
    .admin-sidebar > div:first-child { padding: .6rem 1rem; gap: .7rem; }
    .admin-menu-enabled .admin-menu-toggle { display: inline-flex; margin-inline-start: auto; padding: .4rem .6rem; border: 1px solid #aec8c6; border-radius: .5rem; color: white; font-size: .85rem; }
    .admin-menu-enabled:not(.admin-menu-open) .admin-menu { display: none; }
}

.ops-form .ops-check { display: flex; align-items: center; gap: .5rem; }
.ops-form .ops-check input { width: auto; }

@media screen and (max-width: 1023px) {
    /* WebView can resolve nested full-height flex containers to zero height. */
    html.rifqa-android,
    .rifqa-android body { height: auto; min-height: 100vh; }
    .rifqa-android body { display: block; }
    .rifqa-android .admin-shell { min-height: 100vh; }
    .rifqa-android .admin-shell > div { overflow: visible; }
    .rifqa-android .ops-heading > div { display: flex; flex-wrap: wrap; gap: .75rem; }
}
