.user-info .user-name {
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.65);
    border-radius: 999px;
    font-weight: 600;
}

.user-info .btn-small {
    background: white;
    color: #0f172a;
}
/* ============================================
   RESET & BASE STYLES
   ============================================ */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-light: #f5f6fb;
    --bg-lighter: #ffffff;
    --surface-dark: #eceef6;
    --primary-navy: #14162b;
    --soft-cyan: #00bfff;
    --soft-cyan-glow: rgba(0, 191, 255, 0.25);
    --secondary-neon: #8a6bff;
    --accent-green: #2ad5a1;
    --text-dark: #11131b;
    --text-light: #5e6282;
    --border-color: #e1e5f3;
    --shadow: 0 25px 45px rgba(31, 38, 135, 0.12);
    --card-bg: #ffffff;
    --tab-bg: #ffffff;
    --header-bg: #ffffff;
    --header-text: #121212;
    --panel-bg: #ffffff;
    --panel-border: rgba(0,0,0,0.06);
    --select-arrow: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l7 7 7-7' stroke='%235e6282' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

body[data-theme="dark"] {
    --bg-light: #121212;
    --bg-lighter: #1c1c1c;
    --surface-dark: #1e1e1e;
    --primary-navy: #e3f4ff;
    --soft-cyan: #00f9ff;
    --soft-cyan-glow: rgba(0, 249, 255, 0.4);
    --secondary-neon: #8a6bff;
    --accent-green: #45ffb6;
    --text-dark: #ffffff;
    --text-light: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.12);
    --shadow: 0 25px 45px rgba(0,0,0,0.45);
    --card-bg: #161616;
    --tab-bg: #1d1d1d;
    --header-bg: #0f0f0f;
    --header-text: #ffffff;
    --panel-bg: #141414;
    --panel-border: rgba(255,255,255,0.08);
    --select-arrow: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l7 7 7-7' stroke='%23ffffff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    color: #ffffff;
    background-color: var(--bg-light);
}

/* Đảm bảo tất cả text trong dark mode đều sáng */
body[data-theme="dark"] * {
    color: inherit;
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] div,
body[data-theme="dark"] label,
body[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
    color: var(--text-dark) !important;
}

body[data-theme="dark"] .label,
body[data-theme="dark"] .detail-label,
body[data-theme="dark"] .stat-label,
body[data-theme="dark"] .event-details,
body[data-theme="dark"] .mini-weekdays {
    color: var(--text-light) !important;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6 {
    color: var(--text-dark) !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Đảm bảo các elements quan trọng có màu sáng trong dark mode */
body[data-theme="dark"] .stat-value,
body[data-theme="dark"] .date-value,
body[data-theme="dark"] .event-title,
body[data-theme="dark"] .timeline-title,
body[data-theme="dark"] .mini-month-name,
body[data-theme="dark"] .current-period,
body[data-theme="dark"] .day-number,
body[data-theme="dark"] .nav-btn {
    color: var(--text-dark) !important;
}

body[data-theme="dark"] .detail-row span:not(.detail-label),
body[data-theme="dark"] #detail-date,
body[data-theme="dark"] #detail-solar,
body[data-theme="dark"] #detail-lunar,
body[data-theme="dark"] #detail-note {
    color: var(--text-dark) !important;
}

body[data-theme="dark"] .card h2,
body[data-theme="dark"] .card h3,
body[data-theme="dark"] .detail-header h3,
body[data-theme="dark"] .timeline-header h4 {
    color: var(--text-dark) !important;
}

/* Footer và các elements khác */
body[data-theme="dark"] .app-footer {
    color: var(--text-light) !important;
}

body[data-theme="dark"] .app-footer a {
    color: var(--soft-cyan) !important;
}

/* Modal */
body[data-theme="dark"] .modal-content {
    color: var(--text-dark) !important;
}

body[data-theme="dark"] .modal-header h3 {
    color: var(--text-dark) !important;
}

body[data-theme="dark"] .modal-close {
    color: var(--text-light) !important;
}

body[data-theme="dark"] .modal-close:hover {
    color: var(--text-dark) !important;
}

/* Event items */
body[data-theme="dark"] .event-item-title,
body[data-theme="dark"] .event-item-content p,
body[data-theme="dark"] .event-item-content span {
    color: var(--text-dark) !important;
}

/* Timeline */
body[data-theme="dark"] .timeline-list li,
body[data-theme="dark"] .timeline-meta {
    color: var(--text-light) !important;
}

/* Settings */
body[data-theme="dark"] .setting-label,
body[data-theme="dark"] .help-text {
    color: #ffffff !important;
}

body[data-theme="dark"] .setting-row label,
body[data-theme="dark"] .setting-row-input label {
    color: #ffffff !important;
}

body[data-theme="dark"] .number-input,
body[data-theme="dark"] .time-input {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .number-input::placeholder,
body[data-theme="dark"] .time-input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body[data-theme="dark"] .auth-form .form-group label {
    color: #ffffff !important;
}

body[data-theme="dark"] .auth-form .form-group input {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .auth-form .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body[data-theme="dark"] .auth-form .form-group input:focus {
    border-color: rgba(0,191,255,0.9) !important;
    box-shadow: 0 10px 30px rgba(0,191,255,0.35) !important;
    background: rgba(255,255,255,0.15) !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .auth-form .btn-primary {
    background: linear-gradient(120deg, #00a6c6, #0b6ddf) !important;
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border: none;
}

/* Empty states */
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .events-empty-state,
body[data-theme="dark"] .detail-empty,
body[data-theme="dark"] .timeline-empty {
    color: var(--text-light) !important;
}

/* Calendar info trong login screen */
body[data-theme="dark"] .calendar-month,
body[data-theme="dark"] .calendar-lunar {
    color: rgba(255, 255, 255, 0.9) !important;
}

body[data-theme="dark"] .calendar-day {
    color: #ff6b6b !important;
}

/* Form labels */
body[data-theme="dark"] .form-group label {
    color: var(--text-dark) !important;
}

/* Buttons text */
body[data-theme="dark"] .btn-secondary {
    color: var(--text-dark) !important;
}

/* View mode buttons */
body[data-theme="dark"] .view-mode-btn {
    color: var(--text-light) !important;
}

body[data-theme="dark"] .view-mode-btn.active {
    color: #000000 !important;
}

/* Current period */
body[data-theme="dark"] .current-period {
    color: var(--text-dark) !important;
}

/* Weekday cells */
body[data-theme="dark"] .weekday-cell {
    color: var(--text-light) !important;
}

body[data-theme="dark"] .weekday-cell.weekend {
    color: var(--soft-cyan) !important;
}

.user-info {
    display: inline-flex;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.08);
    padding: 0.2rem;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.12);
    gap: 0.15rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

.user-info.hidden {
    display: none;
}

.user-info span,
.user-info .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 120px;
    text-transform: capitalize;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-info .user-name {
    background: rgba(15,23,42,0.15);
    color: #0f172a;
}

.user-info .btn-small {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15,23,42,0.15);
    box-shadow: 0 6px 14px rgba(15,23,42,0.1);
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: linear-gradient(120deg, rgba(255,255,255,0.92), rgba(247,250,255,0.9));
    color: var(--header-text);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
    border-bottom: 1px solid rgba(15,23,42,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.user-info {
    display: inline-flex;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.08);
    padding: 0.2rem;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.12);
    gap: 0.15rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

.user-info.hidden {
    display: none;
}

.user-info span,
.user-info .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 120px;
    text-transform: capitalize;
}

.user-info .user-name {
    background: rgba(15,23,42,0.18);
    color: #f9fafc;
}

.user-info .btn-small {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15,23,42,0.15);
    box-shadow: 0 6px 14px rgba(15,23,42,0.12);
}

.brand-identity {
    display: inline-flex;
    gap: 0.85rem;
    align-items: center;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    padding: 0;
    border: 2px solid rgba(0, 249, 255, 0.5);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

body[data-theme="dark"] .brand-logo {
    border: 2px solid rgba(0, 249, 255, 0.65);
    box-shadow: 0 12px 24px rgba(0,0,0,0.55);
}

.logo {
    font-size: clamp(1.3rem, 3vw, 1.65rem);
    font-weight: 700;
    color: var(--header-text);
}

body[data-theme="dark"] .logo {
    color: #ffffff !important;
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.08);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

body[data-theme="dark"] header {
    background: linear-gradient(120deg, rgba(17,24,39,0.95), rgba(5,8,15,0.92));
    border-bottom-color: rgba(255,255,255,0.08);
    box-shadow: 0 25px 60px rgba(0,0,0,0.65);
}

body[data-theme="dark"] .user-info {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

body[data-theme="dark"] .user-info .user-name {
    background: rgba(60, 60, 60, 0.9);
    color: #ffffff;
    font-weight: 600;
}

body[data-theme="dark"] .user-info .btn-small {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: rgba(0,0,0,0.08) !important;
    font-weight: 600;
}

body[data-theme="dark"] .user-info .btn-small:hover {
    background: #f0f0f0 !important;
    color: #000000 !important;
}

body[data-theme="dark"] .theme-switcher {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255,255,255,0.75);
}

@media (max-width: 720px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

.theme-switcher-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,0.65), rgba(230,238,255,0.9));
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 12px 35px rgba(13, 35, 64, 0.15);
    backdrop-filter: blur(14px);
}

@media (max-width: 600px) {
    .tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 36px;
        padding: 0.35rem;
        gap: 0.35rem;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .container {
        padding: 0.75rem;
    }

    .overview-card,
    .card {
        border-radius: 18px;
        box-shadow: 0 15px 40px rgba(13, 35, 64, 0.12);
    }

    .week-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .day-cell {
        min-height: 72px;
        padding: 0.65rem;
        border-radius: 14px;
        background: #ffffff;
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
        backdrop-filter: none;
    }

    body[data-theme="dark"] .day-cell {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    }

    .day-number {
        font-size: 1.25rem;
    }

    .lunar-number {
        font-size: 0.95rem;
        opacity: 0.95;
    }

    .day-cell.selected {
        background: linear-gradient(135deg, #00bfff, #0085ff);
        color: #ffffff;
        border: none;
        box-shadow: 0 15px 30px rgba(0, 133, 255, 0.35);
    }

    .day-cell.selected .day-number,
    .day-cell.selected .lunar-number {
        color: #ffffff;
    }

    .day-cell.today {
        border: 2px solid rgba(0, 133, 255, 0.8);
        background: rgba(0, 133, 255, 0.08);
    }

    .event-dot {
        width: 12px;
        height: 12px;
        bottom: auto;
        top: 10px;
        right: 10px;
        display: none;
    }

    .event-badges {
        display: flex;
    }
}

.tab-btn {
    position: relative;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.tab-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #00bfff, #0091ff);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.tab-btn:not(.active):hover {
    color: var(--primary-navy);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.tab-btn.active {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 15px 30px rgba(0, 145, 255, 0.3);
}

.tab-btn.active::after {
    opacity: 1;
}

.tab-btn:focus-visible {
    outline: 2px solid rgba(0, 191, 255, 0.65);
    outline-offset: 4px;
}

body[data-theme="dark"] .tabs {
    background: rgba(17, 25, 40, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .tab-btn:not(.active):hover {
    color: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

body[data-theme="dark"] .tabs {
    background: var(--tab-bg);
}

.card h2 {
    color: var(--primary-navy);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card h3 {
    color: var(--primary-navy);
    margin: 1rem 0 0.5rem;
    font-size: 1.1rem;
}

/* ============================================
   DATE DISPLAY
   ============================================ */
.date-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.solar-date,
.lunar-date {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-lighter);
    border-radius: 8px;
}

.label {
    font-weight: 500;
    color: var(--text-light);
}

.date-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-navy);
}

.date-value.highlight {
    color: var(--soft-cyan);
    font-size: 1.4rem;
}

/* ============================================
   SPECIAL ALERT
   ============================================ */
.special-alert {
    background: linear-gradient(135deg, var(--soft-cyan), var(--cream-yellow));
    color: #10223a;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    margin: 1rem 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    animation: pulse 2s infinite;
}

body[data-theme="dark"] .special-alert {
    background: linear-gradient(135deg, #0078c8, #6c4dff);
    color: #fdfbff;
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}

.special-alert.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ============================================
   EVENTS LIST
   ============================================ */
.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-item {
    background: var(--bg-lighter);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--soft-cyan);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: transform 0.2s ease;
}

.event-item:hover {
    transform: translateX(4px);
}

.event-info {
    flex: 1;
}

.event-title {
    font-weight: bold;
    color: var(--primary-navy);
    margin-bottom: 0.25rem;
}

.event-details {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.event-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.badge-lunar {
    background: var(--cream-yellow);
    color: var(--primary-navy);
}

.badge-solar {
    background: var(--soft-cyan);
    color: white;
}

.event-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   OVERVIEW CALENDAR
   ============================================ */
.overview-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.overview-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
}

.stat-card {
    border-radius: 4px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    overflow: hidden;
    min-width: 0;
}

body[data-theme="dark"] .stat-card {
    box-shadow: 0 15px 30px rgba(0,0,0,0.45), 0 0 20px rgba(0,249,255,0.08);
    border-color: rgba(0, 249, 255, 0.3);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-family: 'Roboto', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}

.view-mode-group {
    display: inline-flex;
    gap: 0.5rem;
    padding: 4px;
    border-radius: 999px;
    background: var(--bg-lighter);
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.view-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-light);
    padding: 0.45rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
    z-index: 1;
}

.view-mode-btn.active {
    background: var(--soft-cyan);
    color: #000000;
    box-shadow: 0 10px 20px rgba(0, 180, 204, 0.35);
}

.view-mode-btn:hover {
    opacity: 0.85;
}

.view-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 80px;
    border-radius: 999px;
    background: rgba(0, 180, 204, 0.12);
    pointer-events: none;
    transition: transform 0.3s ease, width 0.3s ease;
}

.period-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-dark);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: var(--soft-cyan);
    color: #0b0b0b;
    box-shadow: 0 10px 20px var(--soft-cyan-glow);
}

.current-period {
    font-weight: bold;
    color: var(--primary-navy);
    min-width: 160px;
    text-align: center;
}

.overview-body {
    width: 100%;
}

.calendar-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.insight-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
    animation: slideInRight 0.6s ease-out;
}

.calendar-container {
    border-radius: 24px;
    background: var(--tab-bg);
    padding: 0.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 30px rgba(0, 0, 0, 0.08);
}

.calendar-panels {
    position: relative;
    min-height: 420px;
    transition: filter 0.3s ease;
}

.calendar-panels.transitioning {
    filter: saturate(1.2) contrast(1.1);
}

.overview-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.overview-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    position: relative;
}

.overview-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.week-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.month-view {
    display: grid;
    grid-template-rows: auto 1fr;
}

.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: transparent;
    padding: 0 0.25rem;
}

.weekday-cell {
    text-align: center;
    padding: 0.7rem 0;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.78rem;
}

.weekday-cell.weekend {
    color: var(--soft-cyan);
}

.week-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0.4rem 0.25rem 0.75rem;
}

.week-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.day-cell {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    position: relative;
    aspect-ratio: 1 / 1;
}

body[data-theme="dark"] .day-cell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.day-cell:focus {
    outline: 2px solid var(--soft-cyan);
    outline-offset: 2px;
}

.week-view .day-cell {
    aspect-ratio: 1 / 1;
}

/* Removed duplicate - merged above */

.day-cell.weekend {
    background: rgba(0, 191, 255, 0.05);
}

body[data-theme="dark"] .day-cell.weekend {
    background: rgba(0, 249, 255, 0.16);
}

.day-cell:hover {
    border-color: var(--soft-cyan);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 191, 255, 0.25), 0 0 0 1px rgba(0, 191, 255, 0.1) inset;
}

.day-cell:hover .day-number {
    transform: scale(1.05);
}

body[data-theme="dark"] .day-cell:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 249, 255, 0.3), 0 0 0 1px rgba(0, 249, 255, 0.1) inset;
}

.day-cell:active {
    transform: scale(0.98);
}

.day-cell.empty {
    background: var(--bg-light);
    cursor: default;
}

.day-number {
    font-family: 'Roboto', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-navy);
    transition: transform 0.2s ease;
    line-height: 1.2;
}

.lunar-number {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
    opacity: 0.85;
    line-height: 1.3;
}

.day-cell.today {
    background: var(--soft-cyan);
    color: white;
    border: 2px solid var(--soft-cyan);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5), 0 0 50px rgba(59, 130, 246, 0.25);
    position: relative;
}

.day-cell.today::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--soft-cyan), rgba(59, 130, 246, 0.5), var(--soft-cyan));
    background-size: 200% 200%;
    z-index: -1;
    opacity: 0.6;
    animation: pulseGlow 2s ease-in-out infinite, gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}


body[data-theme="dark"] .lunar-number {
    color: rgba(255,255,255,0.9);
    opacity: 1;
}

.day-cell.today .day-number,
.day-cell.today .lunar-number,
.day-cell.today .event-dot {
    color: white;
}

.day-cell.selected {
    border: 2px solid rgba(0, 133, 255, 0.4);
    background: linear-gradient(135deg, rgba(3, 187, 255, 0.95), rgba(0, 134, 255, 0.85));
    box-shadow: 0 16px 32px rgba(0, 134, 255, 0.35);
    outline: none;
}

body[data-theme="dark"] .day-cell.selected {
    background: linear-gradient(135deg, rgba(0, 249, 255, 0.25), rgba(0, 180, 255, 0.2));
    border-color: rgba(0, 249, 255, 0.35);
    box-shadow: 0 16px 32px rgba(0, 249, 255, 0.25);
}

.day-cell.selected .day-number,
.day-cell.selected .lunar-number,
.day-cell.selected .event-dot {
    color: #ffffff;
}

.event-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    bottom: 6px;
    right: 6px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    border: 1.5px solid #fff;
    z-index: 3;
}

body[data-theme="dark"] .event-dot {
    border-color: rgba(0, 0, 0, 0.45);
}

.event-dot-personal {
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.85);
}

.event-dot-special {
    background: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.85);
}

.event-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    display: none;
    gap: 0.25rem;
    flex-wrap: wrap;
    z-index: 4;
}

.event-badge-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    color: #fff;
    background: var(--soft-cyan);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.event-badge-chip.badge-special {
    background: #ff4d6d;
}

.event-badge-chip.badge-personal {
    background: #f8b400;
}

body[data-theme="dark"] .event-dot-personal {
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.9);
}

body[data-theme="dark"] .event-dot-special {
    background: #ff6666;
    box-shadow: 0 0 10px rgba(255, 102, 102, 0.9);
}

#day-detail,
.timeline-card {
    transition: opacity 0.3s ease, transform 0.25s ease;
}

.detail-empty,
.timeline-empty {
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: var(--text-light);
    font-style: italic;
}

.detail-empty svg,
.timeline-empty svg {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

select option {
    background: var(--card-bg);
    color: var(--text-dark);
}

body[data-theme="dark"] select option {
    background: #0f1724;
    color: #f1f5ff;
}

.year-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.month-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.month-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--soft-cyan);
    box-shadow: 0 10px 18px rgba(0,0,0,0.12);
}

.month-card.active {
    border-color: var(--soft-cyan);
    background: rgba(0, 180, 204, 0.08);
}

.mini-month-name {
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 0.4rem;
}

.mini-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.mini-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.15rem;
}

.mini-day {
    font-size: 0.65rem;
    text-align: center;
    padding: 0.15rem 0;
    border-radius: 4px;
}

.mini-day.today {
    background: var(--soft-cyan);
    color: white;
}

.mini-day.selected {
    border: 1px solid var(--soft-cyan);
}

.day-detail {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: fadeIn 0.5s ease-out, slideInRight 0.6s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    transition: all 0.3s ease;
}

body[data-theme="dark"] .day-detail {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.detail-header h3 {
    margin: 0;
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.detail-label {
    min-width: 100px;
    font-weight: 600;
    color: var(--text-light);
}

#events-timeline {
    margin: 0;
    padding: 0;
}

.timeline-card {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    animation: fadeIn 0.5s ease-out 0.1s both, slideInRight 0.6s ease-out 0.1s both;
    transition: all 0.3s ease;
}

body[data-theme="dark"] .timeline-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.timeline-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary-navy);
}

.timeline-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.timeline-list li {
    position: relative;
    padding-left: 1.35rem;
}

.timeline-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--soft-cyan);
    box-shadow: 0 0 0 4px rgba(0, 180, 204, 0.15);
}

.timeline-title {
    font-weight: 600;
    color: var(--primary-navy);
}

.timeline-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.timeline-empty {
    color: var(--text-light);
    font-style: italic;
    padding-left: 0;
}

#detail-events {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

#detail-events li {
    min-width: 140px;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
}

/* ============================================
   TODAY EVENTS
   ============================================ */
.today-events {
    margin-top: 1.5rem;
}

.today-events ul {
    list-style: none;
    margin-top: 0.5rem;
}

.today-events li {
    padding: 0.75rem;
    background: var(--bg-lighter);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--soft-cyan);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--soft-cyan);
    color: #03212f;
    font-weight: 600;
}

.btn-primary:hover {
    background: #0099B0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

/* Dark mode cho nút Đăng nhập trong header */
body[data-theme="dark"] #login-btn.btn-primary.btn-small {
    background: #ffffff !important;
    color: #000000 !important;
    font-weight: 600;
    border: none;
    box-shadow: 0 6px 14px rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] #login-btn.btn-primary.btn-small:hover {
    background: #f0f0f0 !important;
    color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: var(--bg-lighter);
    color: var(--text-dark);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.debug-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(44, 62, 80, 0.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.1;
}

.debug-toggle--visible {
    opacity: 0.5;
}

.debug-toggle--active {
    background: #00B4CC;
    color: #2C3E50;
    opacity: 1;
}

.debug-toggle--hidden {
    opacity: 0;
    pointer-events: none;
}

.debug-toggle:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #C0392B;
}

.btn-edit {
    background: var(--cream-yellow);
    color: var(--primary-navy);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-edit:hover {
    background: #D4B55A;
}

/* ============================================
   SETTINGS
   ============================================ */
.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    flex: 1;
    font-weight: 500;
}

.setting-column {
    flex-direction: column;
    align-items: flex-start;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.setting-row-input {
    flex-wrap: wrap;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--soft-cyan);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.time-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    width: 150px;
}

.number-input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.app-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.app-footer a {
    color: var(--soft-cyan);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

.app-footer a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--soft-cyan);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.app-footer a:hover::after {
    transform: scaleX(1);
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes pulseGlow {
    0% { box-shadow: inset 0 0 0 2px var(--soft-cyan), 0 0 10px rgba(0, 180, 204, 0.2); }
    50% { box-shadow: inset 0 0 0 2px var(--soft-cyan), 0 0 25px rgba(0, 180, 204, 0.4); }
    100% { box-shadow: inset 0 0 0 2px var(--soft-cyan), 0 0 10px rgba(0, 180, 204, 0.2); }
}

@media (max-width: 768px) {
    .calendar-shell {
        background: transparent;
    }
    .week-stack {
        display: grid;
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 0.6rem;
        padding: 0.5rem;
    }
    .week-row {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.35rem;
    }
    .calendar-container {
        padding: 0.5rem;
        border-radius: 16px;
        box-shadow: none;
    }
    .day-cell {
        min-height: 68px;
        border-radius: 14px;
        box-shadow: 0 4px 14px rgba(0,0,0,0.08);
        padding: 0.4rem 0.35rem;
    }
    .overview-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .overview-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .calendar-shell {
        gap: 1rem;
    }
    .insight-panel {
        position: static;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    color: var(--text-dark);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-navy);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-navy);
}

/* Events Modal Styles */
.modal-body {
    padding: 1.5rem;
}

.events-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-item-modal {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-lighter);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.event-item-modal::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--soft-cyan);
    transition: width 0.3s ease;
}

.event-item-modal:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--soft-cyan);
}

.event-item-modal:hover::before {
    width: 6px;
}

.event-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 2px solid;
    background: rgba(0, 191, 255, 0.1);
    transition: all 0.3s ease;
}

.event-item-modal:hover .event-item-icon {
    transform: scale(1.1) rotate(5deg);
}

.event-item-content {
    flex: 1;
    min-width: 0;
}

.event-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    font-family: 'Roboto', sans-serif;
}

.event-item-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: 'Roboto', sans-serif;
}

.badge-special {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.badge-personal {
    background: rgba(0, 191, 255, 0.15);
    color: var(--soft-cyan);
    border: 1px solid rgba(0, 191, 255, 0.3);
}

.events-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-light);
}

.events-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

.events-empty-state p {
    font-size: 1rem;
    margin: 0;
    font-style: italic;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   AUTHENTICATION MODAL
   ============================================ */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.auth-tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.auth-tab-btn.active {
    background: var(--soft-cyan);
    color: #04212f;
    font-weight: 600;
}

.auth-tab-btn:hover:not(.active) {
    background: rgba(0, 191, 255, 0.1);
    color: var(--soft-cyan);
}

.error-message {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 3px solid #ff4444;
}

.error-message.hidden {
    display: none;
}

.auth-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.auth-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

body[data-theme="dark"] .event-item-modal {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .event-item-modal:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .event-item-icon {
    background: rgba(0, 249, 255, 0.15);
    border-color: rgba(0, 249, 255, 0.3);
}

/* ============================================
   FORM
   ============================================ */
#event-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-lighter);
    color: var(--text-dark);
    transition: border 0.25s ease, background 0.25s ease;
}

body[data-theme="dark"] .form-group input[type="text"],
body[data-theme="dark"] .form-group input[type="number"],
body[data-theme="dark"] .form-group input[type="time"],
body[data-theme="dark"] .form-group textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .form-group input[type="text"]::placeholder,
body[data-theme="dark"] .form-group input[type="number"]::placeholder,
body[data-theme="dark"] .form-group input[type="time"]::placeholder,
body[data-theme="dark"] .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body[data-theme="dark"] .form-group select {
    background-color: rgba(255, 255, 255, 0.08) !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-dark) !important;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem !important;
}

body[data-theme="dark"] .form-group:has(select)::after {
    border-top-color: #f7fbff !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
    opacity: 0.8;
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    background-image: none;
    cursor: pointer;
    position: relative;
}

/* Tạo arrow bằng CSS border trick - chỉ cho form-group có select */
.form-group:has(select)::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: calc(1.5rem + 0.5rem + 0.375rem); /* label height + margin-bottom + half of select padding */
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #5e6282;
    pointer-events: none;
    z-index: 2;
}

/* Đảm bảo select không bị override bởi các style khác */
.form-group select option {
    background: var(--bg-lighter);
    color: var(--text-dark);
    padding: 0.5rem;
}

body[data-theme="dark"] .form-group select option {
    background: #1c1c1c !important;
    color: #f7fbff !important;
}

/* Đảm bảo text trong select luôn đọc được - đã có ở trên, xóa duplicate */

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--soft-cyan);
    background: rgba(0, 180, 204, 0.07);
    box-shadow: 0 0 0 3px rgba(0, 180, 204, 0.15);
}

.form-group select:focus {
    outline: none;
    border-color: var(--soft-cyan);
    background-color: rgba(0, 180, 204, 0.07);
    background-image: none;
    box-shadow: 0 0 0 3px rgba(0, 180, 204, 0.15);
}

.form-group select:focus ~ .form-group::after,
.form-group:has(select:focus)::after {
    border-top-color: var(--soft-cyan);
}

body[data-theme="dark"] .form-group input:focus,
body[data-theme="dark"] .form-group textarea:focus {
    background: rgba(0, 180, 204, 0.12);
    box-shadow: 0 0 0 3px rgba(130, 207, 255, 0.25);
}

body[data-theme="dark"] .form-group select:focus {
    background-color: rgba(0, 249, 255, 0.15) !important;
    background-image: none !important;
    border-color: var(--soft-cyan);
    box-shadow: 0 0 0 3px rgba(0, 249, 255, 0.3);
    color: #f7fbff !important;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem !important;
}

body[data-theme="dark"] .form-group:has(select:focus)::after {
    border-top-color: var(--soft-cyan) !important;
}

.form-group textarea {
    resize: vertical;
}

.form-group .switch {
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .tabs {
        flex-direction: column;
    }
    
    .events-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .event-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .event-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .date-display {
        gap: 0.75rem;
    }
    
    .solar-date,
    .lunar-date {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .brand-identity {
        flex-direction: column;
    }
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at top, #f4f4f4 0%, #e1e4ec 45%, #c9d0e3 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.4s ease-out;
    overflow: hidden;
}

@media (max-width: 700px) {
    .login-screen {
        align-items: flex-start;
        overflow-y: auto;
    }
}

.login-screen::before {
    content: '';
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle, rgba(0,191,255,0.18), transparent 55%);
    filter: blur(60px);
    animation: auroraShift 12s ease-in-out infinite alternate;
    opacity: 0.9;
    z-index: -2;
}

.login-screen::after {
    content: '';
    position: absolute;
    inset: -25%;
    background-image:
        repeating-linear-gradient(transparent 0 36px, rgba(255,255,255,0.08) 36px 37px),
        repeating-linear-gradient(90deg, transparent 0 36px, rgba(0,0,0,0.05) 36px 37px),
        conic-gradient(from 90deg, rgba(44,62,80,0.15), transparent 35%, rgba(227,197,101,0.25));
    background-size: 100% 100%, 100% 100%, cover;
    opacity: 0.55;
    z-index: -3;
    animation: calendarGrid 24s linear infinite;
    mix-blend-mode: soft-light;
}

.login-screen.hidden {
    display: none;
}

.login-container {
    width: 100%;
    max-width: 960px;
    padding: 0;
}

.login-panel {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 35px 60px rgba(20, 36, 60, 0.25);
    padding: clamp(1.5rem, 3vw, 2.75rem);
    position: relative;
    overflow: hidden;
    animation: panelIntro 0.7s ease-out forwards;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    width: min(1100px, 95vw);
}

.login-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at top left, rgba(0, 191, 255, 0.08), transparent 55%);
    pointer-events: none;
}

.calendar-art {
    width: 360px;
    min-height: 380px;
    background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(230, 239, 255, 0.85));
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 25px 50px rgba(20,40,80,0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1.75rem 1.5rem;
    position: relative;
    overflow: hidden;
    animation: floatBloc 7s ease-in-out infinite;
    backdrop-filter: blur(6px);
}

.calendar-art::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 26px;
    border: 1px solid rgba(0,191,255,0.25);
    pointer-events: none;
    box-shadow: inset 0 0 25px rgba(0,191,255,0.15);
    }

.calendar-art::after {
    content: '';
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at top right, rgba(0,191,255,0.15), transparent 65%);
    animation: rotateGlow 18s linear infinite;
    opacity: 0.65;
    pointer-events: none;
}

.calendar-strap {
    background: linear-gradient(120deg, #c0392b, #ff8a4c);
    color: #fff;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    width: fit-content;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.calendar-strap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: translateX(-120%);
    animation: strapShine 4s ease-in-out infinite;
}

.calendar-flag {
    width: 22px;
    height: 14px;
    border-radius: 3px;
    background: #da251d;
    position: relative;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    animation: flagFlutter 4s ease-in-out infinite;
}

.calendar-flag::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #ffde00;
    clip-path: polygon(50% 0%, 61% 38%, 100% 38%, 68% 59%, 79% 100%, 50% 75%, 21% 100%, 32% 59%, 0% 38%, 39% 38%);
    transform: translate(-50%, -50%);
}

.calendar-date {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.calendar-day {
    font-size: 4rem;
    font-weight: 800;
    color: #b3261e;
    font-family: 'Playfair Display', serif;
    animation: popIn 0.65s ease-out;
    text-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.calendar-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: #2c3e50;
}

.calendar-month {
    font-weight: 600;
}

.calendar-weekday {
    font-size: 0.95rem;
    color: rgba(44, 62, 80, 0.75);
}

.calendar-lunar {
    font-size: 0.9rem;
    color: #b8860b;
}

.calendar-footer {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(44,62,80,0.7);
    border-top: 1px dashed rgba(0,0,0,0.08);
    padding-top: 0.75rem;
    letter-spacing: 0.02em;
}

.login-card {
    flex: 1;
    background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(245,250,255,0.85));
    border-radius: 26px;
    padding: 2.25rem;
    border: 1px solid rgba(255,255,255,0.7);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 25px 45px rgba(15,30,50,0.12);
    height: 640px;
}

.login-card .auth-tabs {
    display: inline-flex;
    background: rgba(44, 62, 80, 0.08);
    padding: 0.35rem;
    border-radius: 999px;
    gap: 0.5rem;
}

.login-card .auth-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.login-card .auth-tab-btn.active {
    background: linear-gradient(120deg, var(--soft-cyan), #09e0ff);
    color: #03212f;
    box-shadow: 0 10px 24px rgba(0, 191, 255, 0.3);
    transform: translateY(-1px);
}

.login-card .auth-tab-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-card .auth-tab-btn.active::after {
    opacity: 1;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    justify-content: space-between;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-form .form-group label {
    font-weight: 600;
    color: var(--primary-navy);
}

.login-form .form-group input {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 2px solid rgba(44,62,80,0.08);
    background: rgba(255,255,255,0.6);
    transition: border 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    z-index: 1;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: rgba(0,191,255,0.7);
    box-shadow: 0 8px 25px rgba(0, 191, 255, 0.25);
}

.login-form .form-group input::selection {
    background: rgba(0, 191, 255, 0.2);
}

.form-group.collapsible {
    overflow: hidden;
    max-height: 120px;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
}

.form-group.collapsible.hidden {
    display: block !important;
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.form-group.collapsible.hidden label {
    height: 0;
    margin: 0;
    overflow: hidden;
}

.form-group.collapsible.hidden input {
    height: 0;
    padding: 0;
    border: 0;
    margin: 0;
}

.login-card.register-mode {
    background: linear-gradient(155deg, rgba(255,255,255,0.98), rgba(0, 191, 255, 0.15));
    box-shadow: 0 30px 55px rgba(0, 170, 255, 0.25);
}

.login-form.is-register .form-group label,
.auth-form.is-register .form-group label {
    color: #0f3b57;
}

.login-form.is-register .form-group input,
.auth-form.is-register .form-group input {
    border-color: rgba(0, 191, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 191, 255, 0.15);
}

.login-form.is-register .btn-primary,
.auth-form.is-register .btn-primary {
    background: linear-gradient(120deg, #00b4cc, #00e0ff);
    box-shadow: 0 15px 30px rgba(0, 191, 255, 0.35);
}

#auth-modal .modal-content.register-mode {
    box-shadow: 0 35px 60px rgba(0, 191, 255, 0.25);
    border-color: rgba(0, 191, 255, 0.2);
}

body[data-theme="dark"] .login-panel {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(255,255,255,0.07);
    box-shadow: 0 40px 70px rgba(0,0,0,0.6);
}

body[data-theme="dark"] .calendar-art {
    background: rgba(20,20,20,0.95);
    border-color: rgba(227,197,101,0.5);
    box-shadow: inset 0 0 0 6px rgba(0,0,0,0.2);
}

body[data-theme="dark"] .calendar-info,
body[data-theme="dark"] .calendar-footer {
    color: rgba(244,244,244,0.85);
}

body[data-theme="dark"] .calendar-weekday {
    color: rgba(244,244,244,0.65);
}

body[data-theme="dark"] .login-card {
    background: linear-gradient(155deg, rgba(22,22,28,0.95), rgba(15,23,42,0.92));
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
}

body[data-theme="dark"] .login-card .auth-tabs {
    background: rgba(255,255,255,0.08);
}

body[data-theme="dark"] .login-card .auth-tab-btn {
    color: rgba(255, 255, 255, 0.8);
}

body[data-theme="dark"] .login-card .auth-tab-btn.active {
    background: linear-gradient(120deg, #00a6c6, #0b6ddf);
    color: #061224;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255,255,255,0.4);
    box-shadow: 0 12px 26px rgba(11, 109, 223, 0.35);
}

body[data-theme="dark"] .login-card .auth-tab-btn:focus-visible {
    outline: 2px solid rgba(0, 191, 255, 0.7);
    outline-offset: 2px;
}

body[data-theme="dark"] .login-card .auth-tab-btn::after {
    display: none;
}

body[data-theme="dark"] .login-form .form-group label {
    color: #ffffff !important;
    font-weight: 600;
}

body[data-theme="dark"] .login-form .form-group input {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.3) !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .login-form .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body[data-theme="dark"] .login-form .form-group input:focus {
    border-color: rgba(0,191,255,0.9) !important;
    box-shadow: 0 10px 30px rgba(0,191,255,0.35) !important;
    background: rgba(255,255,255,0.15) !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .login-form .btn-primary {
    background: linear-gradient(120deg, #00a6c6, #0b6ddf) !important;
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 18px 32px rgba(11,109,223,0.35);
    border: none;
}

body[data-theme="dark"] .login-form .btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
    color: #ffffff !important;
}

@media (max-width: 1024px) {
    header {
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .brand-identity {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.3rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }

    .tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 620px;
        margin: 1rem auto;
    }

    .login-panel {
        width: min(820px, 94vw);
    }
}

@media (max-width: 900px) {
    .login-panel {
        flex-direction: column;
        align-items: center;
        min-height: auto;
    }

    .calendar-art {
    width: 100%;
        max-width: 320px;
    }

    .login-card {
        height: 600px;
    }
}

@media (max-width: 600px) {
    .login-panel {
        padding: 1.5rem;
        min-height: auto;
}

    .login-card {
        padding: 1.5rem;
        height: 580px;
    }
}

@keyframes panelIntro {
    0% {
        opacity: 0;
        transform: translateY(32px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes floatBloc {
    0%, 100% {
        transform: translateY(0) rotate(-0.5deg);
    }
    50% {
        transform: translateY(-8px) rotate(0.5deg);
    }
}

@keyframes calendarGrid {
    0% {
        background-position: 0 0, 0 0, 0 0;
        transform: rotate(0deg) scale(1);
    }
    100% {
        background-position: 0 48px, 48px 0, 0 0;
        transform: rotate(360deg) scale(1.02);
    }
}

@keyframes strapShine {
    0% {
        transform: translateX(-140%);
    }
    40% {
        transform: translateX(140%);
    }
    100% {
        transform: translateX(140%);
}
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes flagFlutter {
    0%, 100% {
        transform: perspective(80px) rotateY(0deg);
    }
    50% {
        transform: perspective(80px) rotateY(8deg);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.65) translateY(20px);
    }
    60% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.main-app {
    width: 100%;
    min-height: 100vh;
}

.main-app.hidden {
    display: none;
}

@media (max-width: 480px) {
    .login-panel {
        padding: 1.25rem;
        border-radius: 20px;
        min-height: auto;
    }

    .calendar-art {
        min-height: auto;
    }
    
    .login-card {
        height: 560px;
    }
    
    .login-card .auth-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .login-card .auth-tab-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    header {
        padding: 0.65rem 0.75rem;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .user-info span,
    .user-info .btn-small {
        min-width: 100px;
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .tabs {
        grid-template-columns: 1fr;
    }

    .login-panel {
        padding: 1rem;
    }

    .login-card {
        padding: 1.25rem;
    }
}

/* ============================================
   DRAGON BACKGROUND ANIMATION - Con Rồng Cháu Tiên - Đã tắt
   ============================================ */
.dragon-background {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body[data-theme="dark"] .dragon-background {
    opacity: 0.25;
}

.dragon-svg {
    position: absolute;
    width: auto;
    height: auto;
    max-width: 800px;
    max-height: 500px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
}

/* Rồng 1 - Bay lượn chính giữa theo đường cong */
.dragon-1 {
    top: 15%;
    left: 5%;
    animation: dragonFlyLoop1 60s infinite ease-in-out;
    opacity: 0.9;
    will-change: transform, opacity;
}

/* Rồng 2 - Bay lượn góc trên phải */
.dragon-2 {
    top: 5%;
    right: 8%;
    width: 50%;
    height: auto;
    max-width: 500px;
    max-height: 350px;
    animation: dragonFlyLoop2 45s infinite ease-in-out;
    opacity: 0.6;
    animation-delay: -15s;
    will-change: transform, opacity;
}

body[data-theme="dark"] .dragon-svg {
    filter: drop-shadow(0 0 30px rgba(0, 249, 255, 0.5)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.3));
}

body[data-theme="dark"] .dragon-1 {
    opacity: 1;
}

body[data-theme="dark"] .dragon-2 {
    opacity: 0.7;
}

body[data-theme="dark"] .dragon-background {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.05), rgba(178, 34, 34, 0.08));
}

/* Animation rồng 1 - Bay lượn theo đường cong số 8 (infinity) mượt mà */
@keyframes dragonFlyLoop1 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.9;
    }
    8% {
        transform: translate(8vw, -8vh) rotate(15deg) scale(1.05);
        opacity: 0.95;
    }
    16% {
        transform: translate(18vw, -5vh) rotate(25deg) scale(1.1);
        opacity: 1;
    }
    24% {
        transform: translate(25vw, 3vh) rotate(20deg) scale(1.08);
        opacity: 0.95;
    }
    32% {
        transform: translate(28vw, 12vh) rotate(10deg) scale(1.05);
        opacity: 0.9;
    }
    40% {
        transform: translate(25vw, 20vh) rotate(-5deg) scale(1);
        opacity: 0.85;
    }
    48% {
        transform: translate(18vw, 25vh) rotate(-15deg) scale(0.95);
        opacity: 0.8;
    }
    56% {
        transform: translate(8vw, 25vh) rotate(-25deg) scale(0.9);
        opacity: 0.85;
    }
    64% {
        transform: translate(-5vw, 20vh) rotate(-20deg) scale(0.92);
        opacity: 0.9;
    }
    72% {
        transform: translate(-15vw, 12vh) rotate(-10deg) scale(0.95);
        opacity: 0.95;
    }
    80% {
        transform: translate(-20vw, 3vh) rotate(5deg) scale(0.98);
        opacity: 1;
    }
    88% {
        transform: translate(-18vw, -5vh) rotate(15deg) scale(1);
        opacity: 0.95;
    }
    96% {
        transform: translate(-8vw, -8vh) rotate(10deg) scale(0.98);
        opacity: 0.9;
    }
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.9;
    }
}

/* Animation rồng 2 - Bay lượn theo đường cong ngược (góc trên phải) */
@keyframes dragonFlyLoop2 {
    0% {
        transform: translate(0, 0) rotate(15deg) scale(0.8);
        opacity: 0.6;
    }
    16% {
        transform: translate(-8vw, 8vh) rotate(5deg) scale(0.85);
        opacity: 0.65;
    }
    32% {
        transform: translate(-12vw, -3vh) rotate(20deg) scale(0.9);
        opacity: 0.7;
    }
    48% {
        transform: translate(-10vw, -8vh) rotate(10deg) scale(0.88);
        opacity: 0.65;
    }
    64% {
        transform: translate(3vw, -10vh) rotate(-5deg) scale(0.85);
        opacity: 0.6;
    }
    80% {
        transform: translate(8vw, 5vh) rotate(8deg) scale(0.82);
        opacity: 0.55;
    }
    100% {
        transform: translate(0, 0) rotate(15deg) scale(0.8);
        opacity: 0.6;
    }
}

/* Animation các bộ phận rồng */
.dragon-body {
    animation: dragonBodyMove 4s ease-in-out infinite;
}

@keyframes dragonBodyMove {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(-2deg);
    }
    50% {
        transform: translateY(-15px) rotate(0deg);
    }
    75% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.dragon-head {
    animation: dragonHeadMove 3s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes dragonHeadMove {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-8px) rotate(-5deg) scale(1.02);
    }
    50% {
        transform: translateY(-10px) rotate(0deg) scale(1.05);
    }
    75% {
        transform: translateY(-8px) rotate(5deg) scale(1.02);
    }
}

.dragon-mouth {
    animation: dragonMouthMove 4s ease-in-out infinite;
}

@keyframes dragonMouthMove {
    0%, 100% {
        stroke-width: 2.5;
        opacity: 0.9;
    }
    50% {
        stroke-width: 3;
        opacity: 1;
    }
}

.dragon-tongue {
    animation: dragonTongueMove 3s ease-in-out infinite;
}

@keyframes dragonTongueMove {
    0%, 100% {
        transform: translateY(0px) scaleY(1);
    }
    50% {
        transform: translateY(2px) scaleY(1.2);
    }
}

.dragon-tooth {
    animation: dragonToothShine 2s ease-in-out infinite;
}

@keyframes dragonToothShine {
    0%, 100% {
        opacity: 0.95;
    }
    50% {
        opacity: 1;
    }
}

.dragon-fins {
    animation: dragonFinsWave 2.5s ease-in-out infinite;
}

@keyframes dragonFinsWave {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.dragon-mane {
    animation: dragonManeWave 3s ease-in-out infinite;
}

@keyframes dragonManeWave {
    0%, 100% {
        transform: translateX(0px);
        opacity: 0.75;
    }
    50% {
        transform: translateX(-3px);
        opacity: 0.9;
    }
}

.dragon-eye {
    animation: dragonEyeBlink 3s ease-in-out infinite;
}

@keyframes dragonEyeBlink {
    0%, 90%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    92%, 98% {
        opacity: 0.3;
        transform: scaleY(0.1);
    }
}

.dragon-tail {
    animation: dragonTailWave 2s ease-in-out infinite;
}

.dragon-tail-fin {
    animation: dragonTailFinWave 3s ease-in-out infinite;
}

@keyframes dragonTailWave {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(15deg);
    }
}

@keyframes dragonTailFinWave {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.85;
    }
    50% {
        transform: translateY(-20px) rotate(20deg) scale(1.1);
        opacity: 1;
    }
}

.dragon-whiskers {
    animation: dragonWhiskersMove 2.5s ease-in-out infinite;
}

@keyframes dragonWhiskersMove {
    0%, 100% {
        transform: translateX(0px);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-5px);
        opacity: 1;
    }
}

.dragon-scales {
    animation: dragonScalesMove 4s ease-in-out infinite;
}

@keyframes dragonScalesMove {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

.dragon-scale {
    animation: dragonScaleShine 3s ease-in-out infinite;
}

@keyframes dragonScaleShine {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.15) rotate(5deg);
    }
}

.dragon-fin {
    animation: dragonFinWave 2s ease-in-out infinite;
}

@keyframes dragonFinWave {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.85;
    }
    50% {
        transform: translateY(-8px) rotate(10deg);
        opacity: 1;
    }
}

.dragon-legs {
    animation: dragonLegsMove 3.5s ease-in-out infinite;
}

@keyframes dragonLegsMove {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Animation mây di chuyển */
.clouds {
    animation: cloudsMove 30s infinite linear;
}

@keyframes cloudsMove {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-20%);
    }
}

.cloud {
    animation: cloudFloat 8s ease-in-out infinite;
}

@keyframes cloudFloat {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-20px);
        opacity: 0.25;
    }
}

/* Responsive - Ẩn hoặc giảm opacity trên màn hình nhỏ */
@media (max-width: 768px) {
    .dragon-background {
        opacity: 0.1;
    }
    
    body[data-theme="dark"] .dragon-background {
        opacity: 0.15;
    }
    
    .dragon-1 {
        max-width: 600px;
        max-height: 400px;
    }
    
    .dragon-2 {
        display: none; /* Ẩn rồng 2 trên màn hình nhỏ */
    }
    
    @keyframes dragonFlyLoop1 {
        0% {
            transform: translate(0, 0) rotate(-5deg) scale(0.8);
        }
        25% {
            transform: translate(10vw, 5vh) rotate(5deg) scale(0.9);
        }
        50% {
            transform: translate(5vw, 10vh) rotate(-3deg) scale(0.85);
        }
        75% {
            transform: translate(-5vw, 5vh) rotate(3deg) scale(0.9);
        }
        100% {
            transform: translate(0, 0) rotate(-5deg) scale(0.8);
        }
    }
}

@media (max-width: 480px) {
    .dragon-background {
        opacity: 0.08;
    }
    
    body[data-theme="dark"] .dragon-background {
        opacity: 0.12;
    }
    
    .dragon-1 {
        max-width: 400px;
        max-height: 300px;
        animation-duration: 40s;
    }
    
    .dragon-2 {
        display: none;
    }
}

/* Hiệu ứng glow khi hover (optional) */
@media (hover: hover) {
    body:hover .dragon-background {
        opacity: 0.2;
        transition: opacity 0.5s ease;
    }
    
    body[data-theme="dark"]:hover .dragon-background {
        opacity: 0.3;
    }
}

/* ============================================
   UPCOMING EVENTS BANNER
   ============================================ */
.upcoming-events-banner {
    background: linear-gradient(135deg, var(--soft-cyan) 0%, #00a8cc 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.3s ease-out;
}

.upcoming-events-banner.hidden {
    display: none;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
    min-width: 0;
}

.banner-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.banner-subtitle {
    font-size: 0.875rem;
    opacity: 0.95;
}

.banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body[data-theme="dark"] .upcoming-events-banner {
    background: linear-gradient(135deg, #0084a8 0%, #006b8a 100%);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
}

@media (max-width: 768px) {
    .upcoming-events-banner {
        padding: 0.875rem 1rem;
    }
    
    .banner-icon {
        font-size: 1.25rem;
    }
    
    .banner-title {
        font-size: 0.9375rem;
    }
    
    .banner-subtitle {
        font-size: 0.8125rem;
    }
}