/* =========================================================
   KAMDHENU CRM
   COMPLETE RESPONSIVE CSS
   Premium Maroon + White + Gold
   ========================================================= */

/* =========================================================
   1. ROOT VARIABLES
   ========================================================= */

.kamdhenu-crm {
    --kd-maroon: #7a0000;
    --kd-maroon-dark: #520000;
    --kd-maroon-light: #970000;

    --kd-gold: #c89b3c;
    --kd-gold-light: #f5dfaa;

    --kd-white: #ffffff;
    --kd-bg: #f5f6f8;
    --kd-card: #ffffff;

    --kd-text: #202124;
    --kd-muted: #6b7280;
    --kd-border: #e4e6eb;

    --kd-success: #15803d;
    --kd-success-bg: #ecfdf3;

    --kd-warning: #b45309;
    --kd-warning-bg: #fff7ed;

    --kd-danger: #b42318;
    --kd-danger-bg: #fef3f2;

    --kd-info: #175cd3;
    --kd-info-bg: #eff8ff;

    --kd-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --kd-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
    --kd-shadow-lg: 0 15px 45px rgba(0, 0, 0, 0.12);

    --kd-radius-sm: 8px;
    --kd-radius: 12px;
    --kd-radius-lg: 16px;

    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    color: var(--kd-text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    line-height: 1.5;
}

.kamdhenu-crm *,
.kamdhenu-crm *::before,
.kamdhenu-crm *::after {
    box-sizing: border-box;
}

.kamdhenu-crm img {
    max-width: 100%;
    height: auto;
}

.kamdhenu-crm button,
.kamdhenu-crm input,
.kamdhenu-crm select,
.kamdhenu-crm textarea {
    font-family: inherit;
}

.kamdhenu-crm button,
.kamdhenu-crm a {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   2. MAIN WRAPPER
   ========================================================= */

.kamdhenu-crm {
    padding: 20px 24px 40px;
    background: var(--kd-bg);
    min-height: calc(100vh - 32px);
    overflow-x: hidden;
}

.kamdhenu-crm .wrap {
    max-width: 1400px;
    margin: 0 auto;
}

.kamdhenu-crm h1,
.kamdhenu-crm h2,
.kamdhenu-crm h3,
.kamdhenu-crm h4,
.kamdhenu-crm p {
    margin-top: 0;
}


/* =========================================================
   3. DASHBOARD HEADER
   ========================================================= */

.kamdhenu-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 22px;
    padding: 26px 30px;

    background:
        linear-gradient(
            135deg,
            var(--kd-maroon-dark) 0%,
            var(--kd-maroon) 55%,
            #920000 100%
        );

    border-radius: var(--kd-radius-lg);
    box-shadow: var(--kd-shadow);

    overflow: hidden;
}

.kamdhenu-header::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -90px;
    top: -140px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.kamdhenu-header::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: 80px;
    bottom: -130px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.kamdhenu-header-content {
    position: relative;
    z-index: 2;
    min-width: 0;
}

.kamdhenu-header h1 {
    margin: 0 0 5px;
    color: #ffffff;
    font-size: 29px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.4px;
}

.kamdhenu-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

.kamdhenu-header-actions {
    position: relative;
    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;

    flex-shrink: 0;
}

.kamdhenu-header-actions a,
.kamdhenu-header-actions button {
    min-height: 42px;
}


/* =========================================================
   4. BUTTONS
   ========================================================= */

.kamdhenu-crm button,
.kamdhenu-crm .button {
    cursor: pointer;
    border: 0;
}

.kamdhenu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 10px 17px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;

    text-decoration: none;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.kamdhenu-btn:hover {
    transform: translateY(-1px);
}

.kamdhenu-btn:active {
    transform: translateY(0);
}

.kamdhenu-btn-primary {
    color: #ffffff !important;
    background: var(--kd-maroon);
    box-shadow: 0 4px 12px rgba(122, 0, 0, 0.18);
}

.kamdhenu-btn-primary:hover {
    background: var(--kd-maroon-dark);
}

.kamdhenu-btn-secondary {
    color: var(--kd-maroon) !important;
    background: #ffffff;
    border: 1px solid #e7d8d8 !important;
}

.kamdhenu-btn-secondary:hover {
    background: #fff8f8;
}

.kamdhenu-btn-gold {
    color: #ffffff !important;
    background: var(--kd-gold);
}

.kamdhenu-btn-danger {
    color: #ffffff !important;
    background: var(--kd-danger);
}

.kamdhenu-btn-success {
    color: #ffffff !important;
    background: var(--kd-success);
}

.kamdhenu-btn-full {
    width: 100%;
}


/* =========================================================
   5. KPI CARDS
   ========================================================= */

.kamdhenu-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.kamdhenu-kpi {
    position: relative;

    display: flex;
    align-items: center;
    gap: 14px;

    min-width: 0;
    padding: 19px;

    background: var(--kd-card);
    border: 1px solid var(--kd-border);
    border-radius: var(--kd-radius);

    box-shadow: var(--kd-shadow-sm);

    overflow: hidden;
}

.kamdhenu-kpi::after {
    content: "";
    position: absolute;
    width: 70px;
    height: 70px;
    right: -25px;
    bottom: -30px;
    border-radius: 50%;
    background: rgba(122, 0, 0, 0.035);
}

.kamdhenu-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    color: var(--kd-maroon);
    background: #fff5f5;

    border-radius: 11px;

    font-size: 20px;
    font-weight: 800;
}

.kamdhenu-kpi-content {
    min-width: 0;
}

.kamdhenu-kpi-label {
    margin-bottom: 2px;
    color: var(--kd-muted);
    font-size: 12px;
    font-weight: 600;
}

.kamdhenu-kpi-value {
    color: var(--kd-text);
    font-size: 23px;
    font-weight: 800;
    line-height: 1.2;
}


/* =========================================================
   6. MAIN WORKSPACE
   ========================================================= */

.kamdhenu-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 22px;
}

.kamdhenu-card {
    min-width: 0;
    background: var(--kd-card);
    border: 1px solid var(--kd-border);
    border-radius: var(--kd-radius-lg);
    box-shadow: var(--kd-shadow-sm);
}

.kamdhenu-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 20px 22px;

    border-bottom: 1px solid var(--kd-border);
}

.kamdhenu-card-title {
    min-width: 0;
}

.kamdhenu-card-title h2,
.kamdhenu-card-title h3 {
    margin: 0;
    color: var(--kd-text);
    font-size: 18px;
    font-weight: 800;
}

.kamdhenu-card-title p {
    margin: 4px 0 0;
    color: var(--kd-muted);
    font-size: 12px;
}

.kamdhenu-card-body {
    padding: 22px;
}


/* =========================================================
   7. CUSTOMER FORM
   ========================================================= */

#kamdhenu-crm-form {
    width: 100%;
}

.kamdhenu-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.kamdhenu-field {
    min-width: 0;
}

.kamdhenu-field-full,
.kamdhenu-full-width {
    grid-column: 1 / -1;
}

.kamdhenu-field label {
    display: block;
    margin-bottom: 7px;

    color: #36383d;
    font-size: 12px;
    font-weight: 700;
}

.kamdhenu-field label .required {
    color: var(--kd-danger);
}

.kamdhenu-field input,
.kamdhenu-field select,
.kamdhenu-field textarea {
    width: 100%;
    max-width: 100%;

    color: var(--kd-text);
    background: #ffffff;

    border: 1px solid #d9dce2;
    border-radius: 9px;

    outline: none;

    font-size: 14px;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.kamdhenu-field input,
.kamdhenu-field select {
    min-height: 46px;
    padding: 10px 13px;
}

.kamdhenu-field textarea {
    min-height: 115px;
    padding: 12px 13px;
    resize: vertical;
    line-height: 1.55;
}

.kamdhenu-field input:hover,
.kamdhenu-field select:hover,
.kamdhenu-field textarea:hover {
    border-color: #b9bdc5;
}

.kamdhenu-field input:focus,
.kamdhenu-field select:focus,
.kamdhenu-field textarea:focus {
    border-color: var(--kd-maroon);
    box-shadow: 0 0 0 3px rgba(122, 0, 0, 0.09);
}

.kamdhenu-field input::placeholder,
.kamdhenu-field textarea::placeholder {
    color: #a0a5ad;
}


/* =========================================================
   8. CUSTOMER LOOKUP
   ========================================================= */

#kamdhenu-customer-lookup {
    position: relative;
}

#kamdhenu-customer-lookup input {
    padding-right: 45px;
}

.kamdhenu-lookup-status {
    margin-top: 7px;
    font-size: 12px;
}

.kamdhenu-customer-found {
    color: var(--kd-success);
}

.kamdhenu-customer-new {
    color: var(--kd-info);
}

.kamdhenu-customer-error {
    color: var(--kd-danger);
}


/* =========================================================
   9. CONVERSATION PANEL
   ========================================================= */

.kamdhenu-conversation-section {
    margin-top: 21px;
    padding: 17px;

    background:
        linear-gradient(
            180deg,
            #fffafa 0%,
            #ffffff 100%
        );

    border: 1px solid #eadada;
    border-left: 4px solid var(--kd-maroon);
    border-radius: 12px;
}

.kamdhenu-conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 10px;
}

.kamdhenu-conversation-title {
    color: var(--kd-maroon);
    font-size: 14px;
    font-weight: 800;
}

.kamdhenu-conversation-help {
    color: var(--kd-muted);
    font-size: 11px;
}

#kamdhenu-conversation {
    min-height: 145px;
    background: #ffffff;
}


/* =========================================================
   10. FORM ACTIONS
   ========================================================= */

.kamdhenu-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 20px;
    padding-top: 18px;

    border-top: 1px solid var(--kd-border);
}

.kamdhenu-form-actions button {
    min-width: 130px;
}

#kamdhenu-form-message {
    margin-top: 12px;
    padding: 10px 13px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 600;
}

#kamdhenu-form-message:empty {
    display: none;
}


/* =========================================================
   11. SIDE SUMMARY / CUSTOMER INFORMATION
   ========================================================= */

.kamdhenu-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.kamdhenu-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding: 13px 0;

    border-bottom: 1px solid #eeeeee;
}

.kamdhenu-summary-row:last-child {
    border-bottom: 0;
}

.kamdhenu-summary-label {
    color: var(--kd-muted);
    font-size: 12px;
    font-weight: 600;
}

.kamdhenu-summary-value {
    min-width: 0;
    color: var(--kd-text);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}


/* =========================================================
   12. STATUS BADGES
   ========================================================= */

.kamdhenu-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 28px;
    padding: 5px 10px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.kamdhenu-status-new-lead {
    color: #175cd3;
    background: #eff8ff;
}

.kamdhenu-status-contacted {
    color: #6941c6;
    background: #f4f3ff;
}

.kamdhenu-status-follow-up {
    color: #b54708;
    background: #fffaeb;
}

.kamdhenu-status-qualified {
    color: #027a48;
    background: #ecfdf3;
}

.kamdhenu-status-proposal-sent {
    color: #175cd3;
    background: #eff8ff;
}

.kamdhenu-status-negotiation {
    color: #b54708;
    background: #fff7ed;
}

.kamdhenu-status-won {
    color: #067647;
    background: #ecfdf3;
}

.kamdhenu-status-lost {
    color: #b42318;
    background: #fef3f2;
}


/* =========================================================
   13. CUSTOMER LIST
   ========================================================= */

.kamdhenu-customer-list {
    margin-top: 22px;
}

.kamdhenu-customer-list .kamdhenu-card-body {
    padding: 0;
}

.kamdhenu-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
}

.kamdhenu-table-wrapper::-webkit-scrollbar {
    height: 7px;
}

.kamdhenu-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.kamdhenu-table-wrapper::-webkit-scrollbar-thumb {
    background: #c6c6c6;
    border-radius: 20px;
}

.kamdhenu-crm table {
    width: 100%;
    min-width: 850px;

    border-collapse: separate;
    border-spacing: 0;

    background: #ffffff;
}

.kamdhenu-crm table th {
    padding: 13px 15px;

    color: #5d6169;
    background: #f8f9fb;

    border-bottom: 1px solid var(--kd-border);

    font-size: 11px;
    font-weight: 800;
    text-align: left;

    white-space: nowrap;
}

.kamdhenu-crm table td {
    padding: 13px 15px;

    color: #34373d;

    border-bottom: 1px solid #eeeeee;

    font-size: 13px;
    vertical-align: middle;
}

.kamdhenu-crm table tbody tr {
    transition: background 0.15s ease;
}

.kamdhenu-crm table tbody tr:hover {
    background: #fffafa;
}

.kamdhenu-crm table tbody tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   14. TABLE ACTIONS
   ========================================================= */

.kamdhenu-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
}

.kamdhenu-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    padding: 0;

    color: var(--kd-maroon);
    background: #fff6f6;

    border: 1px solid #f0dddd !important;
    border-radius: 8px;

    text-decoration: none;

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.kamdhenu-action-btn:hover {
    color: #ffffff;
    background: var(--kd-maroon);
    transform: translateY(-1px);
}

.kamdhenu-action-btn.delete,
.kamdhenu-delete {
    color: var(--kd-danger);
    background: var(--kd-danger-bg);
    border-color: #f3d4d1 !important;
}

.kamdhenu-action-btn.delete:hover,
.kamdhenu-delete:hover {
    color: #ffffff;
    background: var(--kd-danger);
}


/* =========================================================
   15. TABLE STATUS SELECT
   ========================================================= */

.kamdhenu-status-select {
    min-width: 135px;
    min-height: 38px;

    padding: 7px 10px;

    color: var(--kd-text);
    background: #ffffff;

    border: 1px solid #d9dce2;
    border-radius: 8px;

    font-size: 12px;
    font-weight: 600;

    outline: none;
}

.kamdhenu-status-select:focus {
    border-color: var(--kd-maroon);
    box-shadow: 0 0 0 3px rgba(122, 0, 0, 0.08);
}


/* =========================================================
   16. PAGINATION / EMPTY STATE
   ========================================================= */

.kamdhenu-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;

    padding: 18px;
}

.kamdhenu-empty {
    padding: 45px 20px;

    color: var(--kd-muted);

    text-align: center;
}

.kamdhenu-empty strong {
    display: block;
    margin-bottom: 5px;

    color: var(--kd-text);
    font-size: 16px;
}


/* =========================================================
   17. HISTORY MODAL
   ========================================================= */

#kamdhenu-history-modal {
    position: fixed;
    z-index: 999999;

    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 25px;

    background: rgba(15, 15, 15, 0.62);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#kamdhenu-history-modal.is-open,
#kamdhenu-history-modal.active {
    display: flex;
}

.kamdhenu-modal {
    width: min(760px, 100%);
    max-height: min(720px, 90vh);

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border-radius: 17px;
    box-shadow: var(--kd-shadow-lg);

    overflow: hidden;
}

.kamdhenu-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 18px 21px;

    color: #ffffff;
    background: var(--kd-maroon);
}

.kamdhenu-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
}

.kamdhenu-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);

    border: 0;
    border-radius: 8px;

    font-size: 20px;
}

.kamdhenu-modal-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.kamdhenu-modal-body {
    min-height: 0;
    padding: 20px;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.kamdhenu-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kamdhenu-history-item {
    padding: 15px;

    background: #fafafa;

    border: 1px solid #e6e7ea;
    border-left: 4px solid var(--kd-maroon);
    border-radius: 10px;
}

.kamdhenu-history-date {
    margin-bottom: 6px;

    color: var(--kd-muted);
    font-size: 11px;
    font-weight: 700;
}

.kamdhenu-history-note {
    color: var(--kd-text);
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* =========================================================
   18. ALERTS / NOTICES
   ========================================================= */

.kamdhenu-alert {
    margin-bottom: 18px;
    padding: 13px 15px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 600;
}

.kamdhenu-alert-success {
    color: #067647;
    background: var(--kd-success-bg);
    border: 1px solid #abefc6;
}

.kamdhenu-alert-warning {
    color: #b54708;
    background: var(--kd-warning-bg);
    border: 1px solid #fedf89;
}

.kamdhenu-alert-danger {
    color: var(--kd-danger);
    background: var(--kd-danger-bg);
    border: 1px solid #fecdca;
}

.kamdhenu-alert-info {
    color: #175cd3;
    background: var(--kd-info-bg);
    border: 1px solid #b2ddff;
}


/* =========================================================
   19. LOADING
   ========================================================= */

.kamdhenu-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.65;
}

.kamdhenu-loading::after {
    content: "";

    position: absolute;
    z-index: 10;

    width: 20px;
    height: 20px;

    top: 50%;
    left: 50%;

    margin: -10px 0 0 -10px;

    border: 3px solid rgba(122, 0, 0, 0.18);
    border-top-color: var(--kd-maroon);

    border-radius: 50%;

    animation: kamdhenu-spin 0.75s linear infinite;
}

@keyframes kamdhenu-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   20. WHATSAPP
   ========================================================= */

.kamdhenu-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 36px;
    padding: 7px 11px;

    color: #ffffff !important;
    background: #25d366;

    border-radius: 8px;

    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;

    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

.kamdhenu-whatsapp:hover {
    color: #ffffff !important;
    background: #1db954;
    transform: translateY(-1px);
}


/* =========================================================
   21. TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .kamdhenu-crm {
        padding: 18px;
    }

    .kamdhenu-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .kamdhenu-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   22. TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 900px) {

    .kamdhenu-header {
        padding: 22px;
    }

    .kamdhenu-header h1 {
        font-size: 25px;
    }

    .kamdhenu-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kamdhenu-card-body {
        padding: 19px;
    }
}


/* =========================================================
   23. MOBILE — 767px
   ========================================================= */

@media (max-width: 767px) {

    .kamdhenu-crm {
        width: 100%;
        max-width: 100%;
        padding: 12px;
    }

    /* Header */

    .kamdhenu-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;

        margin-bottom: 14px;
        padding: 19px;

        border-radius: 14px;
    }

    .kamdhenu-header h1 {
        font-size: 22px;
        line-height: 1.2;
    }

    .kamdhenu-header p {
        margin-top: 5px;
        font-size: 12px;
        line-height: 1.45;
    }

    .kamdhenu-header-actions {
        width: 100%;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .kamdhenu-header-actions a,
    .kamdhenu-header-actions button {
        width: 100%;
        min-height: 44px;
    }


    /* KPI */

    .kamdhenu-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }

    .kamdhenu-kpi {
        gap: 10px;
        min-height: 78px;
        padding: 13px;
        border-radius: 12px;
    }

    .kamdhenu-kpi-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        font-size: 16px;
        border-radius: 9px;
    }

    .kamdhenu-kpi-label {
        font-size: 10px;
    }

    .kamdhenu-kpi-value {
        font-size: 18px;
    }


    /* Workspace */

    .kamdhenu-workspace {
        display: block;
        margin-bottom: 14px;
    }

    .kamdhenu-workspace > * {
        width: 100%;
        margin-bottom: 14px;
    }

    .kamdhenu-card {
        border-radius: 13px;
    }

    .kamdhenu-card-header {
        padding: 15px;
    }

    .kamdhenu-card-title h2,
    .kamdhenu-card-title h3 {
        font-size: 16px;
    }

    .kamdhenu-card-body {
        padding: 15px;
    }


    /* Form */

    .kamdhenu-form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .kamdhenu-field,
    .kamdhenu-field-full,
    .kamdhenu-full-width {
        grid-column: auto;
        width: 100%;
        min-width: 0;
    }

    .kamdhenu-field label {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .kamdhenu-field input,
    .kamdhenu-field select {
        min-height: 47px;
        font-size: 14px;
    }

    .kamdhenu-field textarea {
        min-height: 125px;
        font-size: 14px;
    }


    /* Conversation */

    .kamdhenu-conversation-section {
        margin-top: 17px;
        padding: 14px;
        border-left-width: 3px;
    }

    .kamdhenu-conversation-header {
        display: block;
        margin-bottom: 9px;
    }

    .kamdhenu-conversation-title {
        display: block;
        margin-bottom: 3px;
    }

    .kamdhenu-conversation-help {
        display: block;
        line-height: 1.45;
    }


    /* Actions */

    .kamdhenu-form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 9px;
        margin-top: 16px;
        padding-top: 15px;
    }

    .kamdhenu-form-actions button {
        width: 100%;
        min-width: 0;
        min-height: 47px;
    }


    /* Summary */

    .kamdhenu-summary-row {
        gap: 12px;
        padding: 11px 0;
    }

    .kamdhenu-summary-label {
        flex: 0 0 38%;
    }

    .kamdhenu-summary-value {
        flex: 1 1 auto;
        font-size: 12px;
    }


    /* Customer table */

    .kamdhenu-customer-list {
        margin-top: 14px;
    }

    .kamdhenu-table-wrapper {
        margin: 0;
        border-radius: 0 0 13px 13px;
    }

    .kamdhenu-crm table {
        min-width: 760px;
    }

    .kamdhenu-crm table th {
        padding: 11px 12px;
        font-size: 10px;
    }

    .kamdhenu-crm table td {
        padding: 11px 12px;
        font-size: 12px;
    }

    .kamdhenu-action-btn {
        width: 40px;
        height: 40px;
    }

    .kamdhenu-status-select {
        min-height: 40px;
    }


    /* Modal */

    #kamdhenu-history-modal {
        align-items: flex-end;
        padding: 0;
    }

    .kamdhenu-modal {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;

        border-radius: 18px 18px 0 0;
    }

    .kamdhenu-modal-header {
        padding: 15px;
    }

    .kamdhenu-modal-body {
        padding: 15px;
    }

    .kamdhenu-modal-close {
        width: 40px;
        height: 40px;
    }


    /* Buttons */

    .kamdhenu-btn {
        min-height: 44px;
        padding: 10px 13px;
    }
}


/* =========================================================
   24. SMALL MOBILE — 480px
   ========================================================= */

@media (max-width: 480px) {

    .kamdhenu-crm {
        padding: 9px;
    }

    .kamdhenu-header {
        padding: 16px;
        border-radius: 12px;
    }

    .kamdhenu-header h1 {
        font-size: 20px;
    }

    .kamdhenu-header-actions {
        grid-template-columns: 1fr;
    }

    .kamdhenu-header-actions a,
    .kamdhenu-header-actions button {
        min-height: 46px;
    }


    /* KPI */

    .kamdhenu-kpis {
        gap: 8px;
    }

    .kamdhenu-kpi {
        min-height: 73px;
        padding: 11px;
    }

    .kamdhenu-kpi-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 14px;
    }

    .kamdhenu-kpi-label {
        font-size: 9px;
    }

    .kamdhenu-kpi-value {
        font-size: 16px;
    }


    /* Cards */

    .kamdhenu-card {
        border-radius: 11px;
    }

    .kamdhenu-card-header {
        padding: 13px;
    }

    .kamdhenu-card-body {
        padding: 13px;
    }


    /* Form */

    .kamdhenu-form-grid {
        gap: 12px;
    }

    .kamdhenu-field input,
    .kamdhenu-field select {
        min-height: 48px;
    }

    .kamdhenu-field textarea {
        min-height: 130px;
    }


    /* Form buttons */

    .kamdhenu-form-actions {
        grid-template-columns: 1fr;
    }

    .kamdhenu-form-actions button {
        min-height: 48px;
    }


    /* Summary */

    .kamdhenu-summary-row {
        display: block;
    }

    .kamdhenu-summary-label {
        display: block;
        margin-bottom: 3px;
    }

    .kamdhenu-summary-value {
        display: block;
        text-align: left;
    }


    /* Table */

    .kamdhenu-crm table {
        min-width: 720px;
    }

    .kamdhenu-crm table th,
    .kamdhenu-crm table td {
        padding-left: 10px;
        padding-right: 10px;
    }

    .kamdhenu-action-btn {
        width: 42px;
        height: 42px;
    }


    /* Modal */

    .kamdhenu-modal {
        max-height: 92vh;
    }

    .kamdhenu-history-item {
        padding: 13px;
    }
}


/* =========================================================
   25. VERY SMALL MOBILE — 360px
   ========================================================= */

@media (max-width: 360px) {

    .kamdhenu-crm {
        padding: 7px;
    }

    .kamdhenu-header {
        padding: 14px;
    }

    .kamdhenu-header h1 {
        font-size: 18px;
    }

    .kamdhenu-header p {
        font-size: 11px;
    }


    /* One KPI per row */

    .kamdhenu-kpis {
        grid-template-columns: 1fr;
    }

    .kamdhenu-kpi {
        min-height: 65px;
    }


    /* Card */

    .kamdhenu-card-header {
        padding: 12px;
    }

    .kamdhenu-card-body {
        padding: 11px;
    }


    /* Inputs */

    .kamdhenu-field input,
    .kamdhenu-field select {
        min-height: 47px;
        padding-left: 11px;
        padding-right: 11px;
    }

    .kamdhenu-field textarea {
        min-height: 125px;
    }


    /* Header buttons */

    .kamdhenu-header-actions {
        grid-template-columns: 1fr;
    }


    /* Conversation */

    .kamdhenu-conversation-section {
        padding: 12px;
    }


    /* Table */

    .kamdhenu-crm table {
        min-width: 680px;
    }


    /* Modal */

    .kamdhenu-modal-header h3 {
        font-size: 15px;
    }
}


/* =========================================================
   26. TOUCH DEVICES
   ========================================================= */

@media (hover: none) and (pointer: coarse) {

    .kamdhenu-btn,
    .kamdhenu-action-btn,
    .kamdhenu-modal-close,
    .kamdhenu-whatsapp {
        touch-action: manipulation;
    }

    .kamdhenu-action-btn {
        min-width: 42px;
        min-height: 42px;
    }
}


/* =========================================================
   27. ACCESSIBILITY
   ========================================================= */

.kamdhenu-crm button:focus-visible,
.kamdhenu-crm a:focus-visible,
.kamdhenu-crm input:focus-visible,
.kamdhenu-crm select:focus-visible,
.kamdhenu-crm textarea:focus-visible {
    outline: 3px solid rgba(122, 0, 0, 0.18);
    outline-offset: 2px;
}


/* =========================================================
   28. WORDPRESS ADMIN COMPATIBILITY
   ========================================================= */

#wpbody-content .kamdhenu-crm {
    max-width: 100%;
}

#wpbody-content .kamdhenu-crm .button {
    box-shadow: none;
}

#wpbody-content .kamdhenu-crm input,
#wpbody-content .kamdhenu-crm select,
#wpbody-content .kamdhenu-crm textarea {
    box-sizing: border-box;
}


/* =========================================================
   29. PREVENT LONG CONTENT FROM BREAKING MOBILE
   ========================================================= */

.kamdhenu-crm h1,
.kamdhenu-crm h2,
.kamdhenu-crm h3,
.kamdhenu-crm p,
.kamdhenu-crm td,
.kamdhenu-crm th,
.kamdhenu-crm label,
.kamdhenu-crm span,
.kamdhenu-crm a {
    overflow-wrap: anywhere;
}

.kamdhenu-crm input,
.kamdhenu-crm select,
.kamdhenu-crm textarea {
    min-width: 0;
}


/* =========================================================
   30. PRINT
   ========================================================= */

@media print {

    .kamdhenu-crm {
        padding: 0;
        background: #ffffff;
    }

    .kamdhenu-header {
        color: #000000;
        background: #ffffff;
        border: 1px solid #cccccc;
        box-shadow: none;
    }

    .kamdhenu-header h1,
    .kamdhenu-header p {
        color: #000000;
    }

    .kamdhenu-header-actions,
    .kamdhenu-form-actions,
    .kamdhenu-actions,
    .kamdhenu-modal {
        display: none !important;
    }

    .kamdhenu-card,
    .kamdhenu-kpi {
        box-shadow: none;
        border: 1px solid #cccccc;
    }

    .kamdhenu-table-wrapper {
        overflow: visible;
    }

    .kamdhenu-crm table {
        min-width: 0;
    }
}