/* Professional Dark Theme Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #1f1f1f;
    --border-primary: rgba(37, 99, 235, 0.15);
    --border-secondary: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --accent-primary: #2563EB;
    --accent-secondary: #1e40af;
    --accent-muted: rgba(37, 99, 235, 0.1);
    --success: #10b981;
    --success-muted: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-muted: rgba(245, 158, 11, 0.1);
    --danger: #dc2626;
    --danger-muted: rgba(220, 38, 38, 0.1);
    --info: #6b7280;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Professional Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* Professional Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.15s ease;
}

.card:hover {
    border-color: var(--border-secondary);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.15s ease;
}

.stat-card:hover {
    border-color: var(--border-secondary);
    background: var(--bg-elevated);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    margin-top: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.stat-change.positive {
    color: var(--success);
    background: var(--success-muted);
}

.stat-change.negative {
    color: var(--danger);
    background: var(--danger-muted);
}

/* Professional Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input, textarea, select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

/* Professional Tables */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-secondary);
}

th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.875rem;
}

tbody tr {
    transition: background-color 0.1s ease;
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Professional Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--accent-muted);
    color: var(--accent-primary);
    border: 1px solid var(--border-primary);
}

.badge-success {
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: var(--warning-muted);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: var(--danger-muted);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-info {
    background: rgba(107, 114, 128, 0.1);
    color: var(--info);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.nav-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-muted);
    color: var(--accent-primary);
}

/* Professional Icons */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Loading States */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    margin-bottom: 0.5rem;
}

.tooltip:hover .tooltip-content {
    opacity: 1;
}

/* Dividers */
.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 1.5rem 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--border-subtle);
    margin: 0 1rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* Error UI */
#blazor-error-ui {
    background: var(--bg-tertiary);
    bottom: 0;
    box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.5);
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--text-primary);
    border-top: 1px solid var(--danger);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

#blazor-error-ui .dismiss:hover {
    color: var(--danger);
}

.blazor-error-boundary {
    background: var(--danger-muted);
    padding: 1rem;
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 6px;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page.";
}

/* Utility Classes */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.shadow { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5); }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Grid System */
.grid {
    display: grid;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .container {
        padding: 0 1rem;
    }
    
    .table-responsive {
        font-size: 0.8125rem;
    }
    
    th, td {
        padding: 0.625rem 0.5rem;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}