@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

.header {
    background: #1a1a2e;
    padding: 0;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(26, 26, 46, 0.12);
    overflow: hidden;
}

.header-brand {
    padding: 16px 24px;
    display: flex;
    align-items: center;
}

.header-brand a {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 36px;
    width: auto;
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    padding: 20px 24px 16px;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 16px 16px;
}

.nav a {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nav a.active {
    background: #fff;
    color: #1a1a2e;
    font-weight: 600;
}

.header .user-info {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.header .user-info a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.header .user-info a:hover {
    color: #ff8787;
}

.card {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(26, 26, 46, 0.06);
    border: 1px solid rgba(26, 26, 46, 0.06);
}

.card h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4a4a68;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08);
}

.btn {
    padding: 11px 22px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #2d2d4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.15);
}

.btn:active {
    transform: translateY(0);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 14px 16px;
    text-align: left;
}

th {
    background: #1a1a2e;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th:first-child {
    border-radius: 8px 0 0 0;
}

th:last-child {
    border-radius: 0 8px 0 0;
}

td {
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

tr:hover td {
    background: #f8f9fa;
}

tbody tr:last-child td:first-child {
    border-radius: 0 0 0 8px;
}

tbody tr:last-child td:last-child {
    border-radius: 0 0 8px 0;
}

.status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.status-box {
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
}

.status-box h3 {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
}

.status-box .value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.status-box.success {
    border-color: #22c55e;
    background: #f0fdf4;
}

.status-box.warning {
    border-color: #f59e0b;
    background: #fffbeb;
}

.status-box.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert.success::before {
    content: '✓';
    font-weight: bold;
}

.alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert.error::before {
    content: '!';
    font-weight: bold;
}

.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(26, 26, 46, 0.12);
    z-index: 100;
    display: none;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: background 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8f9fa;
}

/* Loading Spinner */
.search-container input {
    padding-right: 40px;
}

.search-container .loading-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.search-container .loading-spinner.active {
    display: block;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Utility Classes */
.text-muted {
    color: #64748b;
}

.text-success {
    color: #22c55e;
}

.text-error {
    color: #ef4444;
}

.text-warning {
    color: #f59e0b;
}

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 18px;
        padding: 16px 16px 12px;
    }
    
    .nav {
        padding: 0 12px 12px;
        gap: 6px;
    }
    
    .nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .card {
        padding: 16px;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 10px 12px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #4a4a68;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background: #f8f9fa;
    border-color: #1a1a2e;
    color: #1a1a2e;
}

.page-btn.active {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
}

.page-dots {
    color: #999;
    padding: 0 4px;
}

/* Badge Count */
.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #e0e0e0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #4a4a68;
    margin-left: 8px;
}

