* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;

    --color-blue-50: #eff6ff;
    --color-blue-100: #dbeafe;
    --color-blue-400: #60a5fa;
    --color-blue-500: #3b82f6;
    --color-blue-600: #2563eb;
    --color-blue-700: #1d4ed8;

    --color-green-50: #f0fdf4;
    --color-green-100: #dcfce7;
    --color-green-500: #22c55e;
    --color-green-600: #16a34a;
    --color-green-700: #15803d;
    --color-green-900: #14532d;

    --color-red-50: #fef2f2;
    --color-red-100: #fee2e2;
    --color-red-500: #ef4444;
    --color-red-700: #b91c1c;
    --color-red-900: #7f1d1d;

    --color-yellow-100: #fef3c7;
    --color-yellow-700: #a16207;

    --color-orange-100: #ffedd5;
    --color-orange-700: #c2410c;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-slate-50);
    color: var(--color-slate-800);
    line-height: 1.6;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--color-slate-900);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.sidebar-logo span {
    color: var(--color-blue-400);
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--color-slate-400);
}

.sidebar-user {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-blue-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--color-slate-400);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--color-slate-300);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--color-blue-600);
    color: white;
    border-left: 4px solid var(--color-blue-400);
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.sidebar-section-label {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--color-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-section-label::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-blue-600);
    border-radius: 50%;
    opacity: 0.4;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--color-red-500);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-slate-800);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--color-slate-500);
    font-size: 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 1.5rem;
    border: 1px solid var(--color-slate-200);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--color-blue-300);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-blue-600);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--color-blue-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--color-slate-700);
    border: 1px solid var(--color-slate-200);
}

.btn-secondary:hover {
    background: var(--color-slate-50);
}

.btn-danger {
    background: var(--color-red-500);
    color: white;
}

.btn-danger:hover {
    background: var(--color-red-700);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-slate-700);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-slate-200);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 1.5rem;
    border: 1px solid var(--color-slate-200);
    overflow: hidden;
    margin-top: 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--color-slate-50);
    border-bottom: 1px solid var(--color-slate-100);
}

.table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-slate-100);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background: var(--color-slate-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bg-green-100 {
    background: var(--color-green-100);
}

.text-green-700 {
    color: var(--color-green-700);
}

.bg-blue-100 {
    background: var(--color-blue-100);
}

.text-blue-700 {
    color: var(--color-blue-700);
}

.bg-yellow-100 {
    background: var(--color-yellow-100);
}

.text-yellow-700 {
    color: var(--color-yellow-700);
}

.bg-red-100 {
    background: var(--color-red-100);
}

.text-red-700 {
    color: var(--color-red-700);
}

.bg-orange-100 {
    background: var(--color-orange-100);
}

.text-orange-700 {
    color: var(--color-orange-700);
}

.bg-slate-100 {
    background: var(--color-slate-100);
}

.text-slate-700 {
    color: var(--color-slate-700);
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    gap: 0.5rem;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-slate-200);
    background: white;
    color: var(--color-slate-700);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--color-slate-50);
    border-color: var(--color-blue-400);
    color: var(--color-blue-600);
}

.pagination-btn.active {
    background: var(--color-blue-600);
    color: white;
    border-color: var(--color-blue-600);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--color-slate-50);
}

.pagination-ellipsis {
    color: var(--color-slate-400);
    padding: 0 0.25rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: var(--color-green-50);
    color: var(--color-green-900);
    border: 1px solid var(--color-green-100);
}

.alert-error {
    background: var(--color-red-50);
    color: var(--color-red-900);
    border: 1px solid var(--color-red-100);
}

.alert-info {
    background: var(--color-blue-50);
    color: var(--color-blue-700);
    border: 1px solid var(--color-blue-100);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-4 {
    gap: 2rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: white;
    border-radius: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    padding: 2rem;
    background: var(--color-slate-900);
    color: white;
    text-align: center;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header h1 span {
    color: var(--color-blue-400);
}

.login-header p {
    font-size: 0.875rem;
    color: var(--color-slate-400);
}

.login-body {
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-slate-800);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--color-slate-100);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-close {
    background: var(--color-slate-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-slate-500);
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--color-red-100);
    color: var(--color-red-700);
}

/* Form Enhancements */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--color-slate-400);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-with-icon {
    padding-left: 2.75rem !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.95);
}