/* =================================
   Admin Panel Styles
   ================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6A00;
    --secondary-color: #FF8C00;
    --dark-bg: #1a1a1a;
    --sidebar-bg: #2d2d2d;
    --header-bg: #ffffff;
    --content-bg: #f5f6fa;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #e0e0e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --gradient-primary: linear-gradient(135deg, #FF6A00 0%, #FF8C00 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--content-bg);
    color: var(--text-dark);
}

/* =================================
   Header
   ================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: var(--content-bg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 24px;
}

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

.notification-icon {
    position: relative;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 10px;
}

.notification-icon .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 10px;
    transition: all 0.3s;
}

.user-menu:hover {
    background: var(--content-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
}

/* =================================
   Sidebar
   ================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--sidebar-bg);
    padding: 20px 0;
    overflow-y: auto;
    z-index: 99;
    transition: transform 0.3s;
}

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

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255, 106, 0, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid white;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

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

.main-content.expanded {
    margin-left: 0;
}

/* =================================
   Welcome Banner
   ================================= */
.welcome-banner {
    background: var(--gradient-primary);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.welcome-text p {
    font-size: 16px;
    opacity: 0.9;
}

.quick-actions {
    display: flex;
    gap: 15px;
}

/* =================================
   Stats Grid
   ================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-details h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-change {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* =================================
   Modules Section
   ================================= */
.modules-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.module-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.module-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin-bottom: 20px;
}

.module-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.module-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.module-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.module-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* =================================
   Activity Section
   ================================= */
.activity-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    transition: background 0.3s;
}

.activity-item:hover {
    background: var(--content-bg);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.activity-icon.success {
    background: var(--success);
}

.activity-icon.info {
    background: var(--info);
}

.activity-icon.warning {
    background: var(--warning);
}

.activity-icon.danger {
    background: var(--danger);
}

.activity-content h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.activity-content p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-light);
}

/* =================================
   Buttons
   ================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 106, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

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

/* =================================
   Modal
   ================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    height: 600px;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* =================================
   Responsive Design
   ================================= */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 15px;
    }

    .main-content {
        padding: 15px;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .welcome-text h1 {
        font-size: 24px;
    }

    .quick-actions {
        flex-direction: column;
        width: 100%;
    }

    .quick-actions .btn {
        width: 100%;
        justify-content: center;
    }

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

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