/* ==========================================================================
   1. GLOBAL & VARIABLES (Font chữ, Màu sắc chủ đạo, Reset, Dùng chung)
   ========================================================================== */
:root {
    --brand: #F97316;
    --brand-dark: #EA580C;
    --ink: #2D3748;
    --muted: #718096;
    --line: #E2E8F0;
    --page: #FAF7F2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--page);
    color: var(--ink);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Demo Topbar */
.demo-topbar {
    background: #3B1C10;
    color: #FBD38D;
    padding: 6px 0;
    font-size: 12px;
}

.topbar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-alert {
    background: #E53E3E;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.role-selector span {
    margin-left: 12px;
    font-size: 12px;
}

.role-selector a {
    color: inherit;
    text-decoration: none;
}

.role-selector .active-role {
    background: #ED8936;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
}

/* Tiện ích thông báo & Liên kết dùng chung */
.back-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.back-link:hover {
    color: var(--brand-dark);
}

.cart-message-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 600;
    text-align: center;
}

.text-danger {
    color: #DC2626;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    font-weight: 600;
}

.site-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

/* Footer chung */
.site-footer {
    background: #FAF7F2;
    border-top: 1px solid var(--line);
    padding: 20px 0;
    margin-top: 60px;
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--muted);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}


/* ==========================================================================
   2. LAYOUT, HEADER & NAVBAR (Thanh menu, Nút Đăng công thức, User info)
   ========================================================================== */
.main-header {
    background: #FFFFFF;
    border-bottom: 1px solid #EFEAE2;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-right-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Khung Logo bo viền bên trái */
.brand-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #E2D9CF;
    padding: 6px 14px 6px 10px;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    background: #FFFFFF;
}

.brand-pill .logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-text .sub {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    color: #94A3B8;
    letter-spacing: 0.5px;
}

.brand-text .main {
    font-size: 13.5px;
    font-weight: 800;
    color: #2D3748;
}

/* Thanh Tab dạng cụm bo tròn (Segmented Control) */
.nav-tab-group {
    display: flex;
    align-items: center;
    background: #F1EFEA;
    padding: 4px;
    border-radius: 30px;
    border: 1px solid #E5E0D8;
    gap: 4px;
}

.nav-tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    color: #4A5568;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-tab-item.active {
    background: #FFFFFF;
    color: #2D3748;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.nav-tab-item:hover:not(.active) {
    color: var(--brand);
}

.nav-badge {
    background: #FBD38D;
    color: #C05621;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 12px;
}

/* Nút Đăng công thức */
.btn-create-recipe {
    background: #FF5A1F;
    color: #FFFFFF !important;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(255, 90, 31, 0.35);
    border: 2px solid #E64A12;
    transition: background 0.2s;
    cursor: pointer;
}

.btn-create-recipe:hover {
    background: #E64A12;
}

.admin-header-badge {
    display: inline-block;
    background: #3B1C10;
    color: #FBD38D;
    border: 1px solid #7C4A2F;
    padding: 9px 14px;
    border-radius: 18px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
    white-space: nowrap;
}

/* Cụm thông tin người dùng đăng nhập */
.user-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFF8F3;
    border: 1.5px solid #FBD38D;
    padding: 4px 6px 4px 10px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(221, 107, 32, 0.08);
    transition: all 0.2s ease;
}

.user-profile-badge:hover {
    border-color: #F6AD55;
    box-shadow: 0 4px 12px rgba(221, 107, 32, 0.14);
}

.user-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFEDD5, #FED7AA);
    border: 1px solid #FDBA74;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.user-hello-label {
    font-size: 10.5px;
    color: #9C4221;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.user-name-title {
    font-size: 13.5px;
    color: #2D3748;
    font-weight: 800;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout-form {
    margin: 0;
    display: inline-block;
}

.btn-user-logout {
    background: #FFFFFF;
    color: #E53E3E;
    border: 1px solid #FEB2B2;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-user-logout:hover {
    background: #FFF5F5;
    border-color: #E53E3E;
    color: #C53030;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(229, 62, 62, 0.15);
}

.auth-header-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-auth-login {
    padding: 8px 18px;
    background: linear-gradient(135deg, #FF6B35, #FF5500);
    color: #FFFFFF !important;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.28);
    transition: all 0.2s ease;
    display: inline-block;
    border: 1px solid #FF5500;
}

.btn-auth-login:hover {
    background: linear-gradient(135deg, #E65A20, #E04800);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(255, 107, 53, 0.38);
    color: #FFFFFF !important;
}

.btn-auth-signup {
    padding: 8px 18px;
    background: #FFFFFF;
    color: #FF6B35 !important;
    border: 1.5px solid #FF6B35;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13.5px;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-auth-signup:hover {
    background: #FFF5F0;
    border-color: #E65A20;
    color: #E65A20 !important;
    transform: translateY(-1px);
}


/* ==========================================================================
   3. RECIPE CARDS & INGREDIENT TAGS (Thẻ món ăn dùng chung ở Trang chủ, Cá nhân, Đã lưu)
   ========================================================================== */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.recipe-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.card-img-wrap {
    position: relative;
    height: 190px;
    background: #EDF2F7;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.time-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,0.9);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

/* Nút Trái tim toggle (Lưu / Bỏ lưu) */
.btn-heart-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #A0AEC0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 2;
}

.btn-heart-toggle:hover {
    transform: scale(1.15);
    background: #FFFFFF;
}

.btn-heart-toggle.saved {
    background: #E53E3E;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.4);
}

.card-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.card-rating-badge {
    color: #DD6B20;
    font-size: 11.5px;
    font-weight: 800;
}

.card-rating-new {
    color: #A0AEC0;
    font-size: 11.5px;
    font-weight: 800;
}

.cat-label {
    background: #FEFCBF;
    color: #B7791F;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
}

.recipe-title {
    margin: 8px 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.recipe-desc {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 10px;
    line-height: 1.4;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Thẻ Nguyên Liệu Chuẩn Dạng Viên Thuốc (Pill Tags) */
.recipe-tags-wrap,
.saved-tags-wrap,
.ingredient-tags-list {
    display: flex;
    flex-wrap: wrap; /* Tự động rớt nguyên thẻ xuống dòng mới khi hết chiều ngang */
    gap: 6px; /* Khoảng cách đều giữa các thẻ */
    align-items: center;
    margin-bottom: 12px;
    margin-top: 8px;
}

.recipe-tag-pill,
.saved-tag-pill,
.ing-tag-item {
    display: inline-block;
    white-space: nowrap; /* Tuyệt đối không bẻ gãy chữ bên trong 1 nguyên liệu thành nhiều dòng */
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 600;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.recipe-tag-pill:hover,
.saved-tag-pill:hover,
.ing-tag-item:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.card-author-footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #EDF2F7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #718096;
}

.card-author-name {
    color: #2D3748;
    font-weight: 700;
}

/* Thẻ món ăn trang Đã Lưu */
.saved-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.saved-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.saved-thumb-wrap {
    position: relative;
    height: 190px;
    background: #EDF2F7;
}

.saved-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-time-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,0.9);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: var(--ink);
}

.btn-heart-unsave {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #E53E3E;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.4);
    transition: all 0.2s ease;
    z-index: 2;
}

.btn-heart-unsave:hover {
    transform: scale(1.15);
}

.saved-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.saved-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.saved-rating {
    font-size: 12px;
    font-weight: 700;
    color: #D69E2E;
}

.saved-recipe-name {
    margin: 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-recipe-desc {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 10px;
    line-height: 1.4;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* ==========================================================================
   4. HOME & EXPLORE PAGE (Banner, Bộ lọc danh mục, Thanh tìm kiếm)
   ========================================================================== */
.hero-cooking {
    background: linear-gradient(135deg, #FFFaf0 0%, #FFF4E6 100%);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 30px 35px;
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 25px;
    align-items: center;
}

.hero-text-col {
    flex: 1;
}

.hero-subtitle {
    color: var(--brand);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.3;
}

.hero-title span {
    color: var(--brand);
    border-bottom: 3px solid #F6AD55;
}

.search-form {
    display: flex;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 8px;
    max-width: 550px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.search-form input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
}

.btn-search {
    background: #2D3748;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-search:hover {
    background: #1A202C;
}

/* Khung mascot Đầu bếp nhí */
.mascot-box {
    text-align: center;
    border: 1.5px solid #2D3748;
    padding: 24px 20px 16px;
    border-radius: 24px;
    background: #FFFFFF;
    position: relative;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.mascot-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF8A00;
    color: #FFFFFF;
    padding: 3px 16px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid #E28A00;
}

.mascot-img {
    max-height: 130px;
    width: auto;
    object-fit: contain;
    margin: 8px auto;
    display: block;
}

.mascot-text {
    font-size: 12px;
    color: var(--muted);
    margin: 8px 0 0;
    font-weight: 600;
}

/* Khu vực chọn nhiều tag nguyên liệu trang chủ */
.home-filter-tags-wrap {
    margin-top: 14px;
}

.home-filter-tags-label {
    font-size: 13px;
    font-weight: 700;
    color: #4A5568;
    display: block;
    margin-bottom: 8px;
}

.home-filter-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-checkbox-label {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #CBD5E0;
    background: #FFFFFF;
    color: #4A5568;
}

.tag-checkbox-label.active {
    border-color: #DD6B20;
    background: #FEEBC8;
    color: #9C4221;
}

.tag-checkbox-input {
    display: none;
}

.btn-clear-tags {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #E53E3E;
    background: #FFF5F5;
    border: 1px solid #FEB2B2;
    text-decoration: none;
}

/* Bộ lọc danh mục */
.category-filter-bar {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    overflow-x: auto;
    padding-bottom: 5px;
}

.cat-pill {
    background: white;
    border: 1px solid var(--line);
    padding: 10px 18px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-pill:hover {
    background: #F8FAFC;
    border-color: #CBD5E0;
}

.cat-pill.active {
    background: #2D3748;
    color: white;
    border-color: #2D3748;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Tiêu đề & Sắp xếp */
.section-header {
    margin: 24px 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    background: #2D3748;
    color: #FFFFFF;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-block;
}

.sort-box-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-select-label {
    font-size: 13px;
    font-weight: 700;
    color: #4A5568;
}

.sort-select-input {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #CBD5E0;
    font-size: 13px;
    font-weight: 600;
    color: #2D3748;
    background: #FFFFFF;
    cursor: pointer;
    outline: none;
}

/* Hộp thông báo rỗng khi lọc không thấy món */
.empty-recipes-box {
    text-align: center;
    padding: 40px 20px;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px dashed #CBD5E0;
    margin-bottom: 30px;
}

.empty-recipes-text {
    font-size: 15px;
    font-weight: 700;
    color: #4A5568;
    margin-bottom: 8px;
}

.btn-reset-filters {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: #DD6B20;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}


/* ==========================================================================
   5. RECIPE DETAILS, RATINGS & COMMENTS (Trang chi tiết, Sao đánh giá, Bình luận)
   ========================================================================= */
/* Modal Overlay & Khung Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-window {
    background: #FFFFFF;
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    padding: 28px 32px;
    animation: modalFadeIn 0.25s ease-out;
}

.modal-window-detail {
    max-width: 820px;
    padding: 28px 32px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #F1F5F9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.modal-close-btn:hover {
    background: #E2E8F0;
    color: var(--ink);
}

.modal-header-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 4px;
}

.modal-header-desc {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 20px;
}

/* Các thành phần trong Chi tiết Món Ăn */
.modal-cat-tag {
    background: #F0FDF4;
    color: #166534;
    font-size: 11.5px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 14px;
    border: 1px solid #BBF7D0;
    display: inline-block;
}

.modal-cat-tag-wrap {
    margin-bottom: 14px;
}

.rating-group-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-meta-box {
    text-align: right;
}

.author-permission-note {
    color: #A0AEC0;
    font-size: 11px;
}

.modal-author-actions {
    display: none;
    gap: 6px;
    align-items: center;
}

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

.muted-note {
    color: #A0AEC0;
    font-size: 10.5px;
}

.muted-desc {
    font-size: 13px;
    color: #718096;
}

.detail-column-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-detail-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.modal-img-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    background: #EDF2F7;
    border: 1px solid var(--line);
}

.modal-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-time-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #2D3748;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.modal-recipe-title {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 900;
    color: #2D3748;
    line-height: 1.3;
}

.modal-recipe-desc {
    font-size: 13px;
    color: #718096;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.modal-rating-author-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 10px 14px;
    border-radius: 12px;
}

.modal-rating-score-badge {
    font-size: 20px;
    font-weight: 900;
    color: #DD6B20;
    background: #FFF;
    border: 1px solid #FBD38D;
    padding: 2px 8px;
    border-radius: 8px;
}

.modal-stars-gold {
    color: #F6AD55;
    font-size: 12px;
    letter-spacing: 1px;
}

.modal-review-count {
    color: #718096;
    font-size: 10.5px;
}

.modal-author-label {
    color: #A0AEC0;
    font-size: 10px;
    display: block;
}

.modal-author-name {
    font-size: 12.5px;
    color: #2D3748;
    font-weight: 700;
}

.modal-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-save-btn {
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    background: #FF5A1F;
    border: none;
}

.modal-columns-2 {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-section-title {
    margin: 0 0 12px 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #2D3748;
}

.detail-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.detail-checklist-item input[type="checkbox"] {
    accent-color: var(--brand);
}

.detail-step-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    margin-bottom: 12px;
}

.step-number-pill {
    background: #FFEDD5;
    color: #C2410C;
    font-weight: 800;
    font-size: 12px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-text {
    font-size: 13.5px;
    color: #334155;
    line-height: 1.5;
    margin: 2px 0 0;
}

/* Đánh giá & Bình luận */
.review-section {
    margin-top: 10px;
}

.review-section-title {
    font-size: 15px;
    margin: 0 0 14px;
    font-weight: 800;
    color: #2D3748;
}

.rating-select-bar {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
}

.rating-star {
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    user-select: none;
    display: inline-block;
}

.rating-star:hover {
    transform: scale(1.2);
    color: #f59e0b !important;
}

.rating-star.active,
.rating-star.selected,
.rating-star.text-warning {
    color: #f59e0b !important;
}

.star-rating-label {
    font-size: 12px;
    font-weight: 700;
    color: #DD6B20;
}

.review-input-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.review-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.review-textarea:focus {
    outline: none;
    border-color: #f59e0b;
}

.btn-submit-review {
    white-space: nowrap;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
    font-size: 13px;
    background: #f97316;
    color: white;
    font-weight: 700;
    border-radius: 10px;
    transition: background 0.2s;
}

.btn-submit-review:hover {
    background: #ea580c;
}

.review-list-section {
    margin-top: 20px;
}

.review-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.review-stars {
    color: #f5a623;
    margin: 4px 0;
}

/* Breadcrumb navigation */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.breadcrumb-bar a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.breadcrumb-bar a:hover {
    color: var(--brand);
}

.breadcrumb-separator {
    color: #CBD5E1;
}

.breadcrumb-current {
    color: var(--ink);
    font-weight: 700;
}

.recipe-details-container {
    position: relative;
    padding: 32px;
}

.btn-edit-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-save-recipe {
    border-radius: 999px;
    font-weight: 700;
    transition: all 0.2s ease;
    color: white;
}

.btn-save-recipe.active {
    background: #E11D48 !important;
}

.ingredients-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.steps-flow {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comments-list-box {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 16px;
}

.comment-author-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
    color: #1E293B;
}

.comment-content-text {
    margin: 0;
    font-size: 13.5px;
    color: #475569;
    line-height: 1.5;
}


/* ==========================================================================
   6. CREATE / EDIT RECIPE FORMS & MY RECIPES (Form đăng/sửa món, Quản lý cá nhân)
   ========================================================================== */
.status-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.status-approved {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.my-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--line);
    padding-top: 10px;
    margin-top: auto;
}

.author-note {
    font-size: 12px;
    color: var(--muted);
}

.author-note strong {
    color: var(--ink);
}

.my-card-actions {
    display: flex;
    gap: 8px;
}

.btn-pill-action {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--line);
    transition: 0.2s;
    background: #FFFFFF;
    cursor: pointer;
}

.btn-pill-edit {
    color: #3182CE;
    border-color: #BEE3F8;
}

.btn-pill-edit:hover {
    background: #EBF8FF;
}

.btn-pill-del {
    color: #E53E3E;
    border-color: #FED7D7;
}

.btn-pill-del:hover {
    background: #FFF5F5;
}

/* Header trang Đã Lưu */
.saved-header {
    margin: 26px 0 20px;
}

.saved-sub-badge {
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-block;
    margin-bottom: 4px;
}

.saved-title {
    font-size: 26px;
    font-weight: 900;
    color: var(--ink);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.saved-title .heart-icon {
    color: #E53E3E;
    font-size: 22px;
}

.saved-desc {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.saved-empty-box {
    text-align: center;
    padding: 60px 20px;
    background: #FFF;
    border-radius: 16px;
    border: 1px dashed #CBD5E1;
    margin-top: 20px;
}

/* Biểu mẫu Form dùng chung */
.form-group-custom {
    margin-bottom: 16px;
}

.form-label-custom {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-input-custom {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    background: #F8FAFC;
    transition: border-color .2s, background .2s;
    font-family: inherit;
}

.form-input-custom:focus {
    border-color: var(--brand);
    background: #FFFFFF;
}

.form-actions-custom {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}

.btn-submit-custom {
    background: linear-gradient(135deg, #FF7A00, #FF5500);
    color: white;
    border: none;
    padding: 11px 24px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.25);
    transition: background 0.2s;
}

.btn-submit-custom:hover {
    background: var(--brand-dark);
}

.btn-cancel-custom {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: 0.2s;
}

.btn-cancel-custom:hover {
    background: #F1F5F9;
    color: var(--ink);
}

/* Form chỉnh sửa 2 cột */
.form-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.preview-image-box {
    margin-bottom: 18px;
    padding: 12px 16px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.preview-image-thumb {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}


/* ==========================================================================
   7. AUTHENTICATION & ADMIN (Đăng nhập, Đăng ký, Quản trị viên)
   ========================================================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 220px);
    padding: 40px 15px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 36px 32px;
    background: #FFFFFF;
    border: 1px solid #EFEAE2;
    border-radius: 24px;
    box-shadow: 0 12px 36px rgba(45, 55, 72, 0.08);
    animation: authFadeIn 0.3s ease-out;
}

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

.auth-card h2 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 900;
    color: #2D3748;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 24px 0;
    color: #718096;
    font-size: 13.5px;
    text-align: center;
    line-height: 1.5;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #2D3748;
}

.auth-field .form-control-modern {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #2D3748;
    background: #FAFAFA;
    transition: all 0.2s ease;
}

.auth-field .form-control-modern:focus {
    outline: none;
    border-color: #FF6B35;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.auth-submit {
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FF6B35, #FF5500);
    color: #FFFFFF;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.32);
    transition: all 0.2s ease;
}

.auth-submit:hover {
    background: linear-gradient(135deg, #E65A20, #E04800);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 107, 53, 0.42);
}

.auth-bottom-link {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #EDF2F7;
    text-align: center;
    font-size: 13.5px;
    color: #718096;
}

.auth-bottom-link a {
    color: #FF6B35;
    font-weight: 800;
    text-decoration: none;
    margin-left: 4px;
}

.auth-bottom-link a:hover {
    text-decoration: underline;
}

/* Trang từ chối quyền truy cập (403 Access Denied) */
.access-denied-box {
    text-align: center;
    padding: 48px 32px;
}

.access-denied-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.access-denied-title {
    color: #E53E3E;
    margin-bottom: 12px;
}

.access-denied-desc {
    font-size: 14px;
    color: #A0AEC0;
    margin-bottom: 32px;
}

.access-denied-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary-action {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    padding: 12px 28px;
    background: #EDF2F7;
    color: #2D3748;
    border-radius: 8px;
    font-weight: 600;
}

/* Quản lý danh mục & Admin toolbar */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 18px;
}

.admin-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--ink);
}

.admin-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.btn-add-category {
    background: linear-gradient(135deg, #FF7A00, #FF5500);
    color: white !important;
    padding: 10px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.25);
    display: inline-block;
}

.admin-table-wrap {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--line);
    overflow-x: auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: #F8FAFC;
    border-bottom: 1px solid var(--line);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
}

.admin-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover {
    background-color: #FFFDF9;
}

.order-badge {
    font-weight: 700;
    color: var(--muted);
}

.cat-title-cell {
    font-weight: 700;
    color: var(--ink);
}

.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid #CBD5E0;
}

.color-tag {
    color: #4A5568;
    background: #EDF2F7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.cell-actions {
    text-align: right;
    white-space: nowrap;
}

.act-edit {
    color: #3182CE;
    text-decoration: none;
    font-weight: 600;
    margin-right: 12px;
}

.act-details {
    color: #4A5568;
    text-decoration: none;
    font-weight: 600;
    margin-right: 12px;
}

.act-delete {
    color: #E53E3E;
    text-decoration: none;
    font-weight: 600;
}

.act-edit:hover, .act-details:hover, .act-delete:hover {
    text-decoration: underline;
}

.admin-card {
    background: #FFFFFF;
    border-radius: 20px;
    border: 1px solid var(--line);
    padding: 32px;
    max-width: 650px;
    margin: 24px auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.admin-card-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--ink);
}

.admin-card-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 20px;
}

.detail-list {
    margin: 20px 0;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 180px;
    font-weight: 700;
    color: var(--muted);
}

.detail-value {
    flex: 1;
    color: var(--ink);
    font-weight: 600;
}

.alert-delete-box {
    background: #FFF5F5;
    border: 1px solid #FEB2B2;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #C53030;
    font-size: 14px;
    font-weight: 600;
}

.btn-delete-custom {
    background: #E53E3E;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(229, 62, 62, 0.25);
    transition: background-color .2s;
}

.btn-delete-custom:hover {
    background: #C53030;
}

/* Admin Dashboard & Duyệt bài */
.admin-dashboard-head {
    margin: 26px 0 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.admin-kicker {
    color: var(--brand);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
    margin-bottom: 5px;
}

.admin-dashboard-title {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    color: var(--ink);
}

.admin-dashboard-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-alert {
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 700;
}

.admin-alert-success {
    background: #ECFDF5;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.admin-alert-error {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

/* Ẩn triệt để khung cảnh báo trống khi trang load bình thường (Fix TC13) */
.admin-alert:empty,
.admin-alert-error:empty,
.client-error-box:empty,
.validation-summary-valid {
    display: none !important;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.admin-stat-card {
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.04);
}

.admin-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    flex: 0 0 46px;
}

.stat-visible .admin-stat-icon {
    background: #DCFCE7;
    color: #166534;
}

.stat-pending .admin-stat-icon {
    background: #FEF3C7;
    color: #92400E;
}

.stat-hidden .admin-stat-icon {
    background: #FEE2E2;
    color: #991B1B;
}

.stat-users .admin-stat-icon {
    background: #E1EFFE;
    color: #1C64F2;
}

.stat-comments .admin-stat-icon {
    background: #EDEBFE;
    color: #7E3AF2;
}

.stat-ratings .admin-stat-icon {
    background: #FDF2F8;
    color: #D946EF;
}

.admin-stat-grid-6 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.admin-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.admin-chart-card {
    background: #FFF;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.admin-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-chart-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #2D3748;
}

.admin-chart-badge {
    font-size: 11px;
    color: #A0AEC0;
    font-weight: 600;
}

.admin-chart-canvas-box {
    height: 240px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.admin-stat-label {
    color: #64748B;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .45px;
}

.admin-stat-number {
    font-size: 28px;
    line-height: 1.05;
    font-weight: 900;
    color: var(--ink);
    margin: 3px 0;
}

.admin-stat-note {
    font-size: 11px;
    color: #94A3B8;
}

.admin-list-header {
    margin: 6px 0 12px;
}

.admin-list-header h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    color: var(--ink);
}

.admin-list-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.admin-recipe-table-wrap {
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow-x: auto;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.04);
    margin-bottom: 30px;
}

.admin-recipe-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.admin-recipe-table th {
    background: #F8FAFC;
    color: #64748B;
    padding: 13px 15px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--line);
}

.admin-recipe-table td {
    padding: 13px 15px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
    font-size: 13px;
    color: #475569;
}

.admin-recipe-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-recipe-table tbody tr:hover {
    background: #FFFCF7;
}

.admin-recipe-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 245px;
}

.admin-recipe-thumb {
    width: 58px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
}

.admin-recipe-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 3px;
}

.admin-recipe-time {
    font-size: 11px;
    color: #94A3B8;
}

.admin-status {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-status-approved {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.admin-status-pending {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.admin-status-hidden {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.admin-action-col {
    text-align: right !important;
}

.admin-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.admin-inline-form {
    display: inline-block;
    margin: 0;
}

.admin-btn {
    border: none;
    border-radius: 12px;
    padding: 7px 11px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

.admin-btn:hover {
    transform: translateY(-1px);
    opacity: .9;
}

.admin-btn-approve {
    background: #16A34A;
    color: #FFFFFF;
}

.admin-btn-hide {
    background: #FFF1F2;
    color: #BE123C;
    border: 1px solid #FECDD3;
}

/* Quản lý tài khoản (Users) */
.user-admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.user-admin-table thead th {
    padding: 13px 10px;
    background: #F8FAFC;
    color: #475569;
    font-size: 11.5px;
    font-weight: 700;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

.user-admin-table tbody td {
    padding: 13px 10px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 13px;
    vertical-align: middle;
}

.user-admin-table tbody tr:hover {
    background-color: #FFFDF9;
}

/* Cố định kích thước & canh lề từng cột trong bảng tài khoản */
.col-user-id { width: 45px; text-align: center; }
.col-user-name { width: 145px; }
.col-user-username { width: 110px; }
.col-user-email { min-width: 165px; }
.col-user-recipes { width: 90px; text-align: center; }
.col-user-role { width: 90px; text-align: center; }
.col-user-created { width: 105px; text-align: center; }
.col-user-status { width: 115px; text-align: center; }
.col-user-actions { width: 190px; text-align: right; }

.username-tag {
    display: inline-block;
    padding: 2px 7px;
    background: #F1F5F9;
    color: #334155;
    border-radius: 5px;
    font-size: 12px;
    font-family: Consolas, monospace;
}

.email-text {
    color: #475569;
    font-size: 13px;
    word-break: break-all;
}

.user-role-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.role-admin {
    background: #EBF4FF;
    color: #2B6CB0;
    border: 1px solid #BFDBFE;
}

.role-user {
    background: #F0FFF4;
    color: #276749;
    border: 1px solid #BBF7D0;
}

.user-status-active {
    display: inline-block;
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.user-status-locked {
    display: inline-block;
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* Nút bấm thao tác bảng tài khoản */
.user-admin-table .admin-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.user-admin-table .admin-inline-form {
    display: inline-block;
    margin: 0;
}

.btn-user-lock,
.btn-user-unlock,
.btn-role-promote,
.btn-role-demote {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11.5px;
    padding: 5px 9px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-user-lock {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FECACA;
}
.btn-user-lock:hover {
    background: #FCA5A5;
    color: #7F1D1D;
}

.btn-user-unlock {
    background: #DCFCE7;
    color: #166534;
    border-color: #BBF7D0;
}
.btn-user-unlock:hover {
    background: #86EFAC;
    color: #14532D;
}

.btn-role-promote {
    background: #EFF6FF;
    color: #1D4ED8;
    border-color: #BFDBFE;
}
.btn-role-promote:hover {
    background: #DBEAFE;
    color: #1E40AF;
}

.btn-role-demote {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}
.btn-role-demote:hover {
    background: #FDE68A;
    color: #78350F;
}

/* Huy hiệu số món ăn: Căn giữa, không bẻ dòng, bo góc 6px */
.user-recipe-count-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 3px 9px;
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FFEDD5;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap !important;
    line-height: 1.2;
}

.user-recipe-count-badge i {
    font-size: 11px;
    color: #EA580C;
}

/* Tiện ích Admin & Biểu mẫu */
.card-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin-bottom: 24px;
}

.modal-divider {
    border: 0;
    border-top: 1px solid #EDF2F7;
    margin-bottom: 20px;
}

.title-danger {
    color: #E53E3E !important;
}

.detail-value-lg {
    font-size: 16px;
    font-weight: 700;
}

.detail-value-brand {
    color: var(--brand) !important;
    font-size: 16px;
    font-weight: 700;
}

.text-danger-msg {
    color: #E53E3E;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.cursor-default {
    cursor: default !important;
}

.display-none {
    display: none !important;
}

.admin-toolbar-top {
    margin-top: 24px;
}

.table-col-id {
    width: 50px;
}

.table-date-cell {
    font-size: 13px;
    color: #718096;
}

.author-self-badge {
    font-size: 12px;
    color: #A0AEC0;
    font-style: italic;
}

.auth-icon-wrap {
    text-align: center;
    margin-bottom: 12px;
}

.auth-icon {
    font-size: 36px;
}

.saved-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.saved-empty-title {
    font-size: 18px;
    font-weight: 800;
    color: #2D3748;
    margin: 0 0 8px 0;
}

.saved-empty-desc {
    color: #718096;
    font-size: 14px;
    margin: 0 0 20px 0;
}

/* Quản lý tài khoản (User Management) */
.user-profile-badge-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-role-display {
    padding: 8px 0;
}

.user-filter-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 20px 0 !important;
    padding: 14px 18px;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
}

.user-filter-form {
    width: 100%;
    margin: 0;
}

.user-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.filter-input-search {
    flex: 2;
    min-width: 220px;
}

.filter-select-box {
    flex: 1;
    min-width: 140px;
}

.filter-buttons-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.form-input-search {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #F8FAFC;
    box-sizing: border-box;
}
.form-input-search:focus {
    border-color: var(--brand);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(226, 75, 41, 0.12);
}

.form-select-custom {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 13.5px;
    outline: none;
    background: #F8FAFC;
    color: #334155;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s;
}
.form-select-custom:focus {
    border-color: var(--brand);
    background: #FFFFFF;
}

.btn-filter-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(226, 75, 41, 0.2);
    white-space: nowrap;
}
.btn-filter-submit:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
}

.btn-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-filter-reset:hover {
    background: #E2E8F0;
    color: #1E293B;
}

.empty-table-cell {
    padding: 36px 20px;
    color: var(--muted);
    font-size: 14px;
}

/* =========================================================
   PHÂN TRANG TRANG CHỦ (CHUẨN GIÁO TRÌNH BUỔI 06)
   ========================================================= */
.store-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 36px 0 28px;
    flex-wrap: wrap;
}

.store-pagination .page-nav-btn,
.store-pagination .page-num-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.store-pagination .page-nav-btn:hover,
.store-pagination a.page-num-btn:hover {
    background: #FFF7ED;
    border-color: #FED7AA;
    color: var(--brand);
    transform: translateY(-1px);
}

.store-pagination .page-num-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(226, 75, 41, 0.25);
    cursor: default;
}

/* Toast thông báo gọn, dùng cho phản hồi hành động trong Cooking Baby */
.cb-toast {
    position: fixed;
    z-index: 10050;
    top: 24px;
    right: 24px;
    display: grid;
    grid-template-columns: 38px minmax(180px, 1fr) 24px;
    align-items: center;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    min-height: 76px;
    padding: 14px 16px;
    overflow: hidden;
    color: #293447;
    background: rgba(255, 255, 255, .98);
    border: 1px solid #f1e4d5;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(37, 45, 59, .18);
    opacity: 0;
    transform: translate3d(0, -14px, 0) scale(.98);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}

.cb-toast.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    pointer-events: auto;
}

.cb-toast-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    background: #f97316;
    border-radius: 13px;
    font-size: 20px;
    font-weight: 800;
}

.cb-toast-success .cb-toast-icon { background: #22a06b; }
.cb-toast-error .cb-toast-icon { background: #dc4c43; }
.cb-toast-info .cb-toast-icon { background: #f97316; }

.cb-toast-message {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
}

.cb-toast-close {
    align-self: start;
    padding: 0;
    color: #8b93a1;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.cb-toast-close:hover { color: #293447; }

.cb-toast-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #fed7aa;
    transform: scaleX(0);
    transform-origin: left;
}

.cb-toast.is-visible .cb-toast-progress {
    transform: scaleX(1);
    transition: transform 4.2s linear;
}

/* Responsive (Mobile & Tablet) */
@media (max-width: 1050px) {
    .header-flex {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-tab-group {
        order: 3;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .nav-tab-item {
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    .cb-toast {
        top: 12px;
        right: 12px;
        width: calc(100vw - 24px);
    }

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

    .hero-cooking {
        grid-template-columns: 1fr;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .modal-detail-grid,
    .modal-columns-2,
    .form-grid-2-1,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-title {
        font-size: 23px;
    }

    .topbar-flex {
        align-items: flex-start;
        gap: 8px;
    }

    .role-selector {
        text-align: right;
    }
}
