/* ========================================
   PROJECT MILESTONES - HORIZONTAL STEPPER
   ======================================== */

/* STEPPER CONTAINER */
.ms-stepper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    position: relative;
    width: 100%;
}

/* INDIVIDUAL STEP */
.ms-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* CONNECTOR LINE BETWEEN STEPS */
.ms-step::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    z-index: 0;
}

.ms-step:last-child::after {
    display: none;
}

.ms-step.ms-completed::after {
    background: #22c55e;
}

/* NODE (ICON CIRCLE) */
.ms-node {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: all 0.2s;
}

.ms-node:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ms-icon {
    font-size: 18px;
}

/* CHECKMARK ON COMPLETED */
.ms-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* STATUS COLORS */
.ms-step.ms-completed .ms-node {
    background: #dcfce7;
    border-color: #22c55e;
}

.ms-step.ms-current .ms-node {
    background: #dbeafe;
    border-color: #3b82f6;
    animation: ms-pulse 2s infinite;
}

.ms-step.ms-pending .ms-node {
    opacity: 0.5;
}

@keyframes ms-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

/* LABEL BELOW NODE */
.ms-label {
    margin-top: 8px;
    text-align: center;
    max-width: 90px;
}

.ms-name {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}

.ms-date {
    display: block;
    font-size: 10px;
    color: #22c55e;
    margin-top: 2px;
}

.ms-step.ms-pending .ms-name {
    color: #9ca3af;
}

.ms-step.ms-pending .ms-date {
    color: #cbd5e1;
}

/* ========================================
   MODAL STYLES
   ======================================== */

.ms-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.ms-modal-header.ms-header-done {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.ms-modal-icon {
    font-size: 28px;
}

.ms-modal-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ms-modal-title p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.ms-close-btn {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-close-btn:hover {
    background: rgba(255,255,255,0.3);
}


.ms-modal-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.ms-done-badge {
    background: #dcfce7;
    color: #166534;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* ========================================
   FORM STYLES
   ======================================== */

.ms-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ms-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ms-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.ms-input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.ms-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* NOTICES */
.ms-notice {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    align-items: flex-start;
}

.ms-notice span:first-child {
    font-size: 20px;
}

.ms-notice strong {
    display: block;
    font-size: 13px;
    color: #1e293b;
}

.ms-notice p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #64748b;
}

.ms-notice-green {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.ms-notice-blue {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

/* ========================================
   EQUIPMENT TABLE (DELIVERY)
   ======================================== */

.ms-equipment-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.ms-equipment-header {
    margin-bottom: 12px;
}

.ms-equipment-header h4 {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.ms-equipment-header p {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #64748b;
}

.ms-eq-table-wrap {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
}

.ms-eq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ms-eq-table thead tr {
    background: #e5e7eb;
}

.ms-eq-table th {
    padding: 8px 6px;
    font-weight: 600;
    font-size: 11px;
    color: #374151;
    text-align: left;
    border-bottom: 1px solid #d1d5db;
}

.ms-eq-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

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

.ms-eq-table tbody tr.ms-eq-matched {
    background: #f0fdf4;
}

.ms-eq-table td {
    padding: 6px;
    vertical-align: middle;
}

.ms-eq-sno {
    display: block;
    text-align: center;
    font-weight: 500;
    color: #6b7280;
}

.ms-eq-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    box-sizing: border-box;
}

.ms-eq-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ms-eq-input[type="date"] {
    padding: 4px 6px;
}

/* MODEL CELL WITH AUTOCOMPLETE - FIXED */
.ms-eq-model-cell {
    position: relative;
}

.ms-eq-suggestions {
    position: fixed;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    max-height: 200px;
    overflow-y: auto;
    z-index: 999999;
    display: none;
    min-width: 200px;
}

.ms-eq-suggestion {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ms-eq-suggestion:hover {
    background: #eff6ff;
}

.ms-eq-suggestion:last-child {
    border-bottom: none;
}

.ms-eq-suggestion strong {
    color: #1e293b;
}

.ms-eq-suggestion span {
    color: #64748b;
    font-size: 11px;
}

.ms-eq-del-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}

.ms-eq-del-btn:hover {
    color: #ef4444;
}

.ms-add-row-btn {
    margin-top: 12px;
    padding: 8px 16px;
    border: 1px dashed #94a3b8;
    background: transparent;
    color: #3b82f6;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.ms-add-row-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.btn-secondary {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 600px) {
    .ms-form-row {
        grid-template-columns: 1fr;
    }
    
    .ms-stepper {
        padding: 12px 0;
    }
    
    .ms-step {
        min-width: 70px;
    }
    
    .ms-node {
        width: 36px;
        height: 36px;
    }
    
    .ms-icon {
        font-size: 14px;
    }
    
    .ms-name {
        font-size: 10px;
    }
}

/* ========================================
   MODAL FIX - SCROLLING
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ms-modal-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.ms-modal-header {
    flex-shrink: 0;
}

.ms-modal-footer {
    flex-shrink: 0;
}

