:root {
    --primary-color: #d63031;
    --primary-hover: #b32d2e;
    --dark-bg: #1e2229;
    --sidebar-width: 260px;
    --body-bg: #f5f6fa;
    --card-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
    --font-heading: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Lucida Grande", Arial, Ubuntu, Cantarell, "Fira Sans", sans-serif;
    --font-body: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Lucida Grande", Arial, Ubuntu, Cantarell, "Fira Sans", sans-serif;
}

body {
    background-color: var(--body-bg);
    font-family: var(--font-body);
    color: #4a4a4a;
    font-size: 0.9rem;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #2d3436;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--dark-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar .brand {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar .brand img {
    height: 40px;
    margin-right: 12px;
}

.sidebar .brand span {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    font-family: var(--font-heading);
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    padding: 2px 20px;
}

.sidebar-menu li.menu-header {
    color: #858b97;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 15px 25px 5px 25px;
    letter-spacing: 1px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    color: #b2bec3;
    padding: 12px 18px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-menu li.active a {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(214, 48, 49, 0.3);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Header Navbar */
.top-header {
    background-color: #fff;
    padding: 5px 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Left & right header elements: never shrink or wrap */
.top-header > h4,
.top-header > .dropdown {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Center ad: take remaining space between left & right elements */
.top-header .header-ad {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.top-header .header-ad img {
    max-width: 85%;
    height: 75px;
    width: auto;
    object-fit: contain;
}

.top-header .user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.top-header .user-profile img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid var(--primary-color);
}

/* Cards Design */
.stat-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.stat-card.primary .card-icon {
    background-color: rgba(214, 48, 49, 0.1);
    color: var(--primary-color);
}

.stat-card.success .card-icon {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.stat-card.warning .card-icon {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
}

.stat-card.info .card-icon {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.stat-card .card-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: var(--font-heading);
}

.stat-card .card-label {
    color: #95a5a6;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Custom Table Styling */
.custom-table-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: none;
    overflow: hidden;
}

.custom-table-card .card-header {
    background-color: #fff;
    border-bottom: 1px solid #f1f2f6;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-table-card .table {
    margin-bottom: 0;
}

.custom-table-card .table th {
    background-color: #f8f9fa;
    color: #858b97;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 15px 25px;
    border-bottom: 1px solid #f1f2f6;
}

.custom-table-card .table td {
    padding: 15px 25px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f2f6;
    color: #4f535b;
}

/* Badges */
.badge-custom {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background-color: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.badge-pending { background-color: rgba(241, 196, 15, 0.15); color: #f1c40f; }
.badge-suspended { background-color: rgba(230, 126, 34, 0.15); color: #e67e22; }
.badge-cancelled { background-color: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.badge-inactive { background-color: rgba(149, 165, 166, 0.15); color: #95a5a6; }

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ── Collapsible Parent Menu Items ────────────────────── */
.sidebar-menu li.nav-parent > a.nav-group-toggle {
    display: flex;
    align-items: center;
    color: #b2bec3;
    padding: 12px 18px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.sidebar-menu li.nav-parent > a.nav-group-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Arrow rotates when submenu is open */
.sidebar-menu li.nav-parent > a.nav-group-toggle .nav-arrow {
    font-size: 0.65rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.sidebar-menu li.nav-parent > a.nav-group-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(90deg);
}

/* Parent item gets accent when a child is active */
.sidebar-menu li.nav-parent.open > a.nav-group-toggle {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.04);
}

/* ── Submenu List ─────────────────────────────────────── */
.nav-submenu {
    list-style: none;
    padding: 2px 0 4px 0;
    margin: 0;
}

.nav-submenu li {
    padding: 1px 12px 1px 28px;
}

.nav-submenu li a {
    display: flex;
    align-items: center;
    color: #8a9bb0;
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.18s ease;
}

.nav-submenu li a i {
    font-size: 0.9rem;
    margin-right: 10px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.nav-submenu li a:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-submenu li.active a {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(214, 48, 49, 0.25);
}

/* ── Logout item separator ────────────────────────────── */
.sidebar-menu li.nav-logout {
    margin-top: 12px;
    padding: 2px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        left: -260px;
    }
    .sidebar.active {
        left: 0;
    }
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
}
