/* ===== DatePicker toolbar ===== */

.mud-picker-datepicker-toolbar {
    display: none !important;
}

/* ===== Input background ===== */

.mud-input > input.mud-input-root,
.mud-input-slot {
    background: #fff !important;
}

/* ===== Global button style ===== */

.mud-button-root {
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* ===== App Shell ===== */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #fafaf9;
}

.app-header {
    align-items: center;
    background-color: #fafaf9;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-shrink: 0;
    gap: 16px;
    padding: 8px 24px;
}

.app-logo {
    color: #374151;
    cursor: pointer;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.app-header-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 4px;
    margin-left: auto;
}

.app-header-btn {
    border-color: #d1d5db !important;
    border-radius: 8px !important;
    color: #374151 !important;
    font-size: 13px !important;
    letter-spacing: 0.03em !important;
    text-transform: none !important;
}

.app-header-btn-active {
    color: var(--theme-secondary, #B7DD7E) !important;
}


.app-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ===== Step Indicator ===== */

.step-indicator {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 8px;
    justify-content: center;
}

.step-item {
    align-items: center;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: default;
    display: flex;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    gap: 6px;
    padding: 4px 8px;
}

.step-icon {
    align-items: center;
    background: rgba(0, 0, 0, 0.07);
    border: none;
    border-radius: 12px;
    color: inherit;
    display: flex;
    height: 28px;
    justify-content: center;
    transition: all 0.2s ease;
    width: 28px;
}

.step-active {
    color: #374151;
    font-weight: 500;
}

.step-active .step-icon {
    background: var(--theme-secondary, #B7DD7E);
    color: #fff;
}

.step-completed {
    color: #6b7280;
}

.step-completed .step-icon {
    background: color-mix(in srgb, var(--theme-secondary, #B7DD7E) 25%, rgba(0, 0, 0, 0.07));
    color: #6b7280;
}

.step-clickable {
    cursor: pointer;
}

.step-clickable:hover .step-icon {
    outline: 2px solid var(--theme-secondary, #B7DD7E);
}

.step-connector {
    background: #d1d5db;
    border-radius: 1px;
    flex: none;
    height: 2px;
    width: 24px;
    transition: background 0.3s;
}

.step-connector--done {
    background: var(--theme-secondary, #B7DD7E);
}

.step-connector--active {
    background: linear-gradient(to right, var(--theme-secondary, #B7DD7E) 50%, #d1d5db 50%);
}

/* ===== Navigation Footer ===== */

.nav-footer {
    align-items: center;
    background: #fafaf9;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-shrink: 0;
    padding: 10px 24px;
}

.nav-footer-spacer {
    align-items: center;
    display: flex;
    flex: 1;
    justify-content: center;
}

.nav-footer-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.nav-footer-total-label {
    color: #9ca3af;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-footer-total-numbers {
    color: #111827;
    font-size: 0.8rem;
    font-weight: 400;
}

.nav-footer-logo {
    display: flex;
    align-items: center;
}

.nav-footer-logo img {
    height: auto;
    opacity: 0.4;
    transition: opacity 0.2s;
    width: 60px;
}

.nav-footer-logo:hover img {
    opacity: 1;
}

.nav-footer-back {
    border: 2px solid var(--theme-secondary, #B7DD7E) !important;
    border-radius: 12px !important;
    color: var(--theme-secondary, #B7DD7E) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: 0.03em !important;
    padding: 8px 23px !important;
    text-transform: none !important;
}

.nav-footer-back:hover:not(:disabled) {
    filter: brightness(0.88);
}

.nav-footer-next {
    background-color: var(--theme-secondary, #B7DD7E) !important;
    border: 2px solid transparent !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: 0.03em !important;
    padding: 8px 23px !important;
    text-transform: none !important;
}

.nav-footer-next:hover:not(:disabled) {
    filter: brightness(0.92);
}

.nav-footer-next:disabled {
    background-color: #e5e7eb !important;
    color: #9ca3af !important;
}

/* ===== Page Content ===== */

.page-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 32px 8px;
    scrollbar-gutter: stable both-edges;
}

.page-content-narrow {
    margin: 0 auto;
    max-width: 85%;
    width: 100%;
}

.page-title {
    color: #1f2937;
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: 10px;
}

.page-subtitle {
    color: rgba(0, 0, 0, 0.4);
    font-size: 13px;
    margin-bottom: 20px;
}

/* ===== Filter bar ===== */

.filter-bar {
    align-items: center;
    background: #fafaf9;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 16px;
    width: 100%;
}

.filter-daterange {
    align-items: center;
    display: flex;
    gap: 8px;
}

.filter-daterange-sep {
    color: #9ca3af;
}

.filter-clear-btn {
    color: #6b7280 !important;
    margin-left: auto !important;
    text-transform: none !important;
}

.template-selector-help-button {
    position: fixed;
    bottom: 90px;
    left: 24px;
    z-index: 1200;
}

@media (max-width: 768px) {
    .template-selector-help-button {
        left: unset;
        right: 24px;
    }
}

.custom-button {
    background-color: var(--theme-secondary, #B7DD7E) !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: 0.03em !important;
    padding: 8px 23px !important;
    text-transform: none !important;
}

.custom-button:hover:not(:disabled) {
    filter: brightness(0.92);
}

.custom-button:disabled {
    background-color: #e5e7eb !important;
    color: #9ca3af !important;
}

@media (max-width: 768px) {
    .app-header {
        gap: 6px;
        padding: 6px 10px;
    }

    .nav-footer {
        padding: 6px 16px;
    }

    .app-logo {
        font-size: 13px;
    }

    .app-header-actions {
        gap: 2px;
    }

    .app-header-btn {
        font-size: 12px !important;
        min-width: unset !important;
        padding: 4px 10px !important;
    }

    .custom-button,
    .custom-button-secondary,
    .nav-footer-back,
    .nav-footer-next {
        font-size: 13px !important;
        padding: 6px 16px !important;
    }

    .step-label {
        display: none;
    }

    .page-content {
        padding: 16px 16px 0;
    }
}

/* ===== Column toggle group ===== */

.column-toggle-group {
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
}

.column-toggle-group .mud-toggle-item:first-child {
    border-radius: 10px 0 0 10px !important;
}

.column-toggle-group .mud-toggle-item:last-child {
    border-radius: 0 10px 10px 0 !important;
}

.column-toggle-group .mud-toggle-item {
    transition: background 0.15s ease, box-shadow 0.15s ease !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    background: #f8f9fa !important;
}

.column-toggle-group .mud-toggle-item .col-icon-wrap {
    display: flex;
    gap: 3px;
    height: 18px;
    align-items: stretch;
    border-radius: 2px;
    padding: 2px;
    background: transparent;
}

.column-toggle-group .mud-toggle-item .col-icon-wrap--1 {
    width: 14px;
}

.column-toggle-group .mud-toggle-item .col-icon-wrap--2 {
    width: 22px;
}

.column-toggle-group .mud-toggle-item .col-icon-wrap--3 {
    width: 30px;
}

.column-toggle-group .mud-toggle-item .col-icon-wrap--4 {
    width: 38px;
}

.column-toggle-group .mud-toggle-item .col-icon-bar {
    flex: 1;
    background: transparent;
    border: 1.5px solid var(--mud-palette-primary);
    border-radius: 1px;
}

.column-toggle-group .mud-toggle-item-selected {
    background: color-mix(in srgb, var(--mud-palette-primary) 15%, white) !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12) !important;
    z-index: 1;
    position: relative;
}

.column-toggle-group .mud-toggle-item-selected:not(:last-child) {
    border-right: 1px solid var(--mud-palette-primary) !important;
}

.column-toggle-group .mud-toggle-item-selected .col-icon-bar {
    border-color: var(--mud-palette-primary);
}

.custom-button-secondary {
    background-color: transparent !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border: 2px solid var(--theme-secondary, #B7DD7E) !important;
    color: var(--theme-secondary, #B7DD7E) !important;
    text-transform: none !important;
    transition: all 0.3s ease !important;
}

.custom-button-secondary:hover {
    border-color: var(--theme-secondary, #B7DD7E) !important;
    color: var(--theme-secondary, #B7DD7E) !important;
    filter: brightness(0.88);
}

.item-text {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.section-label {
    align-items: center;
    color: #111827 !important;
    display: flex;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    gap: 0.5rem;
    margin-bottom: 0.5rem !important;
}


/* ===== Date picker ===== */


.mud-picker-calendar-container {
    min-width: fit-content !important;
}

.mud-picker-calendar .mud-day.date-added,
.mud-picker-calendar .mud-day.date-added.mud-disabled {
    background-color: transparent !important;
    border: 2px solid var(--theme-secondary, #B7DD7E) !important;
    border-radius: 50%;
    box-shadow: none !important;
    color: var(--theme-secondary, #B7DD7E) !important;
    font-weight: 600 !important;
    opacity: 1 !important;
    transform: scale(0.80) !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.mud-picker-calendar .mud-day.date-added .mud-typography,
.mud-picker-calendar .mud-day.date-added.mud-disabled .mud-typography {
    color: var(--theme-secondary, #B7DD7E) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

.mud-picker-calendar .mud-day.date-added:hover {
    background-color: color-mix(in srgb, var(--theme-secondary, #B7DD7E) 8%, white) !important;
    border-color: var(--theme-secondary, #B7DD7E) !important;
    box-shadow: none !important;
}

.mud-picker-calendar-content.mud-picker-calendar-content-1 {
    padding: 0 !important;
    margin-top: 0 !important;
}

.mud-picker-calendar-content.mud-picker-calendar-content-1 .mud-picker-calendar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.mud-picker.mud-picker-inline {
    border-radius: 8px;
}

.date-picker-dialog-content {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

.date-picker-dialog-content .mud-picker-calendar .mud-day {
    width: 44px !important;
    height: 44px !important;
    font-size: 0.85rem !important;
}

.date-picker-dialog-content .mud-picker-calendar-header-day .mud-day-label {
    width: 44px !important;
}

/* ===== Publication page — numbered sections ===== */

.pub-section {
    background: #f8f8f7;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 24px;
    padding: 16px 20px;
}

.pub-section-header {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.pub-section-icon {
    color: var(--mud-palette-primary) !important;
    margin-top: 1px;
}

.pub-section-title {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.pub-section-desc {
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
}

.pub-cat-grid {
    align-items: start;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.pub-cat-grid .cat-card {
    max-width: none;
}

.pub-card-tooltip-root {
    display: block;
    height: 100%;
    width: 100%;
}

.cat-card--disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.cat-card--stacked {
    align-items: flex-start;
}

/* ===== Publication panel (pub-panel-*) ===== */

@media (max-width: 768px) {
    .pub-panel-row {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    .pub-panel-header {
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .pub-panel-list {
        gap: 0;
    }

    .pub-panel-pagination {
        margin-bottom: 8px;
        padding-top: 4px;
    }
}

.pub-panel-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pub-panel-header .section-label {
    flex-shrink: 0;
    margin-bottom: 0 !important;
    white-space: nowrap;
}

.pub-panel-shrink-0 {
    flex-shrink: 0;
}

.pub-panel-row--clickable {
    cursor: pointer;
}

.pub-panel-row--clickable:hover {
    background-color: color-mix(in srgb, var(--theme-secondary, #B7DD7E) 6%, white);
    border-radius: 4px;
}

.pub-panel-flex-fill {
    flex: 1;
    min-width: 0;
}

.pub-panel-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pub-panel-pagination {
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    margin-top: 4px;
    padding-top: 8px;
}

.pub-panel-row {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    gap: 4px;
}

.pub-panel-group-header {
    background: #fff !important;
    cursor: pointer;
    gap: 2px;
}

.pub-panel-card {
    background: #fff !important;
    border: 1px solid #e5e7eb;
    border-radius: 10px !important;
}

.pub-panel-card-header {
    background: #fff !important;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    color: #374151;
    cursor: default;
}

.pub-badge {
    align-items: center;
    border-radius: 6px;
    display: flex;
    flex-shrink: 0;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.pub-badge-text {
    font-size: 14px;
    font-weight: 600;
}

.pub-badge--sm {
    height: 28px;
    width: 28px;
}

.pub-badge--sm .pub-badge-text {
    font-size: 12px;
}

.pub-panel-date-list {
    padding: 4px 12px 10px;
}

.pub-panel-date-row {
    border-bottom: 1px solid #f1f5f9;
}

.pub-panel-date-row--single {
    border-bottom: none;
}

.pub-panel-date-content {
    gap: 6px;
}

.pub-remove-icon-btn {
    color: #9ca3af !important;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.pub-remove-icon-btn:hover {
    background-color: color-mix(in srgb, var(--mud-palette-error) 12%, transparent) !important;
    color: var(--mud-palette-error) !important;
}

.pub-remove-icon-btn:active {
    background-color: color-mix(in srgb, var(--mud-palette-error) 20%, transparent) !important;
    color: var(--mud-palette-error-darken) !important;
}

.pub-panel-empty-state {
    align-items: center;
    background: #fff;
    border-radius: 10px;
    border: 1.5px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    min-height: 200px;
    padding: 32px;
    text-align: center;
}

.pub-panel-muted {
    color: #374151;
}

.pub-panel-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pub-panel-empty-icon {
    font-size: 40px;
    color: #cbd5e1;
}

.pub-panel-empty-title {
    color: #64748b;
    font-weight: 500;
}

.pub-panel-text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pub-panel-info-icon {
    color: #94a3b8;
    cursor: help;
    font-size: 14px;
}

.pub-panel-tooltip-content {
    padding: 4px 2px;
    text-align: left;
}

.pub-panel-tooltip-line {
    display: block;
}

.pub-panel-alert {
    font-size: 12px;
}

/* ===== Bulk date preset picker ===== */

.bulk-preset-picker {
    background: color-mix(in srgb, var(--theme-secondary, #B7DD7E) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--theme-secondary, #B7DD7E) 25%, #e5e7eb);
    border-radius: 5px;
    padding: 14px 16px;
    width: 100%;
    box-sizing: border-box;
}

.bulk-preset-picker__header {
    align-items: center;
    display: flex;
    gap: 6px;
}

.bulk-preset-picker__header-icon {
    color: var(--theme-secondary, #B7DD7E) !important;
    font-size: 18px !important;
    position: relative;
    top: -2px;
}

.bulk-preset-picker__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}

.bulk-preset-picker__label {
    color: #374151;
    font-weight: 600 !important;
    font-size: 13px !important;
    line-height: 1.35;
}

.bulk-preset-picker__helper {
    color: #6b7280;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.3;
}

.bulk-preset-picker__close {
    color: #6b7280 !important;
    flex-shrink: 0;
    margin: -8px -8px -8px 0;
    padding: 8px !important;
}

.bulk-preset-picker__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-preset-picker__chip {
    background: #fff !important;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 40%, #e5e7eb) !important;
    border-radius: 20px !important;
    color: color-mix(in srgb, var(--mud-palette-primary) 70%, #1f2937) !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    text-transform: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bulk-preset-picker__chip:hover {
    border-color: var(--mud-palette-primary) !important;
}

.bulk-preset-picker__chip--active {
    background: color-mix(in srgb, var(--mud-palette-primary) 20%, #fff) !important;
    border-color: var(--mud-palette-primary) !important;
    color: color-mix(in srgb, var(--mud-palette-primary) 65%, #1f2937) !important;
    font-weight: 600 !important;
}

.bulk-preset-picker__chip--reset {
    background: transparent !important;
    border-color: transparent !important;
    color: #9ca3af !important;
    margin-left: 4px;
}

.bulk-preset-picker__chip--reset:hover {
    background: color-mix(in srgb, #ef4444 8%, #fff) !important;
    border-color: color-mix(in srgb, #ef4444 30%, #fff) !important;
    color: #ef4444 !important;
}

/* ===== Font picker ===== */

.font-picker-item {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    padding: 5px 10px;
    transition: background-color 0.12s ease;
    user-select: none;
}

.font-picker-item:hover {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 6%, white);
}

.font-picker-item__check {
    color: #d1d5db;
    flex-shrink: 0;
    font-size: 18px !important;
}

.font-picker-item--selected .font-picker-item__check {
    color: var(--mud-palette-primary) !important;
}

/* ===== Home edit dialog ===== */

.home-edit-dialog-content {
    margin: 8px 16px 32px;
}

.dashed-field fieldset {
    border-style: dashed !important;
}

.account-card-action-btn {
    background: #f3f4f6 !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
}

.account-card-action-btn:hover {
    background: #e5e7eb !important;
}

/* ===== Instant dialog (no entrance animation) ===== */

.instant-dialog,
.instant-dialog .mud-dialog,
.instant-dialog .mud-dialog-container {
    animation: none !important;
    transition: none !important;
}

.instant-dialog .mud-overlay {
    animation: none !important;
    transition: none !important;
}
