/* Base styles */
:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --secondary: #3b82f6;
    --accent: #06b6d4;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Dashboard Layout */
body {
    background: var(--gray-100);
    min-height: 100vh;
    display: grid;
    grid-template-columns: auto 1fr;
}

/* Sidebar */
.sidebar {
    background: var(--primary);
    color: white;
    width: 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    object-fit: cover;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 0 0.75rem;
}

.menu-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.menu-link:hover {
    background: var(--primary-light);
    color: white;
}

.menu-link.active {
    background: var(--secondary);
    color: white;
}

.menu-link i {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

/* Main Content */
main {
    padding: 2rem;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.header-content p {
    color: var(--gray-500);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.user-menu img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--gray-900);
}

.user-role {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

.stat-title {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary {
    background: rgba(59, 130, 246, 0.1);
    color: rgb(59, 130, 246);
}

.stat-icon.secondary {
    background: rgba(6, 182, 212, 0.1);
    color: rgb(6, 182, 212);
}

.stat-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(34, 197, 94);
}

.stat-icon.accent {
    background: rgba(168, 85, 247, 0.1);
    color: rgb(168, 85, 247);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        z-index: 50;
    }

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

    main {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

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

/* Login Page */
.login-page {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header img {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 22.5%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.login-header h1 {
    color: #2563eb;
    font-size: 1.8rem;
    margin: 0;
}

.login-header p {
    color: #64748b;
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin: 0;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#loginButton {
    width: 100%;
    padding: 0.875rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#loginButton:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

#loginButton:active {
    transform: translateY(1px);
}

.error-message {
    color: #ef4444;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Table Styles */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
}

.data-table tr:hover {
    background: var(--gray-50);
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(34, 197, 94);
}

.status-suspended {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(239, 68, 68);
}

.status-inactive {
    background: rgba(100, 116, 139, 0.1);
    color: rgb(100, 116, 139);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.btn-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: rgb(245, 158, 11);
}

.btn-icon.warning:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(239, 68, 68);
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: var(--gray-600);
    font-size: 0.875rem;
}

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

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.btn i {
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-secondary:focus {
    outline: 2px solid var(--gray-400);
    outline-offset: 2px;
} 