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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #111827;
    background: #f8fafc; /* pastel background */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* Navbar */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .nav-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #312e81;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.brand-title {
    color: #1f2937;
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-alert-pill {
	font-size: 0.75rem;
	padding: 0.25rem 0.65rem;
	border-radius: 999px;
	border: 1px solid #1f2937;
	background: rgba(29, 78, 216, 0.08);
	color: #1d4ed8;
}
.nav-alert-pill.warning {
	background: rgba(245, 158, 11, 0.08);
	color: #f97316;
	border-color: rgba(245, 158, 11, 0.5);
}
.nav-alert-pill.critical {
	background: rgba(220, 38, 38, 0.08);
	color: #dc2626;
	border-color: rgba(220, 38, 38, 0.5);
}
.nav-alert-pill.hidden {
	display: none;
}

.alert-snackbar {
	position: fixed;
	top: 72px;
	right: 1rem;
	left: 1rem;
	max-width: 360px;
	margin: 0 auto;
	padding: 0.75rem 1rem;
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
	font-weight: 500;
	color: #111827;
	background: rgba(16, 185, 129, 0.1);
	border: 1px solid rgba(16, 185, 129, 0.4);
	transition: transform 0.3s ease, opacity 0.3s ease;
	transform: translateY(-100%);
	opacity: 0;
}
.alert-snackbar.warning {
	background: rgba(245, 158, 11, 0.12);
	border-color: rgba(245, 158, 11, 0.6);
}
.alert-snackbar.critical {
	background: rgba(220, 38, 38, 0.12);
	border-color: rgba(220, 38, 38, 0.6);
}
.alert-snackbar.visible {
	opacity: 1;
	transform: translateY(0);
}
.alert-snackbar .alert-snackbar-content {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}
.alert-snackbar .alert-snackbar-link {
	font-size: 0.75rem;
	color: inherit;
}
.alert-snackbar button {
	color: inherit;
	border: none;
	padding: 0;
	background: transparent;
	font-weight: 600;
	cursor: pointer;
}

.nav-guest {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user-label {
    font-weight: 600;
    color: #1e293b;
}

.nav-user-link {
    cursor: pointer;
    text-decoration: none;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover { color: #6366f1; }
.nav-link.active { color: #4f46e5; }
.nav-link.disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}

/* Main Content */
main {
    min-height: calc(100vh - 70px);
    padding: 2rem 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #93c5fd; /* pastel blue */
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-primary { background: linear-gradient(135deg, #a5b4fc, #93c5fd); color: #111827; }
.btn-primary:hover { filter: brightness(0.98); }

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Hero */
.hero-section {
    padding: 3rem 0 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    align-items: stretch;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: #6366f1;
    font-weight: 600;
}

.hero-copy h1 {
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.1;
    color: #0f172a;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #475569;
    max-width: 55ch;
}

.hero-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.hero-benefits li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #1e293b;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.cta-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.cta-link:hover {
    text-decoration: underline;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.3);
    max-width: 420px;
    margin-left: auto;
}

.auth-toggle {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.auth-toggle-btn {
    border: none;
    background: transparent;
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    color: #475569;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-toggle-btn:hover {
    color: #1e293b;
}

.auth-toggle-btn.active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.16);
}

.auth-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-subtitle-text {
    color: #475569;
    font-size: 0.95rem;
}

.auth-switch {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
}

.auth-switch a {
    color: #4f46e5;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.stats-section {
    padding: 1rem 0 2rem;
}

.stats-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    align-items: center;
}

.directory-preview .card {
    margin-bottom: 0;
}

.card-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.program-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.preview-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.preview-card-header h4 {
    font-size: 1rem;
    color: #0f172a;
}

.preview-chip {
    padding: 0.3rem 0.6rem;
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.preview-description {
    color: #475569;
    font-size: 0.9rem;
}

.preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.preview-meta {
    color: #6366f1;
    font-weight: 600;
}

.preview-link {
    color: #111827;
    font-weight: 500;
    text-decoration: none;
}

.preview-link:hover {
    color: #4f46e5;
}

.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
}

.meta-text {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.programs-header {
    margin-bottom: 1.5rem;
}

.empty-state-card {
    background: #f8fafc;
    border: 1px dashed #c7d2fe;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.empty-state-title {
    font-size: 1.4rem;
    color: #0f172a;
    margin: 0;
}

.empty-state-body {
    margin: 0;
    max-width: 38ch;
    color: #475569;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.site-footer {
    background: #0f172a;
    color: #e2e8f0;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.site-footer h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #f8fafc;
}

.site-footer p {
    color: #cbd5f5;
    font-size: 0.95rem;
}

.site-footer strong {
    display: block;
    color: #f8fafc;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card {
        margin: 0;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .nav-guest {
        gap: 0.5rem;
    }
}

/* Search */
.search-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Program Cards */
.program-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.program-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.program-brand {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.program-description {
    color: #666;
    margin-bottom: 1rem;
}

.program-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.keyword-tag {
    background: #eef2ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #4f46e5;
}

.program-actions {
    display: flex;
    gap: 0.5rem;
}

/* Dashboard */
.dashboard-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 2rem;
}

.dashboard-alert-center {
	margin-bottom: 1rem;
}

.alert-center-card .alert-chip {
	font-size: 0.85rem;
	padding: 0.25rem 0.65rem;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	margin-left: 1rem;
}

.alert-center-card .alert-chip.success {
	color: #138a00;
	background: rgba(19, 138, 0, 0.08);
}

.alert-center-card .alert-chip.warning {
	color: #b45309;
	background: rgba(180, 83, 9, 0.08);
}

.alert-center-card .alert-chip.neutral {
	color: #1f2937;
	background: rgba(15, 23, 42, 0.08);
}

.alert-center-card .alert-center-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.alert-center-card .alert-row {
	display: flex;
	justify-content: space-between;
	font-size: 0.9rem;
	color: #374151;
}

.alert-center-card .alert-row p {
	margin: 0;
}

.alert-center-card .trend-alert-table {
	overflow-x: auto;
}

.alert-center-card table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	margin-top: 0.5rem;
}

.alert-center-card th,
.alert-center-card td {
	padding: 0.35rem 0.4rem;
	text-align: left;
	border-bottom: 1px solid #e5e7eb;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #1e293b;
}

.card-actions {
    margin-left: auto;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.program-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.program-avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.program-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.program-url {
    font-size: 0.875rem;
    color: #4f46e5;
    word-break: break-all;
    text-decoration: none;
}

.program-url:hover {
    text-decoration: underline;
}

.tracking-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tracking-field input {
    flex: 1;
    min-width: 180px;
}

.onboarding-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 2rem;
    border: 1px dashed #d1d5db;
}

.onboarding-hero h3 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
}

.onboarding-hero p {
    margin: 0;
    color: #4b5563;
    max-width: 540px;
}

.onboarding-steps {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: grid;
    gap: 1rem;
}

.onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.step-index {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #4f46e5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step-body h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.step-body p {
    margin: 0;
    color: #4b5563;
}

.step-helper {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6366f1;
}

.onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.wizard-modal {
    max-width: 640px;
    width: 92%;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
    z-index: 1000;
    padding: 1.25rem;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
    position: relative;
    padding: 1.5rem;
}

.modal-content:focus-visible {
	outline: 3px solid #4f46e5;
	outline-offset: 4px;
}

.modal .close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #475569;
}

.wizard-header h2 {
    margin: 0 0 0.5rem;
}

.wizard-header p {
    margin: 0;
    color: #4b5563;
}

.wizard-progress {
	display: flex;
	justify-content: space-between;
	margin-top: 1rem;
	padding: 0 0.5rem;
}

.progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	padding: 0.5rem;
	border-bottom: 2px solid #e5e7eb;
	color: #94a3b8;
}

.progress-step.active {
	border-color: #4f46e5;
	color: #1f2937;
}

.progress-step .step-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
}

.wizard-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wizard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.wizard-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .wizard-grid {
        grid-template-columns: 1fr;
    }
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.image-preview img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.image-preview input {
    flex: 1;
}

.branding-swatches {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.swatch-group,
.font-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #475569;
}

.color-chip {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #cbd5f5;
    background: #e0e7ff;
}

.font-group span:last-child {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
    color: #0f172a;
}

.preview-status {
    font-size: 0.9rem;
    margin: 0;
    color: #4b5563;
}

.preview-status[data-state="loading"] {
    color: #2563eb;
}

.preview-status[data-state="success"] {
    color: #15803d;
}

.preview-status[data-state="error"] {
    color: #b91c1c;
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid #eee;
    font-weight: 600;
    color: #333;
    background-color: transparent;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: #f8f9fa;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal footer */
.modal-footer {
    margin-top: 1rem;
    text-align: center;
    color: #666;
}

.modal-footer a {
    color: #007bff;
    text-decoration: none;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .program-actions {
        flex-direction: column;
    }
}
.alert-metrics {
	position: fixed;
	top: 132px;
	right: 1rem;
	left: 1rem;
	max-width: 440px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.5rem;
	background: rgba(15, 23, 42, 0.9);
	padding: 0.5rem;
	border-radius: 12px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.12);
}
.alert-metrics.hidden {
	display: none;
}
.alert-metric-card {
	background: rgba(59, 130, 246, 0.15);
	border-radius: 8px;
	padding: 0.35rem 0.6rem;
	text-align: center;
}
.alert-metric-label {
	font-size: 0.65rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
}
.alert-metric-value {
	font-size: 1.1rem;
	font-weight: 600;
}
