/* Global hidden utility
   Several SAMAR components use display:flex/grid. Without this rule, elements
   with the HTML hidden attribute can still appear when component display rules win. */
[hidden] {
    display: none !important;
}

.samar-search {
    width: min(440px, 34vw);
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--samar-surface);
    border: 1px solid var(--samar-border);
    color: var(--samar-text-muted);
    box-shadow: var(--samar-shadow-xs);
}

    .samar-search svg {
        width: 20px;
        height: 20px;
    }

    .samar-search input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        color: var(--samar-text);
        font-size: 13px;
        font-weight: 650;
    }

    .samar-search:focus-within {
        border-color: var(--samar-primary);
        box-shadow: 0 0 0 4px rgba(15,118,110,.12);
    }

.samar-icon-button {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--samar-border);
    border-radius: 14px;
    color: var(--samar-text-muted);
    background: var(--samar-surface);
    transition: .18s ease;
}

    .samar-icon-button svg {
        width: 21px;
        height: 21px;
    }

    .samar-icon-button:hover {
        color: var(--samar-primary);
        border-color: rgba(15,118,110,.24);
        background: var(--samar-primary-light);
    }

.samar-icon-button--light {
    color: #E5E7EB;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.08);
}

    .samar-icon-button--light:hover {
        color: #fff;
        background: rgba(255,255,255,.12);
    }

.samar-dot {
    position: absolute;
    top: 9px;
    left: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--samar-accent);
    border: 2px solid #fff;
}

.samar-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 4px 4px 12px;
    border-radius: 999px;
    background: var(--samar-surface);
    border: 1px solid var(--samar-border);
    box-shadow: var(--samar-shadow-xs);
}

    .samar-user-chip > span {
        width: 32px;
        height: 32px;
    }

    .samar-user-chip div {
        display: grid;
        gap: 2px;
    }

    .samar-user-chip strong {
        color: var(--samar-text);
        font-size: 12px;
        font-weight: 900;
    }

    .samar-user-chip small {
        color: var(--samar-text-muted);
        font-size: 11px;
        font-weight: 750;
    }

.samar-card {
    border: 1px solid var(--samar-border);
    border-radius: var(--samar-radius-lg);
    background: var(--samar-surface);
    box-shadow: var(--samar-shadow-sm);
}

.samar-card__body {
    padding: 20px;
}

.samar-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--samar-border);
}

.samar-card__title {
    margin: 0;
    color: var(--samar-text);
    font-size: 16px;
    font-weight: 950;
}

.samar-card__subtitle {
    margin: 6px 0 0;
    color: var(--samar-text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.9;
}

.samar-grid {
    display: grid;
    gap: 16px;
}

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

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

.samar-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.samar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    transition: .18s ease;
    white-space: nowrap;
}

    .samar-btn:hover {
        transform: translateY(-1px);
    }

    .samar-btn svg {
        width: 18px;
        height: 18px;
    }

.samar-btn--sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 10px;
}

.samar-btn--lg {
    min-height: 50px;
    padding: 0 22px;
    font-size: 14px;
    border-radius: 14px;
}

.samar-btn--primary {
    color: #fff;
    background: var(--samar-primary);
    box-shadow: 0 10px 24px rgba(15,118,110,.18);
}

    .samar-btn--primary:hover {
        color: #fff;
        background: var(--samar-primary-dark);
    }

.samar-btn--secondary {
    color: var(--samar-text);
    background: var(--samar-surface);
    border-color: var(--samar-border);
}

    .samar-btn--secondary:hover {
        color: var(--samar-primary);
        border-color: rgba(15,118,110,.28);
    }

.samar-btn--ghost {
    color: var(--samar-primary);
    background: transparent;
}

    .samar-btn--ghost:hover {
        background: var(--samar-primary-light);
    }

.samar-btn--warning {
    color: #fff;
    background: var(--samar-accent);
}

.samar-btn--danger {
    color: #fff;
    background: var(--samar-danger);
}

.samar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    width: max-content;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    word-break: keep-all;
    flex-shrink: 0;
}

.samar-badge--success {
    color: var(--samar-success);
    background: var(--samar-success-bg);
}

.samar-badge--warning {
    color: var(--samar-warning);
    background: var(--samar-warning-bg);
}

.samar-badge--danger {
    color: var(--samar-danger);
    background: var(--samar-danger-bg);
}

.samar-badge--info {
    color: var(--samar-info);
    background: var(--samar-info-bg);
}

.samar-badge--neutral {
    color: var(--samar-neutral);
    background: var(--samar-neutral-bg);
}

.samar-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.samar-field {
    display: grid;
    gap: 8px;
}

    .samar-field label {
        color: var(--samar-text);
        font-size: 12px;
        font-weight: 900;
    }

.samar-input, .samar-select, .samar-textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--samar-border);
    border-radius: 12px;
    background: var(--samar-surface);
    color: var(--samar-text);
    padding: 0 13px;
    outline: 0;
    transition: .18s ease;
}

.samar-textarea {
    min-height: 110px;
    padding-block: 12px;
    resize: vertical;
    line-height: 1.9;
}

    .samar-input:focus, .samar-select:focus, .samar-textarea:focus {
        border-color: var(--samar-primary);
        box-shadow: 0 0 0 4px rgba(15,118,110,.12);
    }

    .samar-input:disabled, .samar-select:disabled, .samar-textarea:disabled {
        color: #9CA3AF;
        background: var(--samar-surface-soft);
        cursor: not-allowed;
    }

.samar-field small {
    color: var(--samar-text-muted);
    font-size: 11px;
    font-weight: 700;
}

.samar-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.samar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}

    .samar-table th, .samar-table td {
        padding: 13px 14px;
        border-bottom: 1px solid var(--samar-border);
        text-align: right;
        vertical-align: middle;
    }

    .samar-table th {
        color: var(--samar-text-muted);
        background: var(--samar-surface-soft);
        font-size: 12px;
        font-weight: 950;
    }

    .samar-table td {
        color: var(--samar-text);
        font-size: 13px;
        font-weight: 650;
    }

    .samar-table tr:hover td {
        background: #FCFCFD;
    }

.samar-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.9;
}

    .samar-alert strong {
        display: block;
        margin-bottom: 2px;
        font-weight: 950;
    }

.samar-alert--success {
    color: var(--samar-success);
    background: var(--samar-success-bg);
    border-color: rgba(15,118,110,.12);
}

.samar-alert--warning {
    color: #9A3412;
    background: #FFF7ED;
    border-color: rgba(234,88,12,.16);
}

.samar-alert--danger {
    color: var(--samar-danger);
    background: var(--samar-danger-bg);
    border-color: rgba(220,38,38,.14);
}

.samar-alert--info {
    color: var(--samar-info);
    background: var(--samar-info-bg);
    border-color: rgba(37,99,235,.14);
}

.samar-metric {
    display: grid;
    gap: 14px;
}

.samar-metric__icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: var(--samar-primary);
    background: var(--samar-primary-light);
}

    .samar-metric__icon svg {
        width: 24px;
        height: 24px;
    }

.samar-metric strong {
    color: var(--samar-text);
    font-size: 25px;
    font-weight: 950;
}

.samar-metric span {
    color: var(--samar-text-muted);
    font-size: 12px;
    font-weight: 850;
}

.samar-sheet-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--samar-border);
    border-radius: 16px;
    background: var(--samar-surface);
    color: var(--samar-text);
    text-align: right;
}

    .samar-sheet-item span {
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 13px;
        color: var(--samar-primary);
        background: var(--samar-primary-light);
    }

    .samar-sheet-item svg {
        width: 20px;
        height: 20px;
    }

    .samar-sheet-item strong {
        flex: 1;
        font-size: 13px;
        font-weight: 900;
    }

    .samar-sheet-item small {
        color: var(--samar-text-muted);
        font-size: 11px;
        font-weight: 850;
    }

.samar-sheet-item--danger {
    color: var(--samar-danger);
}

    .samar-sheet-item--danger span {
        color: var(--samar-danger);
        background: var(--samar-danger-bg);
    }

.samar-sheet-logout {
    margin: 0;
}

@media (max-width: 1024px) {
    .samar-grid--2, .samar-grid--3, .samar-grid--4, .samar-form-grid {
        grid-template-columns: 1fr;
    }

    .samar-card__body {
        padding: 16px;
    }

    .samar-card__header {
        padding: 16px;
    }
}


.samar-logo-lockup {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    line-height: 1;
    min-width: 0;
}

    .samar-logo-lockup:hover {
        text-decoration: none;
    }

.samar-logo-image {
    display: block;
    width: auto;
    height: 3.5rem;
    max-width: 100%;
    object-fit: contain;
}

.samar-logo-lockup--compact .samar-logo-image {
    height: 2.75rem;
}

.samar-logo-lockup--icon .samar-logo-image {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: contain;
}

.samar-sidebar .samar-logo-image {
    height: 3.25rem;
}

@media (max-width: 768px) {
    .samar-logo-image {
        height: 2.75rem;
    }

    .samar-logo-lockup--icon .samar-logo-image {
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* --------------------------------------------------------------------------
   SAMAR shared application components
   -------------------------------------------------------------------------- */
.samar-page,
.samar-list-page {
    display: grid;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}

.samar-page-actions,
.samar-list-tools,
.samar-row-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.samar-btn__icon,
.samar-btn__icon svg {
    width: 1.05rem;
    height: 1.05rem;
    display: inline-flex;
}

.samar-btn.is-loading {
    pointer-events: none;
    opacity: .78;
}

.samar-summary-row {
    margin-bottom: .25rem;
}

.samar-summary-card .samar-card__body {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.samar-summary-card__icon {
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.05rem;
    color: var(--samar-primary);
    background: var(--samar-primary-light);
    flex: 0 0 auto;
}

    .samar-summary-card__icon svg {
        width: 1.55rem;
        height: 1.55rem;
    }

.samar-summary-card__icon--accent {
    color: var(--samar-accent);
    background: var(--samar-accent-light);
}

.samar-summary-card__icon--neutral {
    color: var(--samar-secondary);
    background: var(--samar-surface-soft);
}

.samar-summary-card .samar-card__body > div {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.samar-summary-card small {
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 850;
}

.samar-summary-card strong {
    color: var(--samar-text);
    font-size: clamp(1rem, 1.3vw, 1.45rem);
    font-weight: 950;
    line-height: 1.35;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.samar-table-card,
.samar-card,
.samar-card__body,
.samar-main,
.samar-main-shell {
    min-width: 0;
    max-width: 100%;
}

.samar-table-card__header {
    align-items: flex-start;
}

.samar-list-tools {
    justify-content: flex-end;
}

.samar-list-search {
    width: min(31rem, 100%);
}

.samar-card__body--table {
    padding: 0;
}

.samar-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--samar-border);
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 800;
}

.samar-data-table {
    min-width: 44rem;
}

.samar-table--compact th,
.samar-table--compact td {
    padding-block: 12px;
}

.samar-table-title {
    color: var(--samar-text);
    font-weight: 950;
}

.samar-table__actions {
    width: 12rem;
    text-align: center !important;
}

.samar-row-actions {
    justify-content: center;
}

.samar-table-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
}

.samar-text-danger {
    color: var(--samar-danger) !important;
}

.samar-code {
    display: inline-flex;
    max-width: 13rem;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    unicode-bidi: plaintext;
    color: var(--samar-text-muted);
    background: var(--samar-surface-soft);
    border: 1px solid var(--samar-border);
    border-radius: .5rem;
    padding: .25rem .45rem;
    font-size: .72rem;
}

.samar-empty-state {
    display: grid;
    place-items: center;
    gap: .4rem;
    min-height: 9rem;
    padding: 2rem;
    text-align: center;
}

.samar-empty-state--compact {
    min-height: 7.5rem;
}

.samar-empty-state strong {
    color: var(--samar-text);
    font-size: .95rem;
    font-weight: 950;
}

.samar-empty-state span {
    color: var(--samar-text-muted);
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.9;
}

.samar-segmented-control {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem;
    border: 1px solid var(--samar-border);
    border-radius: 999px;
    background: var(--samar-surface-soft);
}

.samar-segmented-control__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.25rem;
    padding: 0 .85rem;
    border: 0;
    border-radius: 999px;
    color: var(--samar-text-muted);
    background: transparent;
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
    transition: .18s ease;
}

    .samar-segmented-control__item:hover,
    .samar-segmented-control__item.is-active {
        color: #fff;
        background: var(--samar-primary);
        box-shadow: 0 10px 22px rgba(15, 118, 110, .16);
    }

.samar-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding-inline: .4rem;
    border-radius: 999px;
    color: var(--samar-text-muted);
    background: #fff;
    font-size: .72rem;
    font-weight: 950;
}

.samar-segmented-control__item.is-active .samar-count-pill,
.samar-segmented-control__item:hover .samar-count-pill {
    color: var(--samar-primary);
}

.samar-form-grid--single {
    grid-template-columns: 1fr;
}

.samar-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

    .samar-modal.is-open {
        display: flex;
    }

.samar-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(6px);
}

.samar-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(42rem, 100%);
    max-height: min(90vh, 48rem);
    overflow: auto;
    border-radius: 1.4rem;
    background: var(--samar-surface);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.samar-modal__content {
    display: grid;
}

.samar-modal__header,
.samar-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
}

.samar-modal__header {
    border-bottom: 1px solid var(--samar-border);
}

.samar-modal__footer {
    justify-content: flex-end;
    border-top: 1px solid var(--samar-border);
    background: var(--samar-surface-soft);
}

.samar-modal__body {
    padding: 1.25rem;
}

.samar-modal__title {
    margin: 0;
    color: var(--samar-text);
    font-size: 1.05rem;
    font-weight: 950;
}

.samar-modal__subtitle {
    margin: .35rem 0 0;
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.9;
}

@media (max-width: 1024px) {
    .samar-list-tools {
        width: 100%;
        justify-content: stretch;
    }

        .samar-list-tools .samar-search,
        .samar-list-tools .samar-segmented-control {
            width: 100%;
        }

    .samar-segmented-control {
        overflow-x: auto;
        justify-content: flex-start;
        border-radius: 1rem;
    }
}

@media (max-width: 768px) {
    .samar-page-actions,
    .samar-list-tools {
        width: 100%;
    }

        .samar-page-actions .samar-btn,
        .samar-list-tools .samar-search {
            width: 100%;
        }

    .samar-table-card__header {
        flex-direction: column;
    }

    .samar-card__body--table {
        padding: .75rem;
        overflow: hidden;
    }

        .samar-card__body--table .samar-table-wrap {
            width: 100%;
            max-width: 100%;
            overflow: visible;
        }

        .samar-card__body--table .samar-table[data-table-responsive="true"] {
            width: 100%;
            min-width: 0 !important;
            border-spacing: 0;
        }

            .samar-card__body--table .samar-table[data-table-responsive="true"] thead {
                display: none;
            }

            .samar-card__body--table .samar-table[data-table-responsive="true"],
            .samar-card__body--table .samar-table[data-table-responsive="true"] tbody,
            .samar-card__body--table .samar-table[data-table-responsive="true"] tr,
            .samar-card__body--table .samar-table[data-table-responsive="true"] td {
                display: block;
                width: 100%;
            }

                .samar-card__body--table .samar-table[data-table-responsive="true"] tbody {
                    display: grid;
                    gap: .75rem;
                }

                .samar-card__body--table .samar-table[data-table-responsive="true"] tr {
                    padding: .85rem;
                    border: 1px solid var(--samar-border);
                    border-radius: 1rem;
                    background: var(--samar-surface);
                    box-shadow: 0 10px 28px rgba(31, 41, 55, .06);
                }

                .samar-card__body--table .samar-table[data-table-responsive="true"] td {
                    display: grid;
                    grid-template-columns: minmax(5.6rem, .42fr) minmax(0, 1fr);
                    align-items: center;
                    gap: .75rem;
                    padding: .7rem 0;
                    border-bottom: 1px solid var(--samar-border);
                    text-align: right;
                    word-break: break-word;
                }

                    .samar-card__body--table .samar-table[data-table-responsive="true"] td::before {
                        content: attr(data-tbl-lbl);
                        color: var(--samar-text-muted);
                        font-size: .72rem;
                        font-weight: 900;
                        line-height: 1.8;
                    }

                    .samar-card__body--table .samar-table[data-table-responsive="true"] td:last-child {
                        border-bottom: 0;
                        padding-bottom: 0;
                    }

                    .samar-card__body--table .samar-table[data-table-responsive="true"] td[colspan] {
                        display: block;
                        padding: 0;
                        border-bottom: 0;
                    }

                        .samar-card__body--table .samar-table[data-table-responsive="true"] td[colspan]::before {
                            display: none;
                        }

    .samar-table__actions {
        width: auto;
        text-align: right !important;
    }

    .samar-row-actions {
        justify-content: stretch;
        width: 100%;
    }

        .samar-row-actions .samar-btn {
            flex: 1 1 0;
            justify-content: center;
            min-width: 0;
        }

    .samar-empty-state {
        min-height: 8rem;
        padding: 1.25rem .75rem;
    }

    .samar-card__footer {
        padding-inline: 1rem;
    }

    .samar-modal {
        align-items: flex-end;
        padding: 0;
    }

    .samar-modal__dialog {
        width: 100%;
        max-height: 92vh;
        border-radius: 1.4rem 1.4rem 0 0;
    }

    .samar-modal__footer {
        flex-direction: column-reverse;
    }

        .samar-modal__footer .samar-btn {
            width: 100%;
        }
}


/* --------------------------------------------------------------------------
   SAMAR shared entity card components
   -------------------------------------------------------------------------- */
.samar-field--full {
    grid-column: 1 / -1;
}

.samar-text-muted {
    color: var(--samar-text-muted) !important;
}

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

.samar-entity-card {
    min-width: 0;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .samar-entity-card:hover {
        transform: translateY(-2px);
        border-color: rgba(15, 118, 110, .24);
        box-shadow: var(--samar-shadow-md);
    }

.samar-entity-card__body {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.samar-entity-card__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
}

.samar-entity-card__avatar {
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--samar-border);
    background: var(--samar-surface-soft);
}

    .samar-entity-card__avatar img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: .35rem;
    }

.samar-entity-card__title-block {
    display: grid;
    gap: .25rem;
    min-width: 0;
}

.samar-entity-card__title {
    color: var(--samar-text);
    font-size: .98rem;
    font-weight: 950;
    line-height: 1.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .samar-entity-card__title:hover {
        color: var(--samar-primary);
        text-decoration: none;
    }

.samar-entity-card__subtitle {
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.samar-entity-card__actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

    .samar-entity-card__actions .samar-btn {
        flex: 1 1 0;
        min-width: 0;
    }

.samar-meta-list {
    display: grid;
    gap: .75rem;
    margin: 0;
}

.samar-meta-list--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.samar-meta-list div {
    display: grid;
    gap: .25rem;
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--samar-border);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
}

.samar-meta-list dt {
    color: var(--samar-text-muted);
    font-size: .72rem;
    font-weight: 850;
}

.samar-meta-list dd {
    margin: 0;
    color: var(--samar-text);
    font-size: .82rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .samar-entity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .samar-entity-grid {
        grid-template-columns: 1fr;
    }

    .samar-entity-card__header {
        grid-template-columns: auto minmax(0, 1fr);
    }

        .samar-entity-card__header .samar-badge {
            grid-column: 1 / -1;
            justify-self: start;
        }

    .samar-meta-list--2 {
        grid-template-columns: 1fr;
    }

    .samar-entity-card__actions {
        flex-direction: column;
    }

        .samar-entity-card__actions .samar-btn {
            width: 100%;
        }
}

/* --------------------------------------------------------------------------
   SAMAR bill detail and printable receipt components
   -------------------------------------------------------------------------- */
.samar-bill-detail-page {
    gap: 1.1rem;
}

.samar-bill-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 1rem;
    padding: 1.25rem;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(15, 118, 110, .12), transparent 34rem), var(--samar-surface);
}

.samar-bill-hero__main {
    display: grid;
    gap: .95rem;
    min-width: 0;
}

.samar-bill-hero__eyebrow {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    color: var(--samar-text-muted);
    font-size: .8rem;
    font-weight: 850;
}

.samar-bill-hero__title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.samar-bill-hero h1 {
    margin: 0;
    color: var(--samar-text);
    font-size: clamp(1.25rem, 1.8vw, 1.9rem);
    font-weight: 950;
    line-height: 1.55;
}

    .samar-bill-hero h1 span {
        color: var(--samar-primary);
        direction: ltr;
        unicode-bidi: plaintext;
    }

.samar-bill-hero p {
    margin: .35rem 0 0;
    max-width: 44rem;
    color: var(--samar-text-muted);
    font-size: .85rem;
    font-weight: 750;
    line-height: 1.9;
}

.samar-bill-total-pill {
    display: grid;
    gap: .25rem;
    min-width: 13rem;
    padding: .9rem 1rem;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 1.1rem;
    background: var(--samar-primary-light);
}

    .samar-bill-total-pill small {
        color: var(--samar-text-muted);
        font-size: .74rem;
        font-weight: 850;
    }

    .samar-bill-total-pill strong {
        color: var(--samar-primary);
        font-size: 1.25rem;
        font-weight: 950;
        line-height: 1.3;
    }

.samar-bill-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .7rem;
    flex-wrap: wrap;
}

.samar-bill-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: 1rem;
    align-items: start;
}

.samar-bill-layout__main,
.samar-bill-layout__aside {
    min-width: 0;
}

.samar-bill-layout__aside,
.samar-side-card .samar-card__body {
    display: grid;
    gap: 1rem;
}

.samar-receipt {
    overflow: hidden;
}

.samar-receipt__header,
.samar-receipt__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.25rem;
}

.samar-receipt__header {
    border-bottom: 1px solid var(--samar-border);
    background: linear-gradient(135deg, var(--samar-surface), var(--samar-surface-soft));
}

.samar-receipt__label {
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 850;
}

.samar-receipt__header h2 {
    margin: .25rem 0 0;
    color: var(--samar-text);
    font-size: 1.15rem;
    font-weight: 950;
    line-height: 1.6;
}

.samar-receipt__status {
    display: grid;
    justify-items: end;
    gap: .45rem;
}

    .samar-receipt__status small {
        color: var(--samar-text-muted);
        font-size: .75rem;
        font-weight: 800;
    }

.samar-receipt__summary,
.samar-receipt__section {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--samar-border);
}

    .samar-receipt__section:last-of-type {
        border-bottom: 0;
    }

.samar-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}

    .samar-section-heading h3 {
        margin: 0;
        color: var(--samar-text);
        font-size: .98rem;
        font-weight: 950;
    }

    .samar-section-heading p {
        margin: .25rem 0 0;
        color: var(--samar-text-muted);
        font-size: .78rem;
        font-weight: 750;
        line-height: 1.9;
    }

.samar-meta-list--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.samar-meta-list--plain div {
    background: var(--samar-surface-soft);
}

.samar-meta-list--plain dd {
    direction: rtl;
    unicode-bidi: plaintext;
}

.samar-text-center {
    text-align: center !important;
}

.samar-text-left {
    text-align: left !important;
}

.samar-bill-table {
    min-width: 42rem;
}

.samar-table-amount {
    color: var(--samar-text);
    font-weight: 950 !important;
}

.samar-total-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

    .samar-total-panel div {
        display: grid;
        gap: .3rem;
        min-width: 0;
        padding: .9rem;
        border: 1px solid var(--samar-border);
        border-radius: 1rem;
        background: var(--samar-surface-soft);
    }

    .samar-total-panel small,
    .samar-bank-card span,
    .samar-bank-card small,
    .samar-receipt__footer span {
        color: var(--samar-text-muted);
        font-size: .75rem;
        font-weight: 850;
    }

    .samar-total-panel strong,
    .samar-bank-card strong,
    .samar-bank-card code {
        color: var(--samar-text);
        font-size: .88rem;
        font-weight: 950;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.samar-bank-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--samar-border);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
}

    .samar-bank-card div {
        display: grid;
        gap: .25rem;
        min-width: 0;
    }

    .samar-bank-card code {
        direction: ltr;
        unicode-bidi: plaintext;
        font-family: inherit;
        padding: .35rem .55rem;
        border-radius: .75rem;
        background: #fff;
        border: 1px solid var(--samar-border);
    }

.samar-receipt__footer {
    border-top: 1px solid rgba(15, 118, 110, .14);
    background: var(--samar-primary-light);
}

    .samar-receipt__footer strong {
        color: var(--samar-primary);
        font-size: 1.35rem;
        font-weight: 950;
    }

.samar-alert--compact {
    display: grid;
    gap: .25rem;
}

    .samar-alert--compact span {
        color: inherit;
        font-size: .8rem;
        font-weight: 750;
    }

.samar-btn--block {
    width: 100%;
}

@media (max-width: 1200px) {
    .samar-bill-layout {
        grid-template-columns: 1fr;
    }

    .samar-bill-layout__aside {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .samar-bill-hero {
        grid-template-columns: 1fr;
    }

    .samar-bill-hero__title-row,
    .samar-receipt__header,
    .samar-receipt__footer,
    .samar-bank-card {
        align-items: stretch;
        flex-direction: column;
    }

    .samar-receipt__status {
        justify-items: start;
    }

    .samar-bill-total-pill {
        min-width: 0;
    }

    .samar-meta-list--4,
    .samar-total-panel,
    .samar-bill-layout__aside {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .samar-bill-hero__actions .samar-btn,
    .samar-bill-hero__actions {
        width: 100%;
    }

        .samar-bill-hero__actions .samar-btn {
            justify-content: center;
        }

    .samar-bill-table {
        min-width: 0;
    }
}

.samar-modal__dialog--sm {
    width: min(34rem, 100%);
}

.samar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid var(--samar-border);
    border-radius: .9rem;
    background: var(--samar-surface-soft);
    color: var(--samar-text-muted);
    cursor: pointer;
    transition: .18s ease;
}

    .samar-icon-btn:hover {
        border-color: rgba(15, 118, 110, .22);
        background: var(--samar-primary-light);
        color: var(--samar-primary);
    }

    .samar-icon-btn svg {
        width: 1.1rem;
        height: 1.1rem;
    }


/* --------------------------------------------------------------------------
   Bills statistics page
   -------------------------------------------------------------------------- */
.samar-report-shell {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.samar-report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
    gap: 1rem;
}

.samar-summary-card__icon--success {
    color: var(--samar-success);
    background: var(--samar-success-bg);
}

.samar-chart-grid {
    display: grid;
    grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.samar-chart-card,
.samar-chart-card .samar-card__body {
    min-width: 0;
}

.samar-chart-card__body {
    padding: 1rem;
}

.samar-chart {
    min-height: 18rem;
    width: 100%;
    min-width: 0;
}

.samar-chart--wide {
    min-height: 20rem;
}

.samar-chart .apexcharts-canvas,
.samar-chart svg.apexcharts-svg {
    width: 100% !important;
    max-width: 100% !important;
}

.samar-chart svg.apexcharts-svg {
    height: auto !important;
    display: block;
}

.samar-chart .apexcharts-canvas svg,
.samar-chart .apexcharts-canvas foreignObject {
    overflow: visible;
}

.samar-chart .apexcharts-legend {
    max-width: 100%;
}

.portal-chart-empty {
    min-height: 16rem;
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
    border: 1px dashed rgba(148, 163, 184, .38);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
}

    .portal-chart-empty > div {
        display: grid;
        gap: .35rem;
    }

    .portal-chart-empty strong {
        color: var(--samar-text);
        font-size: .95rem;
        font-weight: 950;
    }

    .portal-chart-empty span {
        color: var(--samar-text-muted);
        font-size: .8rem;
        font-weight: 750;
        line-height: 1.9;
    }

.samar-filter-chips {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.samar-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 2rem;
    padding: 0 .75rem;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 999px;
    color: var(--samar-primary);
    background: var(--samar-primary-light);
    font-size: .76rem;
    font-weight: 900;
    cursor: pointer;
    transition: .18s ease;
}

    .samar-chip:hover {
        border-color: rgba(15, 118, 110, .34);
        background: rgba(15, 118, 110, .12);
    }

    .samar-chip b {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.1rem;
        height: 1.1rem;
        border-radius: 999px;
        background: rgba(15, 118, 110, .12);
        font-size: .8rem;
        line-height: 1;
    }

.samar-page-size-control {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 850;
}

.samar-select--sm {
    min-height: 2.35rem;
    width: auto;
    min-width: 5.2rem;
    padding-inline: .75rem;
    border-radius: .8rem;
}

.samar-pagination-footer {
    align-items: center;
}

.samar-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    flex-wrap: wrap;
}

.samar-page-btn,
.samar-page-ellipsis {
    min-width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .75rem;
    font-size: .78rem;
    font-weight: 900;
}

.samar-page-btn {
    border: 1px solid var(--samar-border);
    color: var(--samar-text-muted);
    background: var(--samar-surface);
    cursor: pointer;
    transition: .18s ease;
}

    .samar-page-btn:hover:not(:disabled),
    .samar-page-btn.is-active {
        color: #fff;
        border-color: var(--samar-primary);
        background: var(--samar-primary);
    }

    .samar-page-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

.samar-page-ellipsis {
    color: var(--samar-text-muted);
}

.samar-cell-stack {
    display: grid;
    gap: .25rem;
    min-width: 0;
}

    .samar-cell-stack strong {
        color: var(--samar-text);
        font-size: .86rem;
        font-weight: 950;
    }

    .samar-cell-stack span,
    .samar-table-date {
        color: var(--samar-text-muted);
        font-size: .76rem;
        font-weight: 750;
    }

.samar-fieldset {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--samar-border);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
}

    .samar-fieldset legend {
        padding: 0 .45rem;
        color: var(--samar-text);
        font-size: .78rem;
        font-weight: 950;
    }

.samar-form-grid--mt {
    margin-top: 1rem;
}

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

.samar-check-option {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.8rem;
    padding: .5rem .7rem;
    border: 1px solid var(--samar-border);
    border-radius: .9rem;
    background: var(--samar-surface);
    color: var(--samar-text);
    font-size: .8rem;
    font-weight: 850;
    cursor: pointer;
}

    .samar-check-option input {
        width: 1rem;
        height: 1rem;
        accent-color: var(--samar-primary);
    }

@media (max-width: 1200px) {
    .samar-report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .samar-chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .samar-report-summary-grid,
    .samar-check-grid {
        grid-template-columns: 1fr;
    }

    .samar-page-size-control,
    .samar-pagination-footer {
        width: 100%;
        justify-content: center;
    }

    .samar-pagination {
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   Add bill wizard page
   -------------------------------------------------------------------------- */
.samar-bill-create-page {
    gap: 1rem;
}

.samar-create-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    align-items: stretch;
    gap: 1rem;
    padding: 1.25rem;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(15, 118, 110, .12), transparent 34rem), var(--samar-surface);
}

.samar-create-hero__main {
    display: grid;
    gap: .85rem;
    min-width: 0;
}

.samar-create-hero h1 {
    margin: 0;
    color: var(--samar-text);
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 950;
    line-height: 1.55;
}

.samar-create-hero p {
    margin: .35rem 0 0;
    max-width: 48rem;
    color: var(--samar-text-muted);
    font-size: .85rem;
    font-weight: 750;
    line-height: 1.95;
}

.samar-create-hero__side {
    display: grid;
    align-content: center;
    gap: .35rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 1.15rem;
    background: var(--samar-primary-light);
}

    .samar-create-hero__side span,
    .samar-create-hero__side small {
        color: var(--samar-text-muted);
        font-size: .76rem;
        font-weight: 850;
        line-height: 1.8;
    }

    .samar-create-hero__side strong {
        color: var(--samar-primary);
        font-size: clamp(1rem, 1.25vw, 1.25rem);
        font-weight: 950;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

.samar-wizard {
    overflow: hidden;
}

.samar-wizard__steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--samar-border);
    background: var(--samar-surface);
}

.samar-wizard-step {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    min-height: 4rem;
    padding: .75rem;
    border: 1px solid var(--samar-border);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
    color: var(--samar-text-muted);
    text-align: right;
    cursor: pointer;
    transition: .18s ease;
}

    .samar-wizard-step:hover,
    .samar-wizard-step.is-active {
        border-color: rgba(15, 118, 110, .26);
        background: var(--samar-primary-light);
        color: var(--samar-primary);
    }

    .samar-wizard-step.is-complete {
        border-color: rgba(16, 185, 129, .22);
        background: var(--samar-success-bg);
        color: var(--samar-success);
    }

    .samar-wizard-step:disabled {
        cursor: not-allowed;
        opacity: .75;
    }

.samar-wizard-step__number {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: .85rem;
    background: #fff;
    color: currentColor;
    font-size: .85rem;
    font-weight: 950;
    box-shadow: var(--samar-shadow-xs);
}

.samar-wizard-step__text {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

    .samar-wizard-step__text strong {
        color: var(--samar-text);
        font-size: .86rem;
        font-weight: 950;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .samar-wizard-step__text small {
        color: var(--samar-text-muted);
        font-size: .72rem;
        font-weight: 750;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.samar-wizard-step.is-active .samar-wizard-step__text strong,
.samar-wizard-step.is-complete .samar-wizard-step__text strong {
    color: currentColor;
}

.samar-wizard__body {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.samar-wizard-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.samar-wizard__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--samar-border);
    background: var(--samar-surface-soft);
}

.samar-receipt-type-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.samar-receipt-type-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: .65rem;
    min-height: 10rem;
    padding: 1.15rem;
    border: 1px solid var(--samar-border);
    border-radius: 1.1rem;
    background: var(--samar-surface);
    text-align: center;
    cursor: pointer;
    transition: .18s ease;
}

    .samar-receipt-type-card:hover,
    .samar-receipt-type-card.is-selected {
        transform: translateY(-2px);
        border-color: rgba(15, 118, 110, .28);
        background: var(--samar-primary-light);
        box-shadow: var(--samar-shadow-sm);
    }

    .samar-receipt-type-card input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.samar-receipt-type-card__icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: var(--samar-primary);
    background: #fff;
    font-size: 1.4rem;
    font-weight: 950;
}

.samar-receipt-type-card strong {
    color: var(--samar-text);
    font-size: .92rem;
    font-weight: 950;
    line-height: 1.7;
}

.samar-receipt-type-card small {
    color: var(--samar-text-muted);
    font-size: .75rem;
    font-weight: 750;
    line-height: 1.9;
}

.samar-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid var(--samar-border);
    border-radius: 12px;
    background: var(--samar-surface);
    overflow: hidden;
    transition: .18s ease;
}

    .samar-input-group:focus-within {
        border-color: var(--samar-primary);
        box-shadow: 0 0 0 4px rgba(15,118,110,.12);
    }

    .samar-input-group .samar-input {
        min-height: 42px;
        border: 0;
        border-radius: 0;
        box-shadow: none !important;
        background: transparent;
    }

    .samar-input-group span {
        display: inline-flex;
        align-items: center;
        align-self: stretch;
        padding: 0 .85rem;
        border-right: 1px solid var(--samar-border);
        color: var(--samar-text-muted);
        background: var(--samar-surface-soft);
        font-size: .75rem;
        font-weight: 900;
        white-space: nowrap;
    }

.samar-input-group--sm {
    width: min(8.5rem, 100%);
    margin-inline: auto;
    border-radius: .85rem;
}

    .samar-input-group--sm .samar-input {
        min-height: 2.35rem;
        padding-inline: .65rem;
    }

    .samar-input-group--sm span {
        padding-inline: .55rem;
        font-size: .7rem;
    }

.samar-field-error {
    color: var(--samar-danger) !important;
}

.samar-helper-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

.samar-helper-card {
    display: grid;
    gap: .25rem;
    min-width: 0;
    padding: .9rem 1rem;
    border: 1px solid var(--samar-border);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
}

    .samar-helper-card span {
        color: var(--samar-text-muted);
        font-size: .74rem;
        font-weight: 850;
    }

    .samar-helper-card strong {
        color: var(--samar-text);
        font-size: .86rem;
        font-weight: 950;
        line-height: 1.8;
        overflow-wrap: anywhere;
    }

.samar-meta-list--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.samar-bill-builder {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.samar-total-panel--bill-create {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

    .samar-total-panel--bill-create .samar-total-panel__primary {
        border-color: rgba(15, 118, 110, .24);
        background: var(--samar-primary-light);
    }

        .samar-total-panel--bill-create .samar-total-panel__primary strong {
            color: var(--samar-primary);
            font-size: clamp(1rem, 1.35vw, 1.35rem);
        }

.samar-final-state {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.samar-final-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

@media (max-width: 1200px) {
    .samar-wizard__steps,
    .samar-receipt-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .samar-helper-grid {
        grid-template-columns: 1fr;
    }

    .samar-total-panel--bill-create {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .samar-create-hero {
        grid-template-columns: 1fr;
    }

    .samar-meta-list--3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .samar-wizard__steps,
    .samar-receipt-type-grid,
    .samar-total-panel--bill-create {
        grid-template-columns: 1fr;
    }

    .samar-wizard__body,
    .samar-wizard__footer {
        padding-inline: 1rem;
    }

    .samar-wizard__footer,
    .samar-final-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

        .samar-wizard__footer .samar-btn,
        .samar-final-actions .samar-btn {
            width: 100%;
        }

    .samar-input-group--sm {
        width: 100%;
        margin-inline: 0;
    }
}

/* --------------------------------------------------------------------------
   Village council profile page
   -------------------------------------------------------------------------- */
.samar-profile-page {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.samar-profile-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 1rem;
    padding: 1.25rem;
    background: radial-gradient(circle at top right, rgba(15, 118, 110, .14), transparent 34rem), linear-gradient(135deg, var(--samar-surface), var(--samar-surface-soft));
}

.samar-profile-hero__identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.samar-profile-avatar {
    width: 5rem;
    height: 5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 1.35rem;
    border: 1px solid rgba(15, 118, 110, .16);
    background: #fff;
    box-shadow: var(--samar-shadow-xs);
}

    .samar-profile-avatar img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: .45rem;
    }

.samar-profile-hero__text {
    display: grid;
    gap: .55rem;
    min-width: 0;
}

.samar-profile-hero__eyebrow {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 850;
}

.samar-profile-hero h1 {
    margin: 0;
    color: var(--samar-text);
    font-size: clamp(1.3rem, 2vw, 2rem);
    font-weight: 950;
    line-height: 1.55;
}

.samar-profile-hero p {
    margin: 0;
    max-width: 52rem;
    color: var(--samar-text-muted);
    font-size: .85rem;
    font-weight: 750;
    line-height: 1.95;
}

.samar-profile-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

.samar-profile-tabs-card {
    overflow: hidden;
}

.samar-profile-tabs {
    display: flex;
    align-items: stretch;
    gap: .45rem;
    padding: .6rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--samar-border);
    background: var(--samar-surface);
}

.samar-profile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.7rem;
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: .95rem;
    color: var(--samar-text-muted);
    background: transparent;
    font-size: .82rem;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
    transition: .18s ease;
}

    .samar-profile-tab:hover,
    .samar-profile-tab.is-active {
        color: var(--samar-primary);
        border-color: rgba(15, 118, 110, .18);
        background: var(--samar-primary-light);
    }

.samar-profile-tab-panel {
    padding-top: 1rem;
}

.samar-profile-layout {
    display: grid;
    grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
}

.samar-profile-stack {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

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

.samar-profile-stat-card .samar-card__body {
    display: grid;
    gap: .25rem;
    min-width: 0;
    padding: 1.05rem;
}

.samar-profile-stat-card small {
    color: var(--samar-text-muted);
    font-size: .76rem;
    font-weight: 850;
}

.samar-profile-stat-card strong {
    color: var(--samar-text);
    font-size: clamp(1.1rem, 1.5vw, 1.55rem);
    font-weight: 950;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.samar-info-list {
    display: grid;
    gap: .7rem;
}

.samar-info-row {
    display: grid;
    grid-template-columns: minmax(7rem, .42fr) minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
    min-width: 0;
    padding: .75rem .85rem;
    border: 1px solid var(--samar-border);
    border-radius: .95rem;
    background: var(--samar-surface-soft);
}

    .samar-info-row span {
        color: var(--samar-text-muted);
        font-size: .74rem;
        font-weight: 850;
    }

    .samar-info-row strong,
    .samar-info-row code {
        color: var(--samar-text);
        font-size: .82rem;
        font-weight: 950;
        line-height: 1.8;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .samar-info-row code {
        direction: ltr;
        unicode-bidi: plaintext;
        font-family: inherit;
    }

.samar-description-box {
    margin-bottom: 1rem;
    color: var(--samar-text-muted);
    font-size: .84rem;
    font-weight: 750;
    line-height: 2;
}

.samar-profile-action-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.samar-mini-list {
    display: grid;
    gap: .7rem;
}

.samar-mini-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    padding: .85rem;
    border: 1px solid var(--samar-border);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
}

.samar-mini-card__icon {
    width: 2.65rem;
    height: 2.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .95rem;
    color: var(--samar-primary);
    background: var(--samar-primary-light);
    font-size: 1rem;
    font-weight: 950;
}

.samar-mini-card__content {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

    .samar-mini-card__content strong {
        color: var(--samar-text);
        font-size: .84rem;
        font-weight: 950;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .samar-mini-card__content span,
    .samar-mini-card__content code {
        color: var(--samar-text-muted);
        font-size: .74rem;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .samar-mini-card__content code {
        direction: ltr;
        unicode-bidi: plaintext;
        font-family: inherit;
    }

.samar-mini-card__actions,
.samar-inline-actions {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.samar-chart-card--profile .samar-chart {
    min-height: 15rem;
}

.samar-profile-guide {
    display: grid;
    gap: .75rem;
    color: var(--samar-text-muted);
    font-size: .84rem;
    font-weight: 750;
    line-height: 2;
}

    .samar-profile-guide strong {
        color: var(--samar-text);
        font-weight: 950;
    }

.samar-profile-table .samar-table {
    min-width: 50rem;
}

.samar-profile-table .samar-table--wide {
    min-width: 64rem;
}

.samar-timeline {
    display: grid;
    gap: .8rem;
}

.samar-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .75rem;
    min-width: 0;
}

.samar-timeline-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--samar-primary);
    background: var(--samar-primary-light);
    font-weight: 950;
    box-shadow: var(--samar-shadow-xs);
}

.samar-timeline-content {
    display: grid;
    gap: .25rem;
    min-width: 0;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--samar-border);
}

.samar-timeline-item:last-child .samar-timeline-content {
    border-bottom: 0;
    padding-bottom: 0;
}

.samar-timeline-content strong {
    color: var(--samar-text);
    font-size: .86rem;
    font-weight: 950;
}

.samar-timeline-content span {
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.9;
}

.samar-timeline-content time {
    color: var(--samar-text-muted);
    font-size: .72rem;
    font-weight: 800;
}

.samar-modal__dialog--lg {
    width: min(48rem, 100%);
}

.samar-password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border: 1px solid var(--samar-border);
    border-radius: 12px;
    background: var(--samar-surface);
    overflow: hidden;
}

    .samar-password-field:focus-within {
        border-color: var(--samar-primary);
        box-shadow: 0 0 0 4px rgba(15,118,110,.12);
    }

    .samar-password-field .samar-input {
        border: 0;
        border-radius: 0;
        box-shadow: none !important;
    }

    .samar-password-field button {
        width: 2.8rem;
        border: 0;
        border-right: 1px solid var(--samar-border);
        color: var(--samar-text-muted);
        background: var(--samar-surface-soft);
        font-size: .85rem;
        font-weight: 950;
    }

@media (max-width: 1200px) {
    .samar-profile-hero,
    .samar-profile-layout {
        grid-template-columns: 1fr;
    }

    .samar-profile-hero__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .samar-profile-hero__identity {
        align-items: flex-start;
        flex-direction: column;
    }

    .samar-profile-hero__actions,
    .samar-profile-hero__actions .samar-btn,
    .samar-profile-action-row .samar-btn,
    .samar-inline-actions .samar-btn {
        width: 100%;
    }

    .samar-profile-stats {
        grid-template-columns: 1fr;
    }

    .samar-info-row,
    .samar-mini-card {
        grid-template-columns: 1fr;
    }

    .samar-mini-card__actions,
    .samar-inline-actions {
        width: 100%;
    }

        .samar-mini-card__actions .samar-icon-btn,
        .samar-inline-actions .samar-btn {
            flex: 1 1 0;
        }
}

/* SAMAR official bill receipt */
.samar-receipt--official {
    overflow: hidden;
}

.samar-receipt__header--official {
    align-items: flex-start;
}

.samar-receipt__section--table {
    padding-top: 1rem;
}

.samar-bill-table--official tfoot td,
.samar-table-summary-row td {
    border-top: 1px solid var(--samar-border);
    background: var(--samar-surface-soft);
    color: var(--samar-text);
    font-weight: 800;
}

.samar-receipt-payment-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(14rem, .85fr);
    gap: .85rem;
}

.samar-bank-card--receipt {
    min-height: 5rem;
}

    .samar-bank-card--receipt strong {
        line-height: 1.9;
    }

    .samar-bank-card--receipt small + small {
        margin-top: .15rem;
    }

.samar-payment-card {
    display: grid;
    align-content: center;
    gap: .35rem;
    min-height: 5rem;
    padding: 1rem;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 1rem;
    background: var(--samar-primary-light);
}

    .samar-payment-card small {
        color: var(--samar-text-muted);
        font-size: .82rem;
        font-weight: 800;
    }

    .samar-payment-card strong {
        color: var(--samar-primary-strong);
        font-size: clamp(1.15rem, 2vw, 1.55rem);
        font-weight: 900;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

.samar-receipt-issuers,
.samar-signature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.samar-issuer-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 5.25rem;
    padding: .9rem;
    border: 1px solid var(--samar-border);
    border-radius: 1rem;
    background: var(--samar-surface-soft);
}

    .samar-issuer-card img {
        width: 3.2rem;
        height: 3.2rem;
        flex: 0 0 auto;
        object-fit: contain;
    }

.samar-issuer-card__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--samar-primary-light);
    color: var(--samar-primary-strong);
    font-weight: 900;
}

.samar-issuer-card div:not(.samar-issuer-card__mark) {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.samar-issuer-card span,
.samar-signature-box span {
    color: var(--samar-text-muted);
    font-size: .8rem;
    font-weight: 800;
}

.samar-issuer-card strong,
.samar-signature-box strong {
    color: var(--samar-text);
    font-weight: 900;
    line-height: 1.7;
}

.samar-issuer-card small {
    color: var(--samar-text-muted);
    font-size: .78rem;
    font-weight: 700;
}

.samar-signature-box {
    display: grid;
    align-content: end;
    gap: .55rem;
    min-height: 7.25rem;
    padding: .9rem;
    border: 1px dashed var(--samar-border-strong, var(--samar-border));
    border-radius: 1rem;
    background: var(--samar-surface);
}

    .samar-signature-box::before {
        content: "";
        display: block;
        width: 100%;
        border-top: 1px solid var(--samar-border-strong, var(--samar-border));
    }

/* SAMAR hotfix: keep SweetAlert above SAMAR modals. */
:root {
    --samar-z-modal: 1100;
    --samar-z-dialog: 1300;
    --samar-z-toast: 1400;
}

.samar-modal {
    z-index: var(--samar-z-modal);
}

.swal2-container,
.samar-swal-container {
    z-index: var(--samar-z-dialog) !important;
}

.iziToast-wrapper {
    z-index: var(--samar-z-toast) !important;
}

@media (max-width: 900px) {
    .samar-receipt-payment-grid,
    .samar-receipt-issuers,
    .samar-signature-grid {
        grid-template-columns: 1fr;
    }
}
