:root {
    --blue: #0d87dd;
    --blue-dark: #0669b4;
    --sky: #dff1ff;
    --ink: #18202a;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f7fafc;
    --danger: #df3f3f;
    --gold: #f5c84c;
}

* { box-sizing: border-box; }
html { background: #eef2f7; }
body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell {
    min-height: 100vh;
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    padding-bottom: 88px;
    box-shadow: 0 0 40px rgba(15, 23, 42, .08);
}

.login-screen {
    min-height: 100vh;
    padding: 56px 24px 32px;
    background:
        radial-gradient(circle at 20% 12%, rgba(255,255,255,.36) 0 90px, transparent 92px),
        linear-gradient(160deg, #0a7fd2 0 45%, #fff 45% 100%);
}
.campus-mark, .brand-dot {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #0aa05b;
    color: #fff;
    border: 5px solid #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,.18);
    font-weight: 800;
}
.login-screen h1 { margin: 22px 0 8px; color: #fff; font-size: 34px; line-height: 1.05; }
.login-screen p { color: rgba(255,255,255,.92); max-width: 340px; }
.panel {
    margin-top: 80px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
}
.panel-info {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px;
    margin-bottom: 16px;
    display: grid;
    gap: 4px;
}
.panel-info strong { color: var(--blue-dark); font-size: 18px; }
.panel-info span { color: var(--muted); font-weight: 700; }
.register-screen .panel { margin-top: 36px; }

.form-stack { display: grid; gap: 14px; }
.form-stack h3, .content-pad h3 {
    margin: 16px 0 4px;
    font-size: 20px;
}
label { display: grid; gap: 7px; color: #303846; font-weight: 650; }
input, select, textarea {
    width: 100%;
    border: 1px solid #d6dbe3;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 13px 14px;
    outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13, 135, 221, .14); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; }

.btn {
    border: 0;
    border-radius: 8px;
    padding: 13px 16px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.ghost { background: #eef6fd; color: var(--blue-dark); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.full { width: 100%; }
.btn.outline-danger { color: var(--danger); background: #fff; border: 1px solid var(--danger); }
.login-hint { color: var(--muted); text-align: center; font-size: 13px; line-height: 1.45; }
.alert { border-radius: 8px; padding: 12px; margin: 14px 0; background: #e8f7ee; color: #17663b; }
.alert.error { background: #fff1f1; color: #a12828; }

.hero-home {
    min-height: 420px;
    padding: 32px 30px 36px;
    background:
        radial-gradient(circle at 75% 34%, rgba(255,255,255,.13) 0 110px, transparent 112px),
        radial-gradient(circle at 90% 76%, rgba(6, 105, 180, .42) 0 160px, transparent 165px),
        linear-gradient(145deg, #048ce7, #1275c4);
    color: #fff;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.bell {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: grid;
    place-items: center;
    color: #fff;
}
.member-card-preview {
    margin-top: 96px;
    display: grid;
    grid-template-columns: 96px 1fr 96px;
    align-items: center;
    gap: 16px;
    background: #fff;
    color: var(--ink);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .16);
}
.member-card-preview img, .profile-identity img, .alumni-list img, .photo-picker img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9eef5;
}
.member-card-preview h2 { margin: 0 0 8px; font-size: 25px; }
.member-card-preview p { margin: 2px 0; color: #666; font-size: 17px; }
.qr-box {
    min-height: 104px;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    padding: 12px;
    text-align: center;
    font-weight: 800;
}
.qr-box span { background: #fff; border-radius: 2px; }
.qr-box b { grid-column: 1 / -1; }

.content-pad { padding: 26px 30px; }
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 14px;
    margin: 22px 0 30px;
}
.quick-item {
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
    font-size: 14px;
}
.quick-item span {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--sky);
    color: var(--blue-dark);
    font-weight: 900;
    font-size: 25px;
}
.quick-item img {
    width: 38px;
    height: 38px;
    display: block;
}
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 4px 0 28px;
}
.stats-row div {
    background: #f2f8fd;
    border: 1px solid #dcecf7;
    border-radius: 8px;
    padding: 16px;
}
.stats-row strong { display: block; font-size: 28px; color: var(--blue-dark); }
.stats-row span { color: var(--muted); }
.banner-card {
    margin: 16px 0 28px;
    min-height: 132px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f6d94e, #fff06a);
    color: #034f86;
    padding: 26px 28px;
    display: grid;
    align-content: center;
}
.banner-card strong { font-size: 25px; line-height: 1.08; }
.banner-card small { color: #1b638f; margin-top: 8px; }
.news-list { display: grid; gap: 12px; }
.news-list article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}
.news-list span { color: var(--blue-dark); font-weight: 800; font-size: 12px; }
.news-list h4 { margin: 6px 0; }
.news-list p { color: var(--muted); margin: 0; line-height: 1.45; }

.subbar {
    position: sticky;
    top: 0;
    z-index: 4;
    height: 64px;
    background: var(--blue);
    color: #fff;
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
    padding: 0 12px;
}
.subbar h1 { margin: 0; text-align: center; font-size: 22px; font-weight: 600; }
.subbar a, .icon-btn {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 32px;
    text-align: center;
}
.icon-btn { font-size: 22px; cursor: pointer; }

.profile-hero {
    min-height: 270px;
    padding: 32px;
    background: linear-gradient(180deg, #077bd2, #61ade9);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.profile-hero h1 { text-align: center; margin: 6px 0 86px; font-weight: 500; }
.wave {
    position: absolute;
    left: -10%;
    top: 90px;
    width: 120%;
    height: 150px;
    background: rgba(255,255,255,.16);
    border-radius: 50%;
    transform: rotate(5deg);
}
.profile-identity { position: relative; display: flex; align-items: center; gap: 22px; }
.profile-identity h2 { margin: 0 0 8px; color: #ffe4a3; font-size: 24px; }
.profile-identity p { margin: 0; font-size: 18px; }
.profile-menu { padding: 26px 0; }
.profile-menu h3 { margin: 28px 32px 16px; font-size: 21px; }
.profile-menu a {
    min-height: 74px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 72px 1fr 36px;
    align-items: center;
    padding: 0 28px;
    font-size: 20px;
}
.profile-menu span { font-size: 24px; color: #333; }
.profile-menu b { color: #777; font-size: 34px; font-weight: 400; }
.version { text-align: center; color: #333; margin: 30px 0; font-size: 19px; }
.profile-menu form { padding: 0 28px; }

.photo-picker {
    display: grid;
    grid-template-columns: 98px 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.sticky-action {
    position: sticky;
    bottom: 92px;
    z-index: 2;
    box-shadow: 0 10px 24px rgba(13, 135, 221, .2);
}

.searchbar {
    display: grid;
    grid-template-columns: 1fr 82px;
    gap: 8px;
    margin-bottom: 16px;
}
.searchbar button {
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-weight: 800;
}
.admin-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.alumni-list { display: grid; gap: 12px; }
.list-summary {
    color: var(--muted);
    font-weight: 750;
    margin: 0 0 12px;
}
.alumni-list article {
    display: grid;
    grid-template-columns: 70px 1fr 34px;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}
.alumni-list img { width: 70px; height: 70px; }
.alumni-list h3 { margin: 0 0 5px; font-size: 17px; }
.alumni-list p, .alumni-list small { margin: 0; color: var(--muted); line-height: 1.35; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.row-actions a, .row-actions button {
    border: 0;
    background: #eef6fd;
    color: var(--blue-dark);
    border-radius: 8px;
    padding: 7px 10px;
    font-weight: 750;
}
.row-actions button { color: var(--danger); background: #fff1f1; }
.pagination {
    display: grid;
    grid-template-columns: 74px 1fr 74px;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}
.pagination a, .pagination span {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    text-align: center;
    font-weight: 800;
}
.pagination a {
    background: #eef6fd;
    color: var(--blue-dark);
}
.pagination a.disabled {
    pointer-events: none;
    opacity: .45;
}
.pagination span {
    color: var(--muted);
    background: #fff;
}
.empty {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    padding: 24px;
    text-align: center;
}

.card-page { padding: 16px; display: grid; gap: 8px; }
.virtual-card {
    width: 100%;
    aspect-ratio: 1.68 / 1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    color: #fff;
    background:
        linear-gradient(110deg, rgba(246, 186, 48, .95) 0 6%, transparent 6% 88%, rgba(246, 186, 48, .9) 88% 93%, transparent 93%),
        linear-gradient(145deg, #314991, #2d63bb);
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.virtual-card:before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 36% 52%, rgba(255,255,255,.12), transparent 28%),
        repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 10px);
}
.card-brand {
    position: relative;
    display: grid;
    grid-template-columns: 58px 1fr 112px;
    gap: 12px;
    align-items: center;
    padding: 28px 28px 8px;
}
.card-brand span, .back-text span {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #0aa05b;
    border: 3px solid #fff;
    font-weight: 900;
}
.card-brand strong { font-size: clamp(24px, 7vw, 52px); border-right: 4px solid #d7d34a; line-height: .95; }
.card-brand b { font-size: clamp(12px, 3vw, 21px); }
.card-main {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 28%;
    gap: 18px;
    align-items: center;
    padding: 18px 30px;
}
.card-main h2 { font-size: clamp(17px, 4.7vw, 30px); margin: 0 0 6px; }
.card-main p { margin: 0; font-size: clamp(14px, 4vw, 22px); font-weight: 800; }
.card-main small { display: block; margin-top: 10px; font-weight: 800; font-size: clamp(10px, 2.8vw, 16px); }
.card-main hr { width: 82px; margin: 8px 0 12px; border: 0; border-top: 2px solid #fff; }
.card-main img {
    width: 100%;
    aspect-ratio: .78 / 1;
    object-fit: cover;
    border-radius: 8px;
    background: #ef3d35;
    border: 3px solid rgba(255,255,255,.4);
}
.virtual-card.back {
    background:
        linear-gradient(110deg, #304b99 0 64%, rgba(255,255,255,.96) 64% 100%),
        linear-gradient(145deg, #314991, #2d63bb);
}
.watermark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.12);
    font-size: 92px;
    font-weight: 900;
}
.back-text {
    position: absolute;
    left: 24%;
    bottom: 24%;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
}
.qr-print {
    position: absolute;
    right: 7%;
    bottom: 19%;
    color: #222;
    text-align: center;
}
.fake-qr {
    display: grid;
    grid-template-columns: repeat(7, 8px);
    grid-auto-rows: 8px;
    gap: 2px;
    background: #fff;
    padding: 7px;
    margin-top: 6px;
}
.fake-qr i { background: #fff; }
.fake-qr i.on { background: #111; }
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(760px, 100%);
    height: 76px;
    background: #fff;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    z-index: 10;
}
.bottom-nav a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    color: #b8b8b8;
    font-weight: 800;
    font-size: 13px;
}
.bottom-nav a.active { color: var(--blue); }
.nav-icon { font-size: 30px; line-height: 1; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 30;
}
.modal-backdrop[hidden] {
    display: none !important;
}
.lovely-modal {
    width: min(360px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
}
.modal-mark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    background: #fff4d2;
    color: #b77800;
    font-size: 28px;
    font-weight: 900;
}
.lovely-modal h3 { margin: 0 0 8px; }
.lovely-modal p { margin: 0 0 20px; color: var(--muted); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prose p { color: var(--muted); line-height: 1.6; }

.menu-hero {
    padding: 24px 30px 26px;
    background: linear-gradient(135deg, #e9f6ff, #ffffff);
    border-bottom: 1px solid var(--line);
}
.menu-hero h2 {
    margin: 0 0 8px;
    color: var(--blue-dark);
    font-size: 27px;
}
.menu-hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}
.feature-list, .campaign-list {
    display: grid;
    gap: 14px;
}
.feature-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    background: #fff;
}
.feature-icon {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--sky);
    color: var(--blue-dark);
    font-weight: 900;
}
.feature-card span, .campaign-card span {
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 900;
}
.feature-card h3, .campaign-card h3 {
    margin: 4px 0 7px;
    font-size: 18px;
}
.feature-card p, .campaign-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.meta-row small, .deadline {
    display: inline-flex;
    background: #f1f5f9;
    color: #475569;
    border-radius: 8px;
    padding: 6px 9px;
    font-weight: 700;
}
details {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}
summary {
    cursor: pointer;
    color: var(--blue-dark);
    font-weight: 900;
}
.detail-body {
    margin-top: 10px;
    color: #475569;
    line-height: 1.6;
}
.small-btn {
    margin-top: 12px;
    padding: 9px 12px;
    font-size: 13px;
}
.campaign-card, .zakat-calc, .qibla-card, .prayer-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
.progress {
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin: 16px 0 10px;
}
.progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), #0aa05b);
}
.campaign-amount {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.campaign-amount strong { color: var(--blue-dark); font-size: 20px; }
.campaign-amount small { color: var(--muted); }
.bank-box {
    display: grid;
    gap: 4px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}
.bank-box span {
    color: var(--ink);
    font-size: 22px;
    letter-spacing: 0;
}
.zakat-calc {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}
.zakat-calc h3 { margin: 0; }
.calc-result {
    background: #eef6fd;
    color: var(--blue-dark);
    border-radius: 8px;
    padding: 14px;
    font-weight: 800;
}
.qibla-card {
    display: grid;
    gap: 16px;
    text-align: center;
}
.compass {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    border-radius: 50%;
    border: 10px solid #e6eef8;
    background: radial-gradient(circle, #fff 0 50%, #eef6fd 51% 100%);
    position: relative;
    display: grid;
    place-items: center;
}
.compass span {
    position: absolute;
    top: 16px;
    color: var(--blue-dark);
    font-weight: 900;
}
.compass b {
    width: 8px;
    height: 92px;
    background: var(--danger);
    border-radius: 99px;
    transform: rotate(294deg) translateY(-24px);
    transform-origin: 50% 100%;
}
.compass small {
    position: absolute;
    bottom: 46px;
    color: var(--muted);
    font-weight: 900;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.info-grid div, .prayer-grid div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px;
}
.info-grid strong, .prayer-grid strong {
    display: block;
    color: var(--blue-dark);
    font-size: 18px;
}
.info-grid span, .prayer-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}
.prayer-card h3 { margin: 0 0 6px; }
.prayer-card p { margin: 0 0 14px; color: var(--muted); }
.location-btn { margin: 0 0 14px; }
.prayer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.reading-page .detail-body {
    font-size: 17px;
}

@media (max-width: 430px) {
    .hero-home { padding: 28px 16px 34px; min-height: 402px; }
    .member-card-preview { grid-template-columns: 82px 1fr 86px; gap: 12px; padding: 14px; margin-top: 92px; }
    .member-card-preview img { width: 82px; height: 82px; }
    .member-card-preview h2 { font-size: 19px; }
    .member-card-preview p { font-size: 14px; }
    .qr-box { min-height: 86px; padding: 9px; font-size: 12px; }
    .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 22px 8px; }
    .quick-item span { width: 56px; height: 56px; }
    .content-pad { padding: 24px 16px; }
    .profile-hero { padding: 28px 24px; }
    .profile-menu a { grid-template-columns: 56px 1fr 28px; padding: 0 22px; }
    .card-brand { padding: 18px 18px 4px; grid-template-columns: 46px 1fr 86px; gap: 8px; }
    .card-brand span { width: 38px; height: 38px; font-size: 12px; }
    .card-main { padding: 10px 20px; }
}

@media print {
    html, body, .app-shell { background: #fff; box-shadow: none; }
    .subbar, .bottom-nav, .no-print { display: none !important; }
    .app-shell { max-width: none; padding: 0; }
    .card-page { padding: 0; gap: 8mm; }
    .virtual-card { width: 86mm; break-inside: avoid; box-shadow: none; }
}
