:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-glow: rgba(14, 165, 233, 0.4);
    --bg-dark: #0f172a;
    --bg-gradient: radial-gradient(circle at top right, #1e293b, #0f172a);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-strong: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --line-green: #06C755;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --radius-lg: 24px;
    --radius-xl: 36px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Safe Area for iPhone */
.safe-area-top {
    height: env(safe-area-inset-top);
}

/* Global Centering Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center horizontally */
}

/* Header & Navigation */
.header-minimal {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.header-content {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0; /* Allow shrinking */
}

.brand-box img {
    height: 36px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub {
    color: var(--text-dim);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chip {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 100px;
    color: white !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.chip:visited { color: white !important; }

@media (max-width: 480px) {
    .header-minimal { padding: 10px 15px; }
    .brand-box img { height: 32px; }
    .brand-name { font-size: 1.1rem; }
    .brand-sub { font-size: 0.6rem; letter-spacing: 0.5px; }
    .chip { padding: 6px 12px; font-size: 0.75rem; }
    .header-minimal .chip span { display: none; } /* Only hide header chip labels on mobile */
}

.chip i { font-size: 0.9rem; }

/* Form Fields Fix for iOS/Safari */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
.input-field {
    min-height: 56px !important;
    padding: 14px 16px !important;
    display: flex;
    align-items: center;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 1rem;
    width: 100%;
}

input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
}

/* Card System */
.card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover {
    background: var(--glass-strong);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Success Overlay (Premium Full Screen) */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    display: none; /* Changed to display:none by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.success-overlay.active {
    display: flex;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.success-card {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    padding: 48px 32px;
    border-radius: var(--radius-xl);
    text-align: center;
    max-width: 440px;
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.6);
}

.success-overlay.active .success-card {
    transform: scale(1);
}

.success-icon {
    font-size: 5rem;
    color: #22c55e;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.4));
}

.success-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
}

.success-msg {
    color: var(--text-dim);
    margin-bottom: 40px;
    line-height: 1.6;
    font-size: 1.1rem;
}

/* Global Footer */
.footer-minimal {
    width: 100%;
    padding: 40px 24px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    opacity: 0.5;
    font-weight: 600;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
    padding: 10px 24px;
    border-radius: 100px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input:not([type="checkbox"]), select, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 18px;
    color: white;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.4);
    background: #0ba5e9;
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    width: 100%;
    background: #f1f5f9;
    color: #0f172a;
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    background: #334155;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .card { padding: 24px; }
    .brand-name { font-size: 1.2rem; }
    .nav-tabs { width: 100%; }
    .nav-tab { flex: 1; text-align: center; padding: 10px 12px; font-size: 0.85rem; }
}


    .bulletin-date { font-size: 0.8rem; }
}

/* Chip Modifiers */
.chip.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3);
}

.chip.danger:hover {
    background: #ef4444;
    color: white !important;
    border-color: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Portal & Bulletin Modernization */
.bulletin-section { width: 100%; margin-bottom: 30px; animation: slideDown 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.bulletin-card {
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 28px;
    padding: 24px;
}
.bulletin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.view-all-btn {
    background: rgba(14, 165, 233, 0.1); color: var(--primary); padding: 6px 14px; border-radius: 12px; 
    font-size: 0.8rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: all 0.3s;
}
.view-all-btn:hover { background: var(--primary); color: white; }

.carousel-viewport { overflow: hidden; position: relative; height: 60px; }
.carousel-track { display: flex; flex-direction: column; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

.bulletin-item {
    height: 60px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 16px; padding: 0 20px; display: grid; grid-template-columns: auto 1fr auto; 
    align-items: center; gap: 16px; cursor: pointer; box-sizing: border-box; flex-shrink: 0; transition: background 0.3s;
}
.bulletin-info {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0;
}
.bulletin-item:hover { background: rgba(255, 255, 255, 0.08); }
.bulletin-badge { font-size: 0.75rem; font-weight: 800; padding: 4px 12px; border-radius: 8px; color: white; text-align: center; }
.bulletin-badge .short-text { display: none; }
.bulletin-badge .full-text { display: inline; }
.bulletin-title { font-weight: 600; color: white; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.bulletin-date { font-size: 0.85rem; color: var(--text-dim); text-align: right; }

/* Switch System Dropdown */
.switch-menu {
    position: absolute; top: 120%; right: 0; background: #1e293b; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 12px; display: none; flex-direction: column; gap: 8px; z-index: 3000;
    width: 180px; box-shadow: 0 15px 30px rgba(0,0,0,0.5); animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.switch-item {
    padding: 12px; border-radius: 10px; display: flex; align-items: center; gap: 12px; color: white;
    text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: background 0.2s;
}
.switch-item:hover { background: rgba(255,255,255,0.05); color: var(--primary); cursor: pointer; }

/* Account Card & Centering */
.account-card { 
    background: var(--glass); border: 1px solid var(--glass-border); border-radius: 28px; 
    padding: 32px; margin-top: 40px; width: 100%; box-sizing: border-box; text-align: center; 
    display: flex; flex-direction: column; align-items: center; 
}
.footer-actions { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 100%; }

/* Modal List Alignment */
.modal-list-item { padding: 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: background 0.2s; display: grid; grid-template-columns: 75px 1fr 90px; align-items: center; gap: 16px; }
.modal-list-item:hover { background: rgba(255,255,255,0.03); }
.modal-badge-pill { font-size: 0.75rem; font-weight: 800; padding: 4px 10px; border-radius: 8px; color: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.modal-badge-pill .short-text { display: none; }

@media (max-width: 600px) {
    .bulletin-item { grid-template-columns: auto 1fr; padding: 12px 16px; height: auto; min-height: 64px; }
    .bulletin-info { flex-direction: column; align-items: flex-start; gap: 2px; }
    .bulletin-badge { width: 28px; height: 28px; flex-shrink: 0; }
    .bulletin-title { font-size: 0.95rem; white-space: normal; line-height: 1.3; }
    .bulletin-date { font-size: 0.75rem; opacity: 0.6; text-align: left; }
    .bulletin-arrow { display: none; }
    
    .modal-list-item { 
        grid-template-columns: 28px 1fr; 
        gap: 12px; 
        padding: 16px 8px;
    }
    .modal-list-item .item-info { display: flex; flex-direction: column; gap: 4px; }
    .modal-list-item .item-date { text-align: left !important; font-size: 0.75rem; opacity: 0.6; }
    
    .modal-badge-pill .full-text { display: none; }
    .modal-badge-pill .short-text { display: inline; }
    .modal-badge-pill { width: 26px; height: 26px; border-radius: 50%; padding: 0; justify-content: center; }
}

/* Modals & Overlays */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); z-index: 1000; 
    align-items: flex-start; justify-content: center; padding: 40px 20px; box-sizing: border-box; 
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: #1e293b; width: 100%; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 24px; padding: 32px; 
    position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); margin: auto;
    animation: modalIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.close-modal:hover { color: white; }

/* Menu Grid & Cards */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    margin-top: 20px;
}

.menu-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 32px 24px;
    border-radius: 28px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.menu-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: var(--glass-strong);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.4), 0 0 20px -5px var(--primary-glow);
}

.icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(-8deg);
}

.menu-label {
    font-weight: 800;
    font-size: 1.25rem;
}

/* Category Colors */
.bg-blue { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.bg-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.bg-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.bg-green { background: linear-gradient(135deg, #4ade80, #16a34a); }
.bg-admin { background: linear-gradient(135deg, #f43f5e, #be123c); }

.admin-link {
    grid-column: 1 / -1;
    background: rgba(244, 63, 94, 0.05);
    padding: 20px;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    border-radius: 28px;
}

@media (max-width: 900px) {
    .menu-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .menu-grid { gap: 16px; }
    .menu-card { padding: 24px 16px; border-radius: 24px; }
    .icon-wrapper { width: 60px; height: 60px; font-size: 1.6rem; }
    .menu-label { font-size: 1.1rem; }
}
