/* =========================================================
   NEXUS REAL ESTATE — REUSABLE COMPONENTS
   Cards, badges, tables, buttons, progress bars, modals
   ========================================================= */

/* ---------------------------------------------------------
   1. STAT CARD
   --------------------------------------------------------- */
.nx-stat-card {
    background: var(--nx-bg-card);
    border-radius: var(--nx-radius-lg);
    padding: var(--nx-sp-6);
    box-shadow: var(--nx-shadow-sm);
    border: 1px solid var(--nx-gray-100);
    display: flex;
    align-items: flex-start;
    gap: var(--nx-sp-4);
    transition: box-shadow var(--nx-transition-fast);
}

.nx-stat-card:hover {
    box-shadow: var(--nx-shadow-md);
}

.nx-stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--nx-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nx-stat-card__icon svg {
    width: 24px;
    height: 24px;
}

.nx-stat-card__icon--primary {
    background: var(--nx-primary-50);
    color: var(--nx-primary-600);
}

.nx-stat-card__icon--success {
    background: var(--nx-success-50);
    color: var(--nx-success-600);
}

.nx-stat-card__icon--warning {
    background: var(--nx-warning-50);
    color: var(--nx-warning-600);
}

.nx-stat-card__icon--danger {
    background: var(--nx-danger-50);
    color: var(--nx-danger-600);
}

.nx-stat-card__icon--info {
    background: var(--nx-info-50);
    color: var(--nx-info-600);
}

.nx-stat-card__body {
    flex: 1;
    min-width: 0;
}

.nx-stat-card__label {
    font-size: var(--nx-text-xs);
    font-weight: 500;
    color: var(--nx-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--nx-sp-1);
}

.nx-stat-card__value {
    font-size: var(--nx-text-2xl);
    font-weight: 700;
    color: var(--nx-gray-900);
    line-height: 1.2;
}

.nx-stat-card__change {
    font-size: var(--nx-text-xs);
    font-weight: 500;
    margin-top: var(--nx-sp-1);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.nx-stat-card__change--up {
    color: var(--nx-success-600);
}

.nx-stat-card__change--down {
    color: var(--nx-danger-500);
}


/* ---------------------------------------------------------
   2. PROPERTY CARD
   --------------------------------------------------------- */
.nx-property-card {
    background: var(--nx-bg-card);
    border-radius: var(--nx-radius-lg);
    overflow: hidden;
    box-shadow: var(--nx-shadow-sm);
    border: 1px solid var(--nx-gray-100);
    transition: all var(--nx-transition-normal);
    display: flex;
    flex-direction: column;
}

.nx-property-card:hover {
    box-shadow: var(--nx-shadow-lg);
    transform: translateY(-2px);
}

.nx-property-card__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--nx-gray-100);
}

.nx-property-card__body {
    padding: var(--nx-sp-5);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nx-property-card__type {
    font-size: var(--nx-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nx-primary-600);
    margin-bottom: var(--nx-sp-2);
}

.nx-property-card__title {
    font-size: var(--nx-text-base);
    font-weight: 600;
    color: var(--nx-gray-900);
    margin-bottom: var(--nx-sp-1);
    line-height: var(--nx-leading-tight);
}

.nx-property-card__location {
    font-size: var(--nx-text-sm);
    color: var(--nx-gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: var(--nx-sp-4);
}

.nx-property-card__location svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.nx-property-card__meta {
    display: flex;
    gap: var(--nx-sp-4);
    padding-top: var(--nx-sp-3);
    border-top: 1px solid var(--nx-gray-100);
    margin-top: auto;
    margin-bottom: var(--nx-sp-3);
}

.nx-property-card__meta-item {
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.nx-property-card__meta-item svg {
    width: 14px;
    height: 14px;
}

.nx-property-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nx-property-card__price {
    font-size: var(--nx-text-lg);
    font-weight: 700;
    color: var(--nx-gray-900);
}

.nx-property-card__price small {
    font-size: var(--nx-text-xs);
    font-weight: 400;
    color: var(--nx-gray-400);
}


/* ---------------------------------------------------------
   3. INVESTMENT / CAMPAIGN CARD
   --------------------------------------------------------- */
.nx-campaign-card {
    background: var(--nx-bg-card);
    border-radius: var(--nx-radius-lg);
    overflow: hidden;
    box-shadow: var(--nx-shadow-sm);
    border: 1px solid var(--nx-gray-100);
    transition: all var(--nx-transition-normal);
}

.nx-campaign-card:hover {
    box-shadow: var(--nx-shadow-lg);
    transform: translateY(-2px);
}

.nx-campaign-card__img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--nx-gray-100);
}

.nx-campaign-card__body {
    padding: var(--nx-sp-5);
}

.nx-campaign-card__badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--nx-radius-full);
    margin-bottom: var(--nx-sp-2);
}

.nx-campaign-card__title {
    font-size: var(--nx-text-base);
    font-weight: 600;
    color: var(--nx-gray-900);
    margin-bottom: var(--nx-sp-3);
}

.nx-campaign-card__progress {
    margin-bottom: var(--nx-sp-3);
}

.nx-campaign-card__stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-500);
    margin-bottom: var(--nx-sp-4);
}

.nx-campaign-card__stats strong {
    color: var(--nx-gray-900);
}

.nx-campaign-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--nx-sp-3);
    border-top: 1px solid var(--nx-gray-100);
}

.nx-campaign-card__backers {
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-500);
}


/* ---------------------------------------------------------
   4. PROGRESS BAR
   --------------------------------------------------------- */
.nx-progress {
    width: 100%;
    height: 8px;
    background: var(--nx-gray-100);
    border-radius: var(--nx-radius-full);
    overflow: hidden;
}

.nx-progress__bar {
    height: 100%;
    border-radius: var(--nx-radius-full);
    background: var(--nx-primary-500);
    transition: width var(--nx-transition-slow);
}

.nx-progress__bar--success {
    background: var(--nx-success-500);
}

.nx-progress__bar--warning {
    background: var(--nx-warning-500);
}

.nx-progress__bar--danger {
    background: var(--nx-danger-500);
}

.nx-progress__bar--info {
    background: var(--nx-info-500);
}

.nx-progress--lg {
    height: 12px;
}

.nx-progress--sm {
    height: 4px;
}

/* Progress with label */
.nx-progress-labeled {
    display: flex;
    align-items: center;
    gap: var(--nx-sp-3);
}

.nx-progress-labeled .nx-progress {
    flex: 1;
}

.nx-progress-labeled__pct {
    font-size: var(--nx-text-sm);
    font-weight: 600;
    color: var(--nx-gray-700);
    min-width: 40px;
    text-align: right;
}


/* ---------------------------------------------------------
   5. STATUS BADGES
   --------------------------------------------------------- */
.nx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--nx-radius-full);
    white-space: nowrap;
}

.nx-badge--primary {
    background: var(--nx-primary-50);
    color: var(--nx-primary-700);
}

.nx-badge--success {
    background: var(--nx-success-50);
    color: var(--nx-success-700);
}

.nx-badge--warning {
    background: var(--nx-warning-50);
    color: var(--nx-warning-600);
}

.nx-badge--danger {
    background: var(--nx-danger-50);
    color: var(--nx-danger-600);
}

.nx-badge--info {
    background: var(--nx-info-50);
    color: var(--nx-info-600);
}

.nx-badge--gray {
    background: var(--nx-gray-100);
    color: var(--nx-gray-600);
}

/* Dot indicator inside badge */
.nx-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}


/* ---------------------------------------------------------
   6. BUTTONS
   --------------------------------------------------------- */
.nx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--nx-sp-2);
    font-family: var(--nx-font-sans);
    font-size: var(--nx-text-sm);
    font-weight: 600;
    padding: var(--nx-sp-2) var(--nx-sp-5);
    border-radius: var(--nx-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--nx-transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
}

.nx-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nx-btn svg {
    width: 18px;
    height: 18px;
}

.nx-btn--primary {
    background: var(--nx-primary-600);
    color: #fff;
}

.nx-btn--primary:hover {
    background: var(--nx-primary-700);
    color: #fff;
}

.nx-btn--success {
    background: var(--nx-success-600);
    color: #fff;
}

.nx-btn--success:hover {
    background: var(--nx-success-700);
    color: #fff;
}

.nx-btn--danger {
    background: var(--nx-danger-500);
    color: #fff;
}

.nx-btn--danger:hover {
    background: var(--nx-danger-600);
    color: #fff;
}

.nx-btn--outline {
    background: transparent;
    color: var(--nx-gray-700);
    border-color: var(--nx-gray-300);
}

.nx-btn--outline:hover {
    background: var(--nx-gray-50);
    border-color: var(--nx-gray-400);
    color: var(--nx-gray-700);
}

.nx-btn--ghost {
    background: transparent;
    color: var(--nx-gray-600);
    border: none;
}

.nx-btn--ghost:hover {
    background: var(--nx-gray-100);
    color: var(--nx-gray-900);
}

.nx-btn--sm {
    font-size: var(--nx-text-xs);
    padding: var(--nx-sp-1) var(--nx-sp-3);
}

.nx-btn--lg {
    font-size: var(--nx-text-base);
    padding: var(--nx-sp-3) var(--nx-sp-8);
}

.nx-btn--block {
    width: 100%;
}


/* ---------------------------------------------------------
   7. TABLES
   --------------------------------------------------------- */
.nx-table-wrap {
    background: var(--nx-bg-card);
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
    border: 1px solid var(--nx-gray-100);
    overflow: hidden;
}

.nx-table-wrap__header {
    padding: var(--nx-sp-5) var(--nx-sp-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--nx-gray-100);
}

.nx-table-wrap__title {
    font-size: var(--nx-text-base);
    font-weight: 600;
    color: var(--nx-gray-900);
}

.nx-table {
    width: 100%;
    border-collapse: collapse;
}

.nx-table th {
    text-align: left;
    padding: var(--nx-sp-3) var(--nx-sp-4);
    font-size: var(--nx-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nx-gray-500);
    background: var(--nx-gray-50);
    border-bottom: 1px solid var(--nx-gray-200);
}

.nx-table td {
    padding: var(--nx-sp-3) var(--nx-sp-4);
    font-size: var(--nx-text-sm);
    color: var(--nx-gray-700);
    border-bottom: 1px solid var(--nx-gray-100);
    vertical-align: middle;
}

.nx-table tbody tr:last-child td {
    border-bottom: none;
}

.nx-table tbody tr:hover {
    background: var(--nx-gray-50);
}

.nx-table__empty {
    text-align: center;
    padding: var(--nx-sp-12) var(--nx-sp-4);
    color: var(--nx-gray-400);
}

.nx-table__empty svg {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--nx-sp-3);
    opacity: 0.3;
}


/* ---------------------------------------------------------
   8. CARD (Generic)
   --------------------------------------------------------- */
.nx-card {
    background: var(--nx-bg-card);
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
    border: 1px solid var(--nx-gray-100);
}

.nx-card__header {
    padding: var(--nx-sp-5) var(--nx-sp-6);
    border-bottom: 1px solid var(--nx-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nx-card__title {
    font-size: var(--nx-text-base);
    font-weight: 600;
    color: var(--nx-gray-900);
}

.nx-card__body {
    padding: var(--nx-sp-6);
}

.nx-card__body--flush {
    padding: 0;
}

.nx-card__footer {
    padding: var(--nx-sp-4) var(--nx-sp-6);
    border-top: 1px solid var(--nx-gray-100);
}


/* ---------------------------------------------------------
   9. MILESTONE TIMELINE
   --------------------------------------------------------- */
.nx-timeline {
    position: relative;
    padding-left: 28px;
}

.nx-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--nx-gray-200);
}

.nx-timeline__item {
    position: relative;
    padding-bottom: var(--nx-sp-6);
}

.nx-timeline__item:last-child {
    padding-bottom: 0;
}

.nx-timeline__dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.nx-timeline__dot--completed {
    background: var(--nx-success-500);
    color: #fff;
}

.nx-timeline__dot--active {
    background: var(--nx-primary-500);
    color: #fff;
    box-shadow: 0 0 0 4px var(--nx-primary-100);
}

.nx-timeline__dot--pending {
    background: var(--nx-gray-200);
    color: var(--nx-gray-400);
}

.nx-timeline__dot svg {
    width: 12px;
    height: 12px;
}

.nx-timeline__title {
    font-size: var(--nx-text-sm);
    font-weight: 600;
    color: var(--nx-gray-900);
    margin-bottom: 2px;
}

.nx-timeline__desc {
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-500);
}

.nx-timeline__date {
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-400);
    margin-top: 2px;
}

.nx-timeline__media {
    display: flex;
    gap: var(--nx-sp-2);
    margin-top: var(--nx-sp-2);
    flex-wrap: wrap;
}

.nx-timeline__media img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--nx-radius-sm);
    cursor: pointer;
    transition: transform var(--nx-transition-fast);
}

.nx-timeline__media img:hover {
    transform: scale(1.05);
}


/* ---------------------------------------------------------
   10. CCTV PLAYER
   --------------------------------------------------------- */
.nx-cctv {
    background: #000;
    border-radius: var(--nx-radius-lg);
    overflow: hidden;
    position: relative;
}

.nx-cctv__video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    display: block;
}

.nx-cctv__overlay {
    position: absolute;
    top: var(--nx-sp-3);
    left: var(--nx-sp-3);
    display: flex;
    align-items: center;
    gap: var(--nx-sp-2);
}

.nx-cctv__live-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--nx-radius-full);
    font-size: var(--nx-text-xs);
    font-weight: 600;
}

.nx-cctv__live-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nx-danger-500);
    animation: nx-pulse 1.5s infinite;
}

@keyframes nx-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.nx-cctv__controls {
    padding: var(--nx-sp-3) var(--nx-sp-4);
    background: var(--nx-gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nx-cctv__camera-select {
    font-size: var(--nx-text-sm);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--nx-radius-sm);
    padding: var(--nx-sp-1) var(--nx-sp-3);
    font-family: var(--nx-font-sans);
}

.nx-cctv__camera-select option {
    background: var(--nx-gray-900);
}

.nx-cctv__thumbs {
    display: flex;
    gap: var(--nx-sp-2);
    margin-top: var(--nx-sp-3);
}

.nx-cctv__thumb {
    width: 120px;
    height: 68px;
    border-radius: var(--nx-radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all var(--nx-transition-fast);
}

.nx-cctv__thumb.active,
.nx-cctv__thumb:hover {
    opacity: 1;
    border-color: var(--nx-primary-500);
}

.nx-cctv__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ---------------------------------------------------------
   11. MODAL
   --------------------------------------------------------- */
.nx-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--nx-sp-4);
    opacity: 0;
    visibility: hidden;
    transition: all var(--nx-transition-normal);
}

.nx-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.nx-modal {
    background: var(--nx-bg-card);
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--nx-transition-normal);
}

.nx-modal-backdrop.active .nx-modal {
    transform: translateY(0);
}

.nx-modal__header {
    padding: var(--nx-sp-5) var(--nx-sp-6);
    border-bottom: 1px solid var(--nx-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nx-modal__title {
    font-size: var(--nx-text-lg);
    font-weight: 600;
}

.nx-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--nx-sp-1);
    border-radius: var(--nx-radius-sm);
    color: var(--nx-gray-400);
    transition: all var(--nx-transition-fast);
}

.nx-modal__close:hover {
    background: var(--nx-gray-100);
    color: var(--nx-gray-700);
}

.nx-modal__body {
    padding: var(--nx-sp-6);
}

.nx-modal__footer {
    padding: var(--nx-sp-4) var(--nx-sp-6);
    border-top: 1px solid var(--nx-gray-100);
    display: flex;
    justify-content: flex-end;
    gap: var(--nx-sp-3);
}


/* ---------------------------------------------------------
   12. FORM CONTROLS
   --------------------------------------------------------- */
.nx-input-group {
    margin-bottom: var(--nx-sp-5);
}

.nx-input-group label {
    display: block;
    font-size: var(--nx-text-sm);
    font-weight: 500;
    color: var(--nx-gray-700);
    margin-bottom: var(--nx-sp-1);
}

.nx-input {
    width: 100%;
    padding: var(--nx-sp-2) var(--nx-sp-3);
    border: 1px solid var(--nx-gray-300);
    border-radius: var(--nx-radius-sm);
    font-size: var(--nx-text-sm);
    font-family: var(--nx-font-sans);
    color: var(--nx-gray-900);
    background: #fff;
    transition: all var(--nx-transition-fast);
}

.nx-input:focus {
    outline: none;
    border-color: var(--nx-primary-400);
    box-shadow: 0 0 0 3px var(--nx-primary-100);
}

.nx-input--error {
    border-color: var(--nx-danger-500);
}

.nx-input--error:focus {
    box-shadow: 0 0 0 3px var(--nx-danger-100);
}

.nx-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.nx-textarea {
    resize: vertical;
    min-height: 80px;
}

.nx-input-help {
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-500);
    margin-top: var(--nx-sp-1);
}

.nx-form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--nx-sp-4);
}

.nx-form-actions {
    display: flex;
    gap: var(--nx-sp-3);
    flex-wrap: wrap;
}

.nx-form-actions .nx-btn {
    min-width: 120px;
}

.nx-input-error {
    font-size: var(--nx-text-xs);
    color: var(--nx-danger-500);
    margin-top: var(--nx-sp-1);
}


/* ---------------------------------------------------------
   13. FILTER BAR
   --------------------------------------------------------- */
.nx-filter-bar {
    background: var(--nx-bg-card);
    border-radius: var(--nx-radius-lg);
    border: 1px solid var(--nx-gray-100);
    box-shadow: var(--nx-shadow-sm);
    padding: var(--nx-sp-4) var(--nx-sp-5);
    display: flex;
    align-items: center;
    gap: var(--nx-sp-3);
    flex-wrap: wrap;
    margin-bottom: var(--nx-sp-6);
}

.nx-filter-toolbar {
    margin-bottom: var(--nx-sp-5);
}

.nx-toolbar__actions {
    display: flex;
    align-items: center;
    gap: var(--nx-sp-2);
    flex-wrap: wrap;
}

.nx-filter-bar .nx-input,
.nx-filter-bar .nx-select {
    width: auto;
    min-width: 140px;
}

.nx-filter-bar__search {
    flex: 1;
    min-width: 200px;
}


/* ---------------------------------------------------------
   14. TABS
   --------------------------------------------------------- */
.nx-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--nx-gray-200);
    margin-bottom: var(--nx-sp-6);
}

.nx-tabs__tab {
    padding: var(--nx-sp-3) var(--nx-sp-5);
    font-size: var(--nx-text-sm);
    font-weight: 500;
    color: var(--nx-gray-500);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--nx-transition-fast);
    font-family: var(--nx-font-sans);
}

.nx-tabs__tab:hover {
    color: var(--nx-gray-700);
}

.nx-tabs__tab.active {
    color: var(--nx-primary-600);
    border-bottom-color: var(--nx-primary-600);
    font-weight: 600;
}


/* ---------------------------------------------------------
   15. EMPTY STATE
   --------------------------------------------------------- */
.nx-empty {
    text-align: center;
    padding: var(--nx-sp-16) var(--nx-sp-6);
}

.nx-empty__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--nx-sp-4);
    color: var(--nx-gray-300);
}

.nx-empty__title {
    font-size: var(--nx-text-base);
    font-weight: 600;
    color: var(--nx-gray-900);
    margin-bottom: var(--nx-sp-2);
}

.nx-empty__desc {
    font-size: var(--nx-text-sm);
    color: var(--nx-gray-500);
    margin-bottom: var(--nx-sp-6);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.nx-empty--compact {
    padding: var(--nx-sp-10) var(--nx-sp-5);
}


/* ---------------------------------------------------------
   16. TOAST / ALERT
   --------------------------------------------------------- */
.nx-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--nx-sp-3);
    padding: var(--nx-sp-4) var(--nx-sp-5);
    border-radius: var(--nx-radius-md);
    margin-bottom: var(--nx-sp-4);
    font-size: var(--nx-text-sm);
}

.nx-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.nx-alert__content {
    flex: 1;
}

.nx-alert--success {
    background: var(--nx-success-50);
    color: var(--nx-success-700);
    border: 1px solid var(--nx-success-100);
}

.nx-alert--danger {
    background: var(--nx-danger-50);
    color: var(--nx-danger-600);
    border: 1px solid var(--nx-danger-100);
}

.nx-alert--warning {
    background: var(--nx-warning-50);
    color: var(--nx-warning-600);
    border: 1px solid var(--nx-warning-100);
}

.nx-alert--info {
    background: var(--nx-info-50);
    color: var(--nx-info-600);
    border: 1px solid var(--nx-info-100);
}


/* ---------------------------------------------------------
   17. PAGINATION
   --------------------------------------------------------- */
.nx-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--nx-sp-1);
    margin-top: var(--nx-sp-8);
}

.nx-pagination__btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--nx-radius-sm);
    border: 1px solid var(--nx-gray-200);
    background: var(--nx-bg-card);
    color: var(--nx-gray-600);
    font-size: var(--nx-text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--nx-transition-fast);
    font-family: var(--nx-font-sans);
}

.nx-pagination__btn:hover {
    background: var(--nx-gray-50);
    border-color: var(--nx-gray-300);
}

.nx-pagination__btn.active {
    background: var(--nx-primary-600);
    color: #fff;
    border-color: var(--nx-primary-600);
}

.nx-pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ---------------------------------------------------------
   18. OWNERSHIP DONUT (CSS-only for simple %)
   --------------------------------------------------------- */
.nx-ownership-ring {
    --pct: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--nx-primary-500) calc(var(--pct) * 1%),
            var(--nx-gray-100) calc(var(--pct) * 1%));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nx-ownership-ring::after {
    content: '';
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--nx-bg-card);
    position: absolute;
}

.nx-ownership-ring__label {
    position: relative;
    z-index: 1;
    font-size: var(--nx-text-sm);
    font-weight: 700;
    color: var(--nx-gray-900);
}


.nx-section-stack {
    display: flex;
    flex-direction: column;
    gap: var(--nx-sp-5);
}

.nx-summary-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--nx-sp-4);
}

.nx-summary-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nx-sp-4);
    padding-bottom: var(--nx-sp-3);
    border-bottom: 1px solid var(--nx-gray-100);
}

.nx-summary-list li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.nx-summary-list__label {
    color: var(--nx-gray-500);
}

.nx-summary-list__value {
    color: var(--nx-gray-900);
    font-weight: 600;
    text-align: right;
}

.nx-data-block {
    display: flex;
    flex-direction: column;
    gap: var(--nx-sp-1);
}

.nx-data-block__title {
    font-size: var(--nx-text-sm);
    font-weight: 600;
    color: var(--nx-gray-900);
}

.nx-data-block__meta {
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-500);
}

.nx-table__amount {
    font-weight: 700;
    color: var(--nx-gray-900);
    white-space: nowrap;
}

.nx-table__meta {
    font-size: var(--nx-text-xs);
    color: var(--nx-gray-500);
    margin-top: 2px;
}

.nx-action-form {
    display: flex;
    flex-direction: column;
    gap: var(--nx-sp-2);
    min-width: 220px;
}

.nx-chart-card {
    min-height: 360px;
}

.nx-chart-card__canvas {
    min-height: 300px;
}

.nx-inline-link {
    font-size: var(--nx-text-xs);
    font-weight: 600;
}

.nx-panel-stack {
    display: flex;
    flex-direction: column;
    gap: var(--nx-sp-6);
}

.nx-surface {
    background: var(--nx-bg-card);
    border: 1px solid var(--nx-gray-200);
    border-radius: var(--nx-radius-xl);
    box-shadow: var(--nx-shadow-sm);
}

.nx-surface--padded {
    padding: var(--nx-sp-6);
}

.nx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--nx-sp-4);
}

.nx-toolbar__group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--nx-sp-3);
}

.nx-toolbar__group--grow {
    flex: 1 1 420px;
}

.nx-toolbar__group--spread {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
}

.nx-inline-metric {
    display: inline-flex;
    align-items: center;
    gap: var(--nx-sp-2);
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: var(--nx-gray-50);
    border: 1px solid var(--nx-gray-200);
    font-size: var(--nx-text-sm);
    color: var(--nx-gray-600);
}

.nx-media {
    display: flex;
    align-items: center;
    gap: var(--nx-sp-4);
}

.nx-media--start {
    align-items: flex-start;
}

.nx-media--compact {
    gap: var(--nx-sp-2);
}

.nx-media__figure {
    width: 72px;
    height: 72px;
    border-radius: var(--nx-radius-lg);
    overflow: hidden;
    background: var(--nx-gray-100);
    flex-shrink: 0;
}

.nx-media__figure--lg {
    width: 88px;
    height: 88px;
}

.nx-media__figure--xs {
    width: 32px;
    height: 32px;
    border-radius: var(--nx-radius-sm);
}

.nx-media__figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nx-media__body {
    display: flex;
    flex-direction: column;
    gap: var(--nx-sp-1);
    min-width: 0;
}

.nx-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--nx-sp-2);
}

.nx-inline-form {
    display: inline;
}

.nx-heading-reset {
    margin: 0;
}

.nx-textarea--resizable {
    resize: vertical;
}

.nx-mb-1 {
    margin-bottom: var(--nx-sp-1);
}

.nx-mb-3 {
    margin-bottom: var(--nx-sp-3);
}

.nx-mt-1 {
    margin-top: var(--nx-sp-1);
}

.nx-mt-4px {
    margin-top: 4px;
}

.nx-pagination--spaced {
    margin-top: var(--nx-sp-4);
}

.nx-table-col-thumb {
    width: 50px;
}

.nx-table-col-actions {
    width: 120px;
}

.nx-progress-track-mini {
    height: 4px;
    background: var(--nx-gray-200);
    border-radius: 2px;
    margin-top: 4px;
}

.nx-progress-fill-success {
    height: 100%;
    background: var(--nx-success-500);
    border-radius: 2px;
}

.nx-field-compact {
    font-size: var(--nx-text-xs);
    padding: 4px 6px;
}

.nx-field-compact--installment {
    width: 110px;
}

.nx-field-compact--select {
    min-width: 100px;
}

.nx-text-capitalize {
    text-transform: capitalize;
}

.nx-progress-meter {
    width: 100%;
    height: 8px;
    appearance: none;
    border: none;
    border-radius: 999px;
    overflow: hidden;
    background: var(--nx-gray-200);
}

.nx-progress-meter::-webkit-progress-bar {
    background: var(--nx-gray-200);
    border-radius: 999px;
}

.nx-progress-meter::-webkit-progress-value {
    background: var(--nx-primary-500);
    border-radius: 999px;
}

.nx-progress-meter::-moz-progress-bar {
    background: var(--nx-primary-500);
    border-radius: 999px;
}

.nx-progress-meter--success::-webkit-progress-value {
    background: var(--nx-success-500);
}

.nx-progress-meter--success::-moz-progress-bar {
    background: var(--nx-success-500);
}

.nx-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--nx-sp-4);
}

.nx-form-grid--full {
    grid-column: 1 / -1;
}

.nx-empty-state {
    padding: var(--nx-sp-8);
    text-align: center;
    color: var(--nx-gray-500);
}

@media (max-width: 768px) {
    .nx-summary-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    .nx-action-form {
        min-width: 0;
    }

    .nx-form-actions .nx-btn {
        width: 100%;
    }

    .nx-table th,
    .nx-table td {
        padding: var(--nx-sp-3);
    }

    .nx-media {
        align-items: flex-start;
        flex-direction: column;
    }

    .nx-form-grid {
        grid-template-columns: 1fr;
    }

    /* Tables: horizontal scroll on mobile */
    .nx-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nx-table {
        min-width: 480px;
    }

    /* Stat cards: compact padding on mobile */
    .nx-stat-card {
        padding: var(--nx-sp-4);
        gap: var(--nx-sp-3);
    }

    .nx-stat-card__icon {
        width: 40px;
        height: 40px;
    }

    .nx-stat-card__value {
        font-size: 1.25rem;
    }

    /* Card header: allow wrapping on small screens */
    .nx-card__header {
        flex-wrap: wrap;
        gap: var(--nx-sp-2);
    }
}

/* ---------------------------------------------------------
   19. SCROLLBAR STYLING
   --------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--nx-gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nx-gray-400);
}

/* ─── 20. Swiper Gallery ───────────────────────── */
.nx-gallery {
    margin-bottom: var(--nx-sp-2);
}

.nx-gallery__main {
    border-radius: var(--nx-radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--nx-gray-100);
}

.nx-gallery__main .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nx-gallery__main .swiper-button-prev,
.nx-gallery__main .swiper-button-next {
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    width: 36px;
    height: 36px;
    border-radius: var(--nx-radius-full);
    transition: background 0.2s;
}

.nx-gallery__main .swiper-button-prev:hover,
.nx-gallery__main .swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.55);
}

.nx-gallery__main .swiper-button-prev::after,
.nx-gallery__main .swiper-button-next::after {
    font-size: 14px;
    font-weight: 700;
}

.nx-gallery__main .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.6;
}

.nx-gallery__main .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--nx-primary-500);
}

.nx-gallery__thumbs {
    margin-top: var(--nx-sp-2);
}

.nx-gallery__thumbs .swiper-slide {
    width: 80px;
    height: 60px;
    border-radius: var(--nx-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s;
}

.nx-gallery__thumbs .swiper-slide-thumb-active {
    border-color: var(--nx-primary-500);
    opacity: 1;
}

.nx-gallery__thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}