html {
    height: 100%;
}

:root {
    --brand-red: #ff0000;
    --brand-yellow: #ffcc00;
    --brand-black: #000000;
    --bg-soft: #f4f6fb;
    --surface: #ffffff;
    --surface-muted: #f9fafc;
    --text-main: #0f172a;
    --text-sub: #5b6475;
    --line: #e8ecf3;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
    /* Space for bottom tab bar (tap targets + label); add OS nav / gesture inset via env() */
    --bottom-nav-clearance: 94px;
}

body {
    margin: 0;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(255, 204, 0, 0.2), transparent 35%),
        radial-gradient(circle at top left, rgba(255, 0, 0, 0.12), transparent 30%),
        var(--bg-soft);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

.mobile-app-shell {
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--surface);
    position: relative;
    box-shadow: var(--shadow-soft);
    border-left: 1px solid rgba(15, 23, 42, 0.04);
    border-right: 1px solid rgba(15, 23, 42, 0.04);
}

.app-header {
    background: linear-gradient(135deg, #0f172a 0%, #111827 60%, #ef4444 100%);
    color: #fff;
    text-align: center;
    padding: 14px 16px 16px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.22);
}

.app-logo-sm,
.app-logo {
    font-weight: 800;
    letter-spacing: 0.8px;
    line-height: 1.2;
}

.app-logo-sm {
    font-size: 1.05rem;
}

.app-header small {
    color: rgba(255, 255, 255, 0.9);
}

.app-logo-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.tagline {
    color: var(--text-sub);
    font-size: 0.86rem;
    font-weight: 600;
}

.app-main {
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-clearance) + constant(safe-area-inset-bottom));
    padding-bottom: calc(var(--bottom-nav-clearance) + env(safe-area-inset-bottom, 0px));
}

.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    padding: 28px 16px;
    padding-bottom: calc(28px + constant(safe-area-inset-bottom));
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.btn-brand {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.24);
}

.btn-brand:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    transform: translateY(-1px);
}

.btn-yellow {
    background: linear-gradient(135deg, #fde047, #facc15);
    color: #1f2937;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(250, 204, 21, 0.24);
    transition: all 0.25s ease;
}

.btn-yellow:hover {
    transform: translateY(-1px);
}

.bottom-nav {
    position: fixed;
    left: env(safe-area-inset-left, 0px);
    right: env(safe-area-inset-right, 0px);
    bottom: constant(safe-area-inset-bottom);
    bottom: env(safe-area-inset-bottom, 0px);
    width: auto;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 30;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.07);
}

.bottom-nav a {
    text-decoration: none;
    padding: 10px 4px;
    text-align: center;
    color: var(--text-sub);
    font-size: clamp(11px, 2.8vw, 12px);
    font-weight: 600;
    transition: all 0.2s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav a.active {
    color: #dc2626;
    font-weight: 700;
}

.app-card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 13px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.course-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.qr-image {
    width: 100%;
    max-width: 280px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 6px;
    background: #fff;
}

.payment-thumb {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.folder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    margin-right: 6px;
}

.live-frame {
    width: 100%;
    height: 72vh;
    border: 0;
    display: block;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid #d7deea;
    min-height: 44px;
    background: var(--surface-muted);
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.15);
    background: #fff;
}

label {
    font-size: 0.86rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: #991b1b;
}

h5,
h6 {
    margin-bottom: 0.55rem;
    font-weight: 800;
    color: #0f172a;
}

p.small,
.small {
    color: #64748b;
}

.hidden {
    display: none;
}

/* Home banner carousel (landscape) */
.app-card--flush {
    padding: 0;
}

.home-banner-wrap {
    border-radius: 18px;
    overflow: hidden;
}

.home-banner-carousel .home-banner-img {
    width: 100%;
    aspect-ratio: 21 / 9;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.home-banner-carousel--single .carousel-control-prev,
.home-banner-carousel--single .carousel-control-next,
.home-banner-carousel--single .carousel-indicators {
    display: none;
}

.home-banner-carousel .carousel-control-prev-icon,
.home-banner-carousel .carousel-control-next-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

/* Admin banner thumbs */
.banner-admin-thumb-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #f1f5f9;
}

.banner-admin-thumb {
    width: 100%;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    display: block;
}

/* Notification widget + list */
.notif-widget__list {
    margin-bottom: 0;
}

.notif-widget__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.notif-widget__item:last-child {
    border-bottom: none;
}

.notif-widget__item--unread .notif-widget__title {
    font-weight: 800;
    color: #0f172a;
}

.notif-widget__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.notif-card__body {
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.45;
}

.notif-card--read {
    opacity: 0.92;
}
