/* ---------- Order Create & Workflow Styles ---------- */
.order-create-shell,
.form-shell {
    max-width: 1100px;
    margin: 0 auto;
}

.crm-page-card {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
}

.customer-context-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.customer-context-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(13, 110, 253, .1);
    color: #0d6efd;
    font-size: 22px;
}

.eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #64748b;
    margin-bottom: 4px;
}

.customer-context-card h2,
.form-intro h2 {
    margin: 0 0 8px;
}

.context-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #64748b;
    font-size: 13px;
}

.card-title-row,
.page-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.card-title-row h3,
.page-actions-row h2 {
    margin: 0;
}

.stock-live-badge,
.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(25, 135, 84, .1);
    color: #198754;
    font-weight: 700;
    font-size: 12px;
}

.order-item-row {
    padding: 14px 0;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.item-main-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) 1fr 1fr 150px 42px;
    gap: 12px;
    align-items: end;
}

.field-block label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 7px;
}

.form-help {
    display: block;
    color: #64748b;
    margin-top: 5px;
}

.field-error {
    color: #b42318;
    font-size: 12px;
    margin-top: 5px;
}

.stock-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 9px 12px;
    min-height: 42px;
}

.stock-box small {
    display: block;
    color: #64748b;
    font-size: 11px;
}

.stock-value {
    font-size: 17px;
}

.stock-danger {
    color: #b42318;
}

.remove-item-btn {
    border: 0;
    background: transparent;
    color: #94a3b8;
    height: 42px;
}

.remove-item-btn:hover {
    color: #b42318;
}

.add-item-btn {
    margin-top: 16px;
}

.order-submit-bar {
    margin-top: 18px;
    padding: 18px;
    border-radius: 16px;
    background: #0f172a;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.order-submit-bar small {
    display: block;
    color: #cbd5e1;
    margin-top: 4px;
}

.workflow-step {
    padding-bottom: 12px;
}

.workflow-step + .workflow-step {
    border-top: 1px solid #e2e8f0;
    padding-top: 22px;
}

.workflow-step-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.workflow-step-head small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

.step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #0d6efd;
    color: #fff;
    font-weight: 800;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.form-intro {
    margin-bottom: 20px;
}

.form-intro p {
    color: #64748b;
}

.stock-empty {
    background: rgba(180, 35, 24, .1);
    color: #b42318;
}

.status-pill {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-ok {
    background: rgba(25, 135, 84, .1);
    color: #198754;
}

.crm-empty-state {
    text-align: center;
    padding: 40px 15px;
}

.crm-empty-icon {
    font-size: 40px;
    color: #0d6efd;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .item-main-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stock-box {
        grid-column: 1;
    }
    .remove-item-btn {
        grid-column: 2;
        justify-self: end;
    }
    .order-submit-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .page-actions-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .crm-page-card {
        padding: 16px;
    }
    .customer-context-card {
        align-items: flex-start;
    }
    .item-main-grid {
        grid-template-columns: 1fr;
    }
    .stock-box,
    .remove-item-btn {
        grid-column: auto;
    }
    .form-actions .btn {
        width: 100%;
    }
}
/* ---------- Customer 360 ---------- */

.customer-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
}

/* ---------- Activity Timeline ---------- */

.activity-timeline {
    position: relative;
    padding-right: 30px;
}

.activity-timeline::before {
    content: "";
    position: absolute;
    right: 16px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 15px;
    padding: 10px 0;
}

.timeline-icon {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    margin-right: -30px;
}

.timeline-content {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #edf1f6;
    border-radius: 12px;
    padding: 12px 15px;
    transition: .18s;
}

.timeline-content:hover {
    background: #fff;
    border-color: #dce6f8;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

@media (max-width: 600px) {
    .customer-avatar-lg {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
}

/* ---------- Kanban Board ---------- */

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
}

.kanban-column {
    min-width: 280px;
    max-width: 320px;
    flex: 0 0 auto;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 2px solid #cbd5e1;
    margin-bottom: 8px;
}

.kanban-column-total {
    font-size: 11px;
    color: #64748b;
    padding: 4px 10px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
}

.kanban-items {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    cursor: grab;
    transition: .18s;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
}

.kanban-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, .1);
    transform: translateY(-1px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-ghost {
    opacity: 0.4;
    background: #eff6ff;
    border-style: dashed;
}

.kanban-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 20px;
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .kanban-column {
        min-width: 240px;
    }
}