/* ═══════════════════════════════════════════════════════
   NELLCA CRM – Pipeline Kanban
   ═══════════════════════════════════════════════════════ */

/* ── Wrap & toolbar ── */
.ncrm-wrap {
    max-width: 100%;
    padding-bottom: 60px;
}
.ncrm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.ncrm-toolbar__title {
    font-size: 22px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    color: #111 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ncrm-toolbar__title .fa { color: #555; }

/* ── Board ── */
.ncrm-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: flex-start;
    min-height: 400px;
}
.ncrm-board::-webkit-scrollbar { height: 6px; }
.ncrm-board::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* ── Kolumn ── */
.ncrm-column {
    flex: 0 0 240px;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: calc(100vh - 200px);
}
.ncrm-column__header {
    padding: 12px 14px 10px;
    border-bottom: 3px solid var(--stage-color, #888);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px 10px 0 0;
}
.ncrm-column__title {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ncrm-column__count {
    background: #e8e8e8;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
}
.ncrm-column__value {
    font-size: 11px;
    color: #888;
    padding: 4px 14px 6px;
    font-weight: 600;
}
.ncrm-cards {
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}
.ncrm-cards.ncrm-drag-over {
    background: #f0f4ff;
    border-radius: 0 0 8px 8px;
}

/* ── Kort ── */
.ncrm-card {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 12px;
    cursor: grab;
    transition: box-shadow .15s, transform .15s;
    font-size: 13px;
}
.ncrm-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.ncrm-card.ncrm-dragging {
    opacity: .5;
    transform: rotate(2deg);
    cursor: grabbing;
}
.ncrm-card__top {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 7px;
}
.ncrm-card__type { color: #aaa; flex-shrink: 0; margin-top: 1px; }
.ncrm-card__title {
    font-weight: 600;
    color: #111;
    flex: 1;
    line-height: 1.3;
    font-size: 13px;
}
.ncrm-card__edit {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    padding: 0;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}
.ncrm-card__edit:hover { color: #555; }
.ncrm-card__company,
.ncrm-card__contact {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}
.ncrm-card__company .fa,
.ncrm-card__contact .fa { color: #ccc; width: 12px; }
.ncrm-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.ncrm-card__value { font-weight: 700; color: #111; font-size: 13px; }
.ncrm-card__date  { font-size: 11px; color: #aaa; }
.ncrm-card__agent { font-size: 11px; color: #bbb; margin-top: 5px; display: flex; align-items: center; gap: 4px; }

/* ── Knappar ── */
.ncrm-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s;
    text-decoration: none;
    white-space: nowrap;
}
.ncrm-btn--primary   { background: #111; color: #fff !important; }
.ncrm-btn--primary:hover { background: #333; }
.ncrm-btn--secondary { background: #f0f0f0; color: #333 !important; border: 1px solid #ddd; }
.ncrm-btn--secondary:hover { background: #e4e4e4; }
.ncrm-btn--danger    { background: #ffebee; color: #c62828 !important; border: 1px solid #ef9a9a; }
.ncrm-btn--danger:hover { background: #ffcdd2; }

/* ── Modal ── */
.ncrm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ncrm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}
.ncrm-modal__box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
}
.ncrm-modal__box--sm { max-width: 380px; }
.ncrm-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.ncrm-modal__title {
    font-size: 17px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    color: #111 !important;
}
.ncrm-modal__close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #aaa;
    padding: 0;
    line-height: 1;
}
.ncrm-modal__close:hover { color: #333; }
.ncrm-modal__body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
}
.ncrm-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Formulärfält i modal ── */
.ncrm-field { margin-bottom: 16px; }
.ncrm-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #888;
    margin-bottom: 5px;
}
.ncrm-field input[type="text"],
.ncrm-field input[type="email"],
.ncrm-field select,
.ncrm-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #111;
    background: #fff;
    box-sizing: border-box;
}
.ncrm-field input:focus,
.ncrm-field select:focus,
.ncrm-field textarea:focus {
    border-color: #2e7d32;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46,125,50,.1);
}
.ncrm-req { color: #c62828; }
.ncrm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Kundsökning ── */
.ncrm-customer-search { position: relative; }
.ncrm-customer-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.ncrm-customer-results.open { display: block; }
.ncrm-customer-result {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.ncrm-customer-result:hover { background: #f0f4ff; }
.ncrm-customer-result__name { font-weight: 600; color: #111; }
.ncrm-customer-result__sub  { font-size: 11px; color: #888; }
.ncrm-customer-selected {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 5px;
    padding: 7px 10px;
    font-size: 13px;
    color: #3730a3;
}
.ncrm-customer-selected button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 0;
    margin-left: auto;
}

/* ── Responsiv ── */
@media (max-width: 700px) {
    .ncrm-column { flex: 0 0 200px; }
    .ncrm-field-row { grid-template-columns: 1fr; }
    .ncrm-modal__box { width: 95%; margin: 10px; }
}
