.btn-success{

    background-color: #16a34a;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: none;

}
.btn-danger{

    background-color: #dc2626;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;

}
/* ================= Clients Section ================= */
.clients-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
}
.clients-section1 {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
}
.clients-section2 {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
}


/* Title */
.clients-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Divider */
.clients-divider {
    height: 1px;
    background: #d1d5db;
    margin-bottom: 16px;
}

/* ================= Top Row ================= */
.clients-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

/* Search wrapper (input + button attached) */
.search-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

/* Search input */
.search-box {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 14px;
}

/* Search button with Google icon */
.btn-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1f2937;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 500;
    border-left: 1px solid #374151;
}

.btn-search span {
    font-size: 20px;
}

.btn-search:hover {
    background: #111827;
}

/* Add Client button */
.btn-add {
    background: #1f2937;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.btn-add:hover {
    background: #111827;
}

/* ================= Filters ================= */
.clients-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
}

.filter-btn.active {
    background: #1f2937;
    color: #ffffff;
    border-color: #1f2937;
}

/* ================= Mobile (FIXED PADDING) ================= */
@media (max-width: 768px) {

    /* 🔥 Reduce side padding to avoid double spacing */
    .clients-section {
        padding: 16px 12px;   /* was 20px */
        border-radius: 8px;
        
    }

    .clients-top {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-search,
    .btn-add {
        width: 100%;
        justify-content: center;
    }

    .clients-filters {
        justify-content: space-between;
    }
}

/* ==================== table in client lit page ====================*/

/* ================= Clients Table ================= */
.clients-table-section {
    margin-top: 20px;
    background: #ffffff;
    border-radius: 10px;
}

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

.clients-table {
    width: 100%;
    min-width: 900px; /* forces horizontal scroll on mobile */
    border-collapse: collapse;
    font-size: 14px;
}

.clients-table thead {
    background: #f3f4f6;
}

.clients-table th,
.clients-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
/* Small columns → no wrap */
.clients-table th:nth-child(1),
.clients-table th:nth-child(3),
.clients-table th:nth-child(5),
.clients-table th:nth-child(6),
.clients-table td:nth-child(1),
.clients-table td:nth-child(3),
.clients-table td:nth-child(5),
.clients-table td:nth-child(6){
    white-space: nowrap;
}
.clients-table td:nth-child(2),
.clients-table td:nth-child(4){
    max-width: 220px;
    white-space: normal;
    overflow-wrap: break-word;
}
/* Long text → wrap */
.clients-table th:nth-child(2),
.clients-table th:nth-child(4),
.clients-table td:nth-child(2),
.clients-table td:nth-child(4){
    white-space: normal;
    word-break: break-word;
}

.clients-table tbody tr:hover {
    background: #f9fafb;
}

/* Status badge */
.status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.status.active {
    background: #dcfce7;
    color: #166534;
}

.status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* View button */
.btn-view {
    background: #1f2937;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-view:hover {
    background: #111827;
}

/* Mobile smooth scroll */
@media (max-width: 768px) {
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}


/*================= paginagion css ===============*/

/* ================= Pagination ================= */
.pagination-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
}

.page-btn:hover {
    background: #f3f4f6;
}

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

.page-number {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
}

.page-number.active {
    background: #1f2937;
    color: #ffffff;
    border-color: #1f2937;
}

/* Mobile */
@media (max-width: 768px) {
    .pagination-section {
        gap: 6px;
    }
}

/*=========== add client form ==============*/

/* ================= Modal ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 12px;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
}

/* ================= Form ================= */
.client-form .form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.client-form label {
    font-size: 14px;
    margin-bottom: 4px;
}

.client-form input,
.client-form select,
.client-form textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

.client-form textarea {
    resize: vertical;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn-save {
    background: #1f2937;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-cancel {
    background: #e5e7eb;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
}

/* ================= Mobile ================= */
@media (max-width: 768px) {
    .modal-box {
        margin: 0 10px;
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

/*========== error message for editng url ===========*/

.page-notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 12px;      /* ✅ TOP SPACE */
    margin-bottom: 14px;  /* keeps space from table */
    font-size: 14px;
}


/*=========== loading animation ===============*/

/* ===== Save Button Loading ===== */
.btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.btn-save.loading {
    pointer-events: none;
    opacity: 0.85;
}

/* Spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-save.loading .btn-spinner {
    display: inline-block;
}

.btn-save.loading .btn-text {
    opacity: 0.9;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Duplicate Modal Overlay ===== */
#duplicateModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 3000;              /* MUST be higher than form */
    display: none;
    align-items: center;
    justify-content: center;
}

/* Show state */
#duplicateModal.show {
    display: flex;
}

/* Modal box */
#duplicateModal .modal-box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    max-width: 420px;
    width: 90%;
    z-index: 3001;
} 


/* ================= DUPLICATE MODAL ================= */

#duplicateModal {
    z-index: 3000; /* above add-client modal */
}

/* Modal box */
.duplicate-box {
    max-width: 420px;
    width: 90%;
    border-radius: 12px;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: scaleIn 0.2s ease-out;
}

/* Title */
.duplicate-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #b45309; /* warning color */
    margin-bottom: 12px;
}

/* Warning icon */
.duplicate-icon {
    font-size: 26px;
    color: #f59e0b;
}

/* Info text */
.duplicate-info {
    font-size: 14px;
    color: #374151;
    background: #fff7ed;
    border: 1px solid #fde68a;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Buttons container */
.duplicate-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons base */
.duplicate-actions button {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    width: 100%;
}

/* View client */
.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Use anyway (warning) */
.btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background: #d97706;
}

/* Cancel */
.btn-cancel {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-cancel:hover {
    background: #f3f4f6;
}

/* Animation */
@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}