/* ============================================================
   FuneralAgencyERP — Crystal Light Theme
   Crystal Clear ERP family
   ============================================================ */

:root {
    --funeral-primary:       #0284C7;
    --funeral-primary-dark:  #0369A1;
    --funeral-primary-light: #BAE6FD;
    --funeral-primary-pale:  #F0F9FF;
    --funeral-accent:        #0891B2;
    --funeral-green:         #059669;
    --funeral-green-light:   #D1FAE5;
    --funeral-amber:         #D97706;
    --funeral-amber-light:   #FEF3C7;
    --funeral-red:           #DC2626;
    --funeral-red-light:     #FEE2E2;
    --funeral-slate:         #334155;

    --crystal-bg:        #EBF5FB;
    --crystal-surface:   #FFFFFF;
    --crystal-border:    rgba(2, 132, 199, 0.12);
    --crystal-shadow:    0 4px 24px rgba(2, 132, 199, 0.08);
    --crystal-shadow-lg: 0 12px 40px rgba(2, 132, 199, 0.13);

    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #94A3B8;

    --nav-width:      264px;
    --topbar-height:  56px;
    --radius:         14px;
    --radius-sm:      8px;
}

/* ---- База ---- */
*, *::before, *::after {
    box-sizing: border-box;
    animation-duration:        0s !important;
    animation-delay:           0s !important;
    animation-iteration-count: 1 !important;
}

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #C2DFF4 100%) fixed;
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============================================================
   MudBlazor overrides
   ============================================================ */

.mud-drawer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.mud-main-content { background: transparent !important; }

.mud-paper {
    border-radius: var(--radius) !important;
    background: linear-gradient(135deg, #ffffff 0%, #daeef8 100%) !important;
}

.mud-card {
    border-radius: var(--radius) !important;
    box-shadow: var(--crystal-shadow) !important;
    border: 1px solid var(--crystal-border) !important;
}

/* Заглавия на таблици */
.mud-table-head .mud-table-cell {
    background: var(--funeral-primary-pale) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--funeral-primary) !important;
}

/* Полета */
.mud-input-control,
.mud-input-slot,
.mud-input,
.mud-select-input,
.mud-autocomplete,
.mud-picker input,
.mud-checkbox .mud-button-root,
.mud-switch-track,
.mud-radio .mud-button-root {
    background-color: #ffffff !important;
}
.mud-input-outlined {
    background-color: #ffffff !important;
    border-radius: var(--radius-sm) !important;
}
.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--crystal-border) !important;
    border-radius: var(--radius-sm) !important;
}

/* Бутони */
.mud-button-filled { border-radius: 10px !important; font-weight: 600 !important; }

.mud-button-root.mud-button-filled.mud-button-filled-primary {
    background: var(--funeral-primary) !important;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.35) !important;
}
.mud-button-root.mud-button-filled.mud-button-filled-primary:hover {
    background: var(--funeral-primary-dark) !important;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.40) !important;
}
.mud-button-root.mud-button-filled.mud-button-filled-primary:active {
    background: #075985 !important;
    box-shadow: none !important;
}

.mud-button-root.mud-button-filled.mud-button-filled-secondary {
    background: var(--funeral-amber) !important;
    box-shadow: 0 1px 4px rgba(217, 119, 6, 0.30) !important;
}
.mud-button-root.mud-button-filled.mud-button-filled-secondary:hover {
    background: #B45309 !important;
}

.mud-button-root.mud-button-filled.mud-button-filled-success {
    background: var(--funeral-green) !important;
    box-shadow: 0 1px 4px rgba(5, 150, 105, 0.30) !important;
}
.mud-button-root.mud-button-filled.mud-button-filled-success:hover {
    background: #047857 !important;
}

.mud-button-root.mud-button-filled.mud-button-filled-error {
    background: var(--funeral-red) !important;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.30) !important;
}
.mud-button-root.mud-button-filled.mud-button-filled-error:hover {
    background: #B91C1C !important;
}

.mud-button-root.mud-button-outlined.mud-button-outlined-primary {
    border-color: var(--funeral-primary) !important;
    color: var(--funeral-primary) !important;
    background: transparent !important;
}
.mud-button-root.mud-button-outlined.mud-button-outlined-primary:hover {
    background: rgba(2, 132, 199, 0.07) !important;
}

.mud-button-root.mud-button-text.mud-button-text-primary {
    color: var(--funeral-primary) !important;
}
.mud-button-root.mud-button-text.mud-button-text-primary:hover {
    background: rgba(2, 132, 199, 0.07) !important;
}

/* ---- Диалог ---- */
.mud-dialog {
    background: linear-gradient(135deg, #ffffff 0%, #C2DFF4 100%) !important;
}
.mud-dialog .mud-dialog-title {
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    padding: 14px 20px;
    border-bottom: 1px solid var(--crystal-border);
}
.mud-dialog .mud-dialog-title .mud-typography {
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 15px;
}
.mud-dialog .mud-dialog-title .mud-icon-button {
    color: var(--text-secondary) !important;
}
.mud-dialog .mud-dialog-title .mud-icon-button:hover {
    background: rgba(2, 132, 199, 0.10) !important;
    color: var(--funeral-primary) !important;
}

/* ---- MudTabs ---- */
.mud-tabs .mud-tabs-toolbar {
    background: linear-gradient(to bottom, #e8f4fd 0%, #d0e9f8 100%);
    border-bottom: 1px solid rgba(2, 132, 199, 0.20);
    border-radius: 10px 10px 0 0;
    padding: 5px 8px 0;
    gap: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.mud-tabs .mud-tab {
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid rgba(2, 132, 199, 0.15);
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 11.5px;
    padding: 6px 14px;
    margin-bottom: -1px;
    box-shadow: 0 -1px 3px rgba(2, 132, 199, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.80);
}
.mud-tabs .mud-tab:hover:not(.mud-tab-active) {
    background: rgba(255, 255, 255, 0.75);
    color: var(--funeral-primary);
    border-color: rgba(2, 132, 199, 0.25);
}
.mud-tabs .mud-tab.mud-tab-active {
    background: #ffffff !important;
    border-color: rgba(2, 132, 199, 0.20) !important;
    border-bottom: 1px solid #ffffff !important;
    color: var(--funeral-primary) !important;
    font-weight: 600 !important;
    box-shadow: 0 -2px 6px rgba(2, 132, 199, 0.10),
                inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    position: relative;
    z-index: 1;
}
.mud-tab-slider { display: none; }

/* ============================================================
   Статус чипове
   ============================================================ */
.status-chip {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.status-active   { background: var(--funeral-green-light);  color: var(--funeral-green); }
.status-pending  { background: var(--funeral-amber-light);  color: var(--funeral-amber); }
.status-inactive { background: #F1F5F9; color: var(--text-muted); }
.status-error    { background: var(--funeral-red-light);    color: var(--funeral-red); }

/* ============================================================
   Blazor error boundary
   ============================================================ */
/* ============================================================
   Некролог Дизайнер (GrapesJS)
   ============================================================ */

/* Запълва page-content и отменя padding: 20px */
.ned-wrap {
    margin: -20px;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Топ лента ── */
.ned-topbar {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
    flex-shrink: 0;
}
.ned-topbar-left  { display: flex; align-items: center; }
.ned-topbar-center { flex: 1; text-align: center; pointer-events: none; }
.ned-title { font-size: 13px; font-weight: 600; color: #334155; }
.ned-topbar-right  { display: flex; align-items: center; }

/* ── Тяло ── */
.ned-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Ляво: блокове */
.ned-panel-left {
    width: 190px;
    min-width: 190px;
    background: #1e293b;
    border-right: 1px solid #0f172a;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ned-panel-left::-webkit-scrollbar { width: 4px; }
.ned-panel-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Център: GrapesJS canvas */
.ned-canvas {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #475569;
}

/* Дясно: стилове / traits / слоеве */
.ned-panel-right {
    width: 244px;
    min-width: 244px;
    background: #1e293b;
    border-left: 1px solid #0f172a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ned-panel-right-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ned-panel-right-content::-webkit-scrollbar { width: 4px; }
.ned-panel-right-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ── Panel switcher (десен панел) ── */
.panel__switcher {
    display: flex;
    gap: 2px;
    padding: 5px 5px 0;
    background: #1e293b;
    border-bottom: 1px solid #0f172a;
    flex-shrink: 0;
}
.btn-switcher { flex: 1; }

/* ── GrapesJS custom button styles ── */
.btn-editor {
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 5px !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    font-size: 13px !important;
    line-height: 1 !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 7px !important;
    margin: 1px !important;
    transition: background 0.12s, color 0.12s !important;
}
.btn-editor:hover {
    background: rgba(255,255,255,0.15) !important;
    color: #e2e8f0 !important;
}
.btn-editor.gjs-pn-active {
    background: rgba(2,132,199,0.28) !important;
    color: #38bdf8 !important;
    border-color: rgba(2,132,199,0.40) !important;
}

/* ── GrapesJS overrides ── */
.gjs-editor { background: #475569; }
.gjs-cv-canvas { background: transparent; }
.gjs-block { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.10) !important; color: #cbd5e1 !important; border-radius: 6px !important; }
.gjs-block:hover { background: rgba(255,255,255,0.12) !important; border-color: rgba(2,132,199,0.35) !important; }
.gjs-block-category .gjs-title { background: #0f172a !important; color: #64748b !important; font-size: 10px !important; letter-spacing: 0.06em !important; text-transform: uppercase !important; }
.gjs-sm-sector .gjs-sm-title { background: #0f172a !important; color: #64748b !important; font-size: 10px !important; letter-spacing: 0.05em !important; text-transform: uppercase !important; }
.gjs-sm-property { color: #cbd5e1 !important; }
.gjs-sm-property .gjs-sm-label { color: #94a3b8 !important; font-size: 11px !important; }
.gjs-field { background: rgba(255,255,255,0.08) !important; border-color: rgba(255,255,255,0.15) !important; color: #e2e8f0 !important; border-radius: 4px !important; }
.gjs-layer-title { color: #cbd5e1 !important; }
.gjs-layers { background: #1e293b !important; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAx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