:root {
    --primary: #bd4778;
    --primary-dark: #96345f;
    --accent: #e58eae;
    --success: #31816e;
    --warning: #ae751e;
    --danger: #bb3d5a;
    --muted: #82727d;
    --bg: #fff8fb;
    --card: #ffffff;
    --line: #f0dfe7;
    --ink: #342632;
    --plum: #54283f;
    --rose-soft: #fff0f5;
    --shadow-card: 0 12px 34px rgba(90, 43, 67, 0.07);
}

* {
    scrollbar-color: #d7a1b7 #fff5f8;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(ellipse at 92% 8%, rgba(245, 204, 221, 0.3), transparent 28rem),
        linear-gradient(180deg, #fffafd 0%, #fff8fb 52%, #fffafb 100%);
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
    font-size: 0.96rem;
    line-height: 1.6;
}

body > .container.py-4 {
    flex: 1 0 auto;
    width: min(100% - 2rem, 1320px);
    max-width: 1320px;
    padding-top: 2rem !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    color: var(--ink);
    font-family: "Playfair Display", Georgia, serif;
    letter-spacing: -0.025em;
}

p {
    color: inherit;
}

a {
    color: var(--primary-dark);
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--primary);
}

:focus-visible {
    outline: 3px solid rgba(189, 71, 120, 0.38);
    outline-offset: 3px;
}

.site-navbar {
    position: relative;
    z-index: 10;
    padding: 0.72rem 0;
    background: linear-gradient(105deg, #51283f 0%, #69314f 62%, #873d63 100%);
    box-shadow: 0 8px 26px rgba(74, 34, 57, 0.17) !important;
}

.site-navbar .container {
    max-width: 1320px;
}

.site-navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff !important;
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.site-navbar .brand-logo {
    width: 3.15rem;
    height: 3.15rem;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: #f5f4ed;
    box-shadow: 0 3px 12px rgba(34, 17, 27, 0.24);
    object-fit: cover;
    object-position: center;
}

.site-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
    border-radius: 0.75rem;
}

.site-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 217, 231, 0.28);
}

.site-navbar .navbar-nav {
    gap: 0.2rem;
}

.site-navbar .nav-link {
    position: relative;
    padding: 0.55rem 0.8rem !important;
    border-radius: 0.75rem;
    color: rgba(255, 246, 250, 0.76) !important;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 160ms ease, background 160ms ease;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.13);
    color: #fff !important;
}

.site-navbar .nav-link.active::after {
    position: absolute;
    right: 0.8rem;
    bottom: 0.2rem;
    left: 0.8rem;
    height: 2px;
    border-radius: 2px;
    background: #f5b5cd;
    content: "";
}

.notification-count {
    display: inline-flex;
    min-width: 1.3rem;
    height: 1.3rem;
    align-items: center;
    justify-content: center;
    margin-left: 0.3rem;
    padding: 0 0.32rem;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: #f3b4cc;
    color: #54283f;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    vertical-align: 0.08em;
}

.site-navbar .text-white-50 {
    color: rgba(255, 246, 250, 0.82) !important;
    font-size: 0.9rem;
}

.site-navbar .badge.text-bg-light {
    color: var(--plum) !important;
    background: #ffe7f0 !important;
    letter-spacing: 0.06em;
}

.site-navbar .btn-light {
    border-color: #fff;
    color: var(--plum);
    font-weight: 700;
}

.site-navbar .btn-light:hover {
    border-color: #ffe7f0;
    background: #ffe7f0;
}

.card,
.feature,
.stat-card {
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background-color: var(--card);
    box-shadow: var(--shadow-card);
}

.card {
    overflow: hidden;
}

.stat-card {
    min-height: 130px;
    padding: 1.3rem;
    background: linear-gradient(145deg, #fff 20%, #fff6f9 100%);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px rgba(90, 43, 67, 0.11);
}

.stat-icon {
    display: inline-flex;
    width: 3.15rem;
    height: 3.15rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 1rem;
    background: linear-gradient(145deg, #d86d98, #ae3f70) !important;
    box-shadow: 0 7px 16px rgba(189, 71, 120, 0.2);
    color: #fff;
    font-size: 1.15rem;
}

.stat-icon.bg-success {
    background: linear-gradient(145deg, #65a997, #347b69) !important;
}

.stat-icon.bg-warning {
    background: linear-gradient(145deg, #e0b768, #bd8531) !important;
}

.stat-icon.bg-info {
    background: linear-gradient(145deg, #9b84b4, #77618e) !important;
}

.summary-table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #fff5f8;
}

.summary-table th,
.summary-table td {
    padding: 0.85rem;
    vertical-align: middle;
}

.table thead th {
    border-bottom: 1px solid #ecd7e1;
    background: #fff1f6;
    color: #765065;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    border-bottom-color: #f2e7ec;
}

.btn {
    border-radius: 0.75rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.bg-primary {
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
    color: #fff !important;
}

.btn-primary {
    padding: 0.65rem 1rem;
    box-shadow: 0 5px 13px rgba(189, 71, 120, 0.16);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--primary-dark) !important;
    background-color: var(--primary-dark) !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(150, 52, 95, 0.22);
}

.btn-outline-primary {
    border-color: #d99ab5;
    color: var(--primary-dark);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    border-color: #d9c7d0;
    color: #6b5361;
}

.btn-outline-secondary:hover {
    border-color: #826273;
    background: #826273;
    color: #fff;
}

.btn-outline-danger {
    border-color: #df9cad;
    color: var(--danger);
}

.btn-outline-danger:hover {
    border-color: var(--danger);
    background: var(--danger);
}

.btn-success {
    border-color: var(--success);
    background: var(--success);
}

.btn-outline-success {
    border-color: #8db9ad;
    color: #286d5c;
}

.btn-outline-success:hover {
    border-color: var(--success);
    background: var(--success);
}

.btn-link {
    color: var(--primary-dark);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.text-primary,
.link-primary {
    color: var(--primary) !important;
}

.text-muted,
.form-text {
    color: var(--muted) !important;
}

.badge {
    border-radius: 999px;
    padding: 0.45em 0.75em;
    font-weight: 650;
}

.badge.text-bg-primary-subtle,
.badge.bg-primary-subtle {
    background-color: #ffe6ef !important;
    color: #94345f !important;
}

.badge.bg-primary,
.text-bg-primary {
    background-color: var(--primary) !important;
}

.badge.bg-success,
.text-bg-success {
    background-color: var(--success) !important;
}

.badge.bg-warning,
.text-bg-warning {
    background-color: #f3e5c7 !important;
    color: #805514 !important;
}

.badge.bg-info,
.text-bg-info {
    background-color: #e9e1f1 !important;
    color: #65517d !important;
}

.alert {
    border: 1px solid transparent;
    border-radius: 0.9rem;
}

.alert-success {
    border-color: #c5e1d8;
    background: #eff8f4;
    color: #286d5c;
}

.alert-danger {
    border-color: #f1ced7;
    background: #fff2f5;
    color: #94354f;
}

.alert-warning,
.alert-info {
    border-color: #f0dfc2;
    background: #fff9ed;
    color: #76571d;
}

.form-label {
    margin-bottom: 0.4rem;
    color: #513b4a;
    font-size: 0.9rem;
    font-weight: 650;
}

.form-control,
.form-select {
    min-height: 2.85rem;
    border: 1px solid #e6d6df;
    border-radius: 0.75rem;
    background-color: #fff;
    color: var(--ink);
    padding: 0.7rem 0.85rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea.form-control {
    min-height: auto;
}

.form-control::placeholder {
    color: #aa99a3;
    opacity: 1;
}

.form-control:focus,
.form-select:focus {
    border-color: #d47c9f;
    box-shadow: 0 0 0 0.22rem rgba(189, 71, 120, 0.13);
}

.input-group > .btn {
    border-color: #e6d6df;
    color: #785b6b;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .btn:last-child {
    border-top-right-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    background: #fff7fa;
}

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    padding: 4rem 3rem;
    border: 1px solid rgba(255, 229, 239, 0.35);
    border-radius: 1.6rem;
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 224, 237, 0.32), transparent 24rem),
        radial-gradient(circle at 8% 100%, rgba(236, 144, 178, 0.2), transparent 24rem),
        linear-gradient(125deg, #51283f 0%, #853b60 53%, #bd5c84 100%);
    box-shadow: 0 24px 54px rgba(103, 45, 75, 0.2);
    color: #fff;
}

.hero::after {
    position: absolute;
    right: -4rem;
    bottom: -8rem;
    width: 23rem;
    height: 23rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 2rem rgba(255, 255, 255, 0.035), 0 0 0 4rem rgba(255, 255, 255, 0.025);
    content: "";
    pointer-events: none;
}

.hero h1 {
    max-width: 700px;
    margin-bottom: 1rem;
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.hero p {
    color: rgba(255, 247, 251, 0.9);
    font-size: 1.08rem;
}

.hero .btn-light {
    border-color: #fff;
    background: #fff;
    color: var(--plum);
}

.hero .btn-light:hover {
    border-color: #ffe5ef;
    background: #ffe5ef;
}

.hero .btn-outline-light:hover {
    border-color: #fff;
    color: var(--plum);
}

.feature {
    height: 100%;
    padding: 1.5rem;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 38px rgba(90, 43, 67, 0.11);
}

.feature-icon {
    display: inline-flex;
    width: 3.6rem;
    height: 3.6rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid #f3d9e4;
    border-radius: 1.1rem;
    background: linear-gradient(145deg, #fff0f5, #f8dce7);
    color: var(--primary);
    font-size: 1.45rem;
}

.feature h4 {
    margin-bottom: 0.55rem;
    font-size: 1.25rem;
}

.feature p {
    margin-bottom: 0;
    color: var(--muted);
}

.home-section {
    margin: 4rem 0;
}

.section-kicker {
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.section-title {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.home-summary {
    max-width: 440px;
    margin: 0 auto;
    padding: 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 1.25rem;
    background: rgba(255, 245, 250, 0.11);
    text-align: left;
    backdrop-filter: blur(12px);
}

.home-summary-heading {
    padding: 0.25rem 0.3rem 1rem;
    color: rgba(255, 240, 247, 0.78);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-summary-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.home-summary-stat span {
    color: rgba(255, 247, 251, 0.88);
}

.home-summary-stat strong {
    color: #fff;
    font-size: 1.65rem;
}

.event-preview {
    position: relative;
    display: flex;
    min-height: 300px;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: linear-gradient(155deg, #fff 50%, #fff7fa 100%);
    box-shadow: var(--shadow-card);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.event-preview:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(90, 43, 67, 0.12);
}

.event-preview-date {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    min-width: 3.35rem;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #f2d5e0;
    border-radius: 0.9rem;
    background: #fff0f5;
    color: var(--primary-dark);
    line-height: 1.1;
}

.event-preview-date span {
    font-size: 0.68rem;
    font-weight: 750;
    text-transform: uppercase;
}

.event-preview-date strong {
    margin-top: 0.15rem;
    font-size: 1.35rem;
}

.event-preview > .badge {
    align-self: flex-start;
    margin-right: 4rem;
}

.event-preview h2,
.event-preview h3 {
    margin: 0.2rem 4rem 0.6rem 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.event-preview > p {
    color: var(--muted);
}

.event-preview-meta {
    display: grid;
    gap: 0.45rem;
    margin-top: auto;
    color: #685766;
    font-size: 0.9rem;
}

.event-preview-meta i {
    width: 1rem;
    color: var(--primary);
}

.event-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

.event-preview-footer a {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.event-preview-footer a:hover {
    color: var(--primary);
}

.empty-events {
    padding: 3rem 1rem;
    border: 1px dashed #dfbdcc;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.65);
    color: var(--muted);
    text-align: center;
}

.empty-events i {
    margin-bottom: 0.8rem;
    color: #c583a1;
    font-size: 2rem;
}

.empty-events h3 {
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 700;
}

.notification-list {
    display: grid;
    gap: 0.8rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 7px 22px rgba(90, 43, 67, 0.045);
}

.notification-item.is-unread {
    border-color: #e7bfd0;
    background: linear-gradient(110deg, #fff5f8, #fff 58%);
    box-shadow: 0 8px 24px rgba(189, 71, 120, 0.075);
}

.notification-icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #f1d7e2;
    border-radius: 0.9rem;
    background: #fff0f5;
    color: var(--primary);
    font-size: 1.05rem;
}

.notification-content {
    min-width: 0;
    flex: 1 1 auto;
}

.notification-content h2 {
    color: var(--ink);
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -0.015em;
}

.notification-content > p {
    color: #665462;
}

.notification-unread-label {
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: #ffe6ef;
    color: #94345f;
    font-size: 0.7rem;
    font-weight: 750;
}

.notification-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.notification-meta a {
    font-weight: 650;
    text-decoration: none;
}

.notification-action {
    flex: 0 0 auto;
}

.home-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin: 4rem 0 1rem;
    padding: 2.5rem;
    border: 1px solid #f0d8e3;
    border-radius: 1.35rem;
    background:
        radial-gradient(circle at 90% 15%, rgba(255, 255, 255, 0.9), transparent 18rem),
        linear-gradient(120deg, #fff0f5, #f9eaf1 65%, #f5e3ed);
}

.home-cta h2 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.home-cta > div > p:last-child {
    color: var(--muted);
}

.login-panel {
    max-width: 540px;
    margin: 2.5rem auto;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 55px rgba(90, 43, 67, 0.1);
}

.login-panel .display-6 {
    display: grid;
    width: 3.7rem;
    height: 3.7rem;
    margin: 0 auto 0.85rem;
    place-items: center;
    border: 1px solid #f1d7e2;
    border-radius: 1.15rem;
    background: #fff0f5;
    color: var(--primary);
    font-size: 1.45rem;
}

.login-panel h2 {
    margin-bottom: 0.4rem;
    font-size: 2rem;
    font-weight: 700;
}

.login-panel .form-text {
    font-size: 0.8rem;
}

.login-panel a {
    font-weight: 650;
}

.pass-card {
    height: 100%;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: linear-gradient(160deg, #fff 60%, #fff3f7);
    box-shadow: var(--shadow-card);
}

.pass-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.pass-card-heading > div > span {
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.pass-card-heading h2 {
    margin: 0.35rem 0 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.pass-card-heading > i {
    color: var(--primary);
    font-size: 1.5rem;
}

.pass-details {
    display: grid;
    gap: 0.7rem;
    margin: 1rem 0;
}

.pass-details > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.pass-details dt {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.pass-details dd {
    margin: 0;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
}

.pass-qr {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    padding: 1rem;
    border: 1px dashed #dfbdcc;
    border-radius: 0.9rem;
    background: #fffafd;
}

.qr-render {
    display: grid;
    min-height: 180px;
    place-items: center;
}

.student-attendance-qr {
    border-color: #ead9e1 !important;
    border-radius: 1.15rem !important;
    box-shadow: 0 12px 32px rgba(90, 43, 67, 0.1);
}

.student-attendance-qr .qr-render {
    min-height: 220px;
}

.pass-pending {
    padding: 1rem;
    border: 1px solid #f0dfc2;
    border-radius: 0.9rem;
    background: #fff9ed;
    color: #805514;
    font-size: 0.9rem;
}

.qr-camera {
    display: block;
    width: min(100%, 520px);
    max-height: 360px;
    border: 3px solid #f0dfe7;
    border-radius: 1rem;
    background: #2f1e2a;
    object-fit: cover;
}

.footer {
    flex-shrink: 0;
    margin-top: 3rem;
    border-top: 1px solid #f0dfe7;
    background: rgba(255, 255, 255, 0.72);
}

.footer .text-muted {
    color: #8b7884 !important;
    font-size: 0.85rem;
}

.letter-spacing {
    letter-spacing: 0.25em;
}

@media (max-width: 991.98px) {
    .site-navbar .navbar-collapse {
        padding-top: 0.8rem;
    }

    .site-navbar .navbar-nav {
        padding: 0.5rem 0;
    }

    .site-navbar .text-white-50 {
        flex-wrap: wrap;
        padding: 0.6rem 0;
    }
}

@media (max-width: 767.98px) {
    body > .container.py-4 {
        width: min(100% - 1.25rem, 1320px);
        padding-top: 1.25rem !important;
    }

    .hero {
        padding: 2.5rem 1.4rem;
        border-radius: 1.2rem;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 10vw, 3rem);
    }

    .home-cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.6rem;
    }

    .home-section {
        margin: 3rem 0;
    }

    .login-panel {
        margin: 1rem auto;
    }

    .summary-table th,
    .summary-table td {
        padding: 0.7rem;
    }

    .notification-item {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1rem;
    }

    .notification-action {
        width: 100%;
        padding-left: 3.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .no-print,
    .site-navbar,
    .footer {
        display: none !important;
    }

    body {
        background: white;
        color: #111;
    }

    .card,
    .stat-card,
    .feature {
        border: 1px solid #dfe3ea !important;
        box-shadow: none !important;
    }
}
