:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --border-color: #1f2937;
    --border-highlight: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shield-icon {
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: var(--accent-blue);
}

.env-pill {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
}

.alert-icon {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Hero */
.hero-section {
    text-align: center;
    padding: 3rem 1rem 4rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 999px;
    font-size: 0.825rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #9ca3af 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.hero-subtitle {
    max-width: 760px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-highlight);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.btn-block {
    width: 100%;
}

/* Grid */
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3.5rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.4);
}

.card-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Diagnostic List */
.diag-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.diag-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.6);
}

.diag-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.diag-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.diag-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.diag-value.highlight {
    color: #60a5fa;
}

.text-success {
    color: #34d399 !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.code-snippet {
    font-family: monospace;
    background: #000;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #a7f3d0;
}

/* Forms */
.form-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #0a0e17;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Features Section */
.section {
    margin-bottom: 3rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.feature-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
}

.badge-status {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Error Pages */
.error-container {
    text-align: center;
    padding: 5rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-code {
    font-size: 5rem;
    font-weight: 900;
    color: var(--accent-rose);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    text-align: center;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-sub {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .grid-2-col { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Self-Contained Auth, Form & Dashboard Component Styles (Zero CDN Dependency)
   ========================================================================== */

/* Auth Layout */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 1rem;
    background: radial-gradient(circle at top, #111827 0%, #0a0e17 100%);
}

.auth-card-box {
    width: 100%;
    max-width: 440px;
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
}

/* Input Form Controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.9rem;
    color: #f9fafb !important;
    background-color: #0b0f19 !important;
    border: 1px solid #374151 !important;
    border-radius: 0.75rem !important;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    background-color: #0f172a !important;
}

/* Buttons */
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.925rem;
    font-weight: 600;
    color: #ffffff !important;
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    border-radius: 0.75rem !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca) !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-1px);
}

/* Global Link Styles */
a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #93c5fd;
}

/* Base Utility Fallbacks */
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.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-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.text-white { color: #ffffff !important; }
.text-gray-300 { color: #d1d5db !important; }
.text-gray-400 { color: #9ca3af !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-blue-400 { color: #60a5fa !important; }
.text-emerald-400 { color: #34d399 !important; }
.text-rose-400 { color: #fb7185 !important; }
.text-purple-400 { color: #c084fc !important; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.relative { position: relative; }
.absolute { position: absolute; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Dashboard Desktop Flex-Row Layout */
body.dashboard-body {
    display: flex !important;
    flex-direction: row !important;
    height: 100vh !important;
    width: 100vw !important;
    max-height: 100vh !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    .app-sidebar {
        width: 270px !important;
        min-width: 270px !important;
        max-width: 270px !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        background: #0f172a !important;
        border-right: 1px solid #1e293b !important;
        z-index: 30 !important;
    }
}

.app-main-viewport {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #020617 !important;
}

.app-main-scroll {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
}



