html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
    text-align: start;
}

/* ===== Auth Pages ===== */

.auth-page {
    min-height: 100vh;
    background: #f5f7fa;
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

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

.auth-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #060649;
    margin-bottom: 1.2rem;
    letter-spacing: -0.01em;
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 0;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.4rem;
}

.auth-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: #060649;
    box-shadow: 0 0 0 3px rgba(6, 6, 73, 0.12);
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #4b5563;
    cursor: pointer;
}

.auth-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: #060649;
}

.auth-link {
    color: #060649;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.auth-link:hover {
    color: #0a0a7a;
    text-decoration: underline;
}

.auth-btn-primary {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #060649;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(6, 6, 73, 0.35);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-secondary {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.auth-btn-secondary:hover {
    border-color: #060649;
    background: #f0f0f8;
    color: #060649;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #6b7280;
}

.auth-link-bold {
    color: #060649;
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.3rem;
    transition: color 0.15s;
}

.auth-link-bold:hover {
    color: #0a0a7a;
    text-decoration: underline;
}

.auth-page-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}

.auth-page-footer a {
    color: #060649;
    text-decoration: none;
}

/* ===== Register Split Panel ===== */

.auth-split {
    display: flex;
    min-height: 100vh;
}

.auth-split-brand {
    flex: 0 0 42%;
    background: #060649;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-split-brand::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-split-brand::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-split-brand-content {
    position: relative;
    z-index: 1;
    color: #fff;
}

.auth-split-brand-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}

.auth-split-brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-split-brand-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.auth-feature-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    flex-shrink: 0;
}

.auth-split-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: #fff;
}

.auth-split-form-inner {
    width: 100%;
    max-width: 440px;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .auth-split {
        flex-direction: column;
    }

    .auth-split-brand {
        flex: none;
        min-height: auto;
        padding: 2rem;
    }

    .auth-split-brand-title {
        font-size: 1.5rem;
    }

    .auth-split-form {
        padding: 2rem 1.5rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

/* ===== API Keys Page ===== */

.apikeys-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.apikeys-page .page-subtitle {
    color: var(--neutral-foreground-hint, #6b7280);
    margin: 0;
    font-size: 0.9rem;
}

.apikeys-page .page-footer-info {
    color: var(--neutral-foreground-hint, #6b7280);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.apikeys-page .loading-container {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.apikey-masked {
    background: #f3f4f6;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #374151;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.apikey-reveal-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f0f4ff;
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-top: 0.5rem;
}

.apikey-reveal-value {
    flex: 1;
    font-size: 0.82rem;
    word-break: break-all;
    color: #060649;
    font-weight: 500;
}

/* ===== Custom Modal ===== */

.ak-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-modal-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 90%;
    display: flex;
    flex-direction: column;
}

.ak-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.ak-modal-body {
    padding: 1.25rem;
}

.ak-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
}

/* ===== Dashboard Page ===== */

.home-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.home-page .page-subtitle {
    color: var(--neutral-foreground-hint, #6b7280);
    margin: 0;
    font-size: 0.9rem;
}

.home-page .loading-container {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.home-page .page-footer-info {
    color: var(--neutral-foreground-hint, #6b7280);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* ===== Forms Page ===== */

.forms-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forms-page .page-subtitle {
    color: var(--neutral-foreground-hint, #6b7280);
    margin: 0;
    font-size: 0.9rem;
}

.forms-page .page-footer-info {
    color: var(--neutral-foreground-hint, #6b7280);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.forms-page .loading-container {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

/* ===== Form Detail Page ===== */

.form-detail-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-detail-page .page-subtitle {
    color: var(--neutral-foreground-hint, #6b7280);
    margin: 0;
    font-size: 0.9rem;
}

.form-detail-page .loading-container {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.form-detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-detail-panel {
    border: 1px solid var(--neutral-stroke-rest, #e5e7eb);
    border-radius: 8px;
    padding: 1.25rem;
    background: var(--neutral-layer-card-container, #fff);
}

.field-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: background 0.15s;
}

.field-item:hover {
    background: var(--neutral-fill-stealth-hover, #f5f5f5);
}

.field-item-included {
    background: var(--neutral-fill-stealth-rest, #f0f0f0);
}

.field-item-name {
    flex: 1;
    font-weight: 500;
}

.field-item-type {
    color: var(--neutral-foreground-hint, #6b7280);
    font-size: 0.78rem;
}

.included-field-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--neutral-stroke-rest, #e5e7eb);
    border-radius: 6px;
    margin-bottom: 0.35rem;
    background: var(--neutral-layer-floating, #fff);
}

.included-field-order {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-fill-rest, #0078d4);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.included-field-name {
    flex: 1;
    font-weight: 500;
}

.included-field-type {
    color: var(--neutral-foreground-hint, #6b7280);
    font-size: 0.78rem;
}

.included-field-actions {
    display: flex;
    gap: 0.15rem;
    flex-shrink: 0;
}

/* ===== Public Layout ===== */

.public-layout {
    min-height: 100vh;
    background: #f5f7fa;
}

.public-main {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

/* ===== Public Form Page ===== */

.public-form-page {
    width: 100%;
    max-width: 640px;
}

.public-form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 2rem;
}

.public-form-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.public-form-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.public-form-entity {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
}

.public-form-fields {
    margin-bottom: 1rem;
}

.public-form-actions {
    margin-top: 1.5rem;
}

.public-form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 2rem;
    text-align: center;
}

.public-form-success h2 {
    margin: 0;
    color: #059669;
}

.public-form-success p {
    color: #6b7280;
    margin: 0;
}

/* ===== Dashboard Editor ===== */

.dashboard-editor-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-editor-page .page-subtitle {
    color: var(--neutral-foreground-hint, #6b7280);
    margin: 0;
    font-size: 0.9rem;
}

.dashboard-editor-page .loading-container {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.dashboard-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--neutral-foreground-hint, #6b7280);
}

.dashboard-empty-state p {
    font-size: 1.05rem;
    margin: 0;
}

/* Gridstack overrides */
.grid-stack {
    width: 100% !important;
    min-height: 400px;
    background: transparent;
}

.grid-stack-item-content {
    border-radius: 10px;
    overflow: hidden;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
}

.widget-content-wrapper {
    height: 100%;
    width: 100%;
}

/* Widget card */
.widget-card {
    background: var(--neutral-layer-card-container, #1e1e2e);
    border: 1px solid var(--neutral-stroke-rest, #333);
    border-radius: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.widget-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--neutral-stroke-rest, #333);
    flex-shrink: 0;
}

.widget-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--neutral-foreground-rest, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-actions {
    display: flex;
    gap: 0.1rem;
    flex-shrink: 0;
}

.widget-card-body {
    flex: 1;
    padding: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-no-data {
    color: var(--neutral-foreground-hint, #6b7280);
    font-size: 0.85rem;
    text-align: center;
}

/* KPI Card */
.widget-kpi-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.widget-kpi-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-fill-rest, #0078d4);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--neutral-foreground-hint, #6b7280);
    margin-top: 0.4rem;
    text-align: center;
}