
:root {
    --bg-light: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-card-hover: #ffffff;
    --color-primary: #2563eb; /* Modern flat blue */
    --color-secondary: #7c3aed; /* Modern purple */
    --color-gold: #d97706; /* Flat amber gold */
    --color-gold-hover: #b45309;
    --color-text: #0f172a; /* Slate 900 */
    --color-text-muted: #475569; /* Slate 600 */
    --color-border: #e2e8f0; /* Slate 200 */
    --color-border-hover: #cbd5e1; /* Slate 300 */
    --color-success: #059669;
    --color-error: #dc2626;
    --font-heading: 'Outfit', 'Be Vietnam Pro', sans-serif;
    --font-body: 'Inter', 'Be Vietnam Pro', sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-flat: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --shadow-flat-hover: 0 6px 16px -4px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-light);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold);
}

/* Wrapper and Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2.5rem 1.25rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Navigation Header */
header {
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.25rem;
}

.logo a {
    color: var(--color-gold);
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--color-text);
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
}

nav a:hover, nav a.active {
    color: var(--color-gold);
    background-color: rgba(217, 119, 6, 0.06);
}

/* Nav Dropdown (Kiến Thức > Tử Vi, Phong Thuỷ) */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0;
    padding: 0.5rem;
    min-width: 160px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-flat-hover);
    z-index: 20;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    white-space: nowrap;
}

/* Mobile Bottom Navigation — hidden on desktop, shown fixed at the bottom on mobile (see @media 768px). */
.mobile-bottom-nav {
    display: none;
}

/* User Nav & Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: var(--color-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
}

.btn-user-menu:hover, .btn-user-menu.active {
    background: var(--color-gold);
    color: #ffffff;
    border-color: var(--color-gold);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.nav-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-gold);
    background: #1e1b4b;
}

/* Hamburger mobile menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    margin-left: auto;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
}

/* Footer styling */
footer {
    background-color: rgba(248, 250, 252, 0.88);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 1.25rem 0.75rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--color-gold);
}

/* Alerts / Notifications */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--color-gold);
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: var(--color-gold-hover);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.btn-secondary {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background-color: var(--bg-subtle);
    border-color: var(--color-border-hover);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Cards & Forms styles */
.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-flat);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-flat-hover);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

/* Grid perimeters & Horoscope layouts */
.horoscope-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chart-wrapper {
    width: min(750px, 100%);
    aspect-ratio: 750 / 960;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.chart-grid {
    transform: scale(var(--chart-scale, 1));
    transform-origin: top left;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    width: 750px;
    height: 960px;
    min-width: 750px;
    max-width: 750px;
    min-height: 960px;
    max-height: 960px;
    background-color: #475569;
    border: 2px solid #334155;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    position: relative;
}

.house {
    background-color: rgba(255, 255, 255, 0.96);
    border: none;
    padding: 5px 5px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.house:hover {
    background-color: #f8fafc;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.03);
}

.house-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    line-height: 1.2;
    margin-bottom: 2px;
}

.house-month {
    color: var(--color-text-muted);
}

.house-age {
    font-weight: bold;
    color: #0f172a;
    font-size: 0.78rem;
}

.center-info-grid {
    font-size: 0.8rem;
}

.center-info-grid > div:nth-child(even) {
    font-size: 0.85rem;
    font-weight: 800;
    color: #d97706;
}

.house-van-marks {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 4px;
    margin: 1px 0;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
}
.van-mark-tieu { color: #2563eb; }

.house-age-active {
    display: inline-block;
    min-width: 1.6em;
    padding: 0 3px;
    text-align: center;
    border: 2px solid #dc2626;
    border-radius: 50%;
    line-height: 1.35;
}

.phi-hoa { font-weight: 800; }
.phi-hoa-loc { color: #059669; }
.phi-hoa-quyen { color: #2563eb; }
.phi-hoa-khoa { color: #7c3aed; }
.phi-hoa-ky { color: #dc2626; }

.house-main-stars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 2px 0;
    text-align: center;
    line-height: 1.2;
}

.star-main {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.house-columns {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin: 2px 0;
    overflow-y: hidden;
    max-height: 155px;
    min-height: 0;
    scrollbar-width: none;
}
.house-columns::-webkit-scrollbar {
    display: none;
}

.star-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
}

.col-left {
    text-align: left;
    padding-right: 1px;
}

.col-right {
    text-align: left;
    padding-left: 10px;
}

.star-sub {
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
}

.house-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    border-top: none;
    padding-top: 2px;
    margin-top: 1px;
}

.house-branch-badge {
    color: #475569;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}

.house-truongsinh {
    font-size: 0.75rem;
    font-weight: 800;
    color: #0f172a;
}

.house-name-badge {
    font-weight: bold;
    color: #dc2626;
}

/* Boundary Badges for Tuần and Triệt between houses */
.boundary-badge {
    position: absolute;
    transform: translate(-50%, -50%);
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 1px 5px;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 2px;
    z-index: 100;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* Star Element Colors mapping optimized for high contrast on light backgrounds */
.color-moc {
    color: #059669 !important; /* Rich Green */
}

.color-hoa {
    color: #dc2626 !important; /* Crimson Red */
}

.color-tho {
    color: #b45309 !important; /* Dark Amber */
}

.color-kim {
    color: #64748b !important; /* Lighter Silver-Slate Gray */
}

.color-thuy {
    color: #000000 !important; /* Black */
}

.color-gray {
    color: #64748b !important;
}

/* Tuan & Triet Badges */
.badge-tuan, .badge-triet {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #0f172a;
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 1px 6px;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 3px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Center box in traditional chart */
.center-box {
    grid-row: 2 / span 2;
    grid-column: 2 / span 2;
    background-color: rgba(255, 255, 255, 0.98);
    border: none;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 1.5rem 1rem 1rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.center-box::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.06) 0%, transparent 70%);
    z-index: 0;
}

.center-box::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 175px;
    height: 175px;
    background-image: url('../images/pink_lotus.png');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    opacity: 0.35;
    pointer-events: none;
    z-index: 1;
}

.center-title {
    font-family: var(--font-heading);
    color: var(--color-gold);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.center-details {
    font-size: 0.85rem;
    position: relative;
    z-index: 2;
}
    color: #0f172a;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.branch-Dan  { grid-row: 4; grid-column: 1; }
.branch-Mao  { grid-row: 3; grid-column: 1; }
.branch-Thin { grid-row: 2; grid-column: 1; }
.branch-Tyy  { grid-row: 1; grid-column: 1; }
.branch-Ngo  { grid-row: 1; grid-column: 2; }
.branch-Mui  { grid-row: 1; grid-column: 3; }
.branch-Than { grid-row: 1; grid-column: 4; }
.branch-Dau  { grid-row: 2; grid-column: 4; }
.branch-Tuat { grid-row: 3; grid-column: 4; }
.branch-Hoi  { grid-row: 4; grid-column: 4; }
.branch-Ty   { grid-row: 4; grid-column: 3; }
.branch-Suu  { grid-row: 4; grid-column: 2; }

/* Interactive Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    padding: 1.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--color-gold);
}

.modal-title {
    color: var(--color-gold);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.modal-body h4 {
    color: var(--color-secondary);
    margin-top: 1rem;
    margin-bottom: 0.3rem;
}

.modal-body p {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

/* Service packages pricing styles */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pkg-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pkg-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
}

.pkg-name {
    font-size: 1.4rem;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
}

.pkg-price {
    font-size: 2.25rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--color-text);
}

.pkg-price span {
    font-size: 1rem;
    font-weight: normal;
    color: var(--color-text-muted);
}

.pkg-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pkg-features li {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
}

.pkg-features li::before {
    content: '✓';
    color: var(--color-success);
    font-weight: bold;
}

/* Blog layouts */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    overflow: hidden;
    padding: 0;
}

.blog-img {
    width: 100%;
    height: 180px;
    background-color: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-gold);
    font-weight: bold;
    position: relative;
}

.blog-img::before {
    content: '✵';
    font-size: 3rem;
    opacity: 0.2;
}

.blog-body {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Blog detail page: responsive two-column layout (article + sidebar) */
.blog-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2.5rem;
    align-items: start;
}

.blog-detail-main {
    min-width: 0;
}

.blog-detail-sidebar {
    position: sticky;
    top: 100px;
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem;
}

.blog-sidebar-title {
    font-size: 1rem;
    color: var(--color-gold);
    margin: 0 0 1rem;
}

.blog-sidebar-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.9rem;
}

.blog-sidebar-tab {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    color: var(--color-text-muted);
}

.blog-sidebar-tab.active {
    background: rgba(217, 119, 6, 0.12);
    color: var(--color-gold);
}

.blog-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-sidebar-list[hidden] {
    display: none;
}

.blog-sidebar-list a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.4;
    display: block;
}

.blog-sidebar-list a:hover {
    color: var(--color-gold);
}

.blog-sidebar-rank {
    color: var(--color-gold);
    font-weight: 700;
    margin-right: 0.35rem;
}

.blog-sidebar-empty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

.blog-related-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.blog-related-heading {
    font-size: 1.3rem;
    color: var(--color-gold);
    margin-bottom: 1.25rem;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.blog-related-card {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem 1.15rem;
}

.blog-related-card a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}

.blog-related-card a:hover {
    color: var(--color-gold);
}

.blog-related-card time {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

@media (max-width: 900px) {
    .blog-detail-layout {
        grid-template-columns: 1fr;
    }

    .blog-detail-sidebar {
        position: static;
    }
}

/* FAQ accordion styles */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 1rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background-color: var(--bg-subtle);
    color: var(--color-gold);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--color-gold);
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.faq-item.active .faq-answer {
    padding: 1rem 1.25rem;
    max-height: 300px;
    border-top: 1px solid var(--color-border);
}

/* Admin layout */
.admin-container {
    display: grid;
    grid-template-columns: 285px 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html.sidebar-is-collapsed .admin-container,
.admin-container.sidebar-collapsed {
    grid-template-columns: 72px 1fr;
}

.admin-sidebar {
    background-color: var(--bg-card, #1e293b);
    border-right: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-x: hidden;
    transition: width 0.3s ease, padding 0.3s ease;
}

.admin-logo-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    padding-bottom: 0.85rem;
    gap: 0.5rem;
}

.admin-logo {
    color: var(--color-gold, #f59e0b);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
}

.admin-logo span {
    color: #ffffff;
    font-size: 0.95rem;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.15));
    color: var(--color-gold, #f59e0b);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--color-gold, #f59e0b);
    color: #000000;
}

/* Admin Pagination */
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted, #94a3b8);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-link:hover {
    background: var(--color-gold, #f59e0b);
    color: #000000;
    border-color: var(--color-gold, #f59e0b);
}

.pagination-link.active {
    background: var(--color-gold, #f59e0b);
    color: #000000;
    border-color: var(--color-gold, #f59e0b);
    font-weight: 700;
}

.pagination-link.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.admin-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
}

.admin-menu a {
    color: var(--color-text-muted, #94a3b8);
    text-decoration: none;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.92rem;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-menu a .menu-icon {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.admin-menu a .menu-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-menu a:hover, .admin-menu a.active {
    background-color: rgba(245, 158, 11, 0.12);
    color: var(--color-gold, #f59e0b);
}

/* Submenu & Parent Menu Styles */
.admin-menu-parent {
    display: flex;
    flex-direction: column;
}

.admin-menu-parent .parent-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.admin-menu-parent .submenu-arrow {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--color-gold, #f59e0b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    transition: transform 0.25s ease, background 0.25s ease;
    opacity: 1;
}

.admin-menu-parent:hover .submenu-arrow {
    background: rgba(245, 158, 11, 0.3);
}

.admin-menu-parent.open .submenu-arrow {
    transform: rotate(180deg);
}

.admin-submenu {
    list-style: none;
    padding: 0.25rem 0 0.35rem 0.5rem;
    margin: 0;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    border-left: 2px solid rgba(245, 158, 11, 0.25);
    margin-left: 1.1rem;
    margin-top: 0.25rem;
}

.admin-menu-parent.open .admin-submenu {
    display: flex;
}

.submenu-header {
    font-size: 0.7rem;
    color: var(--color-gold, #f59e0b);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.5rem 0.15rem;
    opacity: 0.85;
}

.admin-submenu a {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    color: var(--color-text-muted, #94a3b8);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-submenu a .sub-icon {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.admin-submenu a:hover, .admin-submenu a.active {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--color-gold, #f59e0b);
    font-weight: 600;
}

/* Collapsed Sidebar overrides for Submenu */
html.sidebar-is-collapsed .admin-menu-parent .submenu-arrow,
.admin-container.sidebar-collapsed .admin-menu-parent .submenu-arrow {
    display: none;
}

html.sidebar-is-collapsed .admin-submenu,
.admin-container.sidebar-collapsed .admin-submenu {
    padding-left: 0;
    margin-left: 0;
    border-left: none;
}

html.sidebar-is-collapsed .submenu-header,
.admin-container.sidebar-collapsed .submenu-header {
    display: none;
}

html.sidebar-is-collapsed .admin-submenu a,
.admin-container.sidebar-collapsed .admin-submenu a {
    justify-content: center;
    padding: 0.65rem 0;
}

/* Collapsed Sidebar */
html.sidebar-is-collapsed .admin-logo,
.admin-container.sidebar-collapsed .admin-logo {
    display: none;
}

html.sidebar-is-collapsed .admin-logo-box,
.admin-container.sidebar-collapsed .admin-logo-box {
    justify-content: center;
    padding-bottom: 0.5rem;
}

html.sidebar-is-collapsed .admin-menu a,
.admin-container.sidebar-collapsed .admin-menu a {
    padding: 0.75rem 0;
    justify-content: center;
    gap: 0;
}

html.sidebar-is-collapsed .admin-menu a .menu-text,
.admin-container.sidebar-collapsed .admin-menu a .menu-text {
    display: none;
}

.admin-main {
    padding: 2rem;
    background-color: var(--bg-light);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-gold);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.tab-btn:hover, .tab-btn.active {
    background-color: var(--color-gold);
    color: #ffffff;
    border-color: var(--color-gold);
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    background-color: rgba(217, 119, 6, 0.05);
    color: var(--color-gold);
    font-family: var(--font-heading);
    font-weight: 600;
}

.admin-table tr:hover {
    background-color: #f8fafc;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-pending {
    background-color: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}

.badge-completed {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* Responsiveness */
@media (max-width: 900px) {
    .admin-container {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 998;
        background-color: #ffffff;
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
        padding: 6px 4px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav a {
        flex: 1;
        min-width: 0;
        min-height: 48px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 4px 2px;
        color: var(--color-text-muted);
        text-decoration: none;
        font-size: 0.66rem;
        font-weight: 600;
        border-radius: 8px;
    }

    .mobile-bottom-nav a.active,
    .mobile-bottom-nav a:hover {
        color: var(--color-gold);
        background-color: rgba(217, 119, 6, 0.06);
    }

    .menu-toggle {
        display: flex;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #ffffff;
        border-bottom: 1px solid var(--color-border);
        padding: 1.5rem;
        gap: 0.75rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    }
    
    nav ul.active {
        display: flex;
    }

    /* On mobile the submenu can't rely on hover, so show it inline, always expanded. */
    .dropdown-menu {
        display: block;
        position: static;
        border: none;
        box-shadow: none;
        padding: 0.5rem 0 0 1rem;
        margin-top: 0.5rem;
    }

    .nav-container {
        position: relative;
    }
    
    .chart-wrapper {
        max-width: 100%;
    }
    
    .chart-grid {
        min-width: 750px;
    }

    #chartImageContainer {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto 1.5rem auto !important;
        padding: 0;
    }

    #chartImg {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
    }
}

@media (max-width: 480px) {
    html, body {
        overflow-x: hidden;
    }
    
    .main-content {
        padding: 1rem 0.5rem;
        overflow-x: hidden;
    }
    .card {
        padding: 1rem;
    }
    .pkg-price {
        font-size: 1.75rem;
    }
}

/* Approved horizontal brand artwork. Keep navigation clear at every width. */
.nav-container {
    gap: 1rem;
    flex-wrap: wrap;
}
.logo { flex-shrink: 0; }
.brand-logo {
    display: block;
    width: 255px;
    max-width: 100%;
    height: auto;
}
.nav-container > nav { margin-left: auto; }
.nav-container > nav > ul { gap: 0.35rem; }
.nav-container > nav > ul > li > a { white-space: nowrap; }
.nav-actions { margin-left: auto; flex-wrap: wrap; }
.mobile-account-links { display: none; }
.footer-brand {
    display: block;
    width: min(380px, 100%);
    margin: 0 auto 1.75rem;
}
.footer-brand img { display: block; width: 100%; height: auto; }
@media (min-width: 769px) and (max-width: 1100px) {
    .nav-container > nav { order: 3; flex-basis: 100%; }
    .nav-container > nav > ul { justify-content: center; flex-wrap: wrap; }
}
@media (max-width: 768px) {
    .nav-container { gap: 0.65rem; padding: 0.75rem 1rem; }
    .brand-logo { width: clamp(195px, 54vw, 255px); }
    .nav-container > nav { margin-left: 0; }
    .nav-container > .menu-toggle { order: 2; }
    .nav-container > .nav-actions { display: none; }
    .mobile-account-links {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
        width: 100%;
        border-top: 1px solid var(--color-border);
        padding-top: 1rem;
    }
    #navMenu { max-height: calc(100dvh - 180px - env(safe-area-inset-bottom)); overflow-y: auto; }
    .nav-container > nav > ul { gap: 0.75rem; }
}

/* Performance: backdrop-filter blur rất nặng trên GPU mobile — tắt và dùng nền đặc hơn. */
@media (max-width: 768px) {
    header, footer, .card, .modal-overlay {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    header { background-color: rgba(255, 255, 255, 0.97); }
    footer { background-color: rgba(248, 250, 252, 0.97); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
