* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    height: 100vh;
    background-color: #f3f4f6;
    color: #1f2937;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.nav-menu {
    padding: 1rem 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background-color: #f9fafb;
    color: #111827;
}

.nav-item.active {
    background-color: #eff6ff;
    color: #2563eb;
    border-right-color: #2563eb;
}

.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    background-color: #ffffff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.content-area {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Cards & Forms */
.card {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group input, .form-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    outline: none;
    font-size: 0.875rem;
}

.form-group input:focus, .form-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Table */
.table-container {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    user-select: none;
}

th.sortable {
    cursor: pointer;
    transition: background-color 0.2s;
}

th.sortable:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.sort-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.3;
}
th.sortable.active .sort-icon {
    opacity: 1;
    color: #2563eb;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #f8fafc;
}

select.table-select, input.table-input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #ffffff;
    outline: none;
    width: 100%;
    max-width: 200px;
}

select.table-select:focus, input.table-input:focus {
    border-color: #3b82f6;
}

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

.badge.unassigned {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge.assigned {
    background-color: #dcfce3;
    color: #166534;
}

/* Flex Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* Pagination */
.datatable-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 0.5rem 0.5rem;
}

.pagination {
    display: flex;
    gap: 0.25rem;
}

.page-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.page-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

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

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-danger {
    background-color: #ef4444;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    transform: translateY(150%);
    transition: transform 0.3s;
    z-index: 50;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

#toast.show {
    transform: translateY(0);
}
