/* Header Promotion Banner - Fixed Position */
.header-promotion-banner {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    padding: 6px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    margin: 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1002;
    max-width: 100vw;
    box-sizing: border-box;
    min-width: 0;
    flex-shrink: 0;
    height: 38px;
    min-width: 0;
}

.header-promotion-banner .promotion-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.header-promotion-banner .promotion-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.header-promotion-banner .promotion-text {
    color: white;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.header-promotion-banner .promotion-text strong {
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.header-promotion-banner .promotion-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.header-promotion-banner .promotion-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Adjust sidebar and content when banner is present */
.header-promotion-banner~.dashboard-container .sidebar {
    top: 38px;
    height: calc(100vh - 38px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Note: Upgrade page styles are in components/upgrade.css */
:root {
    /* Colors - Apple Light Theme */
    --primary-bg: #ffffff;
    --secondary-bg: #f5f5f7;
    --tertiary-bg: #e5e5ea;
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --accent-blue: #007AFF;
    --accent-blue-dark: #0051D5;
    --success-green: #34C759;
    --warning-orange: #FF9500;
    --danger-red: #FF3B30;

    /* Typography */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 28px;
    --font-size-4xl: 36px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;

    /* Border Radius - Apple Style */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows - Apple Style (soft, subtle) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-width: 0;
    flex-shrink: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #1d1d1f;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dashboard Layout */
.dashboard-container {
    height: 100vh !important;
    background: #f5f5f7;
    display: flex;
    width: 100vw;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR - COMPLETE REDESIGN
   ============================================ */

/* Sidebar Base */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: none;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Enable transition after page load */
body.sidebar-ready .sidebar,
body.sidebar-ready .sidebar.collapsed {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-ready .main-content,
body.sidebar-ready .content-header {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 80px;
    align-items: center;
}


/* Header Alignment */
.sidebar-header,
.content-header {
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 0;
    flex-shrink: 0;
}

/* Sidebar Header */
.sidebar-header {
    height: 80px;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    background: #ffffff;
    min-width: 0;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 0;
    justify-content: center;
}

/* Content Header - Fixed Position */
.content-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 20px 32px;
    margin: 0 !important;
    position: fixed;
    top: 0;
    left: 280px !important;
    right: 0;
    z-index: 1001;
    height: 80px;
    min-height: 80px;
    max-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 0;
    flex-shrink: 0;
    transition: none;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.8);
}

/* Adjust content-header when banner is present */
body:has(.header-promotion-banner) .content-header {
    top: 38px;
}


.sidebar-logo {
    display: flex;
    align-items: center;
    color: #007AFF;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 44px);
}

.sidebar-logo-img {
    max-height: 40px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.sidebar-logo-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    border-radius: 12px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-logo-img {
    display: block;
}

.sidebar-logo:has(.sidebar-logo-img) .sidebar-logo-text {
    display: none;
}

.sidebar-logo:has(.sidebar-logo-text) .sidebar-logo-img {
    display: none;
}

.sidebar.collapsed .sidebar-logo-img {
    display: none;
}

.sidebar.collapsed .toggle-btn {
    display: flex;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin: 0;
}

.toggle-btn {
    background: #f5f5f7;
    border: none;
    color: #007AFF;
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-btn:hover {
    background: #e5e5ea;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.sidebar.collapsed .sidebar-nav {
    padding: 12px 0;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
}

/* Nav Link - Expanded */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 0 12px;
    color: #6e6e73;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - 24px);
    box-sizing: border-box;
}

.nav-link:hover {
    background: #f5f5f7;
    color: #007AFF;
}

.nav-link.active {
    background: #007AFF;
    color: #ffffff;
}

.nav-link.active:hover {
    background: #0051D5;
    color: #ffffff;
}

/* All SVG icons - remove borders and handle colors */
.nav-link .nav-icon svg,
.nav-link.active .nav-icon svg,
.nav-link:focus .nav-icon svg,
.nav-link:focus-visible .nav-icon svg {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Icon colors for light mode */
.nav-link .nav-icon svg rect,
.nav-link .nav-icon svg path[fill] {
    fill: #6e6e73;
    transition: fill 0.3s ease;
}

.nav-link .nav-icon svg path[stroke] {
    stroke: #6e6e73;
    transition: stroke 0.3s ease;
}

.nav-link.active .nav-icon svg rect,
.nav-link.active .nav-icon svg path[fill] {
    fill: #ffffff;
}

.nav-link.active .nav-icon svg path[stroke] {
    stroke: #ffffff;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar.collapsed * {
    box-sizing: border-box;
}

.sidebar.collapsed .nav-link,
.sidebar.collapsed .toggle-btn,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn {
    margin-left: auto;
    margin-right: auto;
}

/* Nav Link - Collapsed */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
    margin: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.sidebar.collapsed .nav-text {
    display: none;
}

/* Nav Icon & Text */
.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Submenu Styles */
.nav-item-has-submenu {
    flex-direction: column;
    align-items: stretch;
}

.nav-link-toggle {
    position: relative;
    cursor: pointer;
}

.nav-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-has-submenu.expanded .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    padding-top: 4px;
    padding-bottom: 0;
    margin-bottom: 0;
    display: none;
}

.nav-item-has-submenu.expanded .nav-submenu {
    max-height: 500px;
    opacity: 1;
    display: block !important;
}


.nav-link-sub {
    margin-left: 0 !important;
    padding-left: 40px !important;
    margin: 0 16px 0 16px !important;
    width: calc(100% - 32px) !important;
    font-size: 13px !important;
}

.nav-link-sub:hover {
    background: #f5f5f7 !important;
    border-left: 4px solid #007AFF !important;
    color: #007AFF !important;
    transform: translateX(0) !important;
    padding-left: 36px !important;
}

.nav-link-sub.active {
    background: #007AFF !important;
    color: #ffffff !important;
    border-left: none !important;
    padding-left: 40px !important;
}

.nav-link-sub.active:hover {
    background: #0051D5 !important;
    color: #ffffff !important;
    border-left: none !important;
    padding-left: 40px !important;
}

.sidebar.collapsed .nav-submenu {
    display: none !important;
}

.sidebar.collapsed .nav-arrow {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
}

.sidebar.collapsed .sidebar-footer {
    padding: 12px 0;
    align-items: center;
    gap: 8px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin: 0;
    background: #f5f5f7;
    border-radius: 10px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    height: 48px;
}

.user-avatar-wrapper {
    position: relative;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: #007AFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.user-avatar.premium-avatar {
    position: relative;
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.2);
}

.user-avatar.premium-avatar::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 8px;
    z-index: -1;
}

.user-avatar.premium-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #00ff00;
    border-radius: 5px;
    z-index: -1;
}

.crown-on-top {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crown-on-top svg {
    width: 20px;
    height: 16px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 1px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: #6e6e73;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-icon-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #6e6e73;
    transition: all 0.2s;
    flex-shrink: 0;
}

.profile-icon-btn:hover {
    background: #e5e5ea;
    color: #007AFF;
}

.sidebar.collapsed .profile-icon-btn {
    display: none;
}

.sidebar.collapsed .user-info {
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    width: 48px;
    height: 48px;
    border-radius: 0;
    background: transparent;
}

.sidebar.collapsed .user-info:hover {
    background: transparent;
    transform: none;
}

.sidebar.collapsed .user-details {
    display: none;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
    margin-left: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 11px;
}

.sidebar.collapsed .user-avatar-wrapper {
    margin-right: 0;
    margin-left: 0;
}

.sidebar.collapsed .user-avatar.premium-avatar::before {
    border-radius: 13px;
}

.sidebar.collapsed .user-avatar.premium-avatar::after {
    border-radius: 10px;
}

/* Logout Button */
.logout-btn {
    padding: 10px 12px;
    margin: 0;
    background: #FF3B30;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
    height: 48px;
}

.logout-btn:hover {
    background: #FF2D20;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.logout-btn-icon {
    margin-right: 6px;
    font-size: 14px;
}

.logout-btn-text {
    font-weight: 500;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 8px;
    margin: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.sidebar.collapsed .logout-btn-icon {
    margin-right: 0;
}

.sidebar.collapsed .logout-btn-text {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px !important;
    transition: none;
    background: #f5f5f7;
    height: calc(100vh - 80px);
    width: calc(100vw - 280px) !important;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    top: 0;
    margin-top: 80px;
    padding-top: 0;
}

/* Adjust main-content when banner is present */
body:has(.header-promotion-banner) .main-content {
    margin-top: 118px;
    height: calc(100vh - 118px);
}

/* Adjust content-header when sidebar is collapsed - Using body class */
body.sidebar-collapsed .content-header {
    left: 80px !important;
}

/* Adjust content-header when sidebar is collapsed AND banner is present */
body:has(.header-promotion-banner).sidebar-collapsed .content-header {
    left: 80px !important;
    top: 38px !important;
}

.main-content.sidebar-collapsed {
    margin-left: 80px !important;
    width: calc(100vw - 80px) !important;
}

/* Adjust main-content when sidebar is collapsed AND banner is present */
body:has(.header-promotion-banner) .main-content.sidebar-collapsed {
    margin-left: 80px !important;
    width: calc(100vw - 80px) !important;
}

/* Common Layout Styles for All Pages */
.content-body {
    padding: 32px;
    flex: 1;
    width: 100%;
    max-width: none;
    margin-top: 0;
    margin-bottom: 0;
}

.page-title {
    color: #1d1d1f;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8e8e93;
    margin-top: 4px;
    line-height: 1.2;
}

.breadcrumb a {
    color: #007AFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #0051D5;
}

.breadcrumb-separator {
    color: #8e8e93;
    margin: 0px;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Common Layout */
    .content-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .content-body {
        padding: 20px;
        width: 100%;
    }

    /* Dashboard */
    .dashboard-container {
        width: 100vw;
    }

    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
        width: 100vw;
    }

    /* Admin specific responsive */
    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .admin-stat-card {
        padding: 1rem;
    }

    .admin-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .admin-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-filter-group {
        width: 100%;
    }

    .admin-filter-input {
        min-width: auto;
        width: 100%;
    }

    .admin-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 600px;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Note: Upgrade page responsive styles are in components/upgrade.css */

    /* Modal responsive */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .admin-filters {
        flex-wrap: wrap;
    }

    .admin-filter-group {
        min-width: 200px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .content-header {
        padding: 12px 16px;
    }

    .content-body {
        padding: 16px;
    }

    .admin-stat-card {
        padding: 0.75rem;
    }

    .admin-card {
        padding: 0.75rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.375rem;
        font-size: 0.75rem;
    }

    .admin-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .modal-content {
        width: 98%;
        margin: 5% auto;
    }
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: #007AFF;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    width: 100%;
}

.stat-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: #007AFF;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 20px;
    color: #ffffff;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #8e8e93;
    font-weight: 500;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1d1d1f;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    color: #1d1d1f;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007AFF;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #8e8e93;
}

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

/* Button Styles */
.btn {
    background: #007AFF;
    color: #ffffff;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    background: #0051D5;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button Variants */
.btn-secondary {
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

.btn-secondary:hover {
    background: #e5e5ea;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: #34C759;
    color: #ffffff;
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
    background: #30D158;
}

.btn-danger {
    background: #FF3B30;
    color: #ffffff;
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
    background: #FF2D20;
}

.btn-premium {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    border: none;
    color: white;
}

.btn-premium:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

/* Messages - Hidden by default, using toast notifications instead */
.error,
#error {
    display: none !important;
}

.success,
#success {
    display: none !important;
}

/* Loading */
.loading {
    text-align: center;
    margin: 20px 0;
    display: none;
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #1d1d1f;
    background: #ffffff;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

th {
    background: #f5f5f7;
    color: #6e6e73;
    font-weight: 600;
    font-size: 14px;
}

tr:hover {
    background: rgba(0, 122, 255, 0.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        width: 100vw;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
        width: 100vw;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

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

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 8px;
}

.p-2 {
    padding: 16px;
}

.p-3 {
    padding: 24px;
}

.p-4 {
    padding: 32px;
}

.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

/* Common Layout Styles for All Pages */
.page-title {
    color: #212529;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #8e8e93;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #667eea;
}

/* Note: Upgrade page styles are in components/upgrade.css */