*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    color: #1a1a2e;
    background: #f5f6fa;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
}

a {
    color: #6366f1;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Admin layout */
.admin-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: #1a1a2e;
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-header-actions a,
.admin-header-actions button {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
.admin-header-actions a:hover,
.admin-header-actions button:hover {
    color: #fff;
    text-decoration: none;
}

.admin-content {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Admin table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.admin-table th {
    background: #f0f1f5;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f1f5;
    font-size: 0.875rem;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #fafbff;
}

/* Admin forms */
.admin-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.admin-form h4 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.admin-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
}

.admin-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.admin-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    outline: none;
    cursor: pointer;
}

.btn-primary {
    padding: 10px 20px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover {
    background: #4f46e5;
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}
.btn-outline:hover {
    background: #f3f4f6;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-admin {
    background: #ede9fe;
    color: #6d28d9;
}
.badge-user {
    background: #e0f2fe;
    color: #0369a1;
}
.badge-temp {
    background: #fef3c7;
    color: #b45309;
}

.text-muted {
    color: #9ca3af;
}

.text-success {
    color: #059669;
}

.text-error {
    color: #dc2626;
}

.mt-16 { margin-top: 16px; }

/* Blazor error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
