:root {
    --bg-dark: #0b1120;
    --scout-navy: #003366;
    --scout-purple: #7413dc;
    --scout-purple-glow: rgba(116, 19, 220, 0.35);
    --teal-accent: #00a79d;
    --emerald-green: #10b981;
    --rose-red: #ef4444;
    --amber-warning: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bg-hover: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-border-glow: rgba(255, 255, 255, 0.28);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(116, 19, 220, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(0, 167, 157, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 50% 85%, rgba(0, 51, 102, 0.28) 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.95) 0%, #080d1a 100%);
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    color: var(--text-primary);
    text-align: center;
    padding: 30px 20px 50px;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 960px;
    margin: 0 auto 35px;
    padding: 0 5px;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.nav-pill:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--glass-border-glow);
    transform: translateY(-2px);
}

.nav-pill:active {
    transform: translateY(0);
}

.nav-pill.danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fecaca;
}

.nav-pill.danger:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ffffff;
}

/* Glass Cards Grid */
.main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Glass Card */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-glow);
    transform: translateY(-6px);
    box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.5), 0 0 25px rgba(116, 19, 220, 0.2);
}

.glass-card:active {
    transform: translateY(-2px);
}

.glass-card.primary::before {
    background: linear-gradient(90deg, #003366, #7413dc, #00a79d);
}

.glass-card.secondary::before {
    background: linear-gradient(90deg, #7413dc, #c084fc);
}

.glass-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* SVG Icon Badge inside Card */
.icon-badge {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.glass-card:hover .icon-badge {
    transform: scale(1.08);
    box-shadow: 0 10px 25px rgba(116, 19, 220, 0.4);
    border-color: rgba(255, 255, 255, 0.35);
}

.icon-svg {
    width: 32px;
    height: 32px;
}

.icon-svg-sm {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.glass-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.glass-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Center Box (PIN screen, dialogs) */
.center-box {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    margin: 40px auto;
    max-width: 460px;
    box-shadow: 0 18px 50px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.center-box h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.center-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1rem;
}

/* Section Selection Grid */
.grid-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 520px;
    margin: 25px auto;
}

.btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(116, 19, 220, 0.35), rgba(0, 51, 102, 0.4));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 22px 24px;
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
}

.btn-large:hover {
    background: linear-gradient(135deg, rgba(116, 19, 220, 0.55), rgba(0, 167, 157, 0.4));
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(116, 19, 220, 0.35);
}

.btn-large:active {
    transform: translateY(0);
}

.btn-large .small-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Member Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
    margin-top: 25px;
}

.member-card {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 20px 14px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.member-card:not(.attended):not(.absent):hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--glass-border-glow);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}

.avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #7413dc, #a855f7);
    color: #ffffff;
    border-radius: 50%;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(116, 19, 220, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.member-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    word-break: break-word;
}

/* Checked In / Absent states */
.member-card.attended {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
    cursor: default;
}

.member-card.attended .avatar {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.member-card.absent {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
    cursor: default;
}

.member-card.absent .avatar {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.status-pill {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 999px;
}

.status-pill.success {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-pill.danger {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Inputs & Form Elements */
input[type="tel"].pin-input {
    font-size: 2.2rem;
    letter-spacing: 8px;
    text-align: center;
    width: 85%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    color: #ffffff;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) inset;
    transition: all 0.25s ease;
}

input[type="tel"].pin-input:focus {
    border-color: #a855f7;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
}

input[type="text"], input[type="date"] {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 1.1rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

input[type="text"]:focus, input[type="date"]:focus {
    border-color: #a855f7;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.35);
}

/* Submit Buttons */
.btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    padding: 16px 28px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45);
}

.btn-confirm:active {
    transform: translateY(0);
}

/* Checkboxes & Form Rows */
.checklist-section {
    text-align: left;
    margin: 24px 0 12px;
}

.checklist-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-row {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.check-row:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.check-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #10b981;
    margin-right: 14px;
    cursor: pointer;
}

.check-row span {
    font-size: 1.05rem;
    font-weight: 500;
    color: #f1f5f9;
}

/* Alerts & Notifications */
.alert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin: 0 auto 24px;
    max-width: 600px;
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.alert.error {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fecaca;
}

.alert.warning {
    background: rgba(245, 158, 11, 0.25);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fef3c7;
}

.alert.success {
    background: rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #d1fae5;
}

/* Calendar iFrame Container */
.iframe-container {
    width: 100%;
    height: 75vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Evening Plan / Programme Styles */
.plan-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.35);
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.plan-header-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #ffffff, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 4px;
}

.meeting-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(116, 19, 220, 0.25);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
    font-size: 0.95rem;
    font-weight: 600;
}

.meeting-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 14px;
    margin-bottom: 20px;
    scrollbar-width: thin;
}

.meeting-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.meeting-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.meeting-pill.active {
    background: linear-gradient(135deg, rgba(116, 19, 220, 0.5), rgba(0, 167, 157, 0.4));
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(116, 19, 220, 0.3);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .plan-grid {
        grid-template-columns: 1fr;
    }
}

.plan-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: left;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.plan-card.full-width {
    grid-column: 1 / -1;
}

.plan-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.plan-card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.plan-card-header .icon-badge-sm {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.plan-card-body {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #e2e8f0;
    word-break: break-word;
}

.plan-card-body p {
    margin: 0 0 10px;
}

.plan-card-body p:last-child {
    margin-bottom: 0;
}

.plan-card-body ul, .plan-card-body ol {
    margin: 0 0 12px 22px;
    padding: 0;
    text-align: left;
}

.plan-card-body li {
    margin-bottom: 6px;
}

.empty-notice {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
}

/* Risk Assessment Card & Hazard Elements */
.plan-card.risk-card {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 10px 30px -5px rgba(245, 158, 11, 0.15);
}

.plan-card.risk-card .icon-badge-sm {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.hazard-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 12px;
}

.hazard-card:last-child {
    margin-bottom: 0;
}

.hazard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.hazard-title strong {
    font-size: 1.05rem;
    color: #ffffff;
}

.hazard-source {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-left: 6px;
    font-style: italic;
}

.hazard-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fef3c7;
    white-space: nowrap;
}

.hazard-at-risk {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.hazard-controls {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e2e8f0;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 6px;
}

.hazard-controls strong {
    display: block;
    margin-bottom: 4px;
    color: #fbbf24;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.risk-item:last-child {
    margin-bottom: 0;
}

.risk-item a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.risk-item a:hover {
    text-decoration: underline;
}

/* Timetable schedule row */
.schedule-item {
    display: flex;
    gap: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #a855f7;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 10px;
    align-items: flex-start;
}

.schedule-item:last-child {
    margin-bottom: 0;
}

.schedule-time {
    font-weight: 700;
    font-size: 0.95rem;
    color: #c084fc;
    min-width: 65px;
}

.schedule-details h4 {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 4px;
}

.schedule-details p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
