/* Outlined field skeleton — mimics MudTextField Variant.Outlined without the harsh filled-gray look */
.field-skeleton-outlined {
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 14px;
}

/* Settings */
.settings-tabs {
    flex-shrink: 0;
}

.settings-tabs .mud-tab {
    text-transform: none;
    padding: 15px;
}

.settings-tabs .mud-tab.mud-tab-active {
    color: var(--theme-secondary, #B7DD7E);
}

.settings-tabs .mud-tab-slider {
    background-color: var(--theme-secondary, #acd016ff);
}


.settings-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 360px;
}

.settings-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.color-swatch {
    align-items: center;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    height: 48px;
    width: 100%;
    justify-content: space-between;
    padding: 0 16px;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.color-swatch:hover {
    opacity: 0.9;
}

.color-swatch-hex {
    color: inherit;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.color-picker-popup {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    width: fit-content;
}

/* Template editor – loading state */
.template-editor-loading {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 16px;
    gap: 12px;
    background-color: #e8e7e7;
}

.template-editor-skeleton {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 12px;
    margin: auto;
    width: 86mm;
    max-width: 100%;
}


/* Home – header upload area */
.home-header-area .img-upload-wrapper {
    display: block !important;
    width: 100%;
}

.home-header-area {
    padding-top: 16px;
    padding-bottom: 4px;
    width: 100%;
}

.home-header-img-wrapper {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.home-header-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.home-header-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 10px;
}

.home-header-img-wrapper:hover .home-header-overlay {
    opacity: 1;
}

.home-header-placeholder {
    align-items: center;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    box-sizing: border-box;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    gap: 8px;
    height: 120px;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
    width: 100%;
}

.home-header-placeholder:hover {
    border-color: var(--theme-secondary, #B7DD7E);
    color: #6b7280;
}


/* Home – hero header */
.home-hero {
    margin-bottom: 8px;
    padding-top: 12px;
}

.home-hero-title {
    color: #1f2937;
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 4px;
}

.home-hero-subtitle {
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

/* Home – category cards */
.cat-group {
    margin-top: 20px;
}

.cat-group-label {
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    margin-bottom: 8px;
    text-transform: none;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.cat-card {
    align-items: center;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    padding: 19px 18px;
    position: relative;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
}

.cat-card:has(.cat-card-edit-form) {
    align-items: flex-start;
}

.cat-card:hover {
    border-color: var(--theme-secondary, #B7DD7E);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cat-card-selected {
    background: color-mix(in srgb, var(--theme-secondary, #B7DD7E) 6%, white);
    border-color: var(--theme-secondary, #B7DD7E);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cat-card-icon {
    align-items: center;
    border-radius: 10px;
    display: flex;
    flex-shrink: 0;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.cat-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.cat-card-title {
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.cat-card-desc {
    color: #9ca3af;
    font-size: 13px;
}

.cat-card-check {
    flex-shrink: 0;
    color: var(--mud-palette-primary) !important;
}

.cat-card-editable {
    cursor: pointer;
}

.cat-card-editable:hover {
    border-color: #d1d5db;
    box-shadow: none;
}

/* Inline editing inputs */
.cat-inline-input {
    background: transparent;
    border: none;
    border-bottom: 1.5px solid #e5e7eb;
    outline: none;
    padding: 0;
    width: 100%;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s;
}

.cat-inline-input:focus {
    border-bottom-color: var(--theme-secondary, #B7DD7E);
}

.cat-inline-title {
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: 3px;
}

.cat-inline-desc {
    color: #9ca3af;
    font-size: 13px;
}

.cat-inline-actions {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 0;
}

.cat-inline-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
}

@media (max-width: 768px) {
    .cat-group {
        margin-top: 10px;
    }

    .cat-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .cat-group-label {
        width: auto;
        margin-left: 0;
        margin-right: 0;
    }

    .cat-card {
        min-width: unset;
        padding: 24px 18px;
        width: calc(100% - 16px);
        margin-left: 8px;
        margin-right: 8px;
    }
}

/*Template selector*/
.cards-container {
    display: flex !important;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    height: calc(100% - 120px);
}

@media (max-width: 768px) {
    .cards-container {
        justify-content: center;
    }
}

.template-card {
    border: 1px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: fit-content;
    overflow: hidden;
    width: fit-content;
    margin: 1rem;
}

.template-card-selected {
    border: 2px solid var(--theme-secondary, #B7DD7E);
    cursor: pointer;
    height: fit-content;
    overflow: hidden;
    width: fit-content;
    margin: 1rem;

}

.template-preview {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background-color: #f9fafb;
    border-radius: inherit;
}

.template-preview > * {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center;
}


/*EditableTemplate*/

.template-stack-container {
    background-color: #e8e7e7;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0 !important;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.template-stack {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 16px;
    padding-top: 16px;
}

.template-div {
    display: flex;
    flex-direction: column;
    margin: 1% auto;
    overflow: visible;
    position: relative;
    padding: 1mm;
    align-self: flex-start;
    background-color: white;
}

.drop-zone-container {
    background-color: rgba(255, 255, 255, 0.3);
}

.draggable-field-container .img-inactive,
.draggable-field-container-active .img-active {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.draggable-field-container .img-inactive {
    width: auto !important;
}

/* Mobile: Change template-stack to column layout */
@media (max-width: 768px) {
    .template-stack-container {
        flex-direction: column !important;
    }

    .template-stack {
        flex: 1 !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding-bottom: 0 !important;
    }

    .desktop-toolbar {
        display: none !important;
    }

    .mobile-toolbar {
        background: #fafaf9;
        border-top: 1px solid #e5e7eb;
        display: block !important;
        flex-shrink: 0;
        padding: 0;
        position: relative;
        width: 100%;
        z-index: 100;
    }

    .mobile-toolbar .toolbar-container {
        position: relative !important;
        display: block !important;
        height: auto !important;
        width: 100%;
    }

    .template-div {
        width: 100% !important;
        max-width: 86mm !important;
        margin: 16px auto 0 !important;
        padding: 1mm;
    }

    .drop-zone-container {
        width: 100% !important;
    }
}

.draggable-field-container *,
.draggable-field-container-active {
    /*font-size: inherit !important;*/
    /*letter-spacing: inherit !important;*/
    line-height: inherit !important;
    overflow-wrap: break-word;
    position: relative;
    width: 100%;
    /*word-spacing: inherit !important;*/
}

.draggable-field-container-active .ProseMirror {
    font-family: inherit !important;
    font-size: inherit !important;
    letter-spacing: inherit !important;
    line-height: inherit !important;
    min-height: 0 !important;
    padding: 0 !important;
}

/* TableColumnEditor — two-column ProseMirror editor for family-table fields */
.table-col-editor {
    display: flex;
    gap: 0;
    width: 100%;
}

.table-col-editor > * {
    flex: 1;
    min-width: 0;
}


.draggable-field-container-active {
    outline: 1px dashed #656565;
}

.draggable-field-container-active:has(.el-image) {
    overflow: hidden;
    resize: both;
    position: relative;
}


.draggable-field-container-active:has(.el-image)::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 18px 18px;
    border-color: transparent transparent #777 transparent;
    pointer-events: none;
}

.draggable-field-container-active:has(.el-image)::-webkit-resizer {
    background-color: transparent;
}

.inline-img-container {
    position: relative;
}

.inline-img-drag-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
}

.inline-img-drag-handle::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 18px 18px;
    border-color: transparent transparent #777 transparent;
    pointer-events: none;
}

.draggable-field-container:hover {
    background-color: rgba(110, 204, 22, 0.03);
    outline: 1px dashed #656565;
}


.draggable-field-container:has(.drag-handle:active),
.draggable-field-container-active:has(.drag-handle:active) {
    background-color: rgba(94, 182, 18, 0.08) !important;
    box-shadow: 0 4px 12px rgba(94, 182, 18, 0.25);
    outline: 2px dashed #5eb612 !important;
}

.draggable-field-container.mud-drop-item-dragging,
.draggable-field-container-active.mud-drop-item-dragging {
    background-color: rgba(94, 182, 18, 0.08) !important;
    opacity: 0.9;
    outline: 2px dashed #5eb612 !important;
    z-index: 1000 !important;
}


.variation-badge-wrapper {
    align-items: center;
    background: var(--theme-secondary, #B7DD7E);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    height: 30px;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    width: 30px;
}

.variation-badge-wrapper .mud-icon-root {
    color: white !important;
}


/*Review*/

.review-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    align-items: stretch;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .review-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}


/* Payment*/


.summary-line {
    color: #64748b;
    display: flex;
    font-size: 13px;
    justify-content: space-between;
}

.summary-line-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding-right: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-line-value {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.summary-total-line {
    color: #1e293b;
    display: flex;
    font-size: 16px;
    font-weight: 700;
    justify-content: space-between;
}

.summary-total-amount {
    font-variant-numeric: tabular-nums;
}


/* Account page cards */
.account-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: stretch;
}

.account-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 19px 18px;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.account-card-add {
    align-items: center;
    background: #fff;
    border: 1.5px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 120px;
    padding: 19px 18px;
    transition: border-color 0.15s, color 0.15s;
}

.account-card-add:hover {
    border-color: #9ca3af;
    color: #374151;
}

.account-card-icon {
    align-items: center;
    border-radius: 10px;
    display: flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.account-card-type-chip {
    display: inline-block;
    background: #f3f4f6;
    border-radius: 6px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    text-transform: uppercase;
}

.account-card-type-chip.billing {
    background: #fef9c3;
    color: #92400e;
}


@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

/* EditOrder admin page */

.eo-save-btn {
    width: 140px !important;
}

.eo-save-menu {
    border-radius: 10px !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10) !important;
    min-width: 0 !important;
    width: 140px !important;
    padding: 4px !important;
}

.eo-save-menu .mud-list-item {
    border-radius: 7px !important;
    padding: 6px 10px !important;
}

.eo-menu-item-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0;
}

.eo-menu-item-label {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    line-height: 1.3;
}

.eo-menu-item-sub {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
}

.eo-date-chip {
    background: transparent !important;
    color: var(--mud-palette-secondary) !important;
    border: 1px dashed var(--theme-secondary) !important;
    cursor: pointer;
    font-size: 12px;
}

.eo-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.eo-paper {
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
}

.eo-paper-full {
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
}

.eo-pub-panels .mud-expand-panel {
    border-bottom: 1px solid #e5e7eb !important;
}

.eo-left-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


.eo-invoice-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.eo-invoice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.eo-invoice-row:last-child {
    border-bottom: none;
}

.eo-invoice-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.eo-invoice-status--paid {
    background: #d1fae5;
    color: #065f46;
}

.eo-invoice-status--open {
    background: #fef3c7;
    color: #92400e;
}

.eo-invoice-body {
    flex: 1;
    min-height: 0;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eo-invoice-pdf-area {
    flex: 0 0 80%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.eo-invoice-pdf-area iframe {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: 8px;
    display: block;
}

.eo-invoice-empty {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    text-align: center;
    padding: 24px;
}


.eo-summary-grid {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

.eo-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #f3f4f6;
}

.eo-summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.eo-summary-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.eo-summary-icon {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    color: #9ca3af;
}

.eo-summary-value {
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    text-align: right;
}





