/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --secondary: #95a5a6;
    --light: #ecf0f1;
    --dark: #1a252f;
    --bg: #f5f7fa;
    --text: #2c3e50;
    --text-muted: #7f8c9a;
    --border: #e8ecef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 32px 0;
    z-index: 1000;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px 28px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
}

.brand-text h5 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: 0.5px;
}

.brand-text span {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 24px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 11px 24px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-icon {
    margin-right: 10px;
    font-size: 6px;
    opacity: 0.5;
}

.nav-item:hover {
    color: var(--text);
    background: #f8f9fa;
}

.nav-item.active {
    color: var(--text);
    background: #f8f9fa;
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
    margin-left: 260px;
    padding: 32px 40px;
    min-height: 100vh;
}

/* ==================== HEADER ==================== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
}

.page-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* ==================== HERO SECTION (JUMBOTRON) ==================== */
.hero-section {
    background: var(--primary);
    border-radius: var(--radius);
    padding: 44px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1.2px;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 30px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.hero-description {
    font-size: 15px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 24px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

/* Hero Buttons */
.btn-hero-primary,
.btn-hero-secondary {
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-hero-primary {
    background: #fff;
    color: var(--primary);
}

.btn-hero-primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.btn-hero-primary:active {
    transform: translateY(0);
    background: #ecf0f1;
}

.btn-hero-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.btn-hero-secondary:active {
    background: rgba(255,255,255,0.05);
}

/* ==================== ALERTS SECTION ==================== */
.alerts-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: none;
    position: relative;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.alert:active {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #ffffff;
    border-left: 4px solid var(--success);
}

.alert-success:hover {
    background: #f8fdfb;
    border-left-width: 6px;
}

.alert-warning {
    background: #ffffff;
    border-left: 4px solid var(--warning);
}

.alert-warning:hover {
    background: #fffcf8;
    border-left-width: 6px;
}

.alert-danger {
    background: #ffffff;
    border-left: 4px solid var(--danger);
}

.alert-danger:hover {
    background: #fffafa;
    border-left-width: 6px;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.alert:hover .alert-icon {
    transform: scale(1.1) rotate(5deg);
}

.alert-success .alert-icon {
    background: #d5f4e6;
    color: var(--success);
}

.alert-warning .alert-icon {
    background: #fef5e7;
    color: var(--warning);
}

.alert-danger .alert-icon {
    background: #fadbd8;
    color: var(--danger);
}

.alert-body {
    flex: 1;
}

.alert-body strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
    transition: color 0.3s ease;
}

.alert:hover .alert-body strong {
    color: var(--primary);
}

.alert-body p {
    font-size: 14px;
    margin: 0;
    color: var(--text-muted);
}

.btn-close {
    position: absolute;
    top: 18px;
    right: 18px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.btn-close:hover {
    opacity: 1;
    transform: rotate(90deg) scale(1.2);
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

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

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

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.trend-up {
    background: #d5f4e6;
    color: var(--success);
}

.trend-down {
    background: #fadbd8;
    color: var(--danger);
}

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

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

/* ==================== CONTENT CARD ==================== */
.content-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.card-header {
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.card-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* ==================== METRICS LIST (PROGRESS BARS) ==================== */
.metrics-list {
    display: grid;
    gap: 24px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.metric-item:hover {
    background: #f0f2f5;
    transform: translateX(4px);
}

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

.metric-label {
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
}

.metric-value {
    font-size: 16px;
    color: var(--text);
    font-weight: 700;
}

.progress {
    height: 12px;
    background: #e8ecef;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--bar-color) 0%, var(--bar-color-light) 100%);
}

.bg-primary {
    --bar-color: #2c3e50;
    --bar-color-light: #34495e;
    background: linear-gradient(90deg, var(--bar-color) 0%, var(--bar-color-light) 100%);
}

.bg-success {
    --bar-color: #27ae60;
    --bar-color-light: #2ecc71;
    background: linear-gradient(90deg, var(--bar-color) 0%, var(--bar-color-light) 100%);
}

.bg-warning {
    --bar-color: #f39c12;
    --bar-color-light: #f1c40f;
    background: linear-gradient(90deg, var(--bar-color) 0%, var(--bar-color-light) 100%);
}

.bg-danger {
    --bar-color: #e74c3c;
    --bar-color-light: #ec7063;
    background: linear-gradient(90deg, var(--bar-color) 0%, var(--bar-color-light) 100%);
}

/* ==================== ACTIONS GRID (BUTTONS) ==================== */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--radius);
}

.group-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 4px 0;
}

.btn-group-custom {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Button Styles */
.btn {
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    display: inline-block;
}

.btn:focus {
    outline: 3px solid rgba(44, 62, 80, 0.2);
    outline-offset: 2px;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.btn-primary:active {
    background: #1a252f;
    transform: translateY(0);
    box-shadow: none;
    color: #ffffff;
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-success:active {
    background: #1e7e44;
    transform: translateY(0);
    box-shadow: none;
    color: #ffffff;
}

/* Warning Button */
.btn-warning {
    background: var(--warning);
    color: #ffffff;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-warning:active {
    background: #d35400;
    transform: translateY(0);
    box-shadow: none;
    color: #ffffff;
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:active {
    background: #a93226;
    transform: translateY(0);
    box-shadow: none;
    color: #ffffff;
}

/* Outline Buttons */
.btn-outline-primary {
    background: #ffffff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.btn-outline-primary:active {
    background: #1a252f;
    border-color: #1a252f;
    color: #ffffff;
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-secondary {
    background: #ffffff;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline-secondary:hover {
    background: var(--text);
    color: #ffffff;
    border-color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.btn-outline-secondary:active {
    background: var(--dark);
    border-color: var(--dark);
    color: #ffffff;
    transform: translateY(0);
    box-shadow: none;
}

/* Small Button */
.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
}

/* ==================== TABLE ==================== */
.table {
    width: 100%;
    margin-bottom: 0;
}

.table thead th {
    background: var(--light);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.table tbody td {
    padding: 14px 16px;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid var(--light);
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: background var(--transition);
}

.table-hover tbody tr:hover {
    background: #f8f9fa;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

.badge.bg-success {
    background: #d5f4e6 !important;
    color: var(--success);
}

.badge.bg-warning {
    background: #fef5e7 !important;
    color: var(--warning);
}

.badge.bg-danger {
    background: #fadbd8 !important;
    color: var(--danger);
}

/* ==================== PAGINATION ==================== */
.pagination-nav {
    margin-top: 24px;
}

.pagination {
    gap: 6px;
}

.page-link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all var(--transition);
}

.page-link:hover {
    background: #f8f9fa;
    border-color: var(--text-muted);
    color: var(--text);
}

.page-link:focus {
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.15);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-item.active .page-link:hover {
    background: var(--dark);
    border-color: var(--dark);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background: #fff;
    border-color: var(--border);
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== FOOTER ==================== */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.main-footer p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--text);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .main-wrapper {
        padding: 24px 28px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-wrapper {
        margin-left: 0;
        padding: 20px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .hero-section {
        padding: 32px 24px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .main-footer {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text);
}

/* ==================== ANIMATIONS ==================== */
@media (prefers-reduced-motion: no-preference) {
    .stat-card,
    .alert,
    .nav-item {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
}