/* --- GLOBAL THEME CONFIGURATION --- */
/* Change these colors here, and the entire app will instantly update. */
#blazor-error-ui {
    display: none; /* Hides it by default! */
    background: #ef4444;
    color: white;
    bottom: 0;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    text-align: center;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.8rem;
}

:root {
    /* Primary: Modern Emerald Green */
    --primary-color: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.4);
    /* Secondary: Modern Tech Blue */
    --secondary-color: #3b82f6;
    --secondary-hover: #2563eb;
    --secondary-glow: rgba(59, 130, 246, 0.4);
    /* Backgrounds & Surfaces (Dark Mode Optimized) */
    --bg-main: #020617; /* Deep slate black */
    --surface-glass: rgba(255, 255, 255, 0.03);
    --surface-border: rgba(255, 255, 255, 0.08);
    /* Text */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
}

html, body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Global Button Styles using the Theme Variables */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 1.5px; /* Gives it that modern tech look */
    text-transform: uppercase; /* Crisp and authoritative */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--secondary-glow);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--secondary-glow);
}

.dashboard-layout {
    display: flex;
    height: 100vh;
    background-color: var(--bg-main);
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background: var(--surface-glass);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 24px 32px 24px;
}

.logo-accent {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    border-radius: 8px;
    margin-right: 16px;
    transform: rotate(45deg);
    box-shadow: 0 4px 15px var(--secondary-glow);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    color: var(--text-main);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-item .icon {
    margin-right: 16px;
    font-size: 1.2rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* The magic active state using your Primary Green */
.nav-item.active {
    background: linear-gradient(90deg, var(--primary-glow) 0%, transparent 100%);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

/* --- MAIN CONTENT & TOPBAR --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--surface-border);
    z-index: 5;
}

.page-title h3 {
    margin: 0;
    font-weight: 600;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.greeting {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.name {
    font-size: 0.95rem;
    color: var(--text-main);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.content-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* --- PAGE HEADERS & PANELS --- */
.page-header {
    margin-bottom: 24px;
}

    .page-header h2 {
        color: var(--text-main);
        margin: 0 0 8px 0;
        font-weight: 800;
        letter-spacing: 1px;
    }

.text-muted {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.glass-panel-content {
    background: var(--surface-glass);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 30px;
    min-height: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* --- THE TABS --- */
.tabs-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 16px;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.tab-btn .icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateY(-2px);
}

/* The glowing Active state using your Green Theme */
.tab-btn.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), transparent);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

/* Smooth Tab Switching Animation */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- FORMS & INPUTS --- */
.form-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.form-card h4 {
    margin-top: 0;
    color: var(--text-main);
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-select option {
    background-color: var(--bg-main);
    color: var(--text-main);
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

/* --- MODERN DATA TABLE --- */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.modern-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--surface-border);
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modern-table tbody tr {
    transition: background 0.2s ease;
}

.modern-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* --- BADGES & ICONS --- */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

input, select, textarea {
    font-size: 16px !important; /* Forces Apple to disable auto-zoom */
}