/* Bảng màu chủ đạo của Bánh Xe Số theo tiêu chuẩn Web 4.0 (Indigo & Gold/Amber) */
:root {
    --primary-color: #6366f1; /* Premium Indigo */
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.08);
    --secondary-color: #f59e0b; /* Warm Amber */
    --secondary-hover: #d97706;
    --secondary-light: rgba(245, 158, 11, 0.08);
    
    --bg-main: #f8fafc; /* Slate 50 */
    --bg-card: #ffffff;
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */
    --text-white: #ffffff;
    
    --border-color: #e2e8f0; /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(99, 102, 241, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-pulse: 0 0 0 0 rgba(99, 102, 241, 0.4);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Grid & Flex */
.grid {
    display: grid;
    gap: 32px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
    display: flex;
    align-items: center;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.flex-column {
    display: flex;
    flex-direction: column;
}
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Nút bấm (Buttons) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    color: var(--text-white);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #d97706);
    color: var(--text-white);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.btn-secondary:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-pulse {
    animation: pulse 2.5s infinite;
}

/* Sticky Header */
.header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    transition: var(--transition);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    font-size: 22px;
    color: var(--primary-hover);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-link {
    font-weight: 600;
    font-size: 15px;
    color: #334155; /* Slate 700 */
    position: relative;
    padding: 4px 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}
.nav-link:hover {
    color: var(--primary-hover);
}
.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    padding: 100px 0 120px 0;
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15) 0%, rgba(255, 255, 255, 0) 60%),
                radial-gradient(circle at 10% 80%, rgba(245, 158, 11, 0.1) 0%, rgba(255, 255, 255, 0) 50%),
                #f8fafc;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--primary-hover);
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.hero-title {
    font-size: 52px;
    font-weight: 900;
    line-height: 1.15;
    color: #0f172a; /* Slate 900 */
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 19px;
    color: #475569; /* Slate 600 */
    margin-bottom: 40px;
    max-width: 540px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-mockup {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -12px rgba(99, 102, 241, 0.12), 0 18px 36px -18px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transform: perspective(1000px) rotateY(-6deg) rotateX(6deg) translateZ(0);
    transition: var(--transition);
}
.hero-mockup:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) translateZ(10px);
    box-shadow: 0 40px 80px -12px rgba(99, 102, 241, 0.2), 0 20px 40px -20px rgba(0, 0, 0, 0.25);
}

.mockup-header {
    background-color: #0f172a;
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ef4444;
}
.dot:nth-child(2) { background-color: #fbbf24; }
.dot:nth-child(3) { background-color: #10b981; }

.mockup-body {
    padding: 28px;
    background: rgba(248, 250, 252, 0.85);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Features Section */
.section-title-wrapper {
    text-align: center;
    margin-bottom: 70px;
}

.section-tag {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: block;
}

.section-title {
    font-size: 38px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.features-section {
    padding: 110px 0;
    background-color: white;
}

.feature-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 44px 36px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
    transition: var(--transition);
}
.feature-card:hover .feature-icon-wrapper {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.feature-card-title {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 14px;
    color: #0f172a;
}

.feature-card-desc {
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
}

/* Pricing Section */
.pricing-section {
    padding: 110px 0;
    background-color: var(--bg-main);
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, rgba(255, 255, 255, 0) 70%), var(--bg-main);
}

.pricing-card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.pricing-card.popular {
    border: 2px solid var(--primary-color);
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.15);
}

.pricing-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--primary-hover);
    font-size: 11.5px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.plan-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 16px;
    color: #0f172a;
}

.plan-price {
    font-size: 38px;
    font-weight: 900;
    color: var(--primary-hover);
    margin-bottom: 14px;
    letter-spacing: -1px;
}

.plan-price span {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
}

.plan-desc {
    color: #475569;
    font-size: 14.5px;
    margin-bottom: 32px;
    min-height: 48px;
    line-height: 1.5;
}

.plan-features {
    list-style: none;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.plan-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #334155;
}

.plan-feature-icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.pricing-card .btn {
    margin-top: auto;
    width: 100%;
}

/* FAQs Section */
.faqs-section {
    padding: 110px 0;
    background-color: white;
}

.faqs-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--bg-main);
    transition: var(--transition);
}
.faq-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.faq-trigger {
    padding: 22px 28px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    color: #1e293b;
}

.faq-icon {
    font-size: 22px;
    transition: var(--transition);
    color: #64748b;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 28px;
    background-color: white;
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
}

.faq-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.04);
}

.faq-item.active .faq-trigger {
    color: var(--primary-hover);
    background-color: rgba(99, 102, 241, 0.02);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--primary-color);
}

.faq-item.active .faq-content {
    padding-bottom: 24px;
    padding-top: 10px;
    max-height: 250px; /* Sẽ được tính động bằng JS */
}

/* Footer Section */
.footer {
    background-color: #1a202c;
    color: #a0aec0;
    padding: 80px 0 40px 0;
    border-top: 1px solid #2d3748;
}

.footer-brand-title {
    color: white;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 280px;
}

.footer-title {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    font-size: 14px;
}
.footer-link:hover {
    color: var(--primary-color);
    padding-left: 4px;
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #2d3748;
    text-align: center;
    font-size: 13px;
}

/* Auth Pages (Login / Register) Layouts */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background-color: var(--bg-main);
}

.auth-card {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    display: inline-flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: #1a202c;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 15px;
    transition: var(--transition);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 159, 77, 0.15);
}

.form-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    accent-color: var(--primary-color);
}

.form-error {
    color: #e53e3e;
    font-size: 13px;
    margin-top: 4px;
}

.auth-button {
    width: 100%;
    margin-top: 10px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer-link {
    color: var(--primary-color);
    font-weight: 600;
}
.auth-footer-link:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background-color: #1a202c;
    color: #a0aec0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #2d3748;
}

.sidebar-menu {
    list-style: none;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    color: #a0aec0;
}
.sidebar-item:hover, .sidebar-item.active {
    background-color: #2d3748;
    color: white;
}

.sidebar-item.active {
    border-left: 4px solid var(--primary-color);
}

/* Sidebar Logout styling on desktop */
.sidebar-logout-wrap {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #2d3748;
}
.sidebar-logout-wrap .sidebar-item {
    color: #f87171 !important; /* clear, high-contrast bright red */
    background-color: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    font-weight: 600 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-logout-wrap .sidebar-item:hover {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-2px);
}
.sidebar-logout-wrap .sidebar-item:active {
    transform: translateY(0);
}

.main-content {
    background-color: var(--bg-main);
    padding: 40px;
    min-width: 0;
}

.trial-alert {
    background-color: var(--secondary-light);
    border: 1px solid var(--secondary-color);
    color: #c05621;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #1a202c;
    margin: 8px 0;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 171, 0, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(249, 171, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(249, 171, 0, 0);
    }
}

/* Responsive */
@media (max-width: 991px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero-section .container {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .hero-image {
        order: -1;
    }
    .hero-title {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    .nav-menu {
        display: none;
    }
    .hero-title {
        font-size: 32px;
    }
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    .dashboard-wrapper {
        grid-template-columns: minmax(0, 1fr);
        padding-bottom: 80px; /* Space for bottom nav */
        /* Sidebar là position:fixed → không chiếm không gian grid */
        grid-template-rows: auto;
    }
    .sidebar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 64px;
        background-color: var(--primary-color) !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        padding: 0 10px !important;
        z-index: 1000;
        border-radius: 0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    }
    .sidebar .logo-wrapper {
        display: none !important;
    }
    .sidebar-menu {
        display: flex;
        flex-direction: row !important;
        width: 100%;
        justify-content: space-around;
        gap: 0 !important;
        margin: 0 !important;
        align-items: center;
    }
    .sidebar-item {
        display: flex;
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        padding: 4px 2px !important;
        border-radius: 6px;
        font-size: 9px !important;
        gap: 2px !important;
        color: rgba(255, 255, 255, 0.75) !important;
        background: transparent !important;
        margin: 0 !important;
        white-space: normal;
        text-align: center;
        line-height: 1.1;
    }
    .sidebar-item span {
        display: inline-block;
        max-width: 55px;
        word-break: break-word;
        white-space: normal;
    }
    .sidebar-item.active {
        color: #ffffff !important;
        font-weight: 700;
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
    .sidebar-item svg {
        width: 18px;
        height: 18px;
        margin: 0 !important;
    }
    /* Logout item: thu nhỏ thành icon trong bottom nav trên mobile */
    .sidebar-logout-wrap {
        display: flex !important;
        margin-top: 0 !important;
        border-top: none !important;
        border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
        padding: 0 0 0 8px !important;
        margin-left: 6px !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    .sidebar-logout-wrap .sidebar-item {
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        background: rgba(239, 68, 68, 0.15) !important;
        border: 1.5px solid rgba(239, 68, 68, 0.4) !important;
        color: #f87171 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        transition: all 0.2s ease !important;
    }
    .sidebar-logout-wrap .sidebar-item:hover,
    .sidebar-logout-wrap .sidebar-item:active {
        background: #ef4444 !important;
        color: #ffffff !important;
        border-color: #ef4444 !important;
        transform: scale(1.05) !important;
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
    }
    /* Ẩn text label logout trên mobile — chỉ hiện icon */
    .sidebar-logout-wrap .sidebar-item span {
        display: none !important;
    }
    /* Sidebar-menu chiếm phần còn lại của bottom nav */
    .sidebar-menu {
        flex: 1 !important;
        width: auto !important;
        justify-content: space-evenly !important;
    }
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .main-content {
        padding: 16px !important;
        padding-bottom: 90px !important; /* 64px bottom nav + 26px extra */
    }

}


/* CCCD AI Scanner Modals & UI Components */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 480px;
    padding: 32px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.active .modal-card {
    transform: scale(1);
}
.modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 12px;
    text-align: center;
}
.modal-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    text-align: center;
}
.modal-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.choice-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    background: #f8fafc;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}
.choice-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    transform: translateY(-2px);
}
.choice-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}
.choice-btn:hover .choice-icon {
    background-color: var(--primary-color);
    color: #ffffff;
}
.choice-text-title {
    font-weight: 700;
    font-size: 15px;
    color: #1a202c;
}
.choice-text-desc {
    font-size: 12px;
    color: var(--text-muted);
}
.modal-close-btn {
    margin-top: 16px;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
}
.modal-close-btn:hover {
    color: #1a202c;
}

/* Loading State CSS */
.loading-spinner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.loading-pulse-ring {
    position: relative;
    width: 80px;
    height: 80px;
}
.loading-pulse-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0.15;
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
.loading-spinner {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes pulse-ring {
    0% {
        transform: scale(0.85);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    font-size: 16px;
    font-weight: 750;
    color: #1a202c;
    animation: pulse-opacity 1.5s ease-in-out infinite;
    text-align: center;
    min-height: 24px;
}
@keyframes pulse-opacity {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Form and alerts styling */
.toast-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background-color: #1a202c;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
}
.toast-notification.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.toast-success {
    border-left: 4px solid #10b981;
}
.toast-error {
    border-left: 4px solid #ef4444;
}
.form-row {
    margin-bottom: 16px;
}
.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.4;
}

/* Modal action buttons */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.modal-actions .btn {
    flex: 1;
    padding: 10px 16px;
}

@media (max-width: 576px) {
    .modal-overlay {
        align-items: flex-end; /* Align bottom sheets to the bottom of the screen */
    }
    .modal-card {
        width: 100%;
        max-width: 100% !important;
        margin: 0;
        border-radius: 20px 20px 0 0; /* Bo góc trên như sheet native */
        padding: 24px 20px 32px 20px;
        max-height: 92vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.94, 0.6, 1);
    }
    .modal-overlay.active .modal-card {
        transform: translateY(0) !important;
    }
    /* Thanh nắm kéo giả lập trên Mobile Bottom Drawer */
    .modal-card::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background-color: #cbd5e1;
        border-radius: 2px;
        margin: 0 auto 16px auto;
    }
    /* Cỡ chữ 16px để chống auto-zoom trên iOS */
    .form-input, select.form-input, textarea.form-input {
        font-size: 16px !important;
    }
    /* Xếp dọc nút bấm trên Mobile để dễ thao tác */
    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-actions .btn {
        width: 100% !important;
        padding: 12px 16px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   OWNER MANAGE WEB APP — Styles for /manage/* pages
   ═══════════════════════════════════════════════════════════════════════════ */

/* Page Header */
.manage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}
.manage-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: #1a202c;
    line-height: 1.2;
}
.manage-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Section Tabs */
.section-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}
.section-tab {
    flex: 1;
    text-align: center;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.section-tab.active {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.section-tab:hover:not(.active) {
    color: #4a5568;
}
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    margin-left: 5px;
    background: var(--primary-light);
    color: var(--primary-color);
}
.section-tab.active .tab-badge {
    background: var(--primary-color);
    color: white;
}

/* Room Cards Grid */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.room-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
    animation: cardFadeIn 0.3s ease forwards;
    position: relative;
    overflow: hidden;
}
.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--room-accent, #68d391);
    transition: var(--transition);
}
.room-card.occupied::before {
    background: #fc8181;
}
.room-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #c3dafe;
    transform: translateY(-2px);
}
.room-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.room-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}
.room-card-property {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.room-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.room-status-badge.vacant {
    background: #f0fff4;
    color: #276749;
}
.room-status-badge.occupied {
    background: #fff5f5;
    color: #c53030;
}
.room-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}
.room-status-badge.vacant .room-status-dot { background: #48bb78; }
.room-status-badge.occupied .room-status-dot { background: #fc8181; animation-play-state: running; }
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}
.room-card-info {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}
.room-card-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}
.room-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.room-card-actions .btn-action {
    flex: 1;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.btn-checkin {
    background: var(--primary-color);
    color: white;
}
.btn-checkin:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}
.btn-view-booking {
    background: #ebf8ff;
    color: #2b6cb0;
}
.btn-view-booking:hover {
    background: #bee3f8;
}
.btn-edit-room {
    background: #f1f5f9;
    color: #4a5568;
    padding: 9px !important;
}
.btn-edit-room:hover {
    background: #e2e8f0;
}

/* FAB Button */
.fab-btn {
    position: fixed;
    bottom: calc(72px + 16px);  /* Above bottom nav */
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(26,115,232,0.45);
    transition: var(--transition);
    z-index: 100;
    text-decoration: none;
}
.fab-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 24px rgba(26,115,232,0.55);
}
@media (min-width: 769px) {
    .fab-btn {
        bottom: 28px;
    }
}

/* Booking List */
.booking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.booking-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    animation: cardFadeIn 0.25s ease forwards;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
}
.booking-item:hover {
    border-color: #c3dafe;
    box-shadow: var(--shadow-sm);
    transform: translateX(3px);
}
.booking-item-left {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}
.booking-item-body {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 42px - 56px - 20px);
    overflow: hidden;
}
.booking-item-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.booking-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.booking-days-left {
    flex: 0 0 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    text-align: right;
}
.booking-days-left .days-num {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    color: #1a202c;
}
.booking-days-left .days-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Guest List */
.guest-search-bar {
    position: relative;
    margin-bottom: 16px;
}
.guest-search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
}
.guest-search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.guest-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.guest-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.guest-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    animation: cardFadeIn 0.2s ease forwards;
}
.guest-item:hover {
    border-color: #c3dafe;
    box-shadow: var(--shadow-sm);
}
.guest-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}
.guest-info {
    flex: 1;
    min-width: 0;
}
.guest-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.guest-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.guest-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    text-decoration: none;
}
.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-icon.danger:hover {
    background: #fff5f5;
    color: #c53030;
    border-color: #fc8181;
}

/* Property Cards */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.property-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    animation: cardFadeIn 0.3s ease forwards;
}
.property-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.property-card-banner {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}
.property-card-body {
    padding: 16px 20px 20px;
}
.property-card-name {
    font-size: 16px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 4px;
}
.property-card-address {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.property-card-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}
.property-stat {
    text-align: center;
}
.property-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
}
.property-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}
.property-card-actions {
    display: flex;
    gap: 8px;
}

/* Manage Form Layout */
.manage-form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 28px;
    max-width: 600px;
    margin: 0 auto;
}
.form-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Success/Error Flash */
.flash-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: cardFadeIn 0.3s ease;
}
.flash-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}
.flash-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

/* Animations */
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments for manage pages */
@media (max-width: 768px) {
    .room-grid { grid-template-columns: 1fr; }
    .property-grid { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .manage-header { margin-bottom: 16px; }
    .manage-header h1 { font-size: 20px; }
    .manage-header p { font-size: 13px; }
    .manage-form-card { padding: 20px 16px; border-radius: var(--radius-md); }
    .section-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Room card actions: stack vertically on very small screens */
    .room-card { padding: 16px; }
    .room-card-actions { flex-wrap: wrap; }
    .room-card-actions .btn-action { min-width: 0; }

    /* Booking item: compact on mobile */
    .booking-item { padding: 12px 14px; gap: 10px; }
    .booking-item-left { width: 36px; height: 36px; border-radius: 9px; font-size: 15px; }
    .booking-days-left .days-num { font-size: 16px; }

    /* Guest item: compact */
    .guest-item { padding: 12px 14px; }
    .guest-avatar { width: 38px; height: 38px; font-size: 14px; }
    .guest-name { font-size: 14px; }

    /* Property card banner smaller */
    .property-card-banner { height: 80px; }

    /* FAB stays above bottom nav */
    .fab-btn { bottom: calc(64px + 12px); right: 14px; width: 50px; height: 50px; }

    /* Manage header action button — smaller on mobile */
    .manage-header .btn { font-size: 13px; padding: 8px 14px; }
}

/* Extra small phones (< 380px) */
@media (max-width: 380px) {
    .section-tab { font-size: 11px; padding: 7px 6px; }
    .tab-badge { display: none; }
    .room-card-title { font-size: 14px; }
    .booking-item-title { font-size: 13px; }
}

/* Modals 4.0 Styles */
.policy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* Slate 900 translucent */
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.policy-modal.active {
    display: flex;
    opacity: 1;
}

.policy-modal-card {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.policy-modal.active .policy-modal-card {
    transform: translateY(0);
}

.policy-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.policy-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.policy-modal-close {
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.policy-modal-close:hover {
    color: #ef4444;
}

.policy-modal-body {
    padding: 28px;
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
}

.policy-modal-body h5 {
    font-size: 16px;
    font-weight: 750;
    color: #0f172a;
    margin-top: 20px;
    margin-bottom: 8px;
}

.policy-modal-body p {
    margin-bottom: 14px;
}

.policy-modal-body ul {
    margin-bottom: 14px;
    padding-left: 20px;
}


