:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --secondary: #34d399;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #059669;
    --danger: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    font-size: 0.875rem;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem 2rem;
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(52, 211, 153, 0.05) 0px, transparent 50%);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.nav-logo span {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(to right, #059669, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.nav-item {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(16, 185, 129, 0.05);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.3);
}

.nav-item i {
    font-size: 1.1rem;
}

.nav-section-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem 1rem 0.5rem 1rem;
    margin-top: 0.75rem;
}

.nav-section-header:first-of-type {
    margin-top: 0.25rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #059669, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-info h3 {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-info p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.bulk-actions-bar {
    background: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease;
    font-size: 0.85rem;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.search-bar {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-bar form {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    color: var(--text-main);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.filter-select {
    padding: 0.6rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    color: var(--text-main);
    font-size: 0.85rem;
    min-width: 140px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.search-bar input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

th {
    text-align: left;
    padding: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table-filter {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    background: #f8fafc;
    color: var(--text-main);
    font-weight: normal;
}

.table-filter:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

tr:hover td {
    background: rgba(16, 185, 129, 0.02);
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-level {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

.actions {
    display: flex;
    gap: 0.4rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    color: var(--text-main);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Loading Modal */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-card {
    background: white;
    padding: 3rem;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90%;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f1f5f9;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar,
.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.4);
}

/* Firefox scrollbar */
.sidebar,
.nav-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.2) transparent;
}