:root {
    --primary-color: #fd7e14;
    --primary-dark: #e67010;
    --primary-light: #ffb067;
    --primary-50: #fff4e8;
    --primary-100: #ffe5cc;
    --dark: #1a1a1a;
    --dark-700: #2d2d2d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --transition: all 0.25s ease;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fafafa;
    color: #212529;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--primary-dark);
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: none !important;
}

.btn-primary:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.bg-primary-orange {
    background-color: var(--primary-color) !important;
}

.text-primary-orange {
    color: var(--primary-color) !important;
}

.bg-primary-50 {
    background-color: var(--primary-50) !important;
}

.border-primary-orange {
    border-color: var(--primary-color) !important;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm) !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.icon-btn i {
    font-size: 16px;
}

.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.badge-orange {
    background-color: var(--primary-color);
    color: white;
    padding: 0.35em 0.65em;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.only-desktop { display: block; }
.only-mobile { display: none; }
.only-desktop-table { display: table; }
.only-desktop-table-cell { display: table-cell; }
.only-desktop-table-row { display: table-row; }

@media (max-width: 767.98px) {
    .only-desktop { display: none !important; }
    .only-desktop-table { display: none !important; }
    .only-desktop-table-cell { display: none !important; }
    .only-desktop-table-row { display: none !important; }
    .only-mobile { display: block !important; }
}

.horizontal-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #dee2e6;
    -webkit-overflow-scrolling: touch;
}

.horizontal-tabs::-webkit-scrollbar {
    height: 3px;
}

.horizontal-tabs::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 3px;
}

.horizontal-tabs .nav-link {
    flex: 0 0 auto;
    border: none;
    padding: 0.75rem 1.25rem;
    color: #6c757d;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.horizontal-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

.navbar-public {
    box-shadow: var(--shadow-sm);
    background-color: #fff;
    z-index: 1000;
    position: sticky;
    top: 0;
}

.navbar-public .nav-link {
    color: var(--dark-700);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.navbar-public .nav-link:hover,
.navbar-public .nav-link.active {
    color: var(--primary-color);
    background-color: var(--primary-50);
}

.navbar-public .navbar-brand {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-public .navbar-toggler {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: #dee2e6;
    border-radius: var(--radius-sm);
}

.navbar-public .navbar-toggler:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-50) 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    opacity: 0.4;
    border-radius: 50%;
}

.hero-badge {
    display: inline-block;
    background-color: white;
    color: var(--primary-color);
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.section-title h2 {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 50px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.feature-card {
    padding: 2rem 1.5rem;
    text-align: center;
}

.feature-card .feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.25rem;
    background-color: var(--primary-50);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.article-card .article-img {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
}

.article-card .article-date {
    color: #6c757d;
    font-size: 0.85rem;
}

.article-card .article-excerpt {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.coach-card {
    text-align: center;
}

.coach-card .coach-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary-50);
    margin: 0 auto 1rem;
    display: block;
}

.coach-card .coach-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.coach-card .coach-role {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.schedule-grid .schedule-header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.schedule-grid .schedule-cell {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    min-height: 90px;
}

.schedule-slot {
    background-color: var(--primary-50);
    border-left: 3px solid var(--primary-color);
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    line-height: 1.4;
}

.schedule-slot.advanced {
    background-color: #ffe5cc;
}

.schedule-slot .slot-time {
    font-weight: 700;
    color: var(--primary-dark);
    display: block;
}

.schedule-slot .slot-class {
    font-weight: 600;
    color: var(--dark);
    display: block;
}

.schedule-slot .slot-coach {
    color: #495057;
    font-size: 0.75rem;
}

@media (max-width: 991.98px) {
    .schedule-grid {
        grid-template-columns: 1fr;
    }
    .schedule-grid .schedule-header {
        text-align: left;
        padding: 0.6rem 0.75rem;
        margin-top: 0.5rem;
    }
}

.member-card {
    background-color: white;
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.member-card .member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-50);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.member-card .member-info {
    flex: 1;
    min-width: 0;
}

.member-card .member-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.member-card .member-meta {
    font-size: 0.85rem;
    color: #495057;
    line-height: 1.5;
}

.table-responsive-stack table {
    width: 100%;
}

.table-responsive-stack thead th {
    background-color: var(--primary-50);
    color: var(--primary-dark);
    border-color: var(--primary-100);
    font-weight: 600;
    white-space: nowrap;
}

.admin-sidebar {
    background-color: var(--dark);
    min-height: 100vh;
    color: #adb5bd;
    padding-top: 1rem;
    transition: var(--transition);
}

.admin-sidebar .sidebar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #373737;
    margin-bottom: 0.75rem;
}

.admin-sidebar .nav-link {
    color: #adb5bd;
    padding: 0.7rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: 0;
    margin: 0.1rem 0.5rem;
    border-radius: var(--radius-sm);
}

.admin-sidebar .nav-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.admin-sidebar .nav-link:hover {
    color: white;
    background-color: #2a2a2a;
}

.admin-sidebar .nav-link.active {
    color: white;
    background-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.admin-main {
    background-color: #f5f6fa;
    min-height: 100vh;
}

.admin-topbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar .sidebar-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.stat-card {
    background-color: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background-color: var(--primary-50);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.1rem;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

.login-card .login-logo {
    width: 70px;
    height: 70px;
    background-color: var(--primary-50);
    color: var(--primary-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.15) !important;
}

.toast-container-custom {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.public-footer {
    background-color: var(--dark);
    color: #adb5bd;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.public-footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.public-footer .footer-link {
    color: #adb5bd;
    display: block;
    padding: 0.25rem 0;
}

.public-footer .footer-link:hover {
    color: var(--primary-color);
}

.public-footer .bottom-bar {
    border-top: 1px solid #2d2d2d;
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.message-unread {
    background-color: var(--primary-50);
    border-left: 3px solid var(--primary-color);
}

/* ============================================================
   # HIDE TOGGLE BUTTONS ON DESKTOP (>= 992px)
   Chỉ hiện nút toggle khi mobile mới hiện
   ============================================================ */
@media (min-width: 992px) {
    [data-sidebar-toggle],
    button[data-mobile-menu],
    .navbar-toggler.public-hamburger {
        display: none !important;
    }
}

/* ============================================================
   # ADMIN SIDEBAR PROFESSIONAL
   ============================================================ */
.admin-sidebar {
    background: linear-gradient(180deg, #1e1e24 0%, #15151a 100%);
    min-height: 100vh;
    color: #d1d5db;
    position: sticky;
    top: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 3px 0 14px rgba(0,0,0,0.08);
    padding: 0;
    z-index: 1040;
}

.sidebar-brand {
    padding: 1.35rem 1.25rem 1.45rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
    background: linear-gradient(90deg, rgba(253,126,20,0.14) 0%, transparent 100%);
    border-left: 3px solid var(--primary-color);
}
.sidebar-brand i {
    font-size: 1.45rem;
    background: linear-gradient(135deg, #ff9a3c 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.admin-sidebar .nav {
    padding: 0.75rem 0.55rem 1rem !important;
}
.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.85rem;
    color: #b6bcc7;
    border-radius: 10px;
    margin-bottom: 0.2rem;
    font-weight: 500;
    transition: all .2s ease;
    font-size: 0.93rem;
    position: relative;
}
.admin-sidebar .nav-link i {
    width: 18px;
    text-align: center;
    opacity: .9;
}
.admin-sidebar .nav-link span {
    flex: 1;
}
.admin-sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}
.admin-sidebar .nav-link.active {
    color: white !important;
    background: linear-gradient(90deg, #ff8f3c 0%, var(--primary-color) 100%);
    box-shadow: 0 6px 14px rgba(253,126,20,0.28);
    font-weight: 600;
}
.admin-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.1rem;
    background-color: white;
    border-radius: 3px;
    opacity: 0.9;
}
.admin-sidebar .dropdown-divider {
    margin: 0.7rem 0.6rem !important;
    border-top: 1px solid rgba(255,255,255,0.07);
}

/* ============================================================
   # ADMIN TOPBAR + BUTTONS + CARDS + TABLES
   ============================================================ */
.admin-topbar {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f1f5;
    padding: 0.85rem 1.4rem;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.admin-topbar h5 {
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.2px;
    font-size: 1.1rem;
}
.btn-logout {
    border-radius: 999px;
    border: 1.5px solid var(--primary-color);
    background: #fff7f1;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.45rem 1rem;
    transition: all 0.2s ease;
}
.btn-logout:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 6px 14px rgba(253,126,20,0.28);
    transform: translateY(-1px);
}

/* Stat-card makeover */
.stat-card {
    border-radius: 14px;
    padding: 1.5rem 1.4rem;
    box-shadow: 0 1px 2px rgba(17,24,39,0.04), 0 6px 22px rgba(17,24,39,0.06);
    border-left: 4px solid transparent;
    transition: all .2s ease;
    border: 1px solid #eef0f4;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(17,24,39,0.10);
}
.stat-card .stat-icon {
    border-radius: 14px;
    width: 58px;
    height: 58px;
}
.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
}
.stat-card .stat-label {
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.2px;
}
.stat-card.members { border-left-color: #22c55e; }
.stat-card.members .stat-icon { background: #ecfdf5; color: #16a34a; }
.stat-card.classes { border-left-color: #8b5cf6; }
.stat-card.classes .stat-icon { background: #f5f3ff; color: #7c3aed; }
.stat-card.coaches { border-left-color: #3b82f6; }
.stat-card.coaches .stat-icon { background: #eff6ff; color: #2563eb; }
.stat-card.messages-warn { border-left-color: #ef4444 !important; }
.stat-card.messages-warn .stat-icon { background: #fef2f2; color: #dc2626; }

/* Primary action buttons */
.btn-primary-orange {
    background: linear-gradient(135deg, #ff9a3c 0%, var(--primary-color) 100%);
    color: white !important;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(253,126,20,0.28);
    transition: all .2s ease;
}
.btn-primary-orange:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(253,126,20,0.35);
    filter: brightness(1.05);
}

/* Table admin */
.table-admin {
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(17,24,39,0.04), 0 8px 26px rgba(17,24,39,0.05);
}
.table-admin thead th {
    background: linear-gradient(180deg, #fafbff 0%, #f5f6fb 100%);
    color: #374151;
    font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
    padding: 0.95rem 1rem;
    letter-spacing: -0.1px;
    font-size: 0.9rem;
}
.table-admin tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #1f2937;
}
.table-admin tbody tr:last-child td {
    border-bottom: none;
}
.table-admin tbody tr:hover {
    background-color: #fffaf4;
    background: #fff9f1;
}
.table-admin .coach-img-thumb,
.table-admin .member-avatar-sm {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #f3f4f6;
    background: #f3f4f6;
}

/* Action buttons */
.btn-action {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}
.btn-action-edit {
    background: #fff7ed;
    color: var(--primary-color);
    border: 1px solid #fed7aa;
}
.btn-action-edit:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(253,126,20,0.28);
}
.btn-action-delete {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-action-delete:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    box-shadow: 0 4px 10px rgba(220,38,38,0.25);
}
.btn-action-success {
    background: #ecfdf5;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.btn-action-success:hover {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
    box-shadow: 0 4px 10px rgba(22,163,74,0.25);
}

/* ============================================================
   # ADMIN MOBILE SIDEBAR OFFCANVAS BEHAVIOR
   ============================================================ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1045;
        transform: translateX(-105%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
        box-shadow: 8px 0 30px rgba(0,0,0,0.25);
    }
    .admin-sidebar.sidebar-open {
        transform: translateX(0);
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.55);
        z-index: 1040;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}
@media (max-width: 991.98px) {
    .admin-main {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
}
